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@83970623.

Generate fixtures for these test cases for Prague with:

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

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
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
381
@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,
):
    """
    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,
        tag=f"expected_excess_blob_gas:{hex(correct_excess_blob_gas)}",
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) parent_blobs parent_excess_blobs new_blobs
...fork_Cancun-parent_blobs_2-parent_excess_blobs_18-blockchain_test-new_blobs_1 2 18 1
...fork_Cancun-parent_blobs_2-parent_excess_blobs_265-blockchain_test-new_blobs_1 2 265 1
...fork_Cancun-parent_blobs_2-parent_excess_blobs_565-blockchain_test-new_blobs_1 2 565 1
...fork_Cancun-parent_blobs_2-parent_excess_blobs_830-blockchain_test-new_blobs_1 2 830 1
...fork_Cancun-parent_blobs_2-parent_excess_blobs_1130-blockchain_test-new_blobs_1 2 1130 1
...fork_Cancun-parent_blobs_2-parent_excess_blobs_1230-blockchain_test-new_blobs_1 2 1230 1
...fork_Prague-parent_blobs_5-parent_excess_blobs_27-blockchain_test-new_blobs_1 5 27 1
...fork_Prague-parent_blobs_5-parent_excess_blobs_398-blockchain_test-new_blobs_1 5 398 1
...fork_Prague-parent_blobs_5-parent_excess_blobs_848-blockchain_test-new_blobs_1 5 848 1
...fork_Prague-parent_blobs_5-parent_excess_blobs_1245-blockchain_test-new_blobs_1 5 1245 1
...fork_Prague-parent_blobs_5-parent_excess_blobs_1695-blockchain_test-new_blobs_1 5 1695 1
...fork_Prague-parent_blobs_5-parent_excess_blobs_1845-blockchain_test-new_blobs_1 5 1845 1
...fork_Osaka-parent_blobs_5-parent_excess_blobs_27-blockchain_test-new_blobs_1 5 27 1
...fork_Osaka-parent_blobs_5-parent_excess_blobs_398-blockchain_test-new_blobs_1 5 398 1
...fork_Osaka-parent_blobs_5-parent_excess_blobs_848-blockchain_test-new_blobs_1 5 848 1
...fork_Osaka-parent_blobs_5-parent_excess_blobs_1245-blockchain_test-new_blobs_1 5 1245 1
...fork_Osaka-parent_blobs_5-parent_excess_blobs_1695-blockchain_test-new_blobs_1 5 1695 1
...fork_Osaka-parent_blobs_5-parent_excess_blobs_1845-blockchain_test-new_blobs_1 5 1845 1