[v0.1.x-branch] Backport #1077: lwwallet: speed up sync by bypassing the linear block scan - #1079
Merged
Merged
Conversation
Move the sequential hash-history walk off the synchronous startup path. Keep the poll loop behind a fully seeded ring, so reorg handling never observes partial retained history. Retry transient seed failures with bounded exponential backoff until the service stops. Bind requests and retry timers to the component context, so shutdown cancels the entire operation promptly. Cover responsive startup, a reorg racing the seed, retry recovery, and cancellation. Co-authored-by: sputn1ck <kon@kon.ninja> (cherry picked from commit 933c6b9)
Use Esplora script histories to identify candidate transactions for FilterBlocks and Rescan instead of downloading every block body. Preserve canonical matching and ordering, and validate indexed block identities before advancing wallet state. Fall back to full block scans when history is truncated, inconsistent, or cannot represent a watched outpoint address. Page through every transaction at the minimum requested height before stopping. Cover spent addresses, pagination boundaries, ordering, reorg conflicts, fallbacks, cancellation, and the empty index contract. Co-authored-by: sputn1ck <kon@kon.ninja> (cherry picked from commit 3421103)
Document that an empty script history cannot be distinguished from a lagging index. Explain the recovery boundary and require a trusted, fully indexed Esplora endpoint for wallet rescans. (cherry picked from commit 7d514dc)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #1077
Fixes #1073 and is complementary to #1076.
Implements three different speedups:
TipPoller.Start(), fetching the 99 recent block hashes synchronously blocks the whole wallet startup -> moved to background.EsploraChainService.FilterBlocks, since we're already talking to an address indexer, we can bypass the sequentials.esplora.GetRawBlock()calls by looking up the history of the addresses to scan.EsploraChainService.Rescan()we do the same by fetching the whole history of the addresses in question.