Skip to content

Migrate to getwalletstatus RPC for syncing wallets#56

Draft
str4d wants to merge 2 commits into
mainfrom
zallet-getwalletstatus
Draft

Migrate to getwalletstatus RPC for syncing wallets#56
str4d wants to merge 2 commits into
mainfrom
zallet-getwalletstatus

Conversation

@str4d

@str4d str4d commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #63.
Closes COR-1088.
Closes #105.

Depends on zcash/wallet#367 and zcash/wallet#455.

@str4d str4d force-pushed the zallet-getwalletstatus branch from bbdc8ac to 6489d41 Compare March 12, 2026 09:30
@str4d str4d force-pushed the zallet-getwalletstatus branch 2 times, most recently from ab8e0c8 to 79c082b Compare March 13, 2026 02:20
@str4d str4d force-pushed the zallet-getwalletstatus branch from 79c082b to 5f84b1f Compare March 16, 2026 00:20
@linear

linear Bot commented Mar 16, 2026

Copy link
Copy Markdown

@str4d str4d marked this pull request as draft March 16, 2026 00:26
…s in wallet.py

The getwalletstatus sync barrier indexed `wallet_tip` unconditionally, but the
RPC omits that field (Option + skip_serializing_if) until the wallet has a
committed tip — which happens transiently right after blocks are mined. The
barrier therefore raised `KeyError: 'wallet_tip'` ~1 run in 4, exactly during
the window it is meant to poll through. Treat an absent wallet_tip as "not
synced yet" and keep polling, in sync_blocks, sync_mempools, and rebuild_cache.

Also make wallet.py use the now wallet-aware self.sync_all() instead of an
immediate read and a fixed time.sleep(1), removing the remaining flaky
wallet-scan race (and the unused `import time`). This supersedes the bespoke
pollers in #106.

Validated 10/10 green locally against a zallet carrying zcash/wallet#367
(getwalletstatus) + zcash/wallet#455 (empty shielded tree fix).

Closes #105

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oxarbitrage

oxarbitrage commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Picking this up and pushing a follow-up commit (721b513).

Two issues surfaced when validating end-to-end against a zallet carrying zcash/wallet#367 (getwalletstatus) + zcash/wallet#455 (empty shielded-tree fix):

  1. KeyError: 'wallet_tip' in the new sync barrier. getwalletstatus declares wallet_tip as Option<ChainTip> with skip_serializing_if = "Option::is_none", so the field is omitted until the wallet has a committed tip — which happens transiently right after blocks are mined. The barrier indexed it unconditionally and crashed ~1 run in 4, exactly during the window it's meant to poll through. Now sync_blocks/sync_mempools/rebuild_cache treat an absent wallet_tip as "not synced yet" and keep polling.
  2. wallet.py still raced because it read wallet state immediately / with a fixed time.sleep(1) rather than calling the now wallet-aware self.sync_all(). Switched it over.

Validated 10/10 green locally with the fix (was ~22% flaky before).

This supersedes #106 (the bespoke wait_for_* pollers there are no longer needed now that getwalletstatus exists) and Closes #105. Closing #106 in favor of this.

⚠️ CI here will stay red until zcash/wallet#367 + #455 land upstream (stock zallet has no getwalletstatus yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants