From 9171359373ccd08e4448485df28a499cd14f5028 Mon Sep 17 00:00:00 2001 From: kdeme Date: Tue, 21 Mar 2023 11:49:26 +0100 Subject: [PATCH 1/2] Add clientInfo to ENR for easier testnet debugging --- fluffy/fluffy.nim | 3 +++ fluffy/version.nim | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/fluffy/fluffy.nim b/fluffy/fluffy.nim index 0d123b07f0..f1223253dc 100644 --- a/fluffy/fluffy.nim +++ b/fluffy/fluffy.nim @@ -147,6 +147,9 @@ proc run(config: PortalConf) {.raises: [CatchableError].} = d = newProtocol( netkey, extIp, none(Port), extUdpPort, + # Note: The addition of clientInfo to the ENR is a temporary measure to + # easily identify & debug the clients used in the testnet. + localEnrFields = {"c": clientInfoShort}, bootstrapRecords = bootstrapRecords, bindIp = bindIp, bindPort = udpPort, enrAutoUpdate = config.enrAutoUpdate, diff --git a/fluffy/version.nim b/fluffy/version.nim index b0a63508a0..ca7ee1fe7e 100644 --- a/fluffy/version.nim +++ b/fluffy/version.nim @@ -9,6 +9,7 @@ import std/strutils, + stew/byteutils, metrics const @@ -38,6 +39,9 @@ const copyrightBanner* = "Copyright (c) 2021-" & compileYear & " Status Research & Development GmbH" + # Short debugging indentifier for ENR + clientInfoShort* = toBytes("f-" & gitRevision) + func getNimGitHash*(): string = const gitPrefix = "git hash: " let tmp = splitLines(nimFullBanner) From e3ed5d36f3503a51ed487a9c768517aec79b26df Mon Sep 17 00:00:00 2001 From: kdeme Date: Wed, 20 Sep 2023 10:55:59 +0200 Subject: [PATCH 2/2] Remove git rev from ENR client info This allows for a shorter ENR which allows more ENRs to be packed in the Nodes reply. And for glados, only the client name is used anyhow. --- fluffy/fluffy.nim | 7 ++++--- fluffy/version.nim | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fluffy/fluffy.nim b/fluffy/fluffy.nim index f1223253dc..f22d546bbb 100644 --- a/fluffy/fluffy.nim +++ b/fluffy/fluffy.nim @@ -147,9 +147,10 @@ proc run(config: PortalConf) {.raises: [CatchableError].} = d = newProtocol( netkey, extIp, none(Port), extUdpPort, - # Note: The addition of clientInfo to the ENR is a temporary measure to - # easily identify & debug the clients used in the testnet. - localEnrFields = {"c": clientInfoShort}, + # Note: The addition of default clientInfo to the ENR is a temporary + # measure to easily identify & debug the clients used in the testnet. + # Might make this into a, default off, cli option. + localEnrFields = {"c": enrClientInfoShort}, bootstrapRecords = bootstrapRecords, bindIp = bindIp, bindPort = udpPort, enrAutoUpdate = config.enrAutoUpdate, diff --git a/fluffy/version.nim b/fluffy/version.nim index ca7ee1fe7e..e220d71770 100644 --- a/fluffy/version.nim +++ b/fluffy/version.nim @@ -39,8 +39,8 @@ const copyrightBanner* = "Copyright (c) 2021-" & compileYear & " Status Research & Development GmbH" - # Short debugging indentifier for ENR - clientInfoShort* = toBytes("f-" & gitRevision) + # Short debugging identifier to be placed in the ENR + enrClientInfoShort* = toBytes("f") func getNimGitHash*(): string = const gitPrefix = "git hash: "