Skip to content

Commit

Permalink
eth: when snap is complaining for missing eth, be verbose about the d…
Browse files Browse the repository at this point in the history
…etails (#28249)

* eth: when snap is complaining for missing eth, be verbost about the details

* eth: lower snapshot registration error verbosity
  • Loading branch information
karalabe authored and chiphamskymavis committed Jan 23, 2025
1 parent 830b35c commit b9e549e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ func (h *handler) runSnapExtension(peer *snap.Peer, handler snap.Handler) error
snap.EgressRegistrationErrorMeter.Mark(1)
}
}
peer.Log().Debug("Snapshot extension registration failed", "err", err)
return err
}
return handler(peer)
Expand Down
3 changes: 2 additions & 1 deletion eth/peerset.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package eth

import (
"errors"
"fmt"
"math/big"
"sync"

Expand Down Expand Up @@ -84,7 +85,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()
Expand Down

0 comments on commit b9e549e

Please sign in to comment.