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: fuzzing #44
Merged
Merged
feat: fuzzing #44
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testing the shrinking of varlen strings is flaky because the fuzzer may be able to produce the optimal string length by chance in the first iteration because the test case is quite narrow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #16
Introduces fuzzing of solidity test functions with >0 arguments, using the
proptest
library.This is done in 2 parts:
fuzz.rs
which basically says "take in an ABI type and generate a fuzzing strategy for it" and then "combine all fuzzing strategies for a certain function to a strategy for fuzzing the function's calldata"runner.rs
to execute proptest'sTestRunner
if >0 inputs are detected for the current function.A requirement of fuzzing was to make the EVM cloneable, since the TestRunner only accepts
Fn
s which cannot mutate their environment, meaning that we had to add aClone
restriction on it in the fuzzing-related code.(To facilitate that, we need rust-ethereum/evm#61 for Sputnik and vorot93/evmodin#9 for EvmOdin)
TODO:
Clone
requirement by using a factory, and splitting the fuzz tests to a separate function so we can run fuzz tests w/o tracing even when the EVM uses a tracer in non-fuzz tests