test_top_frame_new_account_skipped_for_nonce_only_recipient()¶
Documentation for tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_top_frame_charges.py::test_top_frame_new_account_skipped_for_nonce_only_recipient@2119b382.
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_skipped_for_nonce_only_recipient --fork Amsterdam
A recipient that is alive only by its nonce (nonce=1, zero
balance, no code) is not empty per EIP-161, so a value transfer to
it does not incur the top-frame NEW_ACCOUNT charge. This pins
that the gate keys on is_account_alive, not balance == 0.
Such an account is reachable on-chain: any EOA that has sent a
transaction (nonce bumped) and been fully drained sits at
nonce>0, balance=0, no code.
The gas limit is pinned to exactly the intrinsic, leaving no room
for any extra charge: an implementation that wrongly charged
NEW_ACCOUNT (keying on the zero balance) would out-of-gas
rather than succeed. The recipient has no code, so no EVM runs and
the intrinsic is fully consumed with nothing to refund.
Source code in tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_top_frame_charges.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 1 fork.