Skip to content

Commit cfa0268

Browse files
committed
Version 23.9.1
Changes: * Updated network metadata for Holesky * Use hash_tree_root instead of SHA256 when verifying the Holesky genesis state
1 parent 568e1fb commit cfa0268

File tree

7 files changed

+28
-20
lines changed

7 files changed

+28
-20
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2023-09-25 v23.9.1
2+
==================
3+
4+
Nimbus `v23.9.1` is a `low-urgency` point release that corrects the [Holešky testnet](https://github.com/eth-clients/holesky) metadata after the [failed start](https://twitter.com/parithosh_j/status/1702816780542984504) on 15th of September. If you want to participate in the network, please update your client before the genesis event on 28th of September, 12:00 UTC.
5+
16
2023-09-08 v23.9.0
27
==================
38

@@ -10,7 +15,7 @@ We've been hard at work researching and developing a GossipSub protocol upgrade,
1015
* The GossipSub implementation of Nimbus now consumes less bandwidth and CPU cycles, while improving upon the existing DoS protections through better peer scoring:
1116
https://github.com/status-im/nimbus-eth2/pull/5229
1217

13-
* The new `--web3-signer` command-line option can be used to connect Nimbus to one or more remote signers without requiring any remote keystore files to be created. The list of validators attached to each remote signer is obtained automatically through the [`/api/v1/eth2/publicKeys`](https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Public-Key/operation/ETH2_LIST) Web3Signer API endpoint:
18+
* The new `--web3-signer-url` command-line option can be used to connect Nimbus to one or more remote signers without requiring any remote keystore files to be created. The list of validators attached to each remote signer is obtained automatically through the [`/api/v1/eth2/publicKeys`](https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Public-Key/operation/ETH2_LIST) Web3Signer API endpoint:
1419
https://github.com/status-im/nimbus-eth2/pull/5366
1520
https://github.com/status-im/nimbus-eth2/pull/5385
1621
https://github.com/status-im/nimbus-eth2/pull/5389

beacon_chain/networking/network_metadata.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ elif const_preset == "mainnet":
320320
vendorDir & "/holesky/custom_config_data",
321321
some holesky,
322322
downloadGenesisFrom = some DownloadInfo(
323-
url: "https://github.com/status-im/nimbus-eth2/releases/download/v23.9.0/holesky-genesis.ssz.sz",
324-
digest: Eth2Digest.fromHex "0x76631cd0b9ddc5b2c766b496e23f16759ce1181446a4efb40e5540cd15b78a07"))
323+
url: "https://github.com/status-im/nimbus-eth2/releases/download/v23.9.1/holesky-genesis.ssz.sz",
324+
digest: Eth2Digest.fromHex "0x0ea3f6f9515823b59c863454675fefcd1d8b4f2dbe454db166206a41fda060a0"))
325325

326326
sepoliaMetadata = loadCompileTimeNetworkMetadata(
327327
vendorDir & "/sepolia/bepolia",

beacon_chain/networking/network_metadata_downloads.nim

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import
99
std/uri,
1010
stew/io2, chronos, chronos/apps/http/httpclient, snappy,
11-
../spec/digest
11+
../spec/[digest, forks], ../spec/datatypes/base
1212

1313
import network_metadata
1414
export network_metadata
@@ -29,15 +29,16 @@ proc downloadFile(url: Uri): Future[seq[byte]] {.async.} =
2929
msg: "Unexpected status code " & $response[0] & " when fetching " & $url,
3030
status: response[0])
3131

