Skip to content

test_invalid_max_blobs_per_tx()

Documentation for tests/osaka/eip7594_peerdas/test_max_blob_per_tx.py::test_invalid_max_blobs_per_tx@e9958ed2.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7594_peerdas/test_max_blob_per_tx.py::test_invalid_max_blobs_per_tx --fork Osaka

Test that transactions exceeding MAX_BLOBS_PER_TX are rejected. Verifies that individual transactions cannot contain more than the maximum allowed number of blobs per transaction, even if the total would be within the block limit.

Source code in tests/osaka/eip7594_peerdas/test_max_blob_per_tx.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
@pytest.mark.parametrize_by_fork(
    "blob_count",
    lambda fork: [
        fork.max_blobs_per_tx() + 1,
        fork.max_blobs_per_tx() + 2,
        fork.max_blobs_per_block(),
        fork.max_blobs_per_block() + 1,
    ],
)
@pytest.mark.valid_from("Osaka")
@pytest.mark.exception_test
def test_invalid_max_blobs_per_tx(
    fork: Fork,
    state_test: StateTestFiller,
    pre: Alloc,
    env: Environment,
    tx: Transaction,
    blob_count: int,
) -> None:
    """
    Test that transactions exceeding MAX_BLOBS_PER_TX are rejected. Verifies
    that individual transactions cannot contain more than the maximum allowed
    number of blobs per transaction, even if the total would be within the
    block limit.
    """
    state_test(
        env=env,
        pre=pre,
        tx=tx.with_error(
            TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED
            if blob_count > fork.max_blobs_per_block()
            else TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED
        ),
        post={},
    )

Parametrized Test Cases

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

Test ID (Abbreviated) blob_count
...fork_Osaka-blob_count_7-state_test 7
...fork_Osaka-blob_count_7-blockchain_test_from_state_test 7
...fork_Osaka-blob_count_8-state_test 8
...fork_Osaka-blob_count_8-blockchain_test_from_state_test 8
...fork_Osaka-blob_count_9-state_test 9
...fork_Osaka-blob_count_9-blockchain_test_from_state_test 9
...fork_Osaka-blob_count_10-state_test 10
...fork_Osaka-blob_count_10-blockchain_test_from_state_test 10