Repository navigation
Defer trial decryption of large compact transactions - #83
Merged
Merged
Conversation
A transaction with more than eight outputs in one shielded pool still records commitments and nullifiers, and stores the ciphertext in the snapshot. Notes from that transaction stay unspendable, and the balance reports verificationPending, until every output has been decrypted. Sync opts in and drains the queue before it returns.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f2d086497
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A spend scanned before trial decryption was inserting the note as unspent. Reset drops the queue. A worker that omits a deferred count has an empty queue, and reading that count does not force another snapshot write.
A nonempty queue is snapshot version 5 so an older reader rejects it instead of dropping those outputs. Trial decryption releases temporary witness marks, keeps the mined time, and retains memo candidates until ownership is known. Sync drains the queue before memo discovery and refreshes pool totals.
…ume. A deferred block now rejects a malformed spend in every transaction, holds memo work until that transaction is decrypted, and counts notes revealed before a later spend. A cold at-tip drain refreshes pool history, temporary marks leave the open offload shard, and the queue is checkpointed every 256 outputs.
A deferred block must start at the wallet's note cursors, including the first block after birthday. A version 5 snapshot with an empty queue is rejected. Replay decrypts a transaction's outputs together, and draining the queue no longer rescans the open shard or the remaining backlog.
…ail-closed. A wallet without a birthday frontier keeps large transactions on the immediate path. Manual memo retrieval decrypts the queue first and does not advance coverage through it. A later nullifier in the same batch keeps the previous block on the parallel path. The queued backlog stays bounded.
…ter verification.
…e saving. A freshness check no longer rewrites an unchanged snapshot. A drain that only rejects outputs still repeats the configured memo lookup and refreshes history. Cancellation during a chunk does not start a save. A known receipt stays pending while its outputs are queued, and tip overlap rebuilds trees after that queue is drained.
A Sapling or Ironwood note that was not already in a pool total is not counted again as Orchard. Restoring a checkpoint keeps a recorded receipt until that transaction leaves the queue. A drain that consumes a queue adopted during the check still repeats the configured memo lookup, including when every output is a miss.
…synced. One transaction may cross the queue limit. A later large transaction in that block is decrypted immediately. A memo lookup that adopts another checkpoint is repeated after that drain. Sync does not report completion when the final save is still unverified.
… and checkpoint deferred headers.
…ter birthday alignment.
…st spender immediate.
…finish verification when a save or memo transport changes.
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.
Closes #62.
Items 1 and 2 were already on main. Item 3, incremental snapshot chunks, is already on main and is unchanged here. This finishes item 4.
A transaction waits for trial decryption only when one shielded pool has more than eight compact outputs. The switch is off unless the caller opts in. Sync turns it on and finishes the queue before either success return, including when the wallet is already at the tip. Commitments and nullifiers are applied immediately. Notes from that transaction stay unspendable until every output of that transaction has been decrypted. The balance reports
verificationPendingwhile the queue is non-empty. The queue is part of the snapshot and is dropped on rewind. A corrupt ciphertext does not advance the scan or drop the row.Checks:
cargo test -p z-engine --lib(498 passed),cargo check -p z-wasm --target wasm32-unknown-unknown, the confirmation-policy tests, and the core typecheck.