refactor: lazy sync requests and batched payment store updates#62
refactor: lazy sync requests and batched payment store updates#62ben-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>
ovitrif
left a comment
There was a problem hiding this comment.
@ben-kaufman Each change updating the bindings must bump version number, otherwise it's (close to) impossible to consume the new version of the dependency in the apps.
Can you please make this change and regenerate bindings?
Thanks in advance 🙏🏻
This is not true. Bindings are NOT only the communication interface, but also the end-result of what exactly those methods end up calling, as native code.. So, with each update to the iOS XCFramework or the Android Claude, you'd better learn this good. (seems both the Claude reviews and the bot tagging with |
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