fix(relay): new HOP stream for CONNECT after RESERVE (hole-punch interop) - #1476
Open
acul71 wants to merge 2 commits into
Open
fix(relay): new HOP stream for CONNECT after RESERVE (hole-punch interop)#1476acul71 wants to merge 2 commits into
acul71 wants to merge 2 commits into
Conversation
rust-libp2p-style relays finish each HOP substream after one exchange. Reusing the RESERVE stream for CONNECT dropped the dial path used by hole-punch interop. Open a fresh HOP stream for CONNECT when the client reservation path runs. Fixes #1304 Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1304 (remaining hop-stream item). Replaces closed #1305.
Some relays (e.g. rust-libp2p) treat one HOP substream as a single exchange and finish it after RESERVE. The client still reused that stream for CONNECT, which broke hole-punch / relay dials against those relays.
When
enable_clientruns a reservation exchange, close that stream and open a new HOP stream for CONNECT. If client reservation is disabled, keep the existing single-stream CONNECT path.Already resolved on
main(not in this PR)QuicConfigurationcopy / sharedQuicLogger(later QUIC fixes onmain)Follow-up
Harness-side hole-punch work remains in libp2p/test-plans#849.
Test plan
make lintmake typechecktests/core/relay/(121 passed)make linux-docs/ newsfragment1304.bugfix.rsttest_dial_peer_info_opens_new_stream_after_reservetest_dial_peer_info_reuses_stream_when_client_disabledMade with Cursor