Repository navigation
fix(anchor): take merkle_root and leaf_count from the entry - #549
Closed
astrogilda wants to merge 2 commits into
Closed
astrogilda wants to merge 2 commits into
astrogilda wants to merge 2 commits into
Conversation
Registry Anchor Format section 5 defines the inclusion proof as leaf_index and audit_path, and the section 5.1 algorithm takes merkle_root and leaf_count from the registry entry. TR-ANC-002 still required both on the receipt, so a proof-only receipt with a matching entry was refused as malformed. TR-ANC-002 now replays the proof against the entry's root and count. A receipt that carries its own copies must still carry the entry's (section 6). parse_receipt keeps its contract for callers that replay a self-contained receipt without an entry. Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>
A receipt may leave leaf_count out and take the entry's, but one that carries the field must carry an integer. An explicit null was read as absent and skipped the comparison with the entry. Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>
astrogilda
requested review from
a team,
lywinged and
rajnisht7
as code owners
October 16, 2026 20:23
Contributor
|
❔ Contributor Check: UNKNOWN
Automated check by AgenTrust Contributor Check. |
Member
|
@astrogilda folded into #533 as 1cf5038 and 6a9d803, your authorship and sign-off kept. The one conflict was with fe5d01e: the proof now replays against the entry's root and count over the complete signed claim, so a |
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 this changes
At 95e160a, the head of #533, TR-ANC-002 refuses a receipt that carries only leaf_index and audit_path even when
--entrysupplies its matching registry entry. Section 5.1 of spec/registry-anchor-v1.md takes merkle_root and leaf_count from the entry, so this PR replays the proof against the entry's values.I maintain a 27-case registry anchor corpus whose cases each name the section their expected verdict rests on. TR-ANC-002 agrees with 26 of 27 at 95e160a and 27 of 27 at 762f7b6, this PR's head.
Type of change
A conformance suite fix with no spec text change.
Spec section
None: section 6 in #533 already requires any merkle_root or leaf_count a receipt carries to equal the entry's.
Tests for a fix
test_proof_only_receipt_anchors_against_its_entry and test_proof_only_receipt_is_refused_against_another_batch fail at 95e160a. test_a_receipt_carried_leaf_count_that_is_not_an_integer_is_malformed refuses a null, string, float or boolean leaf_count, and
pytest conformance/testspasses on Linux at 762f7b6.Checklist
git commit -s)