From bd15e1be1e971301067effab08677f548bdf2fe0 Mon Sep 17 00:00:00 2001 From: Rafael Sampaio <5679073+r4f4ss@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:51:11 -0300 Subject: [PATCH] move loglevel to debug (level 4) and remove duplicate log --- p2p/discover/portal_protocol.go | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/p2p/discover/portal_protocol.go b/p2p/discover/portal_protocol.go index a0f449f352..b68a4da5e6 100644 --- a/p2p/discover/portal_protocol.go +++ b/p2p/discover/portal_protocol.go @@ -555,7 +555,9 @@ func (p *PortalProtocol) processOffer(target *enode.Node, resp []byte, request * p.Log.Trace("<< ACCEPT/"+p.protocolName, "id", target.ID(), "accept", accept) isAdded := p.table.addFoundNode(target, true) if isAdded { - log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + } else { + log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) } var contentKeyLen int if request.Kind == TransientOfferRequestKind { @@ -677,7 +679,9 @@ func (p *PortalProtocol) processContent(target *enode.Node, resp []byte) (byte, p.Log.Trace("<< CONTENT/"+p.protocolName, "id", target.ID(), "content", content) isAdded := p.table.addFoundNode(target, true) if isAdded { - log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + } else { + log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) } return resp[1], content.Content, nil case portalwire.ContentConnIdSelector: @@ -690,7 +694,9 @@ func (p *PortalProtocol) processContent(target *enode.Node, resp []byte) (byte, p.Log.Trace("<< CONTENT_CONNECTION_ID/"+p.protocolName, "id", target.ID(), "resp", common.Bytes2Hex(resp), "connIdMsg", connIdMsg) isAdded := p.table.addFoundNode(target, true) if isAdded { - log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + } else { + log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) } connctx, conncancel := context.WithTimeout(p.closeCtx, defaultUTPConnectTimeout) laddr := p.utp.Addr().(*utp.Addr) @@ -735,7 +741,9 @@ func (p *PortalProtocol) processContent(target *enode.Node, resp []byte) (byte, p.Log.Trace("<< CONTENT_ENRS/"+p.protocolName, "id", target.ID(), "enrs", enrs) isAdded := p.table.addFoundNode(target, true) if isAdded { - log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + } else { + log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) } nodes := p.filterNodes(target, enrs.Enrs, nil) return resp[1], nodes, nil @@ -761,9 +769,10 @@ func (p *PortalProtocol) processNodes(target *enode.Node, resp []byte, distances isAdded := p.table.addFoundNode(target, true) if isAdded { - log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + } else { + log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) } - log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) nodes := p.filterNodes(target, nodesResp.Enrs, distances) return nodes, nil @@ -822,7 +831,9 @@ func (p *PortalProtocol) processPong(target *enode.Node, resp []byte) (*portalwi p.Log.Trace("<< PONG_RESPONSE/"+p.protocolName, "id", target.ID(), "pong", pong, "customPayload", customPayload) isAdded := p.table.addFoundNode(target, true) if isAdded { - log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) + } else { + log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP()) } p.radiusCache.Set([]byte(target.ID().String()), customPayload.Radius) @@ -1370,7 +1381,9 @@ func (p *PortalProtocol) lookupWorker(destNode *enode.Node, target enode.ID) ([] if n.ID() != p.Self().ID() { isAdded := p.table.addFoundNode(n, false) if isAdded { - log.Info("Node added to bucket", "protocol", p.protocolName, "node", n.IP(), "port", n.UDP()) + log.Debug("Node added to bucket", "protocol", p.protocolName, "node", n.IP(), "port", n.UDP()) + } else { + log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", n.IP(), "port", n.UDP()) } nodes.push(n, portalFindnodesResultLimit) }