From f6b8463b5c3b6798b596bcead93e517247617480 Mon Sep 17 00:00:00 2001 From: E M <5089238+emizzle@users.noreply.github.com> Date: Tue, 23 Jun 2026 14:53:46 +1000 Subject: [PATCH] Remove warnings from check_spr tool For each SPR tested, there was a warning "No external IP provided for the SPR, this node will not be discoverable" which is irrelevant to the test. An enrIp paramater was provided to the discv5 protocol constructor, to workaround this warning. --- tools/check_spr.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/check_spr.nim b/tools/check_spr.nim index 654bb70b..3c37d772 100644 --- a/tools/check_spr.nim +++ b/tools/check_spr.nim @@ -23,7 +23,7 @@ ## ## Run `check_spr --help` for a full description of every option. -import std/[json, options, os, sequtils, strutils, typetraits, strformat, terminal] +import std/[json, net, options, os, sequtils, strutils, typetraits, strformat, terminal] import pkg/chronicles import pkg/chronos @@ -119,8 +119,11 @@ proc checkDiscv5( let rng = newRng() let privKey = PrivateKey.random(rng).tryGet() let proto = discv5.newProtocol( - privKey, none(IpAddress), none(Port), none(Port), bindPort = Port(0), rng = rng + privKey, IPv4_any().some, none(Port), none(Port), bindPort = Port(0), rng = rng ) + # Use IPv4_any address as the enrIp param in newProtocol to avoid the + # warnings. It changes the SPR of the discv5 protocol ping tool (this), but + # does not affect the SPRs of the target. try: proto.open()