Skip to content

Test Exact BALANCE No Fallback

Documentation for tests/amsterdam/eip8038_state_access_gas_cost_increase/test_exact_balance_no_fallback.py@343274cc.

Generate fixtures for these test cases for Amsterdam with:

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

No-silent-fallback exact-balance tests for EIP-8038: State Access Gas Cost Increase.

Each test funds the sender with exactly gas_limit * gas_price and sets gas_limit one gas below the spec-correct Amsterdam intrinsic for a single repriced dimension. A spec-correct client therefore rejects the transaction with INTRINSIC_GAS_TOO_LOW; a client that silently fell back to the pre-Amsterdam value for that one constant would have computed a strictly smaller intrinsic (new - per_unit_delta) and could have executed the transaction. Because the sender holds no surplus wei, there is no room for such a fallback to hide.

The pre-Amsterdam (old) per-component value is read from the parent fork's schedule (fork.parent()); the spec-correct intrinsic is read from the active fork's intrinsic calculator. Nothing is hardcoded; the gap is asserted to be positive so the construction is only emitted when the dimension genuinely got more expensive.

Test Functions Overview

Name Type Cases (Amsterdam) Description
test_access_list_no_fallback state_test 3 Reject an access-list transaction whose gas_limit is one gas
test_authorization_no_fallback state_test 2 Reject a 7702 set-code transaction whose gas_limit is one
test_cold_account_access_no_fallback state_test 1 Reject a plain call transaction whose gas_limit is one gas below