CSE: disable summaries when prank or expectRevert is active#1025
CSE: disable summaries when prank or expectRevert is active#1025palinatolmach wants to merge 3 commits intomasterfrom
prank or expectRevert is active#1025Conversation
9edf8d6 to
f876875
Compare
CALLDEPTH is smaller than the current oneprank or expectRevert is active
|
Would it work with condition added to LHS of the calldepth: |
|
Let's also add a test of |
|
I opened a separate PR (to make it easier to compare the output diffs and roll back to this implementation if needed) which adds these preconditions to the initial state during CSE: This may be incorrect, but, in the PR, I flipped the sign in This does fix some of the summaries that were affected by the change in the Haskell Backend, but I still need to inspect the remaining expected output updates and the output for two new tests using |
Follow up to #1008.
Starting with #1008, CSE summaries of functions that contain external calls are branching spuriously on
foundry.set.expectrevert.1andfoundry.prankrules applying before the summary of the nested external call. The CSE execution also takes considerably longer (e.g., 5 minutes vs 30 seconds for functions likeidentity()andadd(...).This PR prevents this branching by disabling summaries when
prankandexpectRevertis active by setting<active>and<isRevertExpected>tofalsein the CSE initial configuration, instead of leaving them to be symbolic. This means that the summaries won't apply if the test has either of this cheatcodes enabled; further investigation is needed if we find out that the summaries need to be more general to cover these cases too.Potential ways to achieve this could include additional constraints on
CALLDEPTH_CELL,EXPECTEDDEPTH_CELL,DEPTH_CELL— the challenge is to make these constraints exhaustive enough to prevent spurious branches (attempted here), or refactoring theexpectRevertandprankinclusion and processing logic by introducing cut-point rules that would handle that.