fix(libp2p): drop empty addrs in AddrsFactory#11302
Merged
Conversation
A zero-value Multiaddr (since go-multiaddr v0.15 is a slice type) encodes to zero bytes on the wire. AddrsFactory was passing such empty entries through to the host's signed peer record, where peers that skip the empty-input check render them as "/" and reject the address. js-libp2p autonatv2 first flagged this against a kubo/0.39.0/2896aed/docker agent. AddrsFactory is the central chokepoint for kubo's announced addresses, so filtering here scrubs every downstream consumer until the upstream go-libp2p fix lands. See libp2p/js-libp2p#3478 (comment)
This was referenced Apr 27, 2026
Open
guillaumemichel
approved these changes
Apr 28, 2026
gammazero
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A zero-value
Multiaddr(since go-multiaddr v0.15 is a slice type) encodes to zero bytes on the wire.AddrsFactorywas passing such empty entries through to the host's signed peer record, where peers that skip the empty-input check render them as"/"and reject the address. js-libp2p autonatv2 first flagged this against akubo/0.39.0/2896aed/docker agent.AddrsFactoryis the central chokepoint for kubo's announced addresses, so filtering here scrubs every downstream consumer until the upstream go-libp2p fix lands.I also opened PR upstream:
but my current policy for libp2p regressions is "belt and suspenders" so this PR will ship anyway so Kubo release cycle is not blocked by libp2p (if possible)