Add get_wallet_sync_status RPC for headless wallet note-scan progress - #51
Open
USCMig wants to merge 1 commit into
Open
Add get_wallet_sync_status RPC for headless wallet note-scan progress#51USCMig wants to merge 1 commit into
USCMig wants to merge 1 commit into
Conversation
The headless wallet's note-scan (unspent_orchard_notes etc.) is in-memory only and always restarts from genesis on every process restart, with no RPC to check its progress -- the only prior way to observe it was enabling the DUMP_NOTES debug flag, which reprints the entire notes list on every loop iteration and becomes a serious performance liability once that list grows large (in testing, this was directly implicated in both a multi-hour scan stall and a memory-allocation-failure crash). This adds a lightweight get_wallet_sync_status RPC exposing sync_height, tip_height, and the wallet's balance fields, backed by a small static snapshot (WalletSyncStatus) updated via plain field assignments at the same point the existing WalletState fields are already set each loop iteration -- no new per-block cost, since these values are already computed for the wallet's own internal use. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
The headless wallet's note-scan (
unspent_orchard_notesetc.) is in-memory only and always restarts from genesis on every process restart, with no RPC to check its progress. The only prior way to observe it was enabling theDUMP_NOTESdebug flag, which reprints the entire notes list on every loop iteration -- in testing this became a serious performance liability once that list grew large, directly implicated in both a multi-hour scan stall and a memory-allocation-failure crash.This adds a lightweight
get_wallet_sync_statusRPC exposingsync_height,tip_height, and the wallet's balance fields, backed by a small static snapshot (WalletSyncStatus) updated via plain field assignments at the same point the existingWalletStatefields are already set each loop iteration -- no new per-block cost, since these values are already computed for the wallet's own internal use.Testing
sync_height/tip_height/balances) during an active resync.DUMP_NOTES, which visibly degraded scan throughput on the same machine).s2v10.Test plan
get_wallet_sync_statuscompiles and runs cleanly in CI🤖 Generated with Claude Code