test: pin the envelope relationship between prove_query and the direct indexed-axis provers (#835) - #837
Open
QuantumExplorer wants to merge 2 commits into
Open
test: pin the envelope relationship between prove_query and the direct indexed-axis provers (#835)#837QuantumExplorer wants to merge 2 commits into
QuantumExplorer wants to merge 2 commits into
Conversation
…t indexed-axis provers (#835) The two surfaces deliberately emit different outer wire formats (IndexedAxisRangeProof / IndexedAxisPaginatedProof little-endian standalone envelopes vs the big-endian GroveDBProof::V1 envelope with an AxisDescentProof layer that echoes no query parameters), so whole-proof byte-equality cannot hold. Per the issue's acceptance criteria this is now a documented, pinned fact rather than an assumption: - module doc enumerates the divergence (envelope type, bincode config, path attestation, echoed parameters); - golden tests pin that the semantic core IS byte-identical across all three axes, both traversal shapes, both directions, empty and populated secondaries, and offset 0 / mid / past-the-end: secondary_proof bytes, target_chains, primary_root_hash, other_axes_root_hashes, target_is_pcpsit, axis_tag; - both verifiers reconstruct the same root hash and return identical entries (and identical attested skipped), and both provers are pinned deterministic; - the mutual-acceptance cross-check resolves as mutual rejection: each verifier entry point cleanly errors on the other family's bytes, so the families cannot be cross-fed accidentally. Closes #835. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedNext included review available in 29 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #837 +/- ##
========================================
Coverage 92.53% 92.53%
========================================
Files 292 292
Lines 90484 90501 +17
========================================
+ Hits 83727 83745 +18
+ Misses 6757 6756 -1
🚀 New features to boost your workflow:
|
CI surfaced a genuine divergence the suite had assumed away (exactly the outcome issue #835 says to document): a bounded read over a completely empty secondary proves on the unified surface (empty proof bytes resolving to a NULL_HASH secondary root, so the parent binding attests the emptiness) but is refused outright by the standalone range prover (merk-level 'Cannot create proof for empty tree' — no empty-tree shape). The paginated shape has no such gap. The empty-secondary test now pins both behaviors, and the module-doc divergence enumeration carries it as divergence 2. This is the same asymmetry platform's drive-abci maps onto its retry-unproved InvalidArgument for the having surface. Co-Authored-By: Claude Fable 5 <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.
What
Builds out #835: a golden test suite (
grovedb/src/tests/envelope_byte_equality_tests.rs) pinning the byte-level relationship betweenprove_queryon single-path axis queries and the directprove_indexed_*provers, so platform's switch to the unified surface is a proven relationship rather than an assumption.The documented finding: outer envelopes are NOT byte-identical — by construction
The two surfaces deliberately emit different wire formats, so whole-proof byte-equality does not hold and never did. The divergence is enumerated in the test module doc:
prove_queryIndexedAxisPaginatedProof/IndexedAxisRangeProofGroveDBProof::V1standard()(little-endian)standard().with_big_endian()layer_proofs(single-key Merk proof per segment) +ancestor_attestationsLayerProofnesting of the general proof walkaxis_tag(plus the rank forRankOfKey); everything else is query-as-inputThis lands in the issue's second acceptance branch ("where equality does not hold — a documented enumeration of the divergence and mutual-acceptance tests between the two verifier entry points"). Since the formats are disjoint, mutual acceptance resolves as mutual rejection, and the suite pins that too: each verifier entry point cleanly errors (no panic, no false accept) on the other family's bytes, so the families cannot be cross-fed accidentally.
Divergence 2 (found by CI): bounded-over-empty is unified-only
The first CI run surfaced a genuine capability divergence the suite had assumed away — exactly the outcome the issue says to document rather than fear: a bounded read over a completely empty secondary proves on the unified surface (empty proof bytes resolving to a NULL_HASH secondary root, so the parent binding attests the emptiness) but is refused outright by the standalone range prover (merk-level "Cannot create proof for empty tree" — it has no empty-tree shape). The paginated shape has no such gap: both surfaces prove empty secondaries. Both behaviors are now pinned by the empty-secondary test and enumerated in the module doc. This is the same asymmetry platform's drive-abci maps onto its retry-unproved InvalidArgument for the having surface.
The pinned equality: the semantic core is byte-identical
For the same state and arguments, across all three axes × both traversal shapes (top-k-paginated, bounded) × both directions × empty and populated secondaries × offset 0 / mid / past-the-end, the tests pin byte-for-byte equality of the security-relevant payload shared by the unified
AxisDescentProoflayer and the direct envelopes:secondary_proof— the encoded Merk proof over the per-axis secondary,target_chains— the resolved primary rows,primary_root_hash,other_axes_root_hashes,target_is_pcpsit,axis_tag,plus the observable equivalence that makes the platform switch a pure refactor: both verifiers reconstruct the same GroveDB root hash and return identical entries (and identical attested
skippedfor the paginated shape), and both provers are pinned deterministic (proving twice yields identical bytes — the goldens are stable).Also covered: the single-secondary PSIT target shape (
target_is_pcpsit = false), an in-domain empty selection window, the empty-proof-bytes convention over empty secondaries, and the direct envelopes' parameter echoes (requested_k/requested_offset/requested_limit/descending/axis_tag).Notes for reviewers
prove/verify_indexed_{count,sum,avg}_queryentry points through the sameaxis_lowering::axis_bounded_merk_querylowering both proof sides already share, so the compared queries cannot drift.docs/book/src/unified-path-query.md) already states the entries/root-hash equivalence these tests now pin at the byte level.Closes #835.
🤖 Generated with Claude Code