Skip to content

Commit

Permalink
fix blinded block conversion for Deneb and Electra (#6569)
Browse files Browse the repository at this point in the history
`blob_gas_used` and `excess_blob_gas` were not copied on blinding
signed beacon block.
  • Loading branch information
etan-status authored Sep 20, 2024
1 parent 20bb20f commit 9df3d07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion beacon_chain/spec/mev/deneb_mev.nim
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ func toSignedBlindedBeaconBlock*(blck: deneb.SignedBeaconBlock):
transactions_root:
hash_tree_root(blck.message.body.execution_payload.transactions),
withdrawals_root:
hash_tree_root(blck.message.body.execution_payload.withdrawals)),
hash_tree_root(blck.message.body.execution_payload.withdrawals),
blob_gas_used: blck.message.body.execution_payload.blob_gas_used,
excess_blob_gas: blck.message.body.execution_payload.excess_blob_gas),
bls_to_execution_changes: blck.message.body.bls_to_execution_changes,
blob_kzg_commitments: blck.message.body.blob_kzg_commitments)),
signature: blck.signature)
2 changes: 2 additions & 0 deletions beacon_chain/spec/mev/electra_mev.nim
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ func toSignedBlindedBeaconBlock*(blck: electra.SignedBeaconBlock):
hash_tree_root(blck.message.body.execution_payload.transactions),
withdrawals_root:
hash_tree_root(blck.message.body.execution_payload.withdrawals),
blob_gas_used: blck.message.body.execution_payload.blob_gas_used,
excess_blob_gas: blck.message.body.execution_payload.excess_blob_gas,
deposit_requests_root: hash_tree_root(
blck.message.body.execution_payload.deposit_requests),
withdrawal_requests_root: hash_tree_root(
Expand Down
4 changes: 4 additions & 0 deletions tests/test_toblindedblock.nim
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ template capella_steps() =
do_check

template deneb_steps() =
b.message.body.execution_payload.blob_gas_used = 8
do_check
b.message.body.execution_payload.excess_blob_gas = 9
do_check
check: b.message.body.blob_kzg_commitments.add(default(KzgCommitment))
do_check

Expand Down

0 comments on commit 9df3d07

Please sign in to comment.