refactor: lazy sync requests and batched payment store updates#62
Open
ben-kaufman wants to merge 2 commits intofix/peer-address-upsert-mainfrom
Open
refactor: lazy sync requests and batched payment store updates#62ben-kaufman wants to merge 2 commits intofix/peer-address-upsert-mainfrom
ben-kaufman wants to merge 2 commits intofix/peer-address-upsert-mainfrom
Conversation
Split wallet_sync_request into separate full_scan and incremental methods so only the needed request type is built. Introduce WalletSyncRequest enum to carry the chosen variant through the sync pipeline. Spawn primary and additional wallet syncs concurrently in a single JoinSet instead of running primary first. Batch update_payment_store_for_all_transactions and write_node_metrics into a single call after all updates are applied, and only when at least one update succeeded. Fix a pre-existing bug where additional wallet sync timestamps were set even when apply_update_for_address_type failed. Co-authored-by: Cursor <cursoragent@cursor.com>
coreyphillips
approved these changes
Feb 24, 2026
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.
This PR:
wallet_sync_requestinto separate full-scan and incremental methods so only the needed request type is built per sync cycleWalletSyncRequestenum to carry the chosen sync variant through the pipelineupdate_payment_store_for_all_transactionsandwrite_node_metricsinto a single call after all wallet updates are appliedapply_update_for_address_typefailedQA Notes
Testing
cargo testpassescargo clippycleanNotes
apply_updateandapply_update_for_address_typemethods now require callers to callupdate_payment_store_for_all_transactionsafterward (documented via doc comments)Made with Cursor