wallet: route chain scan + rescan through the Store#1258
Conversation
Coverage Report for CI Build 28395402981Warning No base build found for commit Coverage: 56.12%Details
Uncovered Changes
Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
72b4838 to
5be4143
Compare
915f288 to
3ed7628
Compare
yyforyongyu
left a comment
There was a problem hiding this comment.
LGTM (deepseek-v4-pro)
There was a problem hiding this comment.
Pull request overview
This PR routes key chain-sync paths (relevant-tx notifications, filtered-block batches, scan batch persistence, unmined rebroadcast reads, and scan-data loading) through the runtime Store when configured, while preserving a legacy walletdb fallback for scan initialization data.
Changes:
- Added store-backed implementations for recording relevant tx and filtered-block notifications via batched store writes.
- Added store-backed persistence for sync/targeted scan batches and store-backed scan initialization loading (accounts, addresses, watch outputs).
- Updated unmined rebroadcast reads to load active unmined transactions from the store, and added/expanded tests to validate the new routing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
wallet/syncer.go |
Adds store-backed routing for tx/block notifications, scan batch persistence, unmined rebroadcast reads, and scan initialization loading with fallback behavior. |
wallet/syncer_test.go |
Adds tests and matchers validating store-backed routing for notifications, scan batches, scan-data loading, and unmined rebroadcast reads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
LGTM 🪴 ( |
|
LGTM 🛰️ |
5be4143 to
afaded5
Compare
3ed7628 to
04e4b28
Compare
afaded5 to
c9e1606
Compare
6c8506c to
941a49d
Compare
yyforyongyu
left a comment
There was a problem hiding this comment.
LGTM (deepseek-v4-pro)
yyforyongyu
left a comment
There was a problem hiding this comment.
LGTM (deepseek-v4-pro)
|
LGTM 🧭 |
c9e1606 to
603075d
Compare
941a49d to
cfe5d16
Compare
603075d to
01e07da
Compare
cfe5d16 to
09dbc5f
Compare
01e07da to
2ea1bc5
Compare
|
No issues found by |
|
No issues found by gpt-5.5 🦔 |
|
No issues found by |
|
No issues found by gpt-5.5 🦎 |
|
No issues found by |
|
No issues found by |
|
No issues found by |
|
No issues found by gpt-5.5 🦀 |
|
No issues found by |
Pure plumbing: passes the runtime store reference and wallet ID into the syncer. Behavior is covered by the route tests in follow-up runtime startup, sync-tip, rollback-read, and rollback-write commits.
Route startup account preload and expired lease cleanup through db.Store while preserving existing mock fallback behavior for legacy startup tests.
Route connected-block sync-tip writes through db.Store while preserving the legacy path for syncers that are not store-wired in existing tests.
Read synced block hashes through db.Store for rollback detection while retaining the legacy read path for syncers without store wiring.
Add RewindWallet to the store interface and wire the kvdb, sqlite, and postgres implementations so manual rescans can rewind one wallet without deleting shared block rows.
Add cross-backend coverage proving RewindWallet detaches only the requested wallet and leaves another wallet's transactions and sync state unchanged.
Use the wallet-scoped RewindWallet API for manual rescans, resolving height-only requests to the canonical block hash and header before recording the new sync tip.
DBPutRewind advances the live address manager's in-memory synced tip via SetSyncedTo before txStore.Rollback inside one walletdb update. If the rollback fails, walletdb reverts the bucket write but the in-memory tip stays rewound to a never-persisted fork point. Snapshot the pre-rewind tip and restore it via RestoreSyncedTo on failure, mirroring ApplyScanBatch's synced-tip rollback. Successful rewinds are unchanged.
Use db.Store to load active unmined transactions for rebroadcast while preserving the legacy read path for syncers without store wiring.
Routes relevant-tx notifications, filtered-block batches, scan-batch writes, unmined rebroadcast reads, and scan-data loading (addresses, account horizons, watch outputs) through the Store, with a legacy scan-data fallback. Stacked on impl-runtime-store-2.