diff --git a/EIPS/eip-draft_disable_selfdestruct.md b/EIPS/eip-draft_disable_selfdestruct.md new file mode 100644 index 00000000000000..9dbed3d843cfb3 --- /dev/null +++ b/EIPS/eip-draft_disable_selfdestruct.md @@ -0,0 +1,63 @@ +--- +eip: +title: Disable SELFDESTRUCT +author: Alexey Akhunov (@AlexeyAkhunov) +discussions-to: https://ethereum-magicians.org/t/eip-for-disabling-selfdestruct-opcode/4382 +status: Draft +type: Standards Track +category: Core +created: 2020-06-25 +--- + + +Disable SELFDESTRUCT + +## Simple Summary + +Make `SELFDESTRUCT` EVM operation no-op (effectively disable). Contracts will not be able to delete themselves. + +## Abstract + +Althouth `SELFDESTRUCT` originally came with EVM to help clean up the state, we learnt that in practice it did not achieve this objective on +sufficient scale, and is on balance a burden of extra complexity and unintended effects (GasToken2 and polymorphic contracts). + +## Motivation + +Operation `SELFDESTRUCT` (formerly `SUICIDE`) was in the EVM from the beginning, and its purpose was to incentivise clearing the state, by giving the +caller gas refund. In practice, this incentivisation turned out to be very limited, and the designed purpose was not archieved. However, `SELFDESTRUCT` +brings significant amount of complexity to the EVM. It is responsible for some of the most arcane edge cases in the EVM semantics. +It is also used as a vehicle to run an efficient arbitrage of gas prices (GasToken2), which +ironically lead to the increase use of the state. Introduction of `CREATE2` opcode in Constantinople upgrade created a new phenomenom of +polymorthic contracts, i.e. contracts that can change their bytecode over time, while residing on the same address. Polymorphic contracts are limited +in their use, because changing the bytecode via `SELFDESTRUCT` + `CREATE2` clears all the contract storage, making contract lose all its data, +and making it unsuitable to replace Proxy Pattern as a technique for upgradable contracts. Removing the effect of `SELFDESTRUCT` +will reduce complexity of EVM going forward, disable GasToken2 (but not GasToken1, which is based on storage clearing refunds), and make +polymorthic contracts impossible. +## Specification + +After certain block number, the semantics of `SELFDESTRUCT` becomes the same as the combination of `POP`, followed by transferring remaining ETH +to the address popped from the stack, followed by `STOP`. Gas cost is the same as the gas cost of non-zero value transfer, which is 9000 gas. No gas refund is given. + +## Rationale + +Disabling `SELFDESTRUCT` is the simplest and most effective way to remove its negative effects. + +## Backwards Compatibility + +Backwards incompatible and requres a hard fork. + +## Test Cases + +There are a lot of test in the standards suite related to `SELFDESTRUCT` and its edge cases. These need to be modified for the new no-op semantics. + +## Implementation + +Implementation is likely to be trivial - introducing the eip flag and replacing the old, complex semantics, with the new, simple semantics. + +## Security Considerations + +At this point, author of this EIP is not aware of any class of smart contracts that rely on `SELFDESTRUCT` for their functionality and security, with the exception of +GasToken2 contract and similar. + +## Copyright +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).