Skip to content

[v0.1.x-branch] Backport #1077: lwwallet: speed up sync by bypassing the linear block scan - #1079

Merged
sputn1ck merged 3 commits into
v0.1.x-branchfrom
backport-1077-to-v0.1.x-branch
Jul 31, 2026
Merged

[v0.1.x-branch] Backport #1077: lwwallet: speed up sync by bypassing the linear block scan#1079
sputn1ck merged 3 commits into
v0.1.x-branchfrom
backport-1077-to-v0.1.x-branch

Conversation

@github-actions

Copy link
Copy Markdown

Backport of #1077


Fixes #1073 and is complementary to #1076.

Implements three different speedups:

  • On TipPoller.Start(), fetching the 99 recent block hashes synchronously blocks the whole wallet startup -> moved to background.
  • In EsploraChainService.FilterBlocks, since we're already talking to an address indexer, we can bypass the sequential s.esplora.GetRawBlock() calls by looking up the history of the addresses to scan.
  • On EsploraChainService.Rescan() we do the same by fetching the whole history of the addresses in question.

guggero and others added 3 commits July 31, 2026 15:09
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)
@sputn1ck
sputn1ck merged commit 21ddfbc into v0.1.x-branch Jul 31, 2026
18 checks passed
@sputn1ck
sputn1ck deleted the backport-1077-to-v0.1.x-branch branch July 31, 2026 16:01
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

Successfully merging this pull request may close these issues.

2 participants