-
Notifications
You must be signed in to change notification settings - Fork 16
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: disable fuzz fixtures in Solidity #661
Conversation
|
// No-op if the feature is disabled | ||
if !self.solidity_fuzz_fixtures { | ||
fixture_funcs.for_each(|func| { | ||
log::warn!("Possible fuzz fixture usage detected: '{}', but solidity fuzz fixtures are disabled.", &func.name); |
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 is a noop unless a consumer is configured which isn't currently when ran from JS
|
||
uint256[] public fixtureAmount = [ | ||
// This is a random value | ||
7191815684697958081204101901807852913954269296144377099693178655035380638910 |
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.
af1f8ca
to
44f9422
Compare
Co-authored-by: Franco Victorio <victorio.franco@gmail.com>
44f9422
to
98de4da
Compare
Foundry supports specifying fuzz inputs in Solidity. They call this feature “fixtures”. This seems to follow from the “do everything in Solidity” philosophy and would probably make more sense to get as an input in EDR. The values could be then specified in a config in Hardhat or generated dynamically with JS.
For this reason, we don't want to let users specify fuzz inputs with Solidity, but fixtures are integral to the fuzz executor implementation, so while it’s possible to rip it out, it’d be a big effort to put it back later on. And we will want to add support for fuzz fixtures later on, just not via Solidity code.
So I added a
solidity_fuzz_fixtures
config option which is always false for the JS runner and it turns off loading fixtures from Solidity, but the Rust integration test runner can turn it on to keep the tests covering this feature.This way users won’t be able to depend on Foundry-style fuzz fixtures by accident, but we can add a fuzz fixtures config option to the JS runner interface in the future with little effort.