From 00294e9d28151122e955c7db4344f06724295ec5 Mon Sep 17 00:00:00 2001 From: lightclient <14004106+lightclient@users.noreply.github.com> Date: Tue, 20 Aug 2024 08:02:54 -0600 Subject: [PATCH] cmd/utils,p2p: enable discv5 by default (#30327) --- cmd/utils/flags.go | 3 ++- p2p/discover/v4_udp.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 22dd6645de..611189a2cc 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -807,8 +807,9 @@ var ( DiscoveryV5Flag = &cli.BoolFlag{ Name: "discovery.v5", Aliases: []string{"discv5"}, - Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism", + Usage: "Enables the V5 discovery mechanism", Category: flags.NetworkingCategory, + Value: true, } NetrestrictFlag = &cli.StringFlag{ Name: "netrestrict", diff --git a/p2p/discover/v4_udp.go b/p2p/discover/v4_udp.go index 321552ddc3..cc2a3fb924 100644 --- a/p2p/discover/v4_udp.go +++ b/p2p/discover/v4_udp.go @@ -547,7 +547,9 @@ func (t *UDPv4) readLoop(unhandled chan<- ReadPacket) { } return } - if t.handlePacket(from, buf[:nbytes]) != nil && unhandled != nil { + if err := t.handlePacket(from, buf[:nbytes]); err != nil && unhandled == nil { + t.log.Debug("Bad discv4 packet", "addr", from, "err", err) + } else if err != nil && unhandled != nil { select { case unhandled <- ReadPacket{buf[:nbytes], from}: default: @@ -564,7 +566,6 @@ func (t *UDPv4) handlePacket(from netip.AddrPort, buf []byte) error { rawpacket, fromKey, hash, err := v4wire.Decode(buf) if err != nil { - t.log.Debug("Bad discv4 packet", "addr", from, "err", err) return err } packet := t.wrapPacket(rawpacket)