From c1bf60dfd1ec87b0a0fbdd6d1e178e2b5f41d723 Mon Sep 17 00:00:00 2001 From: sbackend Date: Thu, 20 Aug 2026 14:39:02 +0200 Subject: [PATCH] fix: limit interfaces in test --- pkg/p2p/libp2p/libp2p_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/p2p/libp2p/libp2p_test.go b/pkg/p2p/libp2p/libp2p_test.go index 26dcb848fbc..fa9e719ccda 100644 --- a/pkg/p2p/libp2p/libp2p_test.go +++ b/pkg/p2p/libp2p/libp2p_test.go @@ -55,7 +55,11 @@ func newService(t *testing.T, networkID uint64, o libp2pServiceOpts) (s *libp2p. t.Fatal(err) } - addr := ":0" + // Bind loopback only so host.Addrs() stays small and independent of the + // machine's docker/bridge NICs. Handshake truncates underlays to + // maxUnderlaysPerPeer; listening on :0 expands to every local interface + // and breaks addressbook equality checks on hosts with many addresses. + addr := "127.0.0.1:0" if o.Logger == nil { o.Logger = log.Noop