Skip to content

test_bal_max_account_access()

Documentation for tests/benchmark/stateful/eip7928_block_level_access_lists/test_block_access_lists_max_accounts.py::test_bal_max_account_access@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/benchmark/stateful/eip7928_block_level_access_lists/test_block_access_lists_max_accounts.py::test_bal_max_account_access --gas-benchmark-values 1

Test BAL with maximum unique account accesses via BALANCE.

Source code in tests/benchmark/stateful/eip7928_block_level_access_lists/test_block_access_lists_max_accounts.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
def test_bal_max_account_access(
    pre: Alloc,
    benchmark_test: BenchmarkTestFiller,
    fork: Fork,
    gas_benchmark_value: int,
    tx_gas_limit: int,
) -> None:
    """Test BAL with maximum unique account accesses via BALANCE."""
    setup = cursor_read() + Op.PUSH3(BASE_ADDR) + Op.ADD
    body_gas = _balance_body().gas_cost(fork)
    plan = plan_benchmark(
        fork,
        loop_body_gas=body_gas,
        setup_gas=setup.gas_cost(fork),
        gas_benchmark_value=gas_benchmark_value,
        teardown=_teardown(),
    )
    total = plan.total_iterations
    extra = {
        Address(BASE_ADDR + i): BalAccountExpectation.empty()
        for i in range(CURSOR_INIT, total + CURSOR_INIT)
    }
    authority = pre.fund_eoa(amount=0)
    run_bal_benchmark(
        pre=pre,
        fork=fork,
        benchmark_test=benchmark_test,
        contract_code=create_balance_loop_contract(plan.gas_threshold),
        plan=plan,
        tx_gas_limit=tx_gas_limit,
        authority=authority,
        storage_init_ranges=[StorageInitRange(0, 1, CURSOR_INIT)],
        extra_expectations=extra,
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.