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@21fb11c8.

Generate fixtures for these test cases for Prague with:

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

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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
@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])
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,
):
    """
    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,
        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_4-parent_excess_blobs_17-blockchain_test-new_blobs_1 4 17 1
...fork_Cancun-parent_blobs_4-parent_excess_blobs_264-blockchain_test-new_blobs_1 4 264 1
...fork_Cancun-parent_blobs_4-parent_excess_blobs_564-blockchain_test-new_blobs_1 4 564 1
...fork_Cancun-parent_blobs_4-parent_excess_blobs_829-blockchain_test-new_blobs_1 4 829 1
...fork_Cancun-parent_blobs_4-parent_excess_blobs_1129-blockchain_test-new_blobs_1 4 1129 1
...fork_Cancun-parent_blobs_4-parent_excess_blobs_1229-blockchain_test-new_blobs_1 4 1229 1
...fork_Prague-parent_blobs_7-parent_excess_blobs_26-blockchain_test-new_blobs_1 7 26 1
...fork_Prague-parent_blobs_7-parent_excess_blobs_397-blockchain_test-new_blobs_1 7 397 1
...fork_Prague-parent_blobs_7-parent_excess_blobs_847-blockchain_test-new_blobs_1 7 847 1
...fork_Prague-parent_blobs_7-parent_excess_blobs_1244-blockchain_test-new_blobs_1 7 1244 1
...fork_Prague-parent_blobs_7-parent_excess_blobs_1694-blockchain_test-new_blobs_1 7 1694 1
...fork_Prague-parent_blobs_7-parent_excess_blobs_1844-blockchain_test-new_blobs_1 7 1844 1
...fork_Osaka-parent_blobs_7-parent_excess_blobs_26-blockchain_test-new_blobs_1 7 26 1
...fork_Osaka-parent_blobs_7-parent_excess_blobs_397-blockchain_test-new_blobs_1 7 397 1
...fork_Osaka-parent_blobs_7-parent_excess_blobs_847-blockchain_test-new_blobs_1 7 847 1
...fork_Osaka-parent_blobs_7-parent_excess_blobs_1244-blockchain_test-new_blobs_1 7 1244 1
...fork_Osaka-parent_blobs_7-parent_excess_blobs_1694-blockchain_test-new_blobs_1 7 1694 1
...fork_Osaka-parent_blobs_7-parent_excess_blobs_1844-blockchain_test-new_blobs_1 7 1844 1