diff --git a/tests/core/pyspec/eth2spec/test/deneb/block_processing/test_process_execution_payload.py b/tests/core/pyspec/eth2spec/test/deneb/block_processing/test_process_execution_payload.py index 988070278d..b0937aac96 100644 --- a/tests/core/pyspec/eth2spec/test/deneb/block_processing/test_process_execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/deneb/block_processing/test_process_execution_payload.py @@ -59,6 +59,13 @@ def verify_and_notify_new_payload(self, new_payload_request) -> bool: assert state.latest_execution_payload_header == get_execution_payload_header(spec, body.execution_payload) +""" +Tests with incorrect blob transactions in the execution payload, but the execution client returns +VALID, and the purpose of these tests is that the beacon client must not reject the block by +attempting to do a validation of its own. +""" + + @with_deneb_and_later @spec_state_test def test_incorrect_blob_tx_type(spec, state): @@ -78,14 +85,14 @@ def test_incorrect_blob_tx_type(spec, state): @with_deneb_and_later @spec_state_test -def test_incorrect_transaction_length_1_byte(spec, state): +def test_incorrect_transaction_length_1_extra_byte(spec, state): """ The versioned hashes are wrong, but the testing ExecutionEngine returns VALID by default. """ execution_payload = build_empty_execution_payload(spec, state) opaque_tx, _, blob_kzg_commitments, _ = get_sample_opaque_tx(spec) - opaque_tx = opaque_tx + b'\x12' # incorrect tx length + opaque_tx = opaque_tx + b'\x12' # incorrect tx length, longer execution_payload.transactions = [opaque_tx] execution_payload.block_hash = compute_el_block_hash(spec, execution_payload) @@ -95,7 +102,41 @@ def test_incorrect_transaction_length_1_byte(spec, state): @with_deneb_and_later @spec_state_test -def test_incorrect_transaction_length_32_bytes(spec, state): +def test_incorrect_transaction_length_1_byte_short(spec, state): + """ + The versioned hashes are wrong, but the testing ExecutionEngine returns VALID by default. + """ + execution_payload = build_empty_execution_payload(spec, state) + + opaque_tx, _, blob_kzg_commitments, _ = get_sample_opaque_tx(spec) + opaque_tx = opaque_tx[:-1] # incorrect tx length, shorter + + execution_payload.transactions = [opaque_tx] + execution_payload.block_hash = compute_el_block_hash(spec, execution_payload) + + yield from run_execution_payload_processing(spec, state, execution_payload, blob_kzg_commitments) + + +@with_deneb_and_later +@spec_state_test +def test_incorrect_transaction_length_empty(spec, state): + """ + The versioned hashes are wrong, but the testing ExecutionEngine returns VALID by default. + """ + execution_payload = build_empty_execution_payload(spec, state) + + opaque_tx, _, blob_kzg_commitments, _ = get_sample_opaque_tx(spec) + opaque_tx = opaque_tx[0:0] # incorrect tx length, empty + + execution_payload.transactions = [opaque_tx] + execution_payload.block_hash = compute_el_block_hash(spec, execution_payload) + + yield from run_execution_payload_processing(spec, state, execution_payload, blob_kzg_commitments) + + +@with_deneb_and_later +@spec_state_test +def test_incorrect_transaction_length_32_extra_bytes(spec, state): """ The versioned hashes are wrong, but the testing ExecutionEngine returns VALID by default. """ @@ -110,6 +151,22 @@ def test_incorrect_transaction_length_32_bytes(spec, state): yield from run_execution_payload_processing(spec, state, execution_payload, blob_kzg_commitments) +@with_deneb_and_later +@spec_state_test +def test_no_transactions_with_commitments(spec, state): + """ + The versioned hashes are wrong, but the testing ExecutionEngine returns VALID by default. + """ + execution_payload = build_empty_execution_payload(spec, state) + + _, _, blob_kzg_commitments, _ = get_sample_opaque_tx(spec) + + execution_payload.transactions = [] + execution_payload.block_hash = compute_el_block_hash(spec, execution_payload) + + yield from run_execution_payload_processing(spec, state, execution_payload, blob_kzg_commitments) + + @with_deneb_and_later @spec_state_test def test_incorrect_commitment(spec, state):