diff --git a/execution_chain/config.nim b/execution_chain/config.nim index 1f6efecdb2..611d574375 100644 --- a/execution_chain/config.nim +++ b/execution_chain/config.nim @@ -40,13 +40,16 @@ import export net, defs, jsdefs, jsnet, nimbus_binary_common const - + # e.g.: Copyright (c) 2018-2025 Status Research & Development GmbH + NimbusCopyright* = "Copyright (c) 2018-" & + CompileDate.split('-')[0] & + " Status Research & Development GmbH" # e.g.: # nimbus_execution_client/v0.1.0-abcdef/os-cpu/nim-a.b.c/emvc # Copyright (c) 2018-2025 Status Research & Development GmbH NimbusBuild* = "$#\p$#" % [ ClientId, - copyrights, + NimbusCopyright, ] NimbusHeader* = "$#\p\pNim version $#" % [ diff --git a/execution_chain/version_info.nim b/execution_chain/version_info.nim index a66a328e29..b6c578f122 100644 --- a/execution_chain/version_info.nim +++ b/execution_chain/version_info.nim @@ -11,59 +11,20 @@ import std/[os, strutils, strformat], stew/byteutils, + beacon_chain/buildinfo, ./compile_info, ./version export version -# TODO: Unify and use the buildinfo from nimbus-eth2 -# For that it needs to be shifted to a template which takes in the -# source path of nimbus-eth1 as an input -const sourcePath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0] - -proc gitFolderExists(path: string): bool {.compileTime.} = - # walk up parent folder to find `.git` folder - var currPath = sourcePath - while true: - if dirExists(currPath & "/.git"): - return true - let parts = splitPath(currPath) - if parts.tail.len == 0: - break - currPath = parts.head - false - const NimbusName* = "nimbus-eth1" ## project name string - GitRevisionOverride {.strdefine.} = "" - - GitRevision* = - when GitRevisionOverride.len > 0: - static: - doAssert( - GitRevisionOverride.len == 8, - "GitRevisionOverride must consist of 8 characters", - ) - doAssert( - GitRevisionOverride.allIt(it in HexDigits), - "GitRevisionOverride should contains only hex chars", - ) + #GitRevisionOverride {.strdefine.} = "" + sourcePath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0] - GitRevisionOverride - else: - if gitFolderExists(sourcePath): - # only using git if the parent dir is a git repo. - strip( - staticExec( - "git -C " & strutils.escape(sourcePath) & " rev-parse --short=8 HEAD" - ) - ) - else: - # otherwise we use revision number given by build system. - # e.g. user download from release tarball, or Github zip download. - "00000000" + GitRevision* = generateGitRevision(sourcePath) # Please keep it 4 bytes long, used in `engine_ClientVersionV1` # https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/identification.md#clientversionv1 diff --git a/portal/tests/beacon_network_tests/test_beacon_content.nim b/portal/tests/beacon_network_tests/test_beacon_content.nim index 51a8bbf863..91229e0867 100644 --- a/portal/tests/beacon_network_tests/test_beacon_content.nim +++ b/portal/tests/beacon_network_tests/test_beacon_content.nim @@ -191,14 +191,8 @@ suite "Beacon Content Keys and Values": # TODO: These tests are less useful now and should instead be altered to # use the consensus test vectors to simply test if encoding / decoding works # fine for the different forks. - const forkDigests = ForkDigests( - phase0: ForkDigest([0'u8, 0, 0, 1]), - altair: ForkDigest([0'u8, 0, 0, 2]), - bellatrix: ForkDigest([0'u8, 0, 0, 3]), - capella: ForkDigest([0'u8, 0, 0, 4]), - deneb: ForkDigest([0'u8, 0, 0, 5]), - electra: ForkDigest([0'u8, 0, 0, 6]), # TODO fulu: ForkDigest([0'u8, 0, 0, 7]), - ) + let forkDigests = + ForkDigests.init(getMetadataForNetwork("mainnet").cfg, default(Eth2Digest)) test "LightClientBootstrap": let diff --git a/portal/version.nim b/portal/version.nim index 8ccceff27c..042cf60080 100644 --- a/portal/version.nim +++ b/portal/version.nim @@ -7,7 +7,7 @@ {.push raises: [].} -import stew/byteutils, metrics, beacon_chain/buildinfo +import std/[os, strutils], stew/byteutils, metrics, beacon_chain/buildinfo export buildinfo @@ -18,6 +18,9 @@ const versionAsStr* = $versionMajor & "." & $versionMinor & "." & $versionBuild + sourcePath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0] + GitRevision = generateGitRevision(sourcePath) + fullVersionStr* = "v" & versionAsStr & "-" & GitRevision clientName* = "nimbus_portal_client" diff --git a/vendor/nimbus-eth2 b/vendor/nimbus-eth2 index 8d1f4d5a8e..0415ebc929 160000 --- a/vendor/nimbus-eth2 +++ b/vendor/nimbus-eth2 @@ -1 +1 @@ -Subproject commit 8d1f4d5a8e7b8c3f325416ca1c9b9f0a760cba1f +Subproject commit 0415ebc929ee8c41a1660a154cbec02152c3ce6b