Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down