-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Add Halmos support #5034
Add Halmos support #5034
Conversation
|
The approach of this PR was to formally verify those cases when there's a fuzz test, some of these obviously didn't work given they were also difficult to formally verify with Certora in the first place. These are my notes about the tests that didn't work so were skipped: Base64The algorithm is a loop. Although attempted, tests failed with something similar to:
ShortStringsIn the case of testing if
GovernorDoesn't make sense to formally verify for the description with proposer since we need to increase the loop bound and the string length less than 52 (which is 12 loops given 52 - 40) will always return true. Using a bigger string makes the test timeout. CheckpointsDepends heavily on loops. Some variables might be worth making symbolic but not moving into that yet imo. SignedMathAverage
MathCeilDiv / Sqrt / MulDiv
InvModDepends heavily on loops Log2 / Log10 / Log256Log2 works locally but times out in the CI. I don't think it makes sense to keep them formally verified.
MulDivDomain
Modexp
TryModexp
ModExpMemory
TryModExpMemory
ERC2771ForwarderExecuteAvoidsETHStuck
The batch version is a loop. ERC712ConsecutiveLoops |
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
Looks mostly good. Before merging I'd like to discuss the prefixes. Currently we have:
I'd like use to consider alternatives, maybe
Lets discuss that on today's call. |
I'd be fine with |
So far we've been maintaining our Formal Verification workflows with Certora. Though, Halmos has got lots of improvements lately. This PR is to test it out in our current fuzz tests. Note that our rule of thumb so far has been to formally verify when possible and fuzz otherwise, so it's expected that some of theses tests won't be working.
Currently, we added a decent amount of extra Formal Verification tests that are working good and really fast within our regular checks pipeline.
An important note from the Halmos team is that they don't recommend removing fuzz tests even if they're already formally verified. This is because the bounded model in which both Certora and Halmos only test for fixed size arrays.
PR Checklist
npx changeset add
)