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..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 @@ -676,6 +676,40 @@ 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_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)) + + 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