-
Notifications
You must be signed in to change notification settings - Fork 153
zkevm: add SELFDESTRUCT coverage #1678
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
Conversation
@jochem-brouwer, do you want to do a review of this draft PR (which should be ready) before I open up for other reviewers? |
On it 😄 👍 |
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.
This was a fun one 😄 👍
I am sure I missed some things though. I would also suggest to run these tests inside some EVM with traces on, because upon reading these tests I think these might not behave as we might expect 😄 👍
I think when looking over this again, I might find some other optimizations for the gas here 😄
@jochem-brouwer, thanks a lot for your fantastic review. I'm now opening for formal review! |
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
b152eca
to
364aad1
Compare
Rebased. |
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.
Some style comments and I believe one of the tests is doing unnecessary extra behavior 😄 👍
Done changes after the last review, ready for a final round @jochem-brouwer! |
Still not sure why it says it's waiting for changes when I re-asked for review to get the final check. 🤷 |
Sorry, I forgot to approve, which I wanted to do after my last comment. Will do now! |
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, great work, beautiful tests!
* zkevm: add selfdestruct existing contracts bench Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * zkevm: add selfdestruct of contracts deployed in tx Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * improvements Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * Update tests/zkevm/test_worst_stateful_opcodes.py Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com> * improvements Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * adjust gas prices Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * Update tests/zkevm/test_worst_stateful_opcodes.py Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com> * improvements Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * improvement Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * fix bug Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * selfdestruct in initcode Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * feedback Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> --------- Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
This PR adds coverage for
SELFDESTRUCT
covering two main scenarios:since both cases are relevant for the current way
SELFDESTRUCT
works.Each case covers both value-bearing and non-value-bearing destructions.
Cycles:
Note that
*created
scenarios are very costly to execute since they involve deploying the transactions we want to SELFDESTRUCT. This means that each attempt requires a lot of gas, and most of it isn't coming from SELFDESTRUCT. While this was known before doing it, I decided, for completeness, to cover the scenario anyway.Targets #1657