Skip to content

test_reserve_price_boundary()

Documentation for tests/osaka/eip7918_blob_reserve_price/test_blob_base_fee.py::test_reserve_price_boundary@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/osaka/eip7918_blob_reserve_price/test_blob_base_fee.py::test_reserve_price_boundary --fork Amsterdam

Tests the reserve price boundary mechanism.

The block base fee per gas is calculated as (8 * blob_base_fee) + delta, where 8 * blob_base_fee is the boundary at which reserve_price equals blob_gas_price.

Tests include: - Low excess blob scenarios (blob_gas_price = 1) with various deltas - High blob gas price scenarios (2, 3, 5, 10) at exact equality boundary

Example scenarios: - delta < 0: reserve inactive, effective_fee = blob_gas_price - delta = 0: equality boundary, reserve inactive (uses > not >=) - delta > 0: reserve active, effective_fee = reserve_price

Source code in tests/osaka/eip7918_blob_reserve_price/test_blob_base_fee.py
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
@pytest.mark.parametrize_by_fork(
    "parent_excess_blobs,block_base_fee_per_gas_delta",
    get_boundary_scenarios,
)
@pytest.mark.eels_base_coverage
def test_reserve_price_boundary(
    blockchain_test: BlockchainTestFiller,
    env: Environment,
    pre: Alloc,
    block: Block,
    post: Dict[Address, Account],
) -> None:
    """
    Tests the reserve price boundary mechanism.

    The block base fee per gas is calculated as (8 * blob_base_fee) + delta,
    where 8 * blob_base_fee is the boundary at which reserve_price equals
    blob_gas_price.

    Tests include:
    - Low excess blob scenarios (blob_gas_price = 1) with various deltas
    - High blob gas price scenarios (2, 3, 5, 10) at exact equality boundary

    Example scenarios:
    - delta < 0: reserve inactive, effective_fee = blob_gas_price
    - delta = 0: equality boundary, reserve inactive (uses > not >=)
    - delta > 0: reserve active, effective_fee = reserve_price
    """
    blockchain_test(
        genesis_environment=env,
        pre=pre,
        blocks=[block],
        post=post,
    )

Parametrized Test Cases

This test generates 30 parametrized test cases across 2 forks.