p2p/discover: try to fix TestUDPv5_lookupE2E by using SetFallbackUDP (#35542)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

The test set the local UDP port via ln.Set(enr.UDP(...)), but the "udp"
ENR entry is owned by the endpoint predictor: as soon as the first node
received a PONG, updateEndpoints recomputed the endpoint with no
fallback port set and deleted the entry. Later nodes bootstrapping from
that node's record then failed with "bad bootstrap node: missing UDP
port".

Use SetFallbackUDP like startLocalhostV4 already does, so the port
survives endpoint statements.

fixes CI errors like in
https://github.com/ethereum/go-ethereum/actions/runs/31859911877/job/94953524792?pr=35529
This commit is contained in:
Csaba Kiraly 2026-08-20 10:58:14 +02:00 committed by GitHub
parent 35a016346f
commit 02b73d4ea7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,7 +90,7 @@ func startLocalhostV5(t *testing.T, cfg Config) *UDPv5 {
}
realaddr := socket.LocalAddr().(*net.UDPAddr)
ln.SetStaticIP(realaddr.IP)
ln.Set(enr.UDP(realaddr.Port))
ln.SetFallbackUDP(realaddr.Port)
udp, err := ListenV5(socket, ln, cfg)
if err != nil {
t.Fatal(err)