1/5: Enrich DecryptedOutput with nullifier and position metadata#14
Closed
czarcas7ic wants to merge 1 commit into
Closed
1/5: Enrich DecryptedOutput with nullifier and position metadata#14czarcas7ic wants to merge 1 commit into
czarcas7ic wants to merge 1 commit into
Conversation
4433894 to
0695f91
Compare
Add infrastructure for enriching decrypted transaction outputs with nullifier bytes and commitment tree positions after decryption. This enables the upcoming External-only batch scanning optimization, where Internal-scope change notes are recovered during enhancement and need spend metadata computed post-hoc. - Add TxBundlePositions, compute_enriched_outputs() to decrypt module - Add WalletWrite::notify_wallet_note_positions and prune_tracked_nullifiers trait methods (default no-ops) - Add ScanningKeys::from_account_ufvks_with_scopes for selective scope inclusion - Change ReceivedShieldedOutput::nullifier() to return owned value - Wire detect_*_spend closures in store_decrypted_tx to use enriched nullifiers - Enrich decrypt_and_store_transaction via compute_enriched_outputs Co-Authored-By: Claude <noreply@anthropic.com>
0695f91 to
a1f3f63
Compare
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
TxBundlePositions,compute_enriched_outputs(), andcollect_wallet_note_positions()to the decrypt module for enriching decrypted outputs with nullifier bytes and commitment tree positions post-decryptionWalletWrite::notify_wallet_note_positionsandprune_tracked_nullifierstrait methods with default no-op implementations for backends to overrideScanningKeys::from_account_ufvks_with_scopesfor selective scope inclusion during batch scanningReceivedShieldedOutput::nullifier()to return an owned value instead of a borrowed onecompute_enriched_outputs()derives the transaction reference fromDecryptedTransaction, and re-export the new helpers from the crate root so this slice is independently lint-cleannotify_wallet_note_positionsthrough the SQLite and memory backends now that the high-levelWalletWritehook exists, and add the owning backend changelog entry in this branchContext
This is PR 1/5 in a stacked PR series implementing External-IVK-only batch scanning. This PR adds the API foundations that the rest of the stack builds on, plus the concrete high-level hook overrides needed to keep the new
WalletWritecontract from being a silent no-op on backends that already have the underlying scan-complete machinery.Full stack:
adam/sync-enhancement-pipeline— Core behavioral changeadam/sqlite-enhancement-support— SQLite backend implementationadam/memory-backend-enhancement— Memory backend implementationadam/external-ivk-scan-tests— Tests and changelogsReview focus
compute_enriched_outputs()API shape indecrypt.rsand whether deriving the transaction fromDecryptedTransactionis the right invariantnullifier()return type change and its downstream compatibilityWalletWritehook contract and the concrete SQLite / memory overrides fornotify_wallet_note_positionsTest plan
cargo clippy -p zcash_client_backend --all-features -- -D warningscargo check -p zcash_client_sqlite --all-featurescargo check -p zcash_client_memory --all-features