-
Notifications
You must be signed in to change notification settings - Fork 962
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
Multiaddr duplicated p2p protocol in relay reservation #2696
Comments
I think this is the best way to tackle the issue. Thanks for debugging. Would you mind proposing a patch?
I haven't put enough thoughts into this, though I think you are right. |
Thanks for preparing #2701. I have been thinking about this some more. Sorry for not doing so earlier. The process of a client requesting a reservation with a relay:
We need the I wonder why I added the I still need to research what the Go implementation does. As far as I can tell the Golang client implementation does not require the @marten-seemann in the Go implementation, does the relay add its Let me know if the above makes sense @Pj50. Again, sorry for not raising this earlier. |
@mxinden Don't worry for your post being late, you summed up well the mechanism that adds the P2p protocol during relay reservation. Honestly I don't know which one between adding it before step(1) or before step (2) is the best. |
Turns out, we actually settled on (1) in the past:
https://github.com/libp2p/specs/blob/master/relay/circuit-v2.md Sorry for the noise here. Will review #2701 next.
For the record, yes it does. |
- Minor fixes after review - Bump libp2p-relay Cargo.toml version to 0.9.2 - Add entry in Changelog for upcoming 0.9.2 version
Closing here with #2701 merged. |
Summary
P2p protocol is duplicated in Multiaddr when a relay, using TCP transport with port reuse enabled, accepts a reservation request. This leads to an invalid Multiaddr.
In order to reproduce the bug, just turn on port reuse when creating TcpConfig in relay_v2 example:
rust-libp2p/protocols/relay/examples/relay_v2.rs
Line 49 in fcc987e
Please find some of the logs dumped on the listening client showing the duplicated P2p protocol:
Expected behavior
The relayed Multiaddr should not contain a duplicated P2p protocol.
Possible Solution
Thought about 3 possibilities:
rust-libp2p/protocols/identify/src/identify.rs
Line 327 in fcc987e
rust-libp2p/transports/tcp/src/lib.rs
Line 438 in fcc987e
rust-libp2p/protocols/relay/src/v2/relay.rs
Line 758 in fcc987e
Also wondering if external and observed addresses need to contain the P2p protocol ?
Version
libp2p version 0.45
Would you like to work on fixing this bug?
Yes
The text was updated successfully, but these errors were encountered: