Skip to content

In libp2p-request-responses, give the possiblity to specify a limit to the number of simultaneous requests per peer #1687

@tomaka

Description

@tomaka

Considering that there doesn't exist any back-pressure mechanism when it comes to opening substreams, we need way to protect against an attacker opening thousands of substreams on a connection.

While the multiplexer does enforce a limit to the total number of open substreams per connection, this value must be pretty high in order to avoid accidentally reaching it in legitimate scenarios.

Instead, it seems preferable to me to enforce, for each individual peer and protocol, the number of substreams that can be open simultaneously.

When it comes to request-response protocols, this can be done by enforcing a limit to the number of simultaneous requests that a remote is capable of making.
I'm opening this issue in libp2p because to me it is preferable to do this verification in the ProtocolsHandler.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions