crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://www.trailofbits.com/
GNU Affero General Public License v3.0
292 stars 37 forks source link

Fix corpus call method resolution bug, improve startup logging #308

Closed Xenomega closed 7 months ago

Xenomega commented 7 months ago

This PR should close #287 . The behavior noted in that issue should not have passed through corpus call sequence replay + validation. However, there were two methods for resolving/fetching the *abi.Method associated to a CallSequenceElement/CallMessageDataAbiValues, and the logic deviated between corpus replay and fuzzer workers.

This resolved it by ensuring the CallSequenceElement.Method() function returns the CallMessageDataAbiValues.Method if it exists.

It also makes the following changes:

Note: In the future, the way I calculate active/total sequences in corpus should probably be done another way (not returned by the corpus initialize function), we can flag the corpusFile objects with an invalid (bool) field, and then add a method to loop through and "clean" them. Maybe add a --clean-corpus flag or something to remove invalid corpus items from disk :shrug: