-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2034: Call getAccountBalance for all wallets at once on tip change r=KtorZ a=Anviking # Issue Number #2005 # Overview - [x] Only send the LSQ query `GetFilteredDelegationsAndRewardAccounts` when the tip changes - [x] Query _all_ wallet reward accounts in _the same_ `GetFilteredDelegationsAndRewardAccounts` Listing stake pools with 10 wallets now takes ~5 seconds instead of 2-3 minutes! - [x] Make the implementation easier to follow and actually sane # Comments - [ ] Not completely sure this doesn't mess up some some intricate interactions between the reward balance state and utxo state. The integration tests pass. But maybe there are some rollback scenarios which could lead to the reward balance being incorrectly reported for a while… Would be nice to think through properly and synchronise them. I think this happens on tip changes: 1. Wallet worker updates UTxO 2. Tip worker re-feches balances and writes to TVar 3. (I think on next tip change) Wallet reads the balance from the TVar and writes it to Sqlite 4. New reward balance is queryable from API With this PR, I wonder if it may not risk being out of date for one more tip-change <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
- Loading branch information
Showing
5 changed files
with
372 additions
and
47 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
Oops, something went wrong.