Skip to content

Conversation

lidel
Copy link
Contributor

@lidel lidel commented May 20, 2025

This PR updates func isPublicAddr(a multiaddr.Multiaddr) bool to return false 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

it is possible a node is in a state where relay addrs are still attached
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 p2p-circuit
connection error
@lidel lidel requested review from aschmahmann and hsanjuan May 20, 2025 21:20
@lidel lidel mentioned this pull request May 20, 2025
45 tasks
@aschmahmann
Copy link
Contributor

LGTM

@aschmahmann aschmahmann merged commit 5c1563c into main May 20, 2025
4 checks passed
@aschmahmann aschmahmann deleted the fix-exclude-p2p-circuits branch May 20, 2025 21:29
@lidel lidel mentioned this pull request May 20, 2025
lidel added a commit to ipfs/kubo that referenced this pull request May 20, 2025
lidel added a commit to ipfs/kubo that referenced this pull request May 20, 2025
lidel added a commit to ipfs/kubo that referenced this pull request May 20, 2025
lidel added a commit to ipfs/kubo that referenced this pull request May 20, 2025
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

Successfully merging this pull request may close these issues.

2 participants