Closed smol-ninja closed 3 weeks ago
Although I understand your rationale, I don’t agree with this change, as keeping the lower range for rps
might help us find other problems we are not yet aware of.
On the contrary, changing the rps to realistic range is leading us to new problems that we could not find otherwise. See the failing tests in the CI of this PR.
The problem is that, 100,000 runs are insufficient given the wide range of RPS. If we want to keep lower range for RPS, then based on the above argument, we should have 1M runs. Wider the range, higher the runs.
The only good argument in keeping low ranged rps is to check that no value of rps should lead to over streaming. Other than that, I dont see any value in using ranges of rps that can only stream $0.1 a year in terms of USDC. Thus I propose the following:
The only good argument in keeping low ranged rps is to check that no value of rps should lead to over streaming. Other than that, I dont see any value in using ranges of rps that can only stream $0.1 a year in terms of USDC. Thus I propose the following:
Tagging @PaulRBerg for your view on this.
Great idea @smol-ninja, I'm in favor as long as we're still testing the wide range in at least one or a few places.
- Include a test in WithdrawMultiple contract that assert that actual withdrawn is always less than expected for a very wide range rps.
- Change rps to realistic range for all other tests
the idea of WithdrawMultiple
contract test is to see if there is a long delay for a realistic range for rps
so, i would do it the other way around - withdrawMultiple test, small range, other fuzz/invariant tests, wide range
Thank you both of you for the feedback.
To @andreivladbrg,
other fuzz/invariant tests, wide range
How do you then explain the failed CI in this PR? I think with the wide ranges, seems like we have been asserting 0 values (0 due to rounding off).
How do you then explain the failed CI in this PR? I think with the wide ranges, seems like we have been asserting 0 values (0 due to rounding off).
i don't know the reason, i need to debug
i don't know the reason, i need to debug
I'll debug and let you know.
Meanwhile, @andreivladbrg can you please respond to my comment? You haven't said why you refuse to agree with them.
You mentioned that "keeping the lower range for rps might help us find other problems", to which I replied "The only good argument in keeping low ranged rps is to check that no value of rps should lead to over streaming". What other problems you think you can find with keeping lower range of rps?
The reason tests were failing is the following:
descaled(1_000_000_000e18)
, the foundry was choosing a higher deposit amountmax(uint40)
but uint40
function was wrapping over it.So, as a fix, I adjusted bounds for deposit amount based on 2 years depletion period. Also, changed uint40(solvencyPeriod)
to solvencyPeriod.toUint40()
.
This is another good argument why realistic ranges are useful. Previously, in wide ranges, even though foundry could choose ultra low RPS and extremely high deposit, it could not because the range is so large that even millions of runs that we had run through CI could not detect it.
Your concern that low RPS might be useful to find issues is valid. But I am saying the only issue we need to care about is over streaming and for that, I agree to include wide range RPS in such tests but for all other tests, I haven't seen an argument to why we should not choose realistic ranges.
A perfect solution would be to run all the tests for various ranges of RPS similar to web2 software testing practices. However, I am not sure if foundry accept inputs from a separate file. That will also take a long time to run. In the long term, we should try to achieve that though.
Given how tight the timeline is, I'd appreciate if we can take decision on this before the weekend. @PaulRBerg is in favour so @andreivladbrg I am just waiting for your comment / agreement / disagreement.
Let's merge and do this afterward: https://github.com/sablier-labs/flow/issues/272
I believe it’s becoming one of those things that cause decision fatigue, so feel free to merge it
Thank you. I believe its the right approach :)). And as I mentioned in my comment:
A perfect solution would be to run all the tests for various ranges of RPS similar to web2 software testing practices. However, I am not sure if foundry accept inputs from a separate file. That will also take a long time to run. In the long term, we should try to achieve that though.
We can run the same tests suite for wide range of RPS in a much better way through the use of ffi
(yet to figure out if its possible). We can pass different small ranges for RPS through CI and let the test run (CI-Deep or a new workflow) on all those various ranges. This will help us achieve the same as before but in a very efficient manner.
Continuing from this argument, I suggest we use the realistic ranges for RPS so that our fuzz and invariant tests can test the contract for tight realistic ranges rather than a wide ranges for RPS.
PS: the test fails that means our tests have some issues.