feat: include Orchard activity in shielded account discovery#66
Open
EchoAlice wants to merge 8 commits into
Open
feat: include Orchard activity in shielded account discovery#66EchoAlice wants to merge 8 commits into
EchoAlice wants to merge 8 commits into
Conversation
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>
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.
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
sapling_maxandorchard_maxseparately, then combine them withOption::maxFollow-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 onOption<u32>regardless of which pool produced it.No new pure logic was introduced here beyond computing
orchard_maxin parallel with the existing Sapling scan and combining the two withOption::max.Test plan
cargo checkpasses🤖 Generated with Claude Code