Skip to content

Add get_wallet_sync_status RPC for headless wallet note-scan progress - #51

Open
USCMig wants to merge 1 commit into
ShieldedLabs:s1_devfrom
USCMig:add-wallet-sync-status-rpc
Open

Add get_wallet_sync_status RPC for headless wallet note-scan progress#51
USCMig wants to merge 1 commit into
ShieldedLabs:s1_devfrom
USCMig:add-wallet-sync-status-rpc

Conversation

@USCMig

@USCMig USCMig commented Jul 27, 2026

Copy link
Copy Markdown

Summary

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 -- 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_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.

Testing

  • Verified the RPC returns correct, live-updating values (sync_height/tip_height/balances) during an active resync.
  • Verified no resource regression: CPU/memory stayed at normal levels for active syncing (unlike DUMP_NOTES, which visibly degraded scan throughput on the same machine).
  • Verified this diff builds cleanly in isolation on top of s2v10.

Test plan

  • Maintainer review of the RPC shape (field names/types) before merge
  • Confirm get_wallet_sync_status compiles and runs cleanly in CI

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant