zkevm: add SELFDESTRUCT coverage#1678
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 😄 👍 |
jochem-brouwer
left a comment
There was a problem hiding this comment.
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. |
jochem-brouwer
left a comment
There was a problem hiding this comment.
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! |
jochem-brouwer
left a comment
There was a problem hiding this comment.
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
SELFDESTRUCTcovering two main scenarios:since both cases are relevant for the current way
SELFDESTRUCTworks.Each case covers both value-bearing and non-value-bearing destructions.
Cycles:
Note that
*createdscenarios 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