Skip to content

fix: resolve wildcard swarm in http provides#11297

Open
lidel wants to merge 1 commit intomasterfrom
fix/11213-http-routing-resolve-addrs
Open

fix: resolve wildcard swarm in http provides#11297
lidel wants to merge 1 commit intomasterfrom
fix/11213-http-routing-resolve-addrs

Conversation

@lidel
Copy link
Copy Markdown
Member

@lidel lidel commented Apr 24, 2026

This is a fix for http-only users like Plebbit, likely more relevant in the future as we want to have first-class support for http-only support.

0.41.0's httpRouterAddrFunc only resolved 0.0.0.0/:: when AutoNATv2 had a confirmed reachable address. Otherwise it forwarded raw Addresses.Swarm strings to HTTP routers, so isolated or LAN-only nodes published unreachable provider records.

Changes

  • core/node/libp2p/routingopt.go: fallback now calls host.Addrs(), which resolves wildcard binds to concrete interface addrs and applies the libp2p AddrsFactory (NoAnnounce CIDR, Swarm.AddrFilters); matches the DHT provide path (core/node/provider.go selfAddrsFunc)
  • core/node/libp2p/routingopt_test.go: stubHost.Addrs is configurable; cases rewritten around resolved host addrs, with a new case pinning that NoAnnounce CIDR filtering belongs upstream in host.Addrs
  • test/cli/delegated_routing_v1_http_client_test.go: new end-to-end case asserts provider records sent over HTTP never contain 0.0.0.0 or :: when Addresses.Swarm uses the default wildcard bind

0.41.0's httpRouterAddrFunc only resolved 0.0.0.0/:: when AutoNATv2 had a
confirmed reachable address. Otherwise it forwarded raw Addresses.Swarm
strings to HTTP routers, so isolated or LAN-only nodes published
unreachable provider records.

- core/node/libp2p/routingopt.go: fallback now calls host.Addrs(), which
  resolves wildcard binds to concrete interface addrs and applies the
  libp2p AddrsFactory (NoAnnounce CIDR, Swarm.AddrFilters); matches the
  DHT provide path (core/node/provider.go selfAddrsFunc)
- core/node/libp2p/routingopt_test.go: stubHost.Addrs is configurable;
  cases rewritten around resolved host addrs, with a new case pinning
  that NoAnnounce CIDR filtering belongs upstream in host.Addrs
- test/cli/delegated_routing_v1_http_client_test.go: new end-to-end
  case asserts provider records sent over HTTP never contain 0.0.0.0
  or :: when Addresses.Swarm uses the default wildcard bind

Fixes #11213
@lidel lidel mentioned this pull request Apr 24, 2026
6 tasks
@lidel lidel added the skip/changelog This change does NOT require a changelog entry label Apr 24, 2026
@lidel lidel marked this pull request as ready for review April 24, 2026 15:15
@lidel lidel requested a review from a team as a code owner April 24, 2026 15:15
@lidel
Copy link
Copy Markdown
Member Author

lidel commented Apr 24, 2026

@gammazero @guillaumemichel FYSA this will be useful in our internal experiment too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does NOT require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP Routing V1 provider records contain raw 0.0.0.0 listen addresses instead of resolved interface addresses

1 participant