feat: per-wallet voting state isolation#13
Merged
czarcas7ic merged 2 commits intoMar 15, 2026
Conversation
2d232da to
28716fb
Compare
28716fb to
37a9663
Compare
When both hotkey and keystone wallets were loaded, two issues caused cross-wallet contamination in the voting flow: 1. Wrong notes: getWalletNotes passed seedFingerprint + accountIndex but the Rust FFI used accountIndex as a positional array index, always selecting the first account. Now passes AccountUUID bytes directly for unambiguous lookup. (Requires SDK PR valargroup/zcash-swift-wallet-sdk#3) 2. Shared state: voting.sqlite3 and recovery JSON files were keyed by roundId alone. Both wallets shared bundles, proofs, VAN positions, and crash-recovery state for the same round. Now scopes the DB path by walletId and recovery files by a compound roundId_walletId key captured at voting flow entry.
37a9663 to
70d92da
Compare
When both hotkey and keystone wallets are loaded, voting state is now isolated per wallet: 1. Note fetching: passes AccountUUID bytes for direct account lookup (requires SDK PR valargroup/zcash-swift-wallet-sdk#3). 2. DB scoping: calls setWalletId after opening the voting DB, which scopes all round state via the wallet_id column in the librustvoting schema (requires librustvoting PR). 3. Recovery files: uses compound roundId_walletId key for crash- recovery JSON files (Swift-side only, no Rust changes).
7c2a29b to
c7d4f4d
Compare
greg0x
pushed a commit
that referenced
this pull request
Mar 20, 2026
feat: per-wallet voting state isolation
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.
Summary
AccountUUIDbytes togetWalletNotesfor correct wallet note selection.setWalletIdafter opening the voting DB, scoping all round state via the librustvoting schema'swallet_idcolumn.roundId_walletIdkey (Swift-side only).Depends on: