-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fast-usdc): recover from bad lp proposal (#10787)
closes https://github.com/Agoric/agoric-private/issues/234 ## Description See issue for context. It also seems related to #10684 because the code path that was triggering the bad state was this: https://github.com/Agoric/agoric-sdk/blob/ca25dd59f43f27451fad685207086a9be87860c7/packages/fast-usdc/src/exos/liquidity-pool.js#L272-L285 As you can see, we were updating the pool state, but then the `atomicRearrange` failed, so the pool state was left invalid. This PR makes it so that the bad proposal shape is caught by the type guard earlier, so this code path never happens. The withdraw path was already being handled correctly because the typeguard was specific enough. If the proposal shape is correct, but the amounts are incorrect, the contract already handles that fine by failing before the state update. ### Security Considerations The bug would allow anyone to send an offer that breaks the liquidity pool. ### Scaling Considerations None ### Documentation Considerations None ### Testing Considerations Added a bootstrap test that fails accordingly without the fix. ### Upgrade Considerations None
- Loading branch information
Showing
6 changed files
with
178 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters