core/vm, core/state: implement EIP-8246 Remove SELFDESTRUCT Burn#35192
Closed
VanshSahay wants to merge 6 commits into
Closed
core/vm, core/state: implement EIP-8246 Remove SELFDESTRUCT Burn#35192VanshSahay wants to merge 6 commits into
VanshSahay wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements EIP-8246 which eliminates the last remaining path where
SELFDESTRUCTcan destroy ETH on Ethereum L1.After EIP-6780 (Cancun), ETH could still be burned when a contract created in the same transaction selfdestructs to itself. This EIP removes that burn.
Changes
VM opcode (
core/vm/instructions.go): Under Amsterdam, when a same-transaction contract executesSELFDESTRUCTto itself, the balance is preserved instead of subtracted and burned.State finalization (
core/state/statedb.go): Under Amsterdam, selfdestructed accounts have code, storage, and nonce cleared while the balance is preserved. If the resulting balance is zero, the account is deleted per EIP-161. Otherwise it survives as a balance-only account.Burn log removal (
core/vm/instructions.go,core/vm/interface.go,core/state/state_transition.go,core/state/statedb.go,core/state/statedb_hooked.go):EthBurnLogemission during selfdestruct-to-self andLogsForBurnAccounts()are removed since no ETH burning occurs under EIP-8246.The EIP is a prerequisite for EIP-7708 (ETH transfer logs) and is CFI'd for Glamsterdam.