From 52d978b12ed89a7a6020b7d2c29887648ee35d8a Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Sun, 15 Jan 2023 12:13:35 +0100 Subject: [PATCH] Use `Gwei` for `Withdrawal` amount in mock-EE Updates the EL block hash computation for pytests to match latest spec. Notably, use `Gwei` for `Withdrawal` amount consistently. Also fix `excess_data_gas` not being correctly accounted for. https://github.com/ethereum/execution-apis/pull/354 https://github.com/ethereum/EIPs/pull/6325 --- tests/core/pyspec/eth2spec/test/helpers/execution_payload.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py b/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py index 1f478ccc6..5e0c160b3 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py @@ -26,6 +26,8 @@ def get_execution_payload_header(spec, execution_payload): ) if is_post_capella(spec): payload_header.withdrawals_root = spec.hash_tree_root(execution_payload.withdrawals) + if is_post_eip4844(spec): + payload_header.excess_data_gas = execution_payload.excess_data_gas return payload_header @@ -108,7 +110,7 @@ def get_withdrawal_rlp(spec, withdrawal): # address (Binary(20, 20), withdrawal.address), # amount - (big_endian_int, spec.uint256(withdrawal.amount) * (10**9)), + (big_endian_int, withdrawal.amount), ] sedes = List([schema for schema, _ in withdrawal_rlp])