Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protocols/kad: Limit # of inbound substreams to 32 #2699

Merged
merged 7 commits into from Jun 9, 2022

Conversation

mxinden
Copy link
Member

@mxinden mxinden commented Jun 8, 2022

Description

A remote node may still send more than 32 requests in parallel by using more
than one connection..

First commit splits substream handling into inbound and outbound substream handling. Best reviewed commit by commit.

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

A remote node may still send more than 32 requests in parallel by using more
than one connection or by sending more than one request per stream.
When a new inbound substream comes in and the limit of total inbound substreams
is hit, try to find an old inbound substream waiting to be reused. In such case,
replace the old with the new. In case no such old substream exists, drop the new
one.
protocols/kad/CHANGELOG.md Outdated Show resolved Hide resolved
@mxinden mxinden mentioned this pull request Jun 9, 2022
4 tasks
Copy link
Contributor

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@mxinden mxinden merged commit 5cb4886 into libp2p:master Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants