EIP-6049 Advance notice of SELFDESTRUCT deprecation (Deprecate SELFDESTRUCT)
Final · EVM & execution · EIP status Final · created 2022-11-27
A Meta EIP that marks SELFDESTRUCT, the opcode that lets a contract delete itself, as discouraged in the official documentation and warns that its behavior may change in the future.
Why it is needed
Ethereum has an opcode called SELFDESTRUCT that lets a smart contract delete itself and send its remaining balance to another address. Discussion is ongoing about how to change this opcode, and there is strong consensus that something will change. The problem is that as time passes, more contracts come to rely on this opcode, making the cost of changing it later increasingly large. Yet official channels such as the Ethereum blog have never warned developers that it might change. This EIP does not change code; instead it revises documentation so that developers are warned in advance to avoid using SELFDESTRUCT.
What changes
Today
- SELFDESTRUCT is described as an ordinary opcode in the official documentation
- There is no official warning telling developers that it might change
- New contracts that depend on SELFDESTRUCT can keep being deployed
After EIP-6049
- The official documentation warns against using SELFDESTRUCT
- It is explicitly stated that a breaking change may come in the future
- Developers now have grounds to avoid this opcode when designing new contracts
Who is affected
- Contract developer: Receives an official warning to avoid designs that depend on SELFDESTRUCT, giving reason to reconsider existing patterns.
- Client teams: There is nothing to change from this EIP itself. Only documentation is revised; there is no applicable client change.
- Operators of already-deployed contracts: Behavior does not change right now, but since a future change has been announced, it is worth reviewing the risk of any logic that uses SELFDESTRUCT.
In depth
What changes: documentation, not code
This EIP declares the SELFDESTRUCT opcode deprecated and warns against its use. The specification contains exactly one thing: updating the documentation for the SELFDESTRUCT opcode to warn about its use and note that a breaking change may come. The opcode's actual behavior, gas cost, and return value do not change at all.
Why warn now
The original text states that discussion on how to change SELFDESTRUCT is still ongoing, but there is strong consensus that something will change. Because any change will be a breaking change, the cost of changing it grows over time. Yet official sources, including the Ethereum blog, have never warned developers of this possibility. Closing that gap is the purpose of this EIP.
Backward compatibility: no client changes
What this EIP amends is non-normative text in the Yellow Paper. In other words, only descriptive wording changes, not the part that defines protocol behavior. So there are no changes to apply to clients, and the execution results of existing contracts are not altered by this EIP itself. Security considerations are also explicitly listed as "None" in the original text.
Format and status as a Meta EIP
This EIP's type is Meta. A Meta EIP does not change the protocol itself, such as EVM opcodes or consensus rules, but instead captures decisions about the processes, documentation, or conventions surrounding Ethereum. Its status is finalized as Final. However, what is finalized is the decision to formally document the warning, not any specific detail of how SELFDESTRUCT will actually change. The actual change is left to separate discussion and a separate EIP.