Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clientInfo to ENR for easier testnet debugging #1513

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fluffy/fluffy.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions fluffy/version.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import
std/strutils,
stew/byteutils,
metrics

const
Expand Down Expand Up @@ -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)
Expand Down