Skip to content
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 18 commits into from
Sep 20, 2024
Merged

fix(zk): invariant testing #581

merged 18 commits into from
Sep 20, 2024

Conversation

Karrq
Copy link
Contributor

@Karrq Karrq commented Sep 17, 2024

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.

@Karrq Karrq requested a review from nbaztec September 18, 2024 19:13
nbaztec
nbaztec previously approved these changes Sep 20, 2024
Copy link
Collaborator

@nbaztec nbaztec left a 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.

@Karrq Karrq merged commit e2e2d57 into main Sep 20, 2024
11 checks passed
@Karrq Karrq deleted the tests/invariant-handler branch September 20, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants