Skip to content

test_invalid_block_blob_count()

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

Generate fixtures for these test cases for Amsterdam with:

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

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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
@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 4 forks.