Replace bound
with vm.assume
in invariant handlers
#243
Closed
smol-ninja
started this conversation in
General
Replies: 1 comment
-
Sounds good, feel free to open PRs directly for enhancements like this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
bound
andseed
inputs in invariant handlers make it difficult to debug call sequences in a failed invariant. An example is shown below:I also discovered that Foundry does not even return the correct sequence in failed test (the above sequence is not correct). The reason we use
bound
andseed
inputs was to not waste any of the calls during invariant testing. However, it increases the cost to debug a failed invariant test.The screenshot below shows the sequence when I used
vm.assume
and fuzzed inputs in the handler functions.You can see, the sequence and the function inputs are very clear and easy to follow. Thus, I propose to make the following changes:
bound
withvm.assume
in all handlersPS: We can increase the numbers of runs and depth in CI to compensate for wasted calls.
cc @sablier-labs/solidity
Beta Was this translation helpful? Give feedback.
All reactions