-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(cheatcodes): add ability to ignore (multiple) specific and partial reverts in fuzz and invariant tests #9179
feat(cheatcodes): add ability to ignore (multiple) specific and partial reverts in fuzz and invariant tests #9179
Conversation
23bb2c6
to
3d057c1
Compare
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.
looks good! left couple of comments, going to move back in draft until fix added
@mds1 would be great to have your thoughts re new proposed cheatcodes. Thanks! |
59efe2d
to
3800b7a
Compare
@grandizzy should be in a good state now – apologies, had a hectic week. let me know if anything else looks off. |
moving PR to ready for review |
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.
thank you, left couple of comments.
db65b86
to
ed112a7
Compare
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.
Thank you, looks good! I pushed a change to simplify test and have one more nit re assume_no_revert
fn. @zerosnacks @yash-atreya @klkvr pls chime in when time permits. thank you!
ac4a7d5
to
c215515
Compare
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, thank you! Pending additional review before merging
In general UX LGTM! One thing is let's make sure the behavior between this and the various |
@mds1 apologies, i can update the description (pending final decision) – @grandizzy suggested having the default behavior to accept partial matches. having the granularity of i do appreciate the explicitness, though i do think happy to add back in if there's consensus |
Thanks for those details, so my thoughts are:
|
a28cc9e
to
585e1e0
Compare
Likewise not sure why my changes would affect it - but does seem to consistently be failing for polygon between runs 🤔 |
I rebased PR with master containing fixes for other flaky tests (was thinking that failure could be an effect of those) but same test failing, checking some more why's that |
131c1bf
to
8e6f3e4
Compare
8e6f3e4
to
31f1e43
Compare
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.
thank you, lgtm! had to rework the failing test and split tested contracts and test contract in different files as they were affecting outcome. waiting for one more review before merging
@zerosnacks @yash-atreya @klkvr would love to get this merged if there aren't any more blockers |
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.
Thanks @emo-eth!
LGTM
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 looks unused?
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
yeah, tests within test_cmd.rs
are not importing this file but rather adding same source inline, so this can be removed
Motivation
As raised in #4271, sometimes the fuzzer dictionary will uncover real but irrelevant errors in contract code, especially when testing against stateful forks. Runs that encounter anticipated errors should be thrown out and count towards the global
assume
counter.Closes #4271.
Solution
This PR adds overloaded and related function definitions to
vm.assumeNoRevert
, introduced in #8780, as follows:Behavior
address reverter
param)vm.assumeNoRevert()
with avm.assumeNoRevert(args)
call should result in an error(Currently an invariant dict related test is failing)