Skip to content

test_invalid_block_blob_count()

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

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
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
@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.