Skip to content

Commit

Permalink
Merge branch 'version/v2.0.0' into version/v2.0.0-on-fork-88896
Browse files Browse the repository at this point in the history
  • Loading branch information
moshe-blox committed Oct 27, 2024
2 parents 4f07fc7 + c8f74a5 commit b443a97
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion network/discovery/dv5_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,22 @@ func (dvs *DiscV5Service) Node(logger *zap.Logger, info peer.AddrInfo) (*enode.N
func (dvs *DiscV5Service) Bootstrap(logger *zap.Logger, handler HandleNewPeer) error {
logger = logger.Named(logging.NameDiscoveryService)

// Log every 10th skipped peer.
// TODO: remove once we've merged https://github.com/ssvlabs/ssv/pull/1803
const logFrequency = 10
var skippedPeers uint64 = 0

dvs.discover(dvs.ctx, func(e PeerEvent) {
logger := logger.With(
fields.ENR(e.Node),
fields.PeerID(e.AddrInfo.ID),
)
err := dvs.checkPeer(logger, e)
if err != nil {
logger.Debug("skipped discovered peer", zap.Error(err))
if skippedPeers%logFrequency == 0 {
logger.Debug("skipped discovered peer", zap.Error(err))
}
skippedPeers++
return
}
handler(e)
Expand Down

0 comments on commit b443a97

Please sign in to comment.