Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompactBlockProcessor fetches UTXOs in a weird order #1483

Open
str4d opened this issue May 29, 2024 · 0 comments
Open

CompactBlockProcessor fetches UTXOs in a weird order #1483

str4d opened this issue May 29, 2024 · 0 comments

Comments

@str4d
Copy link
Contributor

str4d commented May 29, 2024

Currently refreshUtxos is triggered every time we finish scanning an individual block range:

when (batchSyncProgress.resultState) {
SyncingResult.UpdateBirthday -> {
updateBirthdayHeight()
}
SyncingResult.EnhanceSuccess -> {
Twig.info { "Triggering transaction refresh now" }
// Invalidate transaction data
checkTransactions(transactionStorage = repository)
batchSyncProgress.range?.start?.let {
refreshUtxos(account = Account.DEFAULT, startHeight = it)
}
}

Note that we refresh UTXOs from the start height of the block range that was scanned. Given that we do non-linear scanning now, this means we're potentially fetching weird subsets of the UTXO set for the wallet.

When I added transparent UTXO fetching to zec-sqlite-cli in https://github.com/Electric-Coin-Company/zec-sqlite-cli/pull/23, I instead implemented it by, just after calling update_chain_tip and before any shielded scanning in a scan cycle, fetching all UTXOs starting at the block-fully-scanned height (which is always increasing, and means we fetch the full block range where we have not scanned all shielded information).

We should do something similar here, adjusted for appropriate re-fetch frequency depending on how the sync state machine is implemented here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant