fix(client): filter out public /p2p-circuit addrs #68
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.
This PR updates
func isPublicAddr(a multiaddr.Multiaddr) bool
to returnfalse
if multiaddr includes/p2p-circuit
.Rationale
It is possible a node is in a state where relay addrs are still attached to libp2p host when registration is attempted.
In such case, it is better to end up with empty list of public addrs, and produce clear
no public address found
error, and then retry later, than waste time on registration that will fail with a vague spaghetti error:p2p-forge broker registration error: 400 Bad Request error from https://registration.libp2p.direct/v1/_acme-challenge: \"error testing addresses: failed to dial: failed to dial 12D3KooWGU3fJrHaWtRSWyrrzCpdgFX5bxbS69hqL1MSdKMGez12: no good addresses\\n * [/ip6/2602:294:0:8c::2/tcp/4001/p2p/12D3KooWKXK31VX9q49v1sfcTBBMTnJPNNMkSH2kAUzSGURQcYAN/p2p-circuit] no transport for protocol\\n * [/ip6/2602:294:0:8c::2/udp/4001/webrtc-direct/certhash/uEiD1NE9t8pMLKAW42jo_ETe7Oyt9wk-QHIE3Ilr4jhFVmg/p2p/12D3KooWKXK31VX9q49v1sfcTBBMTnJPNNMkSH2kAUzSGURQcYAN/p2p-circuit] no transport for protocol\\n * [/ip6/2602:294:0:8c::2/udp/4001/quic-v1/p2p/12D3KooWKXK31VX9q49v1sfcTBBMTnJPNNMkSH2kAUzSGURQcYAN/p2p-circuit] no transport for protocol\\n * [/ip6/2602:294:0:8c::2/udp/4001/quic-v1/webtransport/certhash/uEiBA0nGhqrwTykjfR75LCGdPSQe0R6-67Z03VJ4nYY0QMA/certhash/uEiCHDdu4Y9uv_z031_ANtkngfq4HdSLuiCex6XKW7d55MQ/p2p/12D3KooWKXK31VX9q49v1sfcTBBMTnJPNNMkSH2kAUzSGURQcYAN/p2p-circuit] no transport for protocol
cc @aschmahmann @hsanjuan