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(yamux): yamux uses wrong direction during dcutr #992

Closed
wants to merge 5 commits into from

Conversation

diegomrsantos
Copy link
Collaborator

@diegomrsantos diegomrsantos commented Nov 21, 2023

During DCUtR, the listener initiates the direct connection attempt and must connect to the other peer as the incoming upgrade direction. Yamux must use this direction to decide on using odd or even stream IDs, not the underlying connection direction -which in this case is TCP (or another transport) outgoing as the peer is initiating the connection.

This is an unusual case where a peer initiates a connection, but should treat it as incoming. The reason is probably that DCUtR happens when the other remote peer dials this peer relayed address, therefore the original connection was in fact incoming.

Related:
https://github.com/libp2p/specs/tree/master/yamux
https://github.com/libp2p/specs/blob/master/relay/DCUtR.md

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #992 (5bd55be) into unstable (ce0685c) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           unstable     #992      +/-   ##
============================================
+ Coverage     83.23%   83.25%   +0.01%     
============================================
  Files            91       91              
  Lines         15328    15331       +3     
============================================
+ Hits          12759    12764       +5     
+ Misses         2569     2567       -2     
Files Coverage Δ
libp2p/builders.nim 93.05% <100.00%> (ø)
libp2p/dialer.nim 92.73% <ø> (-0.04%) ⬇️
libp2p/muxers/muxer.nim 72.00% <ø> (ø)
libp2p/muxers/yamux/yamux.nim 89.72% <100.00%> (+0.03%) ⬆️
libp2p/upgrademngrs/muxedupgrade.nim 87.69% <100.00%> (ø)

... and 2 files with indirect coverage changes

@diegomrsantos diegomrsantos changed the title Yamux over dcutr fix(yamux): yamux uses wrong direction during dcutr Nov 23, 2023
@diegomrsantos diegomrsantos marked this pull request as ready for review November 23, 2023 09:49
@diegomrsantos
Copy link
Collaborator Author

This is replaced by #994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant