From a75e981c5b2493df21977524dcc7794422ec0fa6 Mon Sep 17 00:00:00 2001 From: thinkAfCod Date: Wed, 23 Oct 2024 17:10:31 +0800 Subject: [PATCH] fix: replace assert to require --- p2p/discover/portal_protocol.go | 2 ++ p2p/discover/portal_protocol_test.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/p2p/discover/portal_protocol.go b/p2p/discover/portal_protocol.go index 2af0d4d550..98a5636262 100644 --- a/p2p/discover/portal_protocol.go +++ b/p2p/discover/portal_protocol.go @@ -1860,11 +1860,13 @@ func (p *PortalProtocol) Gossip(srcNodeId *enode.ID, contentKeys [][]byte, conte maxClosestNodes := 4 maxFartherNodes := 4 closestLocalNodes := p.findNodesCloseToContent(contentId, 32) + p.Log.Debug("closest local nodes", "count", len(closestLocalNodes)) gossipNodes := make([]*enode.Node, 0) for _, n := range closestLocalNodes { radius, found := p.radiusCache.HasGet(nil, []byte(n.ID().String())) if found { + p.Log.Debug("found closest local nodes", "nodeId", n.ID(), "addr", n.IPAddr().String()) nodeRadius := new(uint256.Int) err := nodeRadius.UnmarshalSSZ(radius) if err != nil { diff --git a/p2p/discover/portal_protocol_test.go b/p2p/discover/portal_protocol_test.go index 7f42ee71f4..adfab1e50f 100644 --- a/p2p/discover/portal_protocol_test.go +++ b/p2p/discover/portal_protocol_test.go @@ -21,7 +21,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p/discover/portalwire" "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/stretchr/testify/assert" + assert "github.com/stretchr/testify/require" ) func setupLocalPortalNode(addr string, bootNodes []*enode.Node) (*PortalProtocol, error) {