test_failed_create_tx_refills_top_frame_new_account()¶
Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py::test_failed_create_tx_refills_top_frame_new_account@26332146.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py::test_failed_create_tx_refills_top_frame_new_account --fork Amsterdam
Verify the top-frame NEW_ACCOUNT of a creation tx is refilled when the initcode fails.
Under EIP-2780 the created account's NEW_ACCOUNT state gas is
charged in the top-frame preparation (not the intrinsic), so
gas_limit must cover it for the initcode to run at all. When the
initcode then fails the whole creation rolls back and no account
persists:
- REVERT preserves
gas_leftandrestore_state_gasreturns the spilledNEW_ACCOUNTto it, so the state block nets to zero and only the execution consumption counts as work. The calldata floor tops up the billed amount and the block-level execution gas alike, so receipt and header agree at the greater of consumption and floor: the memory expansion keepsrevertabove the floor, while the barerevert_floor_boundpins the floor in both. - HALT (INVALID) refills the spilled
NEW_ACCOUNTtogas_leftand then burns all of it, so the sender pays the fullgas_limit.
Source code in tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py
2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 | |
Parametrized Test Cases¶
This test generates 3 parametrized test cases across 1 fork.