Test Fork Transition¶
Documentation for tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_fork_transition.py@5fa5938b.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_fork_transition.py --fork Amsterdam
Fork-transition tests for EIP-2780.
EIP-2780 reshapes the intrinsic transaction cost at the Amsterdam fork boundary. These tests send identical transactions in a pre-fork block and a post-fork block (straddling the transition timestamp) and assert that the per-transaction gas paid changes by the EIP-2780 amount only once the fork activates.
For these shapes the post-fork intrinsic decomposes from the flat
pre-fork TX_BASE of 21_000 as follows:
- A plain call to an existing account drops to
TX_BASE(12_000) plus the newCOLD_ACCOUNT_ACCESSrecipient charge; adding value re-raises it to exactly 21_000 (the value-transfer cost is invariant across the fork by design). - A self-transfer is fully carved out post-fork: it pays only the
lowered
TX_BASEwith no recipient or value-transfer charge, regardless of value, the largest reduction.
Test Functions Overview¶
| Name | Type | Cases (Amsterdam) | Description |
|---|---|---|---|
test_intrinsic_reduction_across_amsterdam_transition |
blockchain_test | 4 | Pin the EIP-2780 intrinsic change across the Amsterdam boundary. |