Skip to content

test_correct_excess_blob_gas_calculation()

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

Generate fixtures for these test cases for Amsterdam with:

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

Test calculation of the excessBlobGas increase/decrease across multiple blocks with and without blobs.

  • With parent block containing [0, MAX_BLOBS_PER_BLOCK] blobs

  • With parent block containing [0, TARGET_BLOBS_PER_BLOCK] equivalent value of excess blob gas

Source code in tests/cancun/eip4844_blobs/test_excess_blob_gas.py
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
@pytest.mark.parametrize_by_fork(
    "parent_blobs",
    lambda fork: range(0, fork.max_blobs_per_block() + 1),
)
@pytest.mark.parametrize_by_fork(
    "parent_excess_blobs",
    lambda fork: range(0, fork.target_blobs_per_block() + 1),
)
@pytest.mark.parametrize("new_blobs", [1])
def test_correct_excess_blob_gas_calculation(
    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` increase/decrease across multiple
    blocks with and without blobs.

    - With parent block containing `[0, MAX_BLOBS_PER_BLOCK]` blobs

    - With parent block containing `[0, TARGET_BLOBS_PER_BLOCK]` equivalent
    value of excess blob gas
    """
    blockchain_test(
        pre=pre,
        post=post,
        blocks=blocks,
        genesis_environment=env,
    )

Parametrized Test Cases

This test generates 330 parametrized test cases across 4 forks.