CSE: disable summaries when prank
or expectRevert
is active
#1025
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up to #1008.
Starting with #1008, CSE summaries of functions that contain external calls are branching spuriously on
foundry.set.expectrevert.1
andfoundry.prank
rules 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
prank
andexpectRevert
is active by setting<active>
and<isRevertExpected>
tofalse
in 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 theexpectRevert
andprank
inclusion and processing logic by introducing cut-point rules that would handle that.