From 3b51cead89b74f65935e10758d1836cf7085aabe Mon Sep 17 00:00:00 2001 From: NC <17676176+ensi321@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:19:14 -0800 Subject: [PATCH 1/4] init --- .../test_process_execution_payload.py | 36 +++++++++++++++++++ .../test_process_execution_payload_bid.py | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py index ea93640583..77c858da65 100644 --- a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py @@ -676,6 +676,42 @@ def test_process_execution_payload_wrong_blob_commitments_root(spec, state): yield from run_execution_payload_processing(spec, state, signed_envelope, valid=False) +@with_gloas_and_later +@spec_state_test +@always_bls +def test_process_execution_payload_wrong_withdrawals(spec, state): + """ + Test wrong withdrawals root fails with separate builder + """ + builder_index = 0 + + setup_state_with_payload_bid(spec, state, builder_index, spec.Gwei(2600000)) + + execution_payload = build_empty_execution_payload(spec, state) + execution_payload.block_hash = state.latest_execution_payload_bid.block_hash + execution_payload.gas_limit = state.latest_execution_payload_bid.gas_limit + execution_payload.parent_hash = state.latest_block_hash + + withdrawal = spec.Withdrawal( + index=0, + validator_index=0, + address=b"\x22" * 20, + amount=spec.Gwei(1), + ) + state.payload_expected_withdrawals = spec.List[ + spec.Withdrawal, spec.MAX_WITHDRAWALS_PER_PAYLOAD + ]([withdrawal]) + execution_payload.withdrawals = spec.List[ + spec.Withdrawal, spec.MAX_WITHDRAWALS_PER_PAYLOAD + ]() + + signed_envelope = prepare_execution_payload_envelope( + spec, state, builder_index=builder_index, execution_payload=execution_payload + ) + + yield from run_execution_payload_processing(spec, state, signed_envelope, valid=False) + + @with_gloas_and_later @spec_state_test @always_bls diff --git a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload_bid.py b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload_bid.py index 1e74795edf..3247846f42 100644 --- a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload_bid.py +++ b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload_bid.py @@ -60,7 +60,7 @@ def prepare_signed_execution_payload_bid( spec.process_slots(state, slot) if builder_index is None: - builder_index = spec.get_beacon_proposer_index(state) + builder_index = spec.BUILDER_INDEX_SELF_BUILD if parent_block_hash is None: parent_block_hash = state.latest_block_hash From 09ecc35526d461cbede04ada49ee8c9840044c2a Mon Sep 17 00:00:00 2001 From: NC <17676176+ensi321@users.noreply.github.com> Date: Thu, 22 Jan 2026 06:34:53 -0800 Subject: [PATCH 2/4] lint --- .../gloas/block_processing/test_process_execution_payload.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py index 77c858da65..9c2814333a 100644 --- a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py @@ -701,9 +701,7 @@ def test_process_execution_payload_wrong_withdrawals(spec, state): state.payload_expected_withdrawals = spec.List[ spec.Withdrawal, spec.MAX_WITHDRAWALS_PER_PAYLOAD ]([withdrawal]) - execution_payload.withdrawals = spec.List[ - spec.Withdrawal, spec.MAX_WITHDRAWALS_PER_PAYLOAD - ]() + execution_payload.withdrawals = spec.List[spec.Withdrawal, spec.MAX_WITHDRAWALS_PER_PAYLOAD]() signed_envelope = prepare_execution_payload_envelope( spec, state, builder_index=builder_index, execution_payload=execution_payload From 714daae29269726da91935c85c88a9bdc48ff8bb Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:30:18 -0600 Subject: [PATCH 3/4] Rename test & update docstring --- .../block_processing/test_process_execution_payload.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py index 9c2814333a..def80dcfda 100644 --- a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py @@ -679,10 +679,10 @@ def test_process_execution_payload_wrong_blob_commitments_root(spec, state): @with_gloas_and_later @spec_state_test @always_bls -def test_process_execution_payload_wrong_withdrawals(spec, state): - """ - Test wrong withdrawals root fails with separate builder - """ +def test_process_execution_payload_missing_expected_withdrawal(spec, state): + """ + Verify payload rejected when it omits a withdrawal expected by the state. + """ builder_index = 0 setup_state_with_payload_bid(spec, state, builder_index, spec.Gwei(2600000)) From 785fba2d8efe1ae5376c913e5e7673e8819243e6 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Fri, 30 Jan 2026 13:36:40 -0600 Subject: [PATCH 4/4] Run make lint --- .../block_processing/test_process_execution_payload.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py index def80dcfda..1cfe4b1631 100644 --- a/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/gloas/block_processing/test_process_execution_payload.py @@ -680,9 +680,9 @@ def test_process_execution_payload_wrong_blob_commitments_root(spec, state): @spec_state_test @always_bls def test_process_execution_payload_missing_expected_withdrawal(spec, state): - """ - Verify payload rejected when it omits a withdrawal expected by the state. - """ + """ + Verify payload rejected when it omits a withdrawal expected by the state. + """ builder_index = 0 setup_state_with_payload_bid(spec, state, builder_index, spec.Gwei(2600000))