Skip to content

test_invalid_block_blob_count()

Documentation for tests/cancun/eip4844_blobs/test_blob_txs.py::test_invalid_block_blob_count@ffe48572.

Generate fixtures for these test cases for Bogota with:

fill -v tests/cancun/eip4844_blobs/test_blob_txs.py::test_invalid_block_blob_count --fork Bogota

Test all invalid blob combinations in a single block, where the sum of all blobs in a block is at MAX_BLOBS_PER_BLOCK + 1.

This test is parametrized with all blob transaction combinations exceeding MAX_BLOBS_PER_BLOCK by one for a given block, and therefore if value of MAX_BLOBS_PER_BLOCK changes, this test is automatically updated.

Source code in tests/cancun/eip4844_blobs/test_blob_txs.py
@pytest.mark.inclusion_test
@pytest.mark.parametrize_by_fork(
    "blobs_per_tx",
    SpecHelpers.invalid_blob_combinations,
)
@pytest.mark.parametrize(
    "tx_error",
    [
        [
            TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED,
            TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED,
        ]
    ],
    ids=[""],
)
@pytest.mark.exception_test
@pytest.mark.valid_from("Cancun")
@pytest.mark.eels_base_coverage
def test_invalid_block_blob_count(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
    env: Environment,
    block: Block,
) -> None:
    """
    Test all invalid blob combinations in a single block, where the sum of all
    blobs in a block is at `MAX_BLOBS_PER_BLOCK + 1`.

    This test is parametrized with all blob transaction combinations exceeding
    `MAX_BLOBS_PER_BLOCK` by one for a given block, and therefore if value of
    `MAX_BLOBS_PER_BLOCK` changes, this test is automatically updated.
    """
    blockchain_test(
        pre=pre,
        post={},
        blocks=[block],
        genesis_environment=env,
    )

Parametrized Test Cases

This test generates 6 parametrized test cases across 5 forks.