Skip to content

Hold work a private reply creates until the next block - #1015

Draft
p0mvn wants to merge 3 commits into
codex/private-query-reaction-hardeningfrom
ai-dev/t-9104853361b04dc5/a1/vizor-wallet
Draft

p0mvn wants to merge 3 commits into
codex/private-query-reaction-hardeningfrom
ai-dev/t-9104853361b04dc5/a1/vizor-wallet

Conversation

@p0mvn

@p0mvn p0mvn commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-ups to the review of #999, where a private reply could still change what the wallet asks at the same block. Stacked on #999 and pinned to two draft wallet-libraries PRs: zakura-core/wallet-libraries#212 (receipt lookups a reply queues wait for the next chain tip) and zakura-core/wallet-libraries#213 (window growth is watched from the next recovery target), which is stacked on #212.

  • Library pin. Every wallet-libraries dependency moves to the head of Redesign the contacts (address book) surfaces #213. The library adds an in-memory transparent PIR session; each wallet now shares one across all its database handles, as it already shares the Enhance session, so the handle that queues work and the one that lists it agree.
  • Receipt lookups wait for the next block. A receive or spend that private recovery stores queues its receipt lookup, and the receipt service no longer sees it in the same sync, even when the receipt is open.
  • Same-block catch-up asks about the same addresses. After a lagging or busy reply, a catch-up pass at the same block watches the addresses the first pass watched; a forged receive near the window's end is watched from the next block.
  • Recovery-created Enhance work waits too. Enhance queries and status lookups that a recovery reply creates are recorded like the ones other replies create, so a sync resumed at the same block neither asks them nor counts them towards a restart.
  • Stale-routing retry. After a 409/410, the retry asks the batch's rows that were not yet asked, instead of re-reading the wallet. A reply that resolved or rerouted another request in the batch no longer changes what is asked again. A request that was already resolved is asked again and changes nothing.
  • Stuck retry flag. Expired service waits are dropped when recovery is off for the sync, when the wallet's saved policy is public, or when a policy change stops a run before it reaches every account. Before this, the tip poll could start a sync every 10 seconds for a recovery that would never run.
  • Receipt display. A lookup the wallet gave up on now reads "Details unavailable", with no loading icon and no "will update" promise. Also fixes a stale comment about work that history replies find.

Breaking changes

None for users. One build change: zcash_voting still pins an older wallet-libraries revision through git. To keep a single copy of the wallet crates, a git patch moves its zakura-wallet-lib to the same revision. Cargo rejects a patch that points at the same URL, so every wallet-libraries dependency now names the repository with a git@ user (https://git@github.com/...). GitHub serves that anonymously. Both the patch and the user part can go once zcash_voting moves to the same revision. When #212 and #213 merge, this repins to wallet-libraries main.

Validation

Tests came first in their own commit, and each failed on #999's head at its target assertion:

Vizor has no PR test CI, so these are local results at this branch's head:

  • Rust, focused groups: enhancement 103 passed / 4 failed, transparent ledger 142 passed, transparent details 41 passed / 2 failed, private recovery reorg 5 passed, transparent recovery 19 passed, history golden 40 passed, private recovery 6 passed, private shielding 6 passed.
  • All six failures also fail on Reduce reply-dependent traffic in private recovery #999's head and are not caused by this change. Four Enhance tests expect no first-query delay, but Reduce reply-dependent traffic in private recovery #999's library pin brought back the random 0–75 second delay. Two transparent-details tests fail building a transaction ("Orchard builder not available").
  • Dart: the sync provider and transparent details tests, 123 passed in the default lane and 55 passed in the mobile lane.
  • The non-test library build has no warnings. Flutter analyze reports no issues on the changed Dart code.

🤖 Generated with Claude Code

p0mvn and others added 3 commits October 15, 2026 13:27
Tests for the follow-ups of the private-reply reaction review: a
recovered receive's receipt lookup and an Enhance query a recovery reply
creates wait for the next block, a same-block catch-up asks about the
first pass's addresses, a stale-routing retry asks the same rows whatever
a reply cleared, no service retry stays due once recovery is off, and a
given-up receipt neither spins nor promises an update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rent PIR session

Pins every wallet-libraries dependency to the head of draft PR #213,
stacked on draft PR #212: lookups a private reply queues, and window
growth it causes, wait for the next chain tip. Each wallet's handles
share one TransparentPirSession, as they share the Enhance session, so
the handle that queues work and the one that lists it agree.

zcash_voting still pins an older wallet-libraries revision; a git patch
moves its zakura-wallet-lib to the same revision so voting and the
wallet share one copy of each crate. Tests that grew a window several
times at one target start each growth from a fresh session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Record the Enhance queries and status lookups a transparent recovery
  run creates, as each drain point does, so a sync resumed at the same
  block neither asks nor counts them.
- After stale routing (409/410), retry the batch's rows that were not
  asked, not a fresh read of the wallet, so a reply that resolved
  another request cannot change the retry.
- Drop expired service waits when recovery is off or stopped by a
  policy change, so the tip poll does not start a sync every 10 s.
- Show a given-up receipt lookup without the loading icon or the
  promise of an update, and fix a stale comment.

Co-Authored-By: Claude Opus 5.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