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

fix: accept two incoming PING streams per peer #1617

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

bajtos
Copy link
Contributor

@bajtos bajtos commented Mar 8, 2023

Modify the default configuration for the PING protocol to accept at most two streams per peer, as recommended in the PING protocol spec.

Quoting https://github.com/libp2p/specs/blob/d4b5fb0152a6bb86cfd9ea/ping/ping.md?plain=1#L38-L43

The dialing peer MUST NOT keep more than one outbound stream for the ping protocol per peer. The listening peer SHOULD accept at most two streams per peer since cross-stream behavior is non-linear and stream writes occur asynchronously. The listening peer may perceive the dialing peer closing and opening the wrong streams (for instance, closing stream B and opening stream A even though the dialing peer is opening stream B and closing stream A).

Modify the default configuration for the PING protocol to accept at most
two streams per peer, as recommended in the PING protocol spec.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@achingbrain achingbrain merged commit afaee4c into libp2p:master Mar 9, 2023
@achingbrain
Copy link
Member

Thanks!

@bajtos bajtos deleted the fix-ping-config branch March 9, 2023 16:48
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.

2 participants