Observation
EIP-161 says:
An account is considered to be touched when it is involved in any potentially state-changing operation. This includes, but is not limited to, being the recipient of a transfer of zero value.
The specs seem to diverge from the clients and the EIP here, it seems to not be testable because empty accounts are not allowed in the pre-state.
Expectation
I would have expected that when we transfer 0 to an account, that there would be some check like:
if account_exists_and_is_empty(tx_state, target): destroy_account(...)
or
modify_state(..., lambda _: None)
To signal the account has been touched and should be removed.
The code currently checks for value != 0 when sending, so without such checks we would not mark an account as touched.
(Not sure about removing the value != 0 check since that potentially affects BAL)
Observation
EIP-161 says:
The specs seem to diverge from the clients and the EIP here, it seems to not be testable because empty accounts are not allowed in the pre-state.
Expectation
I would have expected that when we transfer 0 to an account, that there would be some check like:
or
To signal the account has been touched and should be removed.
The code currently checks for value != 0 when sending, so without such checks we would not mark an account as touched.
(Not sure about removing the value != 0 check since that potentially affects BAL)