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

Circuit relay reservation addresses sometimes returns with repeated relay PeerIds #3003

Closed
achingbrain opened this issue Oct 9, 2024 · 2 comments

Comments

@achingbrain
Copy link
Member

achingbrain commented Oct 9, 2024

If I make a relay reservation the HopMessage.reservation.addrs field sometimes has multiaddrs that repeat the relay's peer id.

This only seems to happen with the WebSocket transport addresses advertised by the Amino DHT bootstrap nodes, so it might to AppendAnnounce addresses. Nodes not listening on DNS/WSS addresses seem fine.

For example I make a reservation on am6.bootstrap.libp2p.io, PeerID QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb, these are the string versions of the .addrs field in the response HopMessage:

"/ip4/147.75.87.27/tcp/4001/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip4/147.75.87.27/udp/4001/webrtc-direct/certhash/uEiAWOyiAQrOpPuymJM2GnnXGQ4CmWIr8v1gV1v0kOfn3Yg/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip4/147.75.87.27/udp/4001/webrtc-direct/certhash/uEiAWOyiAQrOpPuymJM2GnnXGQ4CmWIr8v1gV1v0kOfn3Yg/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip4/147.75.87.27/udp/4001/quic-v1/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip4/147.75.87.27/udp/4001/quic-v1/webtransport/certhash/uEiBX-ETT3QF-2Ugo0sE7lZJkvrqVwltfSye-ghrf9pnPTg/certhash/uEiDLEI9-9k6c8VUdeQCgoyh1EdlRJN70EuCNnfagPe3Cqg/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip4/147.75.87.27/udp/4001/quic-v1/webtransport/certhash/uEiBX-ETT3QF-2Ugo0sE7lZJkvrqVwltfSye-ghrf9pnPTg/certhash/uEiDLEI9-9k6c8VUdeQCgoyh1EdlRJN70EuCNnfagPe3Cqg/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip6/2604:1380:4602:5c00::3/tcp/4001/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip6/2604:1380:4602:5c00::3/udp/4001/webrtc-direct/certhash/uEiAWOyiAQrOpPuymJM2GnnXGQ4CmWIr8v1gV1v0kOfn3Yg/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip6/2604:1380:4602:5c00::3/udp/4001/webrtc-direct/certhash/uEiAWOyiAQrOpPuymJM2GnnXGQ4CmWIr8v1gV1v0kOfn3Yg/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip6/2604:1380:4602:5c00::3/udp/4001/quic-v1/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip6/2604:1380:4602:5c00::3/udp/4001/quic-v1/webtransport/certhash/uEiBX-ETT3QF-2Ugo0sE7lZJkvrqVwltfSye-ghrf9pnPTg/certhash/uEiDLEI9-9k6c8VUdeQCgoyh1EdlRJN70EuCNnfagPe3Cqg/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/ip6/2604:1380:4602:5c00::3/udp/4001/quic-v1/webtransport/certhash/uEiBX-ETT3QF-2Ugo0sE7lZJkvrqVwltfSye-ghrf9pnPTg/certhash/uEiDLEI9-9k6c8VUdeQCgoyh1EdlRJN70EuCNnfagPe3Cqg/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/dns4/am6.bootstrap.libp2p.io/tcp/443/wss/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/dns6/am6.bootstrap.libp2p.io/tcp/443/wss/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"

They are all fine, except the final two /dns4 and /dns6 addresses which have the tuple /p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb repeated twice.

These addresses are set by the AppendAnnounce config key.

I think this may be because the Circuit Relay spec says:

the addrs field contains all the public relay addrs, including the peer ID of the relay node but not the trailing p2p-circuit part

"including the peer ID" is not something we do elsewhere (it's normally omitted from PeerInfos received from the routing, for example), so I guess it's not checking if its PeerID is already present in the address before appending it?

@achingbrain achingbrain changed the title Circuit relay reservation addresses sometimes returned with repeated relay PeerIds Circuit relay reservation addresses sometimes returnes with repeated relay PeerIds Oct 10, 2024
@achingbrain achingbrain changed the title Circuit relay reservation addresses sometimes returnes with repeated relay PeerIds Circuit relay reservation addresses sometimes returns with repeated relay PeerIds Oct 10, 2024
@MarcoPolo
Copy link
Collaborator

I bet the Address factory is inserting these p2p components. Either way the circuitv2 code should handle these cases. Fixed in the linked PR.

@sukunrt
Copy link
Member

sukunrt commented Nov 11, 2024

Fixed by #3006

@sukunrt sukunrt closed this as completed Nov 11, 2024
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

No branches or pull requests

3 participants