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@343274cc.

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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
@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.