test_top_frame_new_account_charged_as_state_gas()¶
Documentation for tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_top_frame_charges.py::test_top_frame_new_account_charged_as_state_gas@a9abd46e.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_top_frame_charges.py::test_top_frame_new_account_charged_as_state_gas --fork Amsterdam
The top-frame NEW_ACCOUNT charge for a value transfer to an
empty recipient is state gas, not regular gas. This pins the
dimension via the block header gas_used, which the spec
computes as max(block_regular_gas, block_state_gas).
Correctly attributed, the NEW_ACCOUNT state gas dominates the
small regular intrinsic, so gas_used == NEW_ACCOUNT. A
regression mis-classifying the charge as regular gas would instead
yield intrinsic_regular + NEW_ACCOUNT.
state_test-based balance assertions (e.g.
test_top_frame_state_charge) only observe the sum of the two
dimensions, so they cannot distinguish this; a block-level
gas_used assertion is required.
Source code in tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_top_frame_charges.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 1 fork.