feat(rs-sdk): backport incremental address balance synchronization#3154
Closed
feat(rs-sdk): backport incremental address balance synchronization#3154
Conversation
Cherry-pick of 28cc30f from feat/zk, excluding all shielded/ZK changes. SDK API changes: - sync_address_balances() gains last_sync_timestamp parameter (None = full sync, Some = incremental from that time) - AddressProvider trait: new current_balances() and last_sync_height() default methods for incremental baseline state - AddressSyncResult: new new_sync_height and new_sync_timestamp fields to persist and pass back on subsequent syncs - AddressSyncConfig: new full_rescan_after_time_s (default: 7 days) - FFI: updated signatures and structs for C/Swift consumers This enables clients to replace ~250 lines of manual full-vs-incremental sync tracking with a single SDK call. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ gRPC Query Coverage Report |
Contributor
Author
|
not needed, already in v3.1-dev |
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.
Issue being fixed or feature implemented
Backport of the incremental address balance synchronization API from
feat/zk(commit 28cc30f, PR #3152) into a standalone branch based onv3.1-dev, excluding all shielded/ZK changes.This enables
dash-evo-tool(v1.0-dev) to use the simplified SDK sync API without pulling in the entire ZK/shielded pool feature set. The client-sideapply_recent_balance_changes()(~250 lines),PlatformSyncModeenum, and manual checkpoint tracking can all be replaced with a singlesdk.sync_address_balances()call.What was done?
Clean cherry-pick of 28cc30f — 6 files, +542/-83 lines, zero shielded contamination:
SDK API changes (
packages/rs-sdk/):sync_address_balances()gainslast_sync_timestamp: Option<u64>parameter (None= full sync,Some= incremental from that time)AddressProvidertrait: newcurrent_balances()andlast_sync_height()default methods for providing incremental baseline stateAddressSyncResult: newnew_sync_heightandnew_sync_timestampfields to persist and pass back on subsequent syncsAddressSyncConfig: newfull_rescan_after_time_sfield (default: 7 days)full_tree_scan()andincremental_catch_up()(compacted + recent two-phase loop)FFI changes (
packages/rs-sdk-ffi/):Excluded: All shielded/ZK code — verified with
grep(0 matches forshielded,nullifier,orchard,zip32,commitment_treein the diff).How Has This Been Tested?
cargo check -p dash-sdkpasses clean on the backport branchgetRecentAddressBalanceChangesandgetRecentCompactedAddressBalanceChangesgRPC endpointsBreaking Changes
sync_address_balances()signature adds a newlast_sync_timestampparameter — callers must addNoneas the fourth argument to maintain existing full-sync behaviorlast_sync_timestamp: u64parameter (0 = full scan)Checklist:
🤖 Co-authored by Claudius the Magnificent AI Agent