Skip to content

bump nim-eth to 92a02b672f60e6b5e5ea570d684904c289b495fa #7209

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

Merged
merged 5 commits into from
Jun 28, 2025
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
20 changes: 10 additions & 10 deletions beacon_chain/libnimbus_lc/libnimbus_lc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ proc ETHExecutionBlockHeaderCreateFromJson(
Opt.some data.requestsHash.get.asEth2Digest.to(Hash32)
else:
Opt.none(Hash32))
if blockHeader.computeRlpHash() != executionHash[]:
if blockHeader.computeRlpHash().asEth2Digest() != executionHash[]:
return nil

# Construct withdrawals
Expand Down Expand Up @@ -1326,15 +1326,15 @@ proc ETHExecutionBlockHeaderCreateFromJson(
bytes: rlpBytes)

let tr = orderedTrieRoot(wds)
if tr != data.withdrawalsRoot.get.asEth2Digest:
if tr != data.withdrawalsRoot.get:
return nil

let executionBlockHeader = ETHExecutionBlockHeader.new()
executionBlockHeader[] = ETHExecutionBlockHeader(
transactionsRoot: blockHeader.txRoot,
withdrawalsRoot: blockHeader.withdrawalsRoot.get(zeroHash32),
transactionsRoot: blockHeader.txRoot.asEth2Digest(),
withdrawalsRoot: blockHeader.withdrawalsRoot.get(zeroHash32).asEth2Digest(),
withdrawals: wds,
requestsHash: blockHeader.requestsHash.get(zeroHash32))
requestsHash: blockHeader.requestsHash.get(zeroHash32).asEth2Digest())
executionBlockHeader.toUnmanagedPtr()

proc ETHExecutionBlockHeaderDestroy(
Expand Down Expand Up @@ -1600,7 +1600,7 @@ proc ETHTransactionsCreateFromJson(
except RlpError:
raiseAssert "Unreachable"
hash = keccak256(rlpBytes)
if data.hash.asEth2Digest != hash:
if data.hash != hash:
return nil

func packSignature(r, s: UInt256, yParity: uint8): array[65, byte] =
Expand Down Expand Up @@ -1667,7 +1667,7 @@ proc ETHTransactionsCreateFromJson(
signature: @sig)

txs.add ETHTransaction(
hash: keccak256(rlpBytes),
hash: keccak256(rlpBytes).asEth2Digest,
chainId: tx.chainId,
`from`: ExecutionAddress(data: fromAddress),
nonce: tx.nonce,
Expand All @@ -1688,7 +1688,7 @@ proc ETHTransactionsCreateFromJson(
signature: @rawSig,
bytes: rlpBytes.TypedTransaction)

if orderedTrieRoot(txs) != transactionsRoot[]:
if orderedTrieRoot(txs).asEth2Digest() != transactionsRoot[]:
return nil

let transactions = seq[ETHTransaction].new()
Expand Down Expand Up @@ -2396,7 +2396,7 @@ proc ETHReceiptsCreateFromJson(
ReceiptStatusType.Root
else:
ReceiptStatusType.Status,
root: rec.hash,
root: rec.hash.asEth2Digest(),
status: rec.status,
gasUsed: distinctBase(data.gasUsed), # Validated during sanity checks.
logsBloom: BloomLogs(data: rec.logsBloom.data),
Expand All @@ -2406,7 +2406,7 @@ proc ETHReceiptsCreateFromJson(
data: it.data)),
bytes: rlpBytes)

if orderedTrieRoot(recs) != receiptsRoot[]:
if orderedTrieRoot(recs).asEth2Digest() != receiptsRoot[]:
return nil

let receipts = seq[ETHReceipt].new()
Expand Down
5 changes: 3 additions & 2 deletions tests/testblockutil.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import
chronicles,
stew/endians2,
../beacon_chain/consensus_object_pools/sync_committee_msg_pool,
../beacon_chain/el/engine_api_conversions,
../beacon_chain/spec/datatypes/bellatrix,
../beacon_chain/spec/[
beaconstate, helpers, keystore, signatures, state_transition, validator]
Expand Down Expand Up @@ -102,7 +103,7 @@ func build_empty_merge_execution_payload(state: bellatrix.BeaconState):
var payload = bellatrix.ExecutionPayload(
parent_hash: latest.block_hash,
state_root: latest.state_root, # no changes to the state
receipts_root: EMPTY_ROOT_HASH,
receipts_root: EMPTY_ROOT_HASH.asEth2Digest,
block_number: latest.block_number + 1,
prev_randao: randao_mix,
gas_limit: 30000000, # retain same limit
Expand Down Expand Up @@ -134,7 +135,7 @@ func build_empty_execution_payload(
parent_hash: latest.block_hash,
fee_recipient: bellatrix.ExecutionAddress(data: distinctBase(feeRecipient)),
state_root: latest.state_root, # no changes to the state
receipts_root: EMPTY_ROOT_HASH,
receipts_root: EMPTY_ROOT_HASH.asEth2Digest,
block_number: latest.block_number + 1,
prev_randao: randao_mix,
gas_limit: latest.gas_limit, # retain same limit
Expand Down
Loading