-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix(zk): invariant testing #581
Merged
Merged
Conversation
This file contains 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
feat: `InZkVm` utility to detect if contract is running in zkVm
nbaztec
reviewed
Sep 18, 2024
fix(test:zk): pre-select target senders for issue565 w/o handler
nbaztec
reviewed
Sep 19, 2024
nbaztec
previously approved these changes
Sep 20, 2024
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.
I'll check on it sometime later, and if no issues are reported probably that was it.
nbaztec
reviewed
Sep 20, 2024
Co-authored-by: Nisheeth Barthwal <[email protected]>
nbaztec
approved these changes
Sep 20, 2024
2 tasks
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.
Motivation
Investigating #565 it was found that invariant tests weren't properly supported, with the handler pattern being usable after #572, but we found that using a non-handler contract as target was still not working as intended, due to a workaround to have the toplevel contract execution not being run in zkVm, to allow tests and script to be run in EVM.
Solution
Adjust the check to only skip if the target address is the (constant) test contract address, so other toplevel calls can be ran in zkVm.
Other changes
Adjusted
InvariantDeposit
test to be a proper invariant test, asserting that execution of the target contracts happens in zkVm (with new utility contract).Added minimal reproducible test for issue described #565 (and alternative test without handler).
Adjusted 1 other test to use the new constant for the test contract address.