Giter Club home page Giter Club logo

Comments (4)

vyzo avatar vyzo commented on August 23, 2024

Yes, there is a limit for message size everywhere we use delimited readers, and that's the default max message size in libp2p.

The limit is there to protect the peer from memory use DoS attacks; otherwise a peer could just send a multi-gigabyte message that slowly consumes all memory and crashes.

from go-libp2p-pubsub.

iulianpascalau avatar iulianpascalau commented on August 23, 2024

Ok, but the host object should take care of that by marking the peer as a flood peer and closing its connection. Pubsub being an "application" over libp2p core should simply not care of this limitation.
This restriction will somehow add some complexity as the message composed shall not exceed 1MB in size. If, for some reason, I have to send more data than 1MB, the program must fragment the data in more than 1 message and then the peer should be able to recompose back the original data from more messages received.

from go-libp2p-pubsub.

vyzo avatar vyzo commented on August 23, 2024

This limit needs to be there otherwise the delimited reader will silently read the huge message and consume all the memory.

Yes, it adds complexity, but we can't not have a limit.

from go-libp2p-pubsub.

vyzo avatar vyzo commented on August 23, 2024

Closing this, as I think it has been resolved.

from go-libp2p-pubsub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.