Gearbox-protocol / core-v3

Other
28 stars 4 forks source link

fix: `setFees` reverts if underlying's LT is below any of collaterals' LTs, accounting for ramps #247

Closed lekhovitsky closed 1 month ago

lekhovitsky commented 1 month ago

Fixes:

StErMi commented 1 month ago

@lekhovitsky with the current implementation you are now considering both the "current" LT of a token (taking in consideration the possible ramp) and the final LT (when the ramp ends or if there's no ramp) when the underlying LT must be updated.

If there are ramps in actions, but you want to set the LT of the underlying to zero, it would always revert. What's your plan in this case? Set each token's LT to 0 without any ramp, and then setting the underlying LT to 0?

StErMi commented 1 month ago

If there aren't already, I think that this would be a good time to add some test cases where you try to

lekhovitsky commented 1 month ago

@StErMi With 100% certainty we won't set underlying's LT to 0 so we don't even consider this case in our analysis and tests.

lekhovitsky commented 1 month ago

The final test does make sense, although invariant tests for configurator actions reasonably have slightly lower priority compared to user actions. We do have relatively exhaustive integration tests for these edge cases though.