From 53df21f00010ba145682ec89b0d78b47c1c6f1e4 Mon Sep 17 00:00:00 2001 From: Kim De Mey Date: Wed, 20 Sep 2023 12:19:40 +0200 Subject: [PATCH] Add clientInfo to ENR for easier testnet debugging (#1513) * Add clientInfo to ENR for easier testnet debugging * 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 | 4 ++++ fluffy/version.nim | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/fluffy/fluffy.nim b/fluffy/fluffy.nim index 0d123b07f..f22d546bb 100644 --- a/fluffy/fluffy.nim +++ b/fluffy/fluffy.nim @@ -147,6 +147,10 @@ proc run(config: PortalConf) {.raises: [CatchableError].} = d = newProtocol( netkey, extIp, none(Port), extUdpPort, + # 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 b0a63508a..e220d7177 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 identifier to be placed in the ENR + enrClientInfoShort* = toBytes("f") + func getNimGitHash*(): string = const gitPrefix = "git hash: " let tmp = splitLines(nimFullBanner)