-
Notifications
You must be signed in to change notification settings - Fork 54
fix(drive): authenticate boundary in compacted absence proofs #3792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
QuantumExplorer
wants to merge
13
commits into
v3.1-dev
Choose a base branch
from
claude/fix-compacted-absence-proof-soundness
base: v3.1-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
94bf370
fix(drive): authenticate boundary in compacted absence proofs
QuantumExplorer 16d1e43
docs(drive): document known liveness bug in compacted absence-proof fix
QuantumExplorer 2191680
fix(drive): cap compacted-proof size + honor transaction (review feed…
QuantumExplorer 0cdf371
docs(drive): update compacted-prover docstrings to current proof appr…
QuantumExplorer a7c31c5
refactor(drive): classify chained-verify cardinality break as interna…
QuantumExplorer 98a62db
refactor(drive): centralize compacted_key into one shared helper
QuantumExplorer 404f1be
fix(drive): compacted-proof review hardening (limit=0, malformed boun…
QuantumExplorer 04097f1
fix(drive): make compacted address-balance path verify-available (fix…
QuantumExplorer 89e1d36
fix(drive): classify malformed authenticated boundary key as Corrupte…
QuantumExplorer 3e20289
refactor(drive): single-source the compacted-address-balance subtree …
QuantumExplorer 89b873f
refactor(drive): derive compacted-address-balance key slice from the …
QuantumExplorer 9f66222
Merge remote-tracking branch 'origin/v3.1-dev' into claude/fix-compac…
QuantumExplorer e3bf0d3
Merge branch 'v3.1-dev' into claude/fix-compacted-absence-proof-sound…
QuantumExplorer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,40 @@ | ||
| pub mod decode; | ||
| pub mod encode; | ||
|
|
||
| /// Builds the 16-byte big-endian compacted-block key `(start_block, end_block)` | ||
| /// shared by the shielded-nullifier and address-balance compacted trees. | ||
| /// | ||
| /// This 16-byte boundary-key encoding is part of the chained-proof contract: | ||
| /// every prover and its matching verifier MUST construct keys identically, or | ||
| /// chained verification silently breaks. It therefore lives in exactly one | ||
| /// place (the four compacted prove/verify modules import it) so the encoding | ||
| /// cannot drift between them. | ||
| pub(crate) fn compacted_key(start_block: u64, end_block: u64) -> Vec<u8> { | ||
| let mut key = Vec::with_capacity(16); | ||
| key.extend_from_slice(&start_block.to_be_bytes()); | ||
| key.extend_from_slice(&end_block.to_be_bytes()); | ||
| key | ||
| } | ||
|
|
||
| /// Canonical subtree key for the compacted address-balance tree under | ||
| /// `SavedBlockTransactions`. | ||
| /// | ||
| /// Defined here (a `verify`-available module) rather than in the `server`-gated | ||
| /// `saved_block_transactions::queries` so the **verify-side** proof verifier and | ||
| /// the **server-side** storage/fetch path reference one definition — the subtree | ||
| /// location is part of the proof contract and must not drift between them. | ||
| /// `saved_block_transactions::queries` re-exports this constant for its | ||
| /// server-side callers, so the `b'c'` byte is written in exactly one place. | ||
| pub const COMPACTED_ADDRESS_BALANCES_KEY_U8: u8 = b'c'; | ||
|
|
||
| /// Path to the compacted address-balance subtree under `SavedBlockTransactions`. | ||
| /// | ||
| /// Shared by the server-side storage/fetch path and the verify-side proof | ||
| /// verifier; both sides reach it through this one helper. See | ||
| /// [`COMPACTED_ADDRESS_BALANCES_KEY_U8`] for why the byte lives in this module. | ||
| pub(crate) fn compacted_address_balances_path() -> Vec<Vec<u8>> { | ||
| vec![ | ||
| vec![crate::drive::RootTree::SavedBlockTransactions as u8], | ||
| vec![COMPACTED_ADDRESS_BALANCES_KEY_U8], | ||
| ] | ||
| } | ||
|
QuantumExplorer marked this conversation as resolved.
QuantumExplorer marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.