sablier-labs / flow

🍃 Smart contracts of the Sablier Flow protocol.
Other
10 stars 2 forks source link

test(fuzz): test delay and deviations bounds #258

Closed smol-ninja closed 2 months ago

smol-ninja commented 2 months ago

A fuzz test on USDC to check that tolerance and delay are within bounds. Refer: Google sheet

To make sure that the deviation and delay are within acceptable bounds for realistic fuzzed values of rps, the following assertions have been added:

  1. $\text{actual total amount withdrawn} \le \text{desired total amount withdrawn}$, this guarantees no over streaming in any situation.
  2. $deviation <= 10^6$, this guarantees that over a sufficient period, the total deviation must never exceed $1.
  3. $delay <= 10\text{ seconds}$, this guarantees that over a sufficient period, the total delay must never exceed 10 seconds.

Realistic limits for RPS are used for the test. For values of RPS further lower than those specified in the test, the bounds may not be valid.

The test name has been chosen to be WithdrawMultiple_Delay_Fuzz_Test as it seems more appropriate i.e. testing delay in case of multiple withdrawals.

smol-ninja commented 2 months ago

@andreivladbrg I have updated the OP. Can you please review this now? I'd recommend to go through the OP first to understand the motivation behind this test.

smol-ninja commented 2 months ago

Thanks. Fixed the file name.