Skip to content

Test Set Code Auth Gas

Documentation for tests/amsterdam/eip8038_state_access_gas_cost_increase/test_set_code_auth_gas.py@26332146.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip8038_state_access_gas_cost_increase/test_set_code_auth_gas.py --fork Amsterdam

Tests for the EIP-7702 authorization execution-gas repricing under EIP-8038: State Access Gas Cost Increase.

Under EIP-2780 each EIP-7702 authorization is charged in two parts: a state-independent execution base cost paid in the intrinsic, and state-dependent costs (NEW_ACCOUNT / ACCOUNT_WRITE for a new authority leaf, AUTH_BASE for a net-new delegation indicator) paid lazily at the top frame in set_delegation. This module pins the execution per-authorization intrinsic magnitude and the repriced cold/warm account-access costs that an authorized delegation incurs when later accessed by a CALL.

The execution per-authorization intrinsic magnitude is the fixed per-authorization base cost charged by the intrinsic (on Amsterdam, 101 * 16 calldata tokens plus the 3000 ecrecover, 3000 cold and 2 * 100 warm accesses of the EIP-7702 base), isolated here as the intrinsic delta of adding one authorization. The top-frame state charges are asserted by the sibling eip8037_state_creation_gas_cost_increase and eip2780_reduce_intrinsic_tx_gas suites; this suite does not re-assert them.

Test Functions Overview

Name Type Cases (Amsterdam) Description
test_auth_account_warming state_test 4 A later CALL to an authorized authority pays the repriced
test_auth_execution_intrinsic_magnitude state_test 12 Assert the EIP-8038 execution per-authorization intrinsic magnitude.
test_auth_intrinsic_oog_boundary state_test 2 Reject a set-code transaction one gas below the full intrinsic.
test_invalid_auth_charged_intrinsic state_test 4 A skipped (invalid) authorization is still charged the full
test_many_auths_block_limit state_test 1 Pack many authorizations into a single transaction near the gas
test_mixed_validity_multi_auth_receipt_gas state_test 4 Pin the exact receipt gas of a transaction carrying one valid and