This Generators
module is responsible for creating and managing the generation of test inputs for fuzzing the Vyper
compiler. Module employs an atheris
fuzzing library to create and mutate compiler inputs.
-
input_generation.py
: Contains theInputGenerator
class and two strategies, which provide mechanisms to create inputs for the generated source codes (random or zero values) tailored forVyper
data types. -
run_api.py
: Defines theGeneratorBase
class, setting up the core environment for fuzzing. It handles configuration, logging, and database interactions, and serves as the base for more specific generators. -
run_adder.py
: Implements a generator focused on using a singleTypedConverter
converter to compileVyper 0.3.10
code. -
run_nagini.py
: Implements a generator focused on using a singleNaginiConverter
converter to compileVyper 0.4.0
code. -
run_diff.py
: Defines a generator for cross-version differential fuzzing. It uses two different converters to generate equivalent source codes.
The generator imports converters to generate source code based on the protobuf
message provided by the atheris
engine.
The run_api.py
defines the main logic for the generator service:
- conversion of
protobuf
toVyper
source code - generation of input values for the generated functions
- communication with runners via
RabbitMQ
- saving results in the database
- information logging
The implementation must override the compile_source
function to correctly instrument the Vyper
compiler and converter.