Skip to content

feat: fuzzing #44

Merged
gakonst merged 16 commits into
masterfrom
feat/fuzzing
Sep 27, 2021
Merged

feat: fuzzing #44
gakonst merged 16 commits into
masterfrom
feat/fuzzing

Conversation

@gakonst

@gakonst gakonst commented Sep 25, 2021

Copy link
Copy Markdown
Member

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