From 95b0555c84ec29c0d8b6947403804d2bccc4189e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 4 Oct 2023 12:37:04 +0300 Subject: [PATCH] eth: when snap is complaining for missing eth, be verbose about the details (#28249) * eth: when snap is complaining for missing eth, be verbost about the details * eth: lower snapshot registration error verbosity --- eth/handler.go | 2 +- eth/peerset.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eth/handler.go b/eth/handler.go index 665df7d8c..0c0c17fee 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -462,7 +462,7 @@ func (h *handler) runSnapExtension(peer *snap.Peer, handler snap.Handler) error snap.EgressRegistrationErrorMeter.Mark(1) } } - peer.Log().Warn("Snapshot extension registration failed", "err", err) + peer.Log().Debug("Snapshot extension registration failed", "err", err) return err } return handler(peer) diff --git a/eth/peerset.go b/eth/peerset.go index b9cc1e03a..b27d3964a 100644 --- a/eth/peerset.go +++ b/eth/peerset.go @@ -18,6 +18,7 @@ package eth import ( "errors" + "fmt" "math/big" "sync" @@ -74,7 +75,7 @@ func (ps *peerSet) registerSnapExtension(peer *snap.Peer) error { // Reject the peer if it advertises `snap` without `eth` as `snap` is only a // satellite protocol meaningful with the chain selection of `eth` if !peer.RunningCap(eth.ProtocolName, eth.ProtocolVersions) { - return errSnapWithoutEth + return fmt.Errorf("%w: have %v", errSnapWithoutEth, peer.Caps()) } // Ensure nobody can double connect ps.lock.Lock()