32-
proc fetchBytes*(metadata: GenesisMetadata,
33-
genesisStateUrlOverride = none(Uri)): Future[seq[byte]] {.async.} =
34-
case metadata.kind
32+
proc fetchGenesisBytes*(
33+
metadata: Eth2NetworkMetadata,
34+
genesisStateUrlOverride = none(Uri)): Future[seq[byte]] {.async.} =
35+
case metadata.genesis.kind
3536
of NoGenesis:
36-
raiseAssert "fetchBytes should be called only when metadata.hasGenesis is true"
37+
raiseAssert "fetchGenesisBytes should be called only when metadata.hasGenesis is true"
3738
of BakedIn:
38-
result = @(metadata.bakedBytes)
39+
result = @(metadata.genesis.bakedBytes)
3940
of BakedInUrl:
40-
result = await downloadFile(genesisStateUrlOverride.get(parseUri metadata.url))
41+
result = await downloadFile(genesisStateUrlOverride.get(parseUri metadata.genesis.url))
4142
# Under the built-in default URL, we serve a snappy-encoded BeaconState in order
4243
# to reduce the size of the downloaded file with roughly 50% (this precise ratio
4344
# depends on the number of validator recors). The user is still free to provide
@@ -54,11 +55,13 @@ proc fetchBytes*(metadata: GenesisMetadata,
5455
# HTTP servers.
5556
if result.isSnappyFramedStream:
5657
result = decodeFramed(result)
57-
if eth2digest(result) != metadata.digest:
58-
raise (ref DigestMismatchError)(
59-
msg: "The downloaded genesis state cannot be verified (checksum mismatch)")
58+
let state = newClone(readSszForkedHashedBeaconState(metadata.cfg, result))
59+
withState(state[]):
60+
if forkyState.root != metadata.genesis.digest:
61+
raise (ref DigestMismatchError)(
62+
msg: "The downloaded genesis state cannot be verified (checksum mismatch)")
6063
of UserSuppliedFile:
61-
result = readAllBytes(metadata.path).tryGet()
64+
result = readAllBytes(metadata.genesis.path).tryGet()
6265

6366
proc sourceDesc*(metadata: GenesisMetadata): string =
6467
case metadata.kind
@@ -75,5 +78,5 @@ when isMainModule:
7578
let holeskyMetadata = getMetadataForNetwork("holesky")
7679
io2.writeFile(
7780
"holesky-genesis.ssz",
78-
waitFor holeskyMetadata.genesis.fetchBytes()
81+
waitFor holeskyMetadata.fetchGenesisBytes()
7982
).expect("success")

beacon_chain/nimbus_beacon_node.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ proc init*(T: type BeaconNode,
564564
if metadata.genesis.kind == BakedInUrl:
565565
info "Obtaining genesis state",
566566
sourceUrl = $config.genesisStateUrl.get(parseUri metadata.genesis.url)
567-
await metadata.genesis.fetchBytes(config.genesisStateUrl)
567+
await metadata.fetchGenesisBytes(config.genesisStateUrl)
568568
except CatchableError as err:
569569
error "Failed to obtain genesis state",
570570
source = metadata.genesis.sourceDesc,
@@ -2074,7 +2074,7 @@ proc handleStartUpCmd(config: var BeaconNodeConf) {.raises: [CatchableError].} =
20742074
stateId: "finalized")
20752075
genesis =
20762076
if network.hasGenesis:
2077-
let genesisBytes = try: waitFor network.genesis.fetchBytes()
2077+
let genesisBytes = try: waitFor network.fetchGenesisBytes()
20782078
except CatchableError as err:
20792079
error "Failed to obtain genesis state",
20802080
source = network.genesis.sourceDesc,

beacon_chain/nimbus_light_client.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ programMain:
6363
template cfg(): auto = metadata.cfg
6464

6565
let
66-
genesisBytes = try: waitFor metadata.genesis.fetchBytes()
66+
genesisBytes = try: waitFor metadata.fetchGenesisBytes()
6767
except CatchableError as err:
6868
error "Failed to obtain genesis state",
6969
source = metadata.genesis.sourceDesc,

beacon_chain/version.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const
1818

1919
versionMajor* = 23
2020
versionMinor* = 9
21-
versionBuild* = 0
21+
versionBuild* = 1
2222

2323
versionBlob* = "stateofus" # Single word - ends up in the default graffiti
2424

0 commit comments

Comments
 (0)