feat: fuzzing #44
Merged
Merged
Conversation
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
This file contains hidden or 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
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
proptestlibrary.This is done in 2 parts:
fuzz.rswhich 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.rsto execute proptest'sTestRunnerif >0 inputs are detected for the current function.A requirement of fuzzing was to make the EVM cloneable, since the TestRunner only accepts
Fns which cannot mutate their environment, meaning that we had to add aClonerestriction 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:
Clonerequirement 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