Test CREATE¶
Documentation for tests/berlin/eip2929_gas_cost_increases/test_create.py@8db70f93.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/berlin/eip2929_gas_cost_increases/test_create.py --fork Amsterdam
Test that CREATE/CREATE2 do not warm the contract address on aborted calls.
When a CREATE or CREATE2 is aborted before execution (due to insufficient balance or sender nonce overflow), the would-be contract address must NOT be added to the warm access set. This was a bug in the original spec where the address was warmed before validation checks.
Note: call depth overflow (the third abort condition in the spec) is not
tested here because EIP-150's 63/64 gas forwarding rule makes it infeasible
to reach the 1024 call depth limit — gas is exhausted around depth ~300.
The depth check shares the same if block as the balance and nonce checks,
so it is implicitly covered.
Tests for [EIP-2929: Gas cost increases for state access opcodes] (https://eips.ethereum.org/EIPS/eip-2929).
Test Functions Overview¶
| Name | Type | Cases (Amsterdam) | Description |
|---|---|---|---|
test_create_insufficient_balance |
state_test | 2 | Test that a failed CREATE/CREATE2 due to insufficient balance does not |
test_create_nonce_overflow |
state_test | 2 | Test that a failed CREATE/CREATE2 due to sender nonce overflow does not |