ethereum / ethereum/execution-specs
EIP-161: Sending zero to an empty account
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 505
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 116
Description
## 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)
Contributor guide
Research direction
The issue points to the transfer path's value != 0 check; start there and compare its account-touch behavior with EIP-161 and client behavior. Verify whether the current pre-state and tests can represent an empty recipient. Done when the specification's expected zero-value behavior is resolved and covered by a test or documented evidence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100