From 9df3d075de458b71c2c69aa3d5d8e4c3957eb312 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Fri, 20 Sep 2024 16:02:24 +0200 Subject: [PATCH] fix blinded block conversion for Deneb and Electra (#6569) `blob_gas_used` and `excess_blob_gas` were not copied on blinding signed beacon block. --- beacon_chain/spec/mev/deneb_mev.nim | 4 +++- beacon_chain/spec/mev/electra_mev.nim | 2 ++ tests/test_toblindedblock.nim | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/beacon_chain/spec/mev/deneb_mev.nim b/beacon_chain/spec/mev/deneb_mev.nim index 961e73645..79cf6a1f7 100644 --- a/beacon_chain/spec/mev/deneb_mev.nim +++ b/beacon_chain/spec/mev/deneb_mev.nim @@ -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) diff --git a/beacon_chain/spec/mev/electra_mev.nim b/beacon_chain/spec/mev/electra_mev.nim index 08ec71e30..b966bf021 100644 --- a/beacon_chain/spec/mev/electra_mev.nim +++ b/beacon_chain/spec/mev/electra_mev.nim @@ -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( diff --git a/tests/test_toblindedblock.nim b/tests/test_toblindedblock.nim index 41f62f14b..36e31e30d 100644 --- a/tests/test_toblindedblock.nim +++ b/tests/test_toblindedblock.nim @@ -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