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
273 stars 33 forks source link

`vm.snapshot` cannot be called subsequently after restoring to earlier history (not persisted) #373

Open 0xalpharush opened 1 week ago

0xalpharush commented 1 week ago

The implementation of vm.snapshot uses go-ethereum's revertToSnapshot which will delete "future" states after reverting e.g. a history of [1,2,3] will become [1] if revertToSnapshot(1) is called so it's not possible to call revertToSnapshot(3) following. This deviates from how Foundry's implementation works (see https://github.com/foundry-rs/foundry/pull/5487).