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

Corpus conversion #25

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Corpus conversion #25

wants to merge 2 commits into from

Conversation

tuturu-tech
Copy link
Collaborator

This PR adds the ability to convert an Echidna corpus to the Medusa corpus format. It partially addresses issue #24

It includes the following changes:

  • New CLI commands convert and generate. The former is used for corpus conversion, and the latter for generating unit tests from failed properties. 8 new flags were added to the convert command
  • A new class EchidnaConverter was added that handles parsing and generation of the converted files. The class takes a lot of code from the Echidna class, so this should be refactored to reduce code duplication before the PR is merged.
  • The way Echidna string and bytes are parsed was updated since the previous version was incorrect. More testing should be done on this part since I'm not 100% confident it's correctly decoded.
  • web3.py and eth_tester were added as dependencies to be able to ABI encode the parsed arguments to the Medusa data field
  • A --no-save flag was added to unit test generation to be able to more easily debug this feature without overriding the already generated files. When --no-save is passed in, the generated unit tests will not be saved to file.

Before merging this PR further work should be done to:

  • Refactor the Echidna and EchidnaConverter classes to reduce code duplication
  • Add tests to confirm the converted corpus can be used by Medusa
  • Figure out how to classify the Echidna coverage call sequences into Medusa immutable and mutable sequences. Currently all sequences are added to both.
  • Investigate if Medusa call sequences naming convention needs to be used. Currently we just use the same file names as Echidna does.
  • Add Medusa to Echidna corpus conversion

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.

1 participant