Skip to content

feat: opt-in LoopbackAddrPublishing#3488

Closed
lidel wants to merge 1 commit intomasterfrom
fix/host-stop-announcing-loopback
Closed

feat: opt-in LoopbackAddrPublishing#3488
lidel wants to merge 1 commit intomasterfrom
fix/host-stop-announcing-loopback

Conversation

@lidel
Copy link
Copy Markdown
Member

@lidel lidel commented Apr 16, 2026

This PR proposes new opt-in flags:

  • libp2p.LoopbackAddrPublishing(bool) that lets hosts exclude loopback addresses (127.0.0.0/8, ::1) from the peerstore self-entry and the signed peer record so they are not advertised via identify or DHT.

Note

Moved to #3489 which fixes wider issue and includes this.

…announce

new opt-in libp2p.LoopbackAddrPublishing(bool) lets hosts exclude loopback
addresses (127.0.0.0/8, ::1) from the peerstore self-entry and the signed
peer record so they are not advertised via identify or DHT.

default is true (current behavior preserved). when set to false the
addrsManager strips loopback before SetAddrs and before signing the peer
record; loopback-to-loopback dev still works because identify keeps
loopback on loopback connections via its viaLoopback path.

- options.go: add LoopbackAddrPublishing(enable bool)
- config/config.go: add DisableLoopbackAddrPublishing, plumb to HostOpts
- basic_host.go: add HostOpts.DisableLoopbackAddrPublishing, pass to newAddrsManager
- addrs_manager.go: new disableLoopbackAddrPublishing field, splitPublishedAddrs helper, updatePeerStore filters loopback when enabled
- addrs_manager_test.go: cover both default and disabled-publishing paths
@lidel lidel changed the title feat: LoopbackAddrPublishing option feat: opt-in addr publishing filters for non-routables Apr 16, 2026
@lidel lidel requested review from MarcoPolo and sukunrt April 16, 2026 19:18
@lidel lidel changed the title feat: opt-in addr publishing filters for non-routables feat: opt-in LoopbackAddrPublishing Apr 16, 2026
@lidel lidel closed this Apr 16, 2026
@lidel lidel deleted the fix/host-stop-announcing-loopback branch April 19, 2026 23:39
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.

1 participant