Skip to content

test_correct_decreasing_blob_gas_costs()

Documentation for tests/cancun/eip4844_blobs/test_excess_blob_gas.py::test_correct_decreasing_blob_gas_costs@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/cancun/eip4844_blobs/test_excess_blob_gas.py::test_correct_decreasing_blob_gas_costs --fork Amsterdam

Test calculation of the excessBlobGas and blob gas tx costs at value points where the cost decreases to interesting amounts.

See test_correct_increasing_blob_gas_costs.

Source code in tests/cancun/eip4844_blobs/test_excess_blob_gas.py
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
@pytest.mark.parametrize_by_fork(
    "parent_excess_blobs",
    generate_blob_gas_cost_increases_tests(0),
)
@pytest.mark.parametrize_by_fork(
    "parent_blobs",
    lambda fork: [fork.target_blobs_per_block() - 1],
)
@pytest.mark.parametrize("new_blobs", [1])
def test_correct_decreasing_blob_gas_costs(
    blockchain_test: BlockchainTestFiller,
    env: Environment,
    pre: Mapping[Address, Account],
    blocks: List[Block],
    post: Mapping[Address, Account],
    correct_excess_blob_gas: int,
) -> None:
    """
    Test calculation of the `excessBlobGas` and blob gas tx costs at value
    points where the cost decreases to interesting amounts.

    See test_correct_increasing_blob_gas_costs.
    """
    blockchain_test(
        pre=pre,
        post=post,
        blocks=blocks,
        genesis_environment=env,
    )

Parametrized Test Cases

This test generates 6 parametrized test cases across 4 forks.