Skip to content

Test Touched Account Emptiness

Documentation for tests/spurious_dragon/eip161_state_trie_clearing/test_touched_account_emptiness.py@814481c0.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/spurious_dragon/eip161_state_trie_clearing/test_touched_account_emptiness.py --fork Amsterdam

EIP-161 emptiness must be judged by an account's fields alone.

A zero-value CALL to an absent precompile runs its code without creating the account, so the address stays dead. A client that records the account on that first touch and later reads its own bookkeeping as proof of existence would skip new-account charges. These tests probe that execution-side possibility around the shape reported in erigontech/erigon#23670, where the touch bookkeeping leaked into BAL construction while state roots agreed.

Test Functions Overview

Name Type Cases (Amsterdam) Description
test_call_new_account_charge_after_precompile_touch state_test 6 Charge the full value-call cost to a dead precompile that was touched
test_extcodehash_after_precompile_touch state_test 72 Probe a precompile's fields after touching it in the same transaction.
test_selfdestruct_beneficiary_charge_after_precompile_touch state_test 6 Charge the beneficiary creation cost when a funded contract