Skip to content

test_invalid_zero_excess_blob_gas_in_header()

Documentation for tests/cancun/eip4844_blobs/test_excess_blob_gas.py::test_invalid_zero_excess_blob_gas_in_header@008e492e.

Generate fixtures for these test cases for Prague with:

fill -v tests/cancun/eip4844_blobs/test_excess_blob_gas.py::test_invalid_zero_excess_blob_gas_in_header --fork Prague

Test rejection of blocks where the excessBlobGas in the header drops to zero in a block with or without data blobs, but the excess blobs in the parent are greater than target.

Source code in tests/cancun/eip4844_blobs/test_excess_blob_gas.py
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
@pytest.mark.parametrize("header_excess_blob_gas", [0])
@pytest.mark.parametrize("new_blobs", [0, 1])
@pytest.mark.parametrize_by_fork(
    "parent_blobs",
    lambda fork: range(0, fork.max_blobs_per_block() + 1),
)
def test_invalid_zero_excess_blob_gas_in_header(
    blockchain_test: BlockchainTestFiller,
    env: Environment,
    pre: Mapping[Address, Account],
    blocks: List[Block],
    correct_excess_blob_gas: int,
    header_excess_blob_gas: Optional[int],
):
    """
    Test rejection of blocks where the `excessBlobGas` in the header drops to
    zero in a block with or without data blobs, but the excess blobs in the parent are
    greater than target.
    """
    if header_excess_blob_gas is None:
        raise Exception("test case is badly formatted")

    if header_excess_blob_gas == correct_excess_blob_gas:
        raise Exception("invalid test case")

    blockchain_test(
        pre=pre,
        post={},
        blocks=blocks,
        genesis_environment=env,
        tag="-".join(
            [
                f"correct:{hex(correct_excess_blob_gas)}",
                f"header:{hex(header_excess_blob_gas)}",
            ]
        ),
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) parent_blobs new_blobs header_excess_blob_gas
...fork_Cancun-parent_blobs_0-blockchain_test-new_blobs_0-header_excess_blob_gas_0 0 0 0
...fork_Cancun-parent_blobs_0-blockchain_test-new_blobs_1-header_excess_blob_gas_0 0 1 0
...fork_Cancun-parent_blobs_1-blockchain_test-new_blobs_0-header_excess_blob_gas_0 1 0 0
...fork_Cancun-parent_blobs_1-blockchain_test-new_blobs_1-header_excess_blob_gas_0 1 1 0
...fork_Cancun-parent_blobs_2-blockchain_test-new_blobs_0-header_excess_blob_gas_0 2 0 0
...fork_Cancun-parent_blobs_2-blockchain_test-new_blobs_1-header_excess_blob_gas_0 2 1 0
...fork_Cancun-parent_blobs_3-blockchain_test-new_blobs_0-header_excess_blob_gas_0 3 0 0
...fork_Cancun-parent_blobs_3-blockchain_test-new_blobs_1-header_excess_blob_gas_0 3 1 0
...fork_Cancun-parent_blobs_4-blockchain_test-new_blobs_0-header_excess_blob_gas_0 4 0 0
...fork_Cancun-parent_blobs_4-blockchain_test-new_blobs_1-header_excess_blob_gas_0 4 1 0
...fork_Cancun-parent_blobs_5-blockchain_test-new_blobs_0-header_excess_blob_gas_0 5 0 0
...fork_Cancun-parent_blobs_5-blockchain_test-new_blobs_1-header_excess_blob_gas_0 5 1 0
...fork_Cancun-parent_blobs_6-blockchain_test-new_blobs_0-header_excess_blob_gas_0 6 0 0
...fork_Cancun-parent_blobs_6-blockchain_test-new_blobs_1-header_excess_blob_gas_0 6 1 0
...fork_Prague-parent_blobs_0-blockchain_test-new_blobs_0-header_excess_blob_gas_0 0 0 0
...fork_Prague-parent_blobs_0-blockchain_test-new_blobs_1-header_excess_blob_gas_0 0 1 0
...fork_Prague-parent_blobs_1-blockchain_test-new_blobs_0-header_excess_blob_gas_0 1 0 0
...fork_Prague-parent_blobs_1-blockchain_test-new_blobs_1-header_excess_blob_gas_0 1 1 0
...fork_Prague-parent_blobs_2-blockchain_test-new_blobs_0-header_excess_blob_gas_0 2 0 0
...fork_Prague-parent_blobs_2-blockchain_test-new_blobs_1-header_excess_blob_gas_0 2 1 0
...fork_Prague-parent_blobs_3-blockchain_test-new_blobs_0-header_excess_blob_gas_0 3 0 0
...fork_Prague-parent_blobs_3-blockchain_test-new_blobs_1-header_excess_blob_gas_0 3 1 0
...fork_Prague-parent_blobs_4-blockchain_test-new_blobs_0-header_excess_blob_gas_0 4 0 0
...fork_Prague-parent_blobs_4-blockchain_test-new_blobs_1-header_excess_blob_gas_0 4 1 0
...fork_Prague-parent_blobs_5-blockchain_test-new_blobs_0-header_excess_blob_gas_0 5 0 0
...fork_Prague-parent_blobs_5-blockchain_test-new_blobs_1-header_excess_blob_gas_0 5 1 0
...fork_Prague-parent_blobs_6-blockchain_test-new_blobs_0-header_excess_blob_gas_0 6 0 0
...fork_Prague-parent_blobs_6-blockchain_test-new_blobs_1-header_excess_blob_gas_0 6 1 0
...fork_Prague-parent_blobs_7-blockchain_test-new_blobs_0-header_excess_blob_gas_0 7 0 0
...fork_Prague-parent_blobs_7-blockchain_test-new_blobs_1-header_excess_blob_gas_0 7 1 0
...fork_Prague-parent_blobs_8-blockchain_test-new_blobs_0-header_excess_blob_gas_0 8 0 0
...fork_Prague-parent_blobs_8-blockchain_test-new_blobs_1-header_excess_blob_gas_0 8 1 0
...fork_Prague-parent_blobs_9-blockchain_test-new_blobs_0-header_excess_blob_gas_0 9 0 0
...fork_Prague-parent_blobs_9-blockchain_test-new_blobs_1-header_excess_blob_gas_0 9 1 0
...fork_Osaka-parent_blobs_0-blockchain_test-new_blobs_0-header_excess_blob_gas_0 0 0 0
...fork_Osaka-parent_blobs_0-blockchain_test-new_blobs_1-header_excess_blob_gas_0 0 1 0
...fork_Osaka-parent_blobs_1-blockchain_test-new_blobs_0-header_excess_blob_gas_0 1 0 0
...fork_Osaka-parent_blobs_1-blockchain_test-new_blobs_1-header_excess_blob_gas_0 1 1 0
...fork_Osaka-parent_blobs_2-blockchain_test-new_blobs_0-header_excess_blob_gas_0 2 0 0
...fork_Osaka-parent_blobs_2-blockchain_test-new_blobs_1-header_excess_blob_gas_0 2 1 0
...fork_Osaka-parent_blobs_3-blockchain_test-new_blobs_0-header_excess_blob_gas_0 3 0 0
...fork_Osaka-parent_blobs_3-blockchain_test-new_blobs_1-header_excess_blob_gas_0 3 1 0
...fork_Osaka-parent_blobs_4-blockchain_test-new_blobs_0-header_excess_blob_gas_0 4 0 0
...fork_Osaka-parent_blobs_4-blockchain_test-new_blobs_1-header_excess_blob_gas_0 4 1 0
...fork_Osaka-parent_blobs_5-blockchain_test-new_blobs_0-header_excess_blob_gas_0 5 0 0
...fork_Osaka-parent_blobs_5-blockchain_test-new_blobs_1-header_excess_blob_gas_0 5 1 0
...fork_Osaka-parent_blobs_6-blockchain_test-new_blobs_0-header_excess_blob_gas_0 6 0 0
...fork_Osaka-parent_blobs_6-blockchain_test-new_blobs_1-header_excess_blob_gas_0 6 1 0
...fork_Osaka-parent_blobs_7-blockchain_test-new_blobs_0-header_excess_blob_gas_0 7 0 0
...fork_Osaka-parent_blobs_7-blockchain_test-new_blobs_1-header_excess_blob_gas_0 7 1 0
...fork_Osaka-parent_blobs_8-blockchain_test-new_blobs_0-header_excess_blob_gas_0 8 0 0
...fork_Osaka-parent_blobs_8-blockchain_test-new_blobs_1-header_excess_blob_gas_0 8 1 0
...fork_Osaka-parent_blobs_9-blockchain_test-new_blobs_0-header_excess_blob_gas_0 9 0 0
...fork_Osaka-parent_blobs_9-blockchain_test-new_blobs_1-header_excess_blob_gas_0 9 1 0