Skip to content

test_valid_blob_tx_combinations()

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

Generate fixtures for these test cases for Amsterdam with:

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

Test all valid blob combinations in a single block, assuming a given value of MAX_BLOBS_PER_BLOCK.

This assumes a block can include from 1 and up to MAX_BLOBS_PER_BLOCK transactions where all transactions contain at least 1 blob, and the sum of all blobs in a block is at most MAX_BLOBS_PER_BLOCK.

This test is parametrized with all valid blob transaction combinations 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
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
421
422
@pytest.mark.parametrize_by_fork(
    "blobs_per_tx",
    SpecHelpers.all_valid_blob_combinations,
)
@pytest.mark.parametrize("block_base_fee_per_gas", [7, 100])
@pytest.mark.valid_from("Cancun")
def test_valid_blob_tx_combinations(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
    env: Environment,
    block: Block,
) -> None:
    """
    Test all valid blob combinations in a single block, assuming a given value
    of `MAX_BLOBS_PER_BLOCK`.

    This assumes a block can include from 1 and up to `MAX_BLOBS_PER_BLOCK`
    transactions where all transactions contain at least 1 blob, and the sum of
    all blobs in a block is at most `MAX_BLOBS_PER_BLOCK`.

    This test is parametrized with all valid blob transaction combinations 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 216 parametrized test cases across 4 forks.