feat(invariant): add fail_on_assert for Solidity assert failures#13519
feat(invariant): add fail_on_assert for Solidity assert failures#13519aviggiano wants to merge 5 commits intofoundry-rs:masterfrom
Conversation
|
Wait a sec, this is not exactly what we need I'm testing this branch on Recon-Fuzz/scfuzzbench-canary#2 but it is reporting I'll try to fix this |
|
Still not feature parity with medusa, since we will only see assertion failures on logs. I'd also see them as "first class citizen" in metrics JSON |
|
I rebased #12587 and got assertion failures working on this canary (with shrinking/replay working w/o changing from an assertion to invariant). I also updated the logs and trace format |
|
hey, thanks for the contribution This looks really good overall, with one caveat: it is picking up So we need to think whether we'd want to support both out of the box (I think so) |
|
It is checking this slot but maybe there's some weird interaction with |
Summary
[invariant].fail_on_asserttoInvariantConfig(defaultfalse)fail_on_revert = falsePanic(0x01)InstructionResult::InvalidFEOpcode)require/generic revertsPanic(0x11))vm.assert*/GLOBAL_FAIL_SLOTsemanticsfail_on_assertfailures asBrokenInvariant(not genericRevert)Implementation Notes
crates/config/src/invariant.rscrates/evm/evm/src/executors/invariant/result.rscrates/evm/evm/src/executors/invariant/mod.rscrates/evm/evm/src/executors/invariant/shrink.rscrates/forge/src/runner.rscrates/evm/evm/src/executors/invariant/error.rscrates/forge/tests/cli/config.rscrates/forge/tests/cli/test_cmd/invariant/common.rsTests
cargo +1.91.0 test -p foundry-evm invariant::result::tests --lib --lockedcargo +1.91.0 test -p forge --test cli fail_on_assert --lockedcargo +1.91.0 test -p forge --test cli invariant_ignore_assert_panic_when_flag_off --lockedcargo +1.91.0 test -p forge --test cli test_default_config --lockedCloses #13322