Skip to content

test_bal_max_pointer_chase()

Documentation for tests/benchmark/stateful/eip7928_block_level_access_lists/test_block_access_lists_pointer_chase.py::test_bal_max_pointer_chase@21507778.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/benchmark/stateful/eip7928_block_level_access_lists/test_block_access_lists_pointer_chase.py::test_bal_max_pointer_chase --gas-benchmark-values 1

Test BAL with maximum dependent pointer-chasing SLOADs.

Source code in tests/benchmark/stateful/eip7928_block_level_access_lists/test_block_access_lists_pointer_chase.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
def test_bal_max_pointer_chase(
    pre: Alloc,
    benchmark_test: BenchmarkTestFiller,
    fork: Fork,
    gas_benchmark_value: int,
    tx_gas_limit: int,
) -> None:
    """Test BAL with maximum dependent pointer-chasing SLOADs."""
    body_gas = _chase_body().gas_cost(fork)
    plan = plan_benchmark(
        fork,
        loop_body_gas=body_gas,
        setup_gas=cursor_read().gas_cost(fork),
        gas_benchmark_value=gas_benchmark_value,
    )
    total = plan.total_iterations
    authority = pre.fund_eoa(amount=0)
    run_bal_benchmark(
        pre=pre,
        fork=fork,
        benchmark_test=benchmark_test,
        contract_code=create_pointer_chase_contract(plan.gas_threshold),
        plan=plan,
        tx_gas_limit=tx_gas_limit,
        authority=authority,
        storage_init_ranges=[StorageInitRange(0, total + 1, 1)],
        data_slot_reads=list(range(1, total + 1)),
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.