Implement EIP-8246: "Remove SELFDESTRUCT Burn"#1572
Merged
Conversation
a36ecb0 to
77f03d5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1572 +/- ##
=======================================
Coverage 97.37% 97.38%
=======================================
Files 163 163
Lines 14572 14622 +50
Branches 3393 3395 +2
=======================================
+ Hits 14190 14240 +50
Misses 280 280
Partials 102 102
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Implements EIP-8246 (“Remove SELFDESTRUCT Burn”) in the test-state transition framework by preventing balance burn on SELFDESTRUCT-to-self starting at the EVMC_AMSTERDAM revision, and adds unit coverage for the new semantics.
Changes:
- Adjust
Host::selfdestruct()to skip balance burn whenbeneficiary == addrfromEVMC_AMSTERDAM. - Update
State::build_diff()to preserve balance for self-destructed accounts (Amsterdam+) instead of deleting them in the no-burn case. - Add unit tests covering Amsterdam vs Cancun/Shanghai behavior for initcode + pre-funded/self-burn scenarios.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/unittests/state_transition_selfdestruct_test.cpp | Adds Amsterdam-focused tests for SELFDESTRUCT burn removal and pre-funded edge cases. |
| test/state/state.cpp | Modifies state diff generation to preserve balance for destructed accounts in Amsterdam+. |
| test/state/host.cpp | Updates SELFDESTRUCT balance-transfer logic to avoid burning on self-to-self in Amsterdam+. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+233
to
+237
| if (rev >= EVMC_AMSTERDAM && m.balance != 0) | ||
| { | ||
| // Preserve the balance of the self-destructed account, no burn (EIP-8246). | ||
| diff.modified_accounts.emplace_back(StateDiff::Entry{addr, 0, m.balance}); | ||
| } |
74ff06a to
8a4ccc1
Compare
This EIP removes the "burn" feature of SELFDESTRUCT. If a contract tries to burn ETH the balance is preserved. https://eips.ethereum.org/EIPS/eip-8246
8a4ccc1 to
a7d03db
Compare
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.
This EIP removes the "burn" feature of SELFDESTRUCT. If a contract tries to burn ETH the balance is preserved.
https://eips.ethereum.org/EIPS/eip-8246