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
291 stars 37 forks source link

Periodically generate calls to view methods in the CallSequence #55

Open Xenomega opened 1 year ago

Xenomega commented 1 year ago

We'll want to periodically call view methods to increase coverage. Additionally, assertion testing supports config-driven options to enable assert testing of view methods, but the FuzzerWorker only produces CallSequences with calls targeting state changing methods right now, so it's never hit.

Requirements:

Jaime-Iglesias commented 1 year ago

Will try to pick this up starting tomorrow.

Looks like this is already being worked on

0xalpharush commented 2 months ago

Ensure the corpus.UpdateCorpusAndCoverageMaps method checks if the last call was to a view method. If it was, do not record the call sequence in the corpus at that step, as it's not a coverage-increasing sequence we'd be interested in recording, as it was not state changing.

need clarification on this but https://github.com/crytic/medusa/pull/363 addresses the other points

ggrieco-tob commented 1 month ago

I think view functions should be part of the coverage, in particular if they have or can contain assertions.