Skip to content
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
2 changes: 1 addition & 1 deletion nimbus/common/chain_config_hash.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Nimbus
# Copyright (c) 2021-2024 Status Research & Development GmbH
# Copyright (c) 2024 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
Expand Down
5 changes: 5 additions & 0 deletions nimbus/common/genesis.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import
eth/common/[hashes, accounts, headers, addresses],
../db/[ledger, core_db],
../constants,
../utils/utils,
./chain_config

# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -78,6 +79,10 @@ proc toGenesisHeader*(
result.excessBlobGas = Opt.some g.excessBlobGas.get(0'u64)
result.parentBeaconBlockRoot = Opt.some g.parentBeaconBlockRoot.get(default(Hash32))

if fork >= Prague:
const EmptyRequestsHash = calcRequestsHash()
result.requestsHash = Opt.some(EmptyRequestsHash)

proc toGenesisHeader*(
genesis: Genesis;
fork: HardFork;
Expand Down
3 changes: 2 additions & 1 deletion nimbus/utils/utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func calcRequestsHash*(requests: varargs[seq[byte]]): Hash32 =
var ctx: sha256
ctx.init()
for i, data in requests:
ctx.update(calcHash(i.byte, data).data)
if data.len > 0:
ctx.update(calcHash(i.byte, data).data)
ctx.finish(result.data)
ctx.clear()

Expand Down
Loading
Loading