-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maintainer optimizations around redemptions (#3663)
Here we introduce a bunch of optimizations to the wallet maintainer. All of them are related to redemptions. I recommend reviewing commit by commit. Here is a brief description of the changes. ### Improve past `RedemptionRequested` events filtering The wallet maintainer seeks past `RedemptionRequested` events in order to propose redemptions. So far, the events lookup was not constrained to any block range which could be problematic for several Ethereum providers. This can be improved as the wallet maintainer is only interested in pending requests that are not timed out yet. That means there is no sense to fetch events that were emitted before `now - redemptionRequestTimeout` block. We reflect that by narrowing the block range of the filter thus making the call more lightweight. ### Submit multiple redemption proposals for different wallets Redemptions are time-sensitive so we must make sure all of them are handled in a reasonable time. So far, the maintainer iterated from the oldest wallet and proposed redemptions for the first wallet having pending redemptions. We can do it better and propose redemptions for multiple wallets at the same time. However, given the fact signing is computationally heavy and a lot of operator nodes have shares in multiple wallets, we need to set a reasonable limit on the maximum number of wallets performing redemptions at the same time. We achieve that by introducing the `RedemptionWalletsLimit` configurable parameter. ### Add an ability to limit the proposed redemptions value We want to limit the risk for initial mainnet redemptions done shortly after the redemptions release. To achieve that, we need a way to limit the total amount of a single redemption proposal to a reasonable value. We address that indirectly, by introducing the `RedemptionRequestAmountLimit` for the wallet maintainer. This parameter guarantees that the redemption proposals submitted by the maintainer will consist of redemption requests whose amounts are below a certain satoshi value. Combined with `WalletCoordinator.redemptionMaxSize` on-chain parameter, we obtain a tool to cap the total value of submitted redemption proposals to safe levels. All redemption requests exceeding the `RedemptionRequestAmountLimit` can be handled manually through the `maintainer-cli` tool after confirming everything is all right.
- Loading branch information
Showing
13 changed files
with
358 additions
and
153 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
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
Oops, something went wrong.