-
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
#991 Deterministic Fuzzer with RNG Seeding #1658
Conversation
Hey @Bind just checking up on what your plans for next steps are here! @mattsse can provide some guidance regarding how to test this, but I'd check how we do it in the integration tests: https://github.com/foundry-rs/foundry/blob/master/cli/tests/it/test_cmd.rs#L236-L279. |
e4cdc0a
to
8112635
Compare
@gakonst Lets see what type of tests I can get done this week otherwise (if someone else is chomping at the bit) might be best for me to bow out for now! |
hi @Bind just bumping this again :D |
This is ready now @gakonst blocked by gakonst/ethers-rs#1524 |
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. Clean.
* feat: basic rng seeding * chore: bump u32 to U256 * feat(config): add additional helper macro * feat: finish fuzz seed impl * bump ethers Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
the fuzz_seed is just an uint256 value ? |
yes exactly, in your config file you can use something like [fuzz]
seed = 10 And leave out the |
Motivation
Allow users to set a RNG seed to get deterministic fuzzing as outlined in #issue-991
Solution
This PR specifically handles RNG-Seeding which simply pipes a
uint256
from thefoundry.toml
or--fuzz-seed
cli arg into the TestRunner initialization.Open Questions
How should I best leverage the built-in test macros to validate fuzzing is deterministic on per test basis regardless of changes to the contract being tested? (Is there an existing set of tests I should reference while building this?)