Skip to content

test_correct_increasing_blob_gas_costs()

Documentation for tests/cancun/eip4844_blobs/test_excess_blob_gas.py::test_correct_increasing_blob_gas_costs@636b5f17.

Generate fixtures for these test cases for Bogota with:

fill -v tests/cancun/eip4844_blobs/test_excess_blob_gas.py::test_correct_increasing_blob_gas_costs --fork Bogota

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

  • At the first blob gas cost increase (1 to 2)
  • At total transaction data cost increase to > 2^32
  • At blob gas wei cost increase to > 2^32
  • At total transaction data cost increase to > 2^64
  • At blob gas wei cost increase to > 2^64
  • At blob gas wei cost increase of around current total Ether supply
Source code in tests/cancun/eip4844_blobs/test_excess_blob_gas.py
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
@pytest.mark.parametrize_by_fork(
    "parent_excess_blobs",
    generate_blob_gas_cost_increases_tests(-1),
)
@pytest.mark.parametrize_by_fork(
    "parent_blobs",
    lambda fork: [fork.target_blobs_per_block() + 1],
)
@pytest.mark.parametrize("new_blobs", [1])
@pytest.mark.valid_for_bpo_forks()
def test_correct_increasing_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 increases to interesting amounts.

    - At the first blob gas cost increase (1 to 2)
    - At total transaction data cost increase to `> 2^32`
    - At blob gas wei cost increase to `> 2^32`
    - At total transaction data cost increase to `> 2^64`
    - At blob gas wei cost increase to `> 2^64`
    - At blob gas wei cost increase of around current total Ether supply
    """
    blockchain_test(
        pre=pre,
        post=post,
        blocks=blocks,
        genesis_environment=env,
    )

Parametrized Test Cases

This test generates 18 parametrized test cases across 11 forks.