Skip to content

feat: include Orchard activity in shielded account discovery#66

Open
EchoAlice wants to merge 8 commits into
zingolabs:mainfrom
EchoAlice:echo/orchard-account-discovery-followup
Open

feat: include Orchard activity in shielded account discovery#66
EchoAlice wants to merge 8 commits into
zingolabs:mainfrom
EchoAlice:echo/orchard-account-discovery-followup

Conversation

@EchoAlice

@EchoAlice EchoAlice commented Apr 10, 2026

Copy link
Copy Markdown

Stacked on #61. Please review/merge this after #61. until then, the diff includes the commits 1-7 from PR #61 + the Orchard follow-up (commit 8) on top.

Summary

  • Extend mnemonic account discovery to consider Orchard activity alongside Sapling
  • Compute sapling_max and orchard_max separately, then combine them with Option::max
  • Account-window expansion now triggers if either shielded pool has activity near the current bound

Follow-up to #61.

Why no new tests

This change feeds Orchard activity into the existing highest_active: Option<u32> signal. The expansion predicate and loop-behavior tests from #61 already cover the downstream logic in a pool-agnostic way — they operate on Option<u32> regardless of which pool produced it.

No new pure logic was introduced here beyond computing orchard_max in parallel with the existing Sapling scan and combining the two with Option::max.

Test plan

  • cargo check passes
  • End-to-end Orchard recovery coverage is still not available in a clean local/CI-friendly form

🤖 Generated with Claude Code

EchoAlice and others added 8 commits April 2, 2026 14:21
Move LightClient construction for mnemonic recovery into a reusable
helper method. No behavior change — still creates 1 account.
Old ZecWallet Lite created new shielded addresses by incrementing the
ZIP 32 account index. Mnemonic-only recovery must discover how many
accounts were in use.

Start with 10 accounts, sync, and check for sapling note history
(including spent notes) near the window edge. If the highest active
account is within 5 of the bound, recreate the wallet with 5 more
accounts and resync from birthday. Repeat until the gap condition is
satisfied.

Uses wallet recreation via LightWallet::new() for each expansion
rather than the untested create_new_account() API.
Report total balance across all instantiated accounts after mnemonic
recovery, not just account 0. Update test to match.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <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