Skip to content
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 16 commits into from Sep 27, 2021
Merged

feat: fuzzing #44

merged 16 commits into from Sep 27, 2021

Conversation

gakonst
Copy link
Member

@gakonst gakonst commented Sep 25, 2021

Closes #16

Introduces fuzzing of solidity test functions with >0 arguments, using the proptest library.

This is done in 2 parts:

  1. Defining the fuzzing rules in 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"
  2. Changing runner.rs to execute proptest's TestRunner if >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 a Clone 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:

  • Expand the types being fuzzed.
  • See if we can remove the 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add random fuzzing of inputs
1 participant