-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SELFDESTRUCT must reset contract account #3067
Conversation
WASM runtime size check:Compared to target branchMoonbase runtime: 2256 KB (no changes) ✅ Moonbeam runtime: 2236 KB (no changes) ✅ Moonriver runtime: 2232 KB (no changes) ✅ Compared to latest release (runtime-3300)Moonbase runtime: 2256 KB (+228 KB compared to latest release) Moonbeam runtime: 2236 KB (+240 KB compared to latest release) Moonriver runtime: 2232 KB (+240 KB compared to latest release) |
Coverage Report@@ Coverage Diff @@
## master rq/fix-selfdestruct +/- ##
======================================================
Coverage 74.70% 74.70% 0.00%
Files 369 369
Lines 94308 94308
======================================================
- Hits 70446 70445 -1
+ Misses 23862 23863 +1
|
This reverts commit c12604a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Ahmad Kaouk <[email protected]>
What does it do?
Adds a test to ensure that when a contract is created with
CREATE2
andSelf Destructed
in the same transaction, it can be created again.The behaviour of
SELFDESTRUCT
was changed in Cancun hard-fork, where it will recover all funds to the target but not delete the account, except when called in the same transaction as creation.References:
https://eips.ethereum.org/EIPS/eip-6780
TODO:
Self-destructed contract accounts are now reaped from pallet system to match with the current ethereum behaviour. Users can now deploy the same contract multiple times when using the following instructions: CREATE2 and SELFDESTRUCT. Important to note, we support the eip-6780 specification, where a contract can only be self-destructed when SELFDESTRUCT is called in the same transaction the contract was created.