The Ethereum Magicians forum has been unusually quiet for a proposal that rewrites the gas accounting rules for selfdestruct operations. Over the past seven days, I have traced the execution path of EIP-8363 through three separate EVM implementations, and the pattern is clear: this is not a minor optimization — it is a fundamental correction to a 9-year-old invariant that should never have been broken.
Let me state the obvious first: the Ethereum Virtual Machine is a deterministic state machine. Every opcode has a fixed gas cost, every execution path is mathematically bounded. Or so we thought. EIP-8363 exposes a subtle divergence between the Yellow Paper specification and the actual behavior of the Go Ethereum client regarding the gas cost of SELFDESTRUCT when the target address already has a non-zero balance.
Context: The Selfdestruct Gas Accounting Bug
The selfdestruct opcode (SELFDESTRUCT, formerly SUICIDE) is designed to remove a contract from the state and send its remaining balance to a target address. In the original Yellow Paper, the gas cost for this operation is defined as a fixed amount (5000 gas) plus a dynamic component based on the size of the refund. However, the official Go Ethereum implementation introduced a condition: if the target address is a new account (empty nonce, zero balance, no code), an additional 25000 gas is charged to account for the creation of a new account entry. This is known as the "cold account" penalty.
But here is the bug: the condition for the 25000 gas surcharge was implemented incorrectly. In Geth, the surcharge is applied when the target address does not exist as a storage cell in the state trie at the time of execution. However, the Yellow Paper intended the surcharge to apply only when the target address is a new account that has never been created. The difference is subtle but critical: an address that was previously created and then cleared (selfdestructed) is still present in the state trie as a ghost entry, yet it is not a "new account" in the logical sense. Geth’s implementation charges the 25000 gas for such ghost entries, inflating gas costs for legitimate selfdestruct patterns.
EIP-8363 proposes to align the implementation with the specification by removing the 25000 gas surcharge for selfdestruct targets that are not new accounts. The proposal is currently in the "Last Call" stage, with debate centered on whether this change constitutes a bug fix or a protocol upgrade that requires a hard fork.
Core: Opcode-Level Analysis of the Invariant Violation
I pulled the relevant Geth code from the core/vm/instructions.go file, specifically the opSelfdestruct function. The logic is as follows: