Skip to content

fix(proof)!: count and report tree result rows as the trusted read does (GROVE_V5) - #1061

Merged
QuantumExplorer merged 3 commits into
developfrom
fix/unreported-empty-tree-row-charge
Nov 18, 2026
Merged

QuantumExplorer merged 3 commits into
developfrom
fix/unreported-empty-tree-row-charge

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Basic explanation

When a query has a limit, the prover and the verifier each count rows as they walk the proof, and they must stop at the same row. For one kind of row they did not count alike: an empty plain tree that is itself a result (nothing in the query descends into it). The prover counts it. A verifier that leaves empty trees out of its results, which is what verify_query and verify_subset_query do, skipped it without counting. From that row on the verifier believed it had one more slot than the prover had, so it either refused an honest proof or reported a row that belongs to the next page.

From GROVE_V5 the verifier counts that row too, even though it still does not report it. GROVE_V4 and earlier verify exactly as before.

Before and after

State:

index/a/d   item
index/a/t   empty tree
index/b/d   item

Query: every child of index, everything below each child, SizedQuery limit 2.

rows
query_raw (trusted read) a/d, a/t
verify_query, GROVE_V4 and GROVE_V5 before this change InvalidProof("V1 proof is missing lower layer for non-empty tree at key 62")
verify_query, GROVE_V5 after a/d
verify_query_with_options with include_empty_trees_in_result: true, every version a/d, a/t

The same happens when the 2 is a per-instance cap (Query::limit on the index query) instead of a global limit.

If index/b is an item instead of a tree, the old verifier does not refuse the proof. It returns a/d and b, although the page the trusted read returns ends at a/t. Under GROVE_V5 it now returns a/d.

Second fix, raised in review: a conditional branch without a subquery

add_conditional_subquery(item, None, None) is how a query says "do not go below these keys": the trusted read returns the element at such a key and stops. Prover and verifier read every key a conditional branch matched as a key to descend into. So a tree at such a key was never treated as the row it is. From GROVE_V5 both sides ask whether the query has anything below the key.

State as above, but the query exempts a from its subquery (Key(a) with no subquery and no path), and c/d is a third item:

index/a is query query_raw verified, GROVE_V4 verified, GROVE_V5 after
empty sum tree no limit a, b/d, b/e, c/d b/d, b/e, c/d a, b/d, b/e, c/d
empty sum tree Query::limit 2 a, b/d b/d, b/e a, b/d
empty plain tree Query::limit 1 a b/d nothing (a with include_empty_trees_in_result: true)
tree holding an item any a, ... prove_query fails with CorruptedPath a, ...

Under GROVE_V4 the empty tree is not reported by any verifier, whatever include_empty_trees_in_result says, and it takes a slot of the global limit but not of a per-instance cap. This predates the PR and has a different cause from the first fix: here prover and verifier agree with each other and both disagree with the trusted read.

Issue being fixed or feature implemented

Found while fixing #962 (PR #1058), which works around it on the prover side. Confirmed by a test on develop under GROVE_V4 and GROVE_V5 before any code changed: the four GROVE_V5 tests of the new module failed there and the GROVE_V4 pins passed.

The two sides:

  • Prover: the "Empty trees without subquery" arm of prove_subqueries_v1 calls charge_row_with_instance for the row.
  • Verifier: the last empty-tree branch of verify_layer_proof_v1 (an empty plain Tree at a terminal position while the caller excludes empty trees) binds the row with verify_empty_tree_binding and charges nothing.

Which side is right

The prover. Three things point the same way:

  1. The trusted read (query_raw) returns the empty tree as a row and counts it against the limit. A proof exists to attest that read, so the page it proves has to end where the read ends.
  2. The prover cannot know which option the verifier will pass. verify_query_raw and include_empty_trees_in_result: true report the row and already charge it, and those verifiers accepted the same proof bytes all along. A budget that depends on a reporting option cannot match a single proof.
  3. The verifier already counts the row elsewhere. In a layer without subqueries the Merk proof is cut at the limit and the empty tree is one of its rows, in every version. The GROVE_V5 local count page (run_local_count_offset_layer_dispatch) charges every returned row and reports the empty tree only on request.

So the fix is on the verifier: charge the row it does not report, and stop where the budget is spent, as after any reported row.

Why this cannot hide a row the query owes

The row is charged only after verify_empty_tree_binding has tied its bytes to the committed value hash. It is therefore a key the state holds, that the query selects, and that really is an empty tree. A prover cannot invent such rows to use up the budget, and cannot pass off a populated tree as empty (that is refused as before, issue #869). The trusted read spends a slot on the same row, so whatever comes after the stop belongs to a later page. a_proof_one_row_short_of_the_limit_is_refused_under_v5 checks that a proof of a 2-row page is still refused for a 3-row query.

What was done?

  • New slot operations.proof.unreported_empty_tree_row_charge: 0 in GROVE_V1..GROVE_V4, 1 in GROVE_V5.
  • New module grovedb/src/operations/proof/unreported_empty_tree_row_charge/{mod,v0,v1}.rs. v0 charges nothing and never stops the walk. v1 charges one row against the global limit and the frame's per-instance cap and reports whether a budget is now spent.
  • verify_layer_proof_v1 calls the dispatch right after binding the row, and breaks out of the layer when it says so. That is the whole change to the verifier (12 lines).
  • The prover does not read this slot. Proof bytes are identical at both of its values.
  • Second slot operations.proof.subquery_descent_on_key: 0 in GROVE_V1..GROVE_V4, 1 in GROVE_V5, read by prover and verifier through one function, GroveDb::query_descends_on_key, in grovedb/src/operations/proof/subquery_descent_on_key/{mod,v0,v1}.rs. v0 is the released test (has_subquery_or_matching_in_path_on_key). v1 is that test and, in addition, PathQuery::query_items_at_path resolving to something below the key, which picks the branch the way the trusted read does. v1 can only turn a descent into a row, never the reverse.
  • prove_subqueries_v1 computes the answer once per tree and its 13 descent guards read it, so a tree the query does not go below falls through to the arms that already prove a tree as a result row (child hash for a populated tree, a charged row for an empty one). verify_layer_proof_v1 uses the same answer in its three branches for a tree without a lower layer. The V0 prover and verifier are not touched.
  • Under GROVE_V5 the proof of a query with such a branch changes when a tree sits at the exempt key. Proofs of every other query are byte for byte the same: the two tests differ only for a key whose branch has neither a subquery nor a path.
  • CHANGELOG.md and the grovedb-version/src/version/v5.rs module doc list the gate. v5_matches_v4_apart_from_its_gates lists the slot.

What changes for a caller of verify_query under GROVE_V5

Only limited queries (a SizedQuery limit or a Query::limit cap) whose result rows include an empty plain Tree, verified with empty trees excluded. For those:

  • A page that was refused with "missing lower layer for non-empty tree" (or, when the next child's layer was proved for a smaller budget than the verifier thought it had, as cut short) now verifies.
  • A row past the page that was reported is no longer reported. This happened when the row after the spent budget was an item of the same layer.
  • No row that the trusted read returns on the page is lost. every_page_matches_the_trusted_read_without_its_empty_trees_under_v5 checks, for budgets 1 to 10, both directions, global limit and per-instance cap, that the verifier's rows are exactly the trusted read's rows minus its empty plain trees.
  • A page can hold fewer rows than its limit while more rows follow, because each unreported empty tree takes one slot. This was already true in every version for a layer without subqueries (a_single_layer_page_counts_the_empty_tree_under_both_versions). A caller that needs "fewer rows than the limit means last page" should verify with include_empty_trees_in_result: true and filter.

Queries without a limit, queries whose budget the empty tree does not exhaust, and verifiers that report empty trees return the same rows as before.

No caller inside GroveDB reads the verifier's budget after the walk; the absence-proof path takes its row count from the query's limit, not from the walk.

Dash Platform, read from its code and not tested: PV15 selects GROVE_V5, PV14 keeps GROVE_V4, so adoption is the pin bump. The one query family that can meet the condition is the contested-resource listing (verify_contests_proof) when it lists a level of the index that is not the last one and a value tree there was left empty after its polls were cleaned up. No caller in the repository infers "last page" from a short page for that shape.

PR #1058

#1058 is not merged. It adds a prover-side guard for this mismatch (V1LimitState::empty_plain_tree_rows, read by truncate_instance_capped_layer_v1, which keeps a capped layer whole once such a row was charged). This PR is based on develop and leaves that guard alone. Once both have merged the guard is no longer needed under GROVE_V5 and can be removed, together with an update of its test an_empty_tree_row_keeps_the_layer_whole, in a follow-up.

How Has This Been Tested?

grovedb/src/tests/conditional_branch_without_subquery_tests.rs, 10 tests for the second fix (the six GROVE_V5 ones failed before the code changed, the four GROVE_V4 pins passed):

  • A sweep against the trusted read under GROVE_V5: six kinds of element at the exempt key (empty plain, sum, MMR and count-indexed trees, populated plain and sum trees), two query shapes (a default subquery with an exemption, and conditional branches only), both directions, no budget and every global limit and per-instance cap from 1 to 6. With empty trees reported the verified rows equal the trusted rows; without, they equal the trusted rows minus the empty plain tree. The same sweep fails under GROVE_V4 and under GROVE_V5 with only this slot set back to 0.
  • GROVE_V4 pins: the empty tree is never reported, it takes no slot of a per-instance cap, and a populated tree at the exempt key cannot be proved.
  • A proof made without the row is refused by the GROVE_V5 verifier. An unknown slot value is a VersionError from prover and verifier.

grovedb/src/tests/unreported_empty_tree_row_budget_tests.rs, 15 tests for the first fix:

  • The reproduction above under a global limit and under a per-instance cap: verifies under GROVE_V5, and is refused under GROVE_V4 with the exact released message.
  • The item-past-the-page shape: not reported under GROVE_V5, reported under GROVE_V4 as released.
  • Empty trees as rows of a layer that also has a subquery branch (conditional subquery): verifies under GROVE_V5, refused under GROVE_V4.
  • verify_subset_query counts the same way.
  • The sweep against the trusted read under GROVE_V5, and the same sweep failing under GROVE_V4 and under GROVE_V5 with only this slot set back to 0.
  • A proof one row short of the limit is refused. An unknown slot value is a VersionError.

Run locally:

  • cargo test -p grovedb --lib -- conditional_branch_without_subquery unreported_empty_tree_row_budget: 25 passed.
  • cargo test -p grovedb --lib -- proof query verify subquery conditional per_instance limit empty_tree indexed aggregate mmr bulk dense commitment non_merk merge private_document_store count_offset reference axis sum_budget: 2858 passed, 1 ignored.
  • cargo test -p grovedb --test branch_count_offset --test proof_breadth --test proof_formatting --test untrusted_decode: 54 passed.
  • cargo test -p grovedb-version: 62 passed.
  • cargo clippy -p grovedb -p grovedb-version --all-targets -- -D warnings: clean.
  • cargo check -p grovedb --no-default-features --features verify: builds.
  • cargo fmt --all -- --check: clean.

The full workspace suite was not run locally.

Breaking Changes

Under GROVE_V5 only (unreleased). GROVE_V1..GROVE_V4 are unchanged.

  • First fix: the verifier accepts proofs it refused and, for the item-past-the-page shape, returns one row fewer than before.
  • Second fix, for a query with a conditional branch that has neither a subquery nor a path: the proof changes when a tree sits at the exempt key, the verifier returns that tree as a row (an empty plain tree only with include_empty_trees_in_result: true), a page under a per-instance cap ends one row earlier for each such empty tree, and prove_query serves a query it refused when the tree is populated. A GROVE_V5 proof of such a query made before this change no longer verifies.

Public interface

  • GroveDBOperationsProofVersions gains two public fields, unreported_empty_tree_row_charge: FeatureVersion and subquery_descent_on_key: FeatureVersion. Code that builds the struct with an exhaustive literal must add them (0 for the released behaviour, 1 for the new one).
  • No function signature, type, error variant or proof encoding changes. Which nodes and lower layers a GROVE_V5 proof carries changes only for a query with a conditional branch that has neither a subquery nor a path.
  • GroveDb::prove_query and the other proving entry points: under GROVE_V5 such a query is proved with the tree at the exempt key as a result row, and no longer fails with CorruptedPath when that tree is populated.
  • Behaviour of GroveDb::verify_query, verify_subset_query, verify_query_with_absence_proof, verify_subset_query_with_absence_proof, verify_query_with_options with include_empty_trees_in_result: false, the GroveDBProof::verify* methods with the same setting, and verify_path_query changes under GROVE_V5 as described above.
  • verify_query_raw and any verifier with include_empty_trees_in_result: true are not affected by the first fix. The second fix changes them as well: they now return the tree at an exempt key.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

🤖 Generated with Claude Code

PR Hygiene · dbfa8d3

  • Bots — coderabbitai skipped after its own rate limit · thepastaclaw ✓, 1 thread unresolved — resolve it
  • Self-review — post /self-reviewed
  • Build green
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

…ROVE_V5)

An empty plain `Tree` that is itself a result row is counted against the
limit by the trusted read and charged one row by the V1 prover. A verifier
that leaves empty trees out of its results (the default of `verify_query`
and `verify_subset_query`) bound the row and charged nothing, so its budget
ran ahead of the prover's: it refused the honest proof of a page whose
budget such a row spent, or reported an item past the page.

From GROVE_V5 the verifier charges the row against the global limit and
the per-instance cap and stops where the budget is spent. The new slot
`proof.unreported_empty_tree_row_charge` is 0 in V1..V4, which verify as
6.1.1 does, and 1 in V5. The prover does not read it: proof bytes are the
same.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3d5d1188-b4a2-4f8a-9b27-642015043795
Commits

Reviewing files that changed from the base of the PR and between 0b36de0 and dbfa8d3.

Files selected for processing: 20

  • CHANGELOG.md
  • grovedb-version/src/tests.rs
  • grovedb-version/src/version/grovedb_versions.rs
  • grovedb-version/src/version/v1.rs
  • grovedb-version/src/version/v2.rs
  • grovedb-version/src/version/v3.rs
  • grovedb-version/src/version/v4.rs
  • grovedb-version/src/version/v5.rs
  • grovedb/src/operations/proof/generate.rs
  • grovedb/src/operations/proof/mod.rs
  • grovedb/src/operations/proof/subquery_descent_on_key/mod.rs
  • grovedb/src/operations/proof/subquery_descent_on_key/v0.rs
  • grovedb/src/operations/proof/subquery_descent_on_key/v1.rs
  • grovedb/src/operations/proof/unreported_empty_tree_row_charge/mod.rs
  • grovedb/src/operations/proof/unreported_empty_tree_row_charge/v0.rs
  • grovedb/src/operations/proof/unreported_empty_tree_row_charge/v1.rs
  • grovedb/src/operations/proof/verify.rs
  • grovedb/src/tests/conditional_branch_without_subquery_tests.rs
  • grovedb/src/tests/mod.rs
  • grovedb/src/tests/unreported_empty_tree_row_budget_tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.23%. Comparing base (0b36de0) to head (dbfa8d3).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1061   +/-   ##
========================================
  Coverage    93.22%   93.23%           
========================================
  Files          366      372    +6     
  Lines       114870   114966   +96     
========================================
+ Hits        107093   107191   +98     
+ Misses        7777     7775    -2     
Components Coverage Δ
grovedb-core 91.47% <100.00%> (+0.01%) ⬆️
merk 94.47% <ø> (ø)
storage 91.94% <ø> (ø)
commitment-tree 94.86% <ø> (ø)
mmr 95.12% <ø> (ø)
bulk-append-tree 94.32% <ø> (ø)
element 97.48% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thepastaclaw

thepastaclaw commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit dbfa8d3) · triage: normal · Phase 2 only (no Phase 1 for this repository)

Conflict in CHANGELOG.md: both Fixed entries kept.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Waiting for bot review — coderabbitai not yet · thepastaclaw requested changes — dismiss the review or push a fix, 1 thread unresolved — resolve it. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 2 only (no Phase 1 for this repository)

The PR fixes ordinary terminal empty-tree accounting under GROVE_V5, but it misses conditional branches whose matching branch is (None, None). In that case, the query executor treats the tree as a terminal result while proof generation and verification classify it as an empty child, so per-instance pagination can still diverge from the trusted read. The issue is blocking because it leaves the stated verifier/prover budget invariant incomplete; current CI has no reported failures, but two test jobs remain in progress.

🔴 1 blocking

Review provenance

Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 6: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 7: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 8: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — This is a large, intricate change to version-gated Merkle proof verification behavior, directly affecting cryptographic proof acceptance and query-result correctness in GROVE_V5.
  • Phase 1 reviewers: not run (disabled for this repository)
  • Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — rust-quality (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `grovedb/src/operations/proof/verify.rs`:
- [BLOCKING] grovedb/src/operations/proof/verify.rs:2866-2871: Terminal empty trees on `(None, None)` conditional branches bypass V5 row charging
  `has_subquery_or_matching_in_path_on_key` returns true for any matching conditional key, even when `add_conditional_subquery(item, None, None)` provides neither a subquery nor a subquery path. Therefore this helper is not reached: the preceding empty-tree branch treats the tree as an empty child and calls `charge_empty_layer()`, which does not consume the frame's per-instance row budget. However, `terminal_keys_v1` explicitly treats the `(None, None)` branch as terminal, and the trusted read falls through to `basic_push`, which returns the tree row and charges an instance slot. A limited query can consequently continue past the trusted page under GROVE_V5 and return inconsistent pagination results. The prover has the same classification at `generate.rs:3552`, so this is an uncovered sibling of the accounting mismatch addressed by this PR. Distinguish an actual descent/path branch from a matching terminal conditional branch in both proof generation and verification, and add a regression test with a matching `(None, None)` branch and an empty tree.

Comment thread grovedb/src/operations/proof/verify.rs Resolved
…result row (GROVE_V5)

The V1 prover and verifier read every key a conditional branch matched as
a descent, even a branch with neither a subquery nor a subquery path,
which the trusted read treats as "return this element". An empty tree at
such a key was proved as an empty child: never reported, and charged
against the global limit only, so a page under a per-instance cap ran
past the trusted read's. A populated tree there could not be proved.

From GROVE_V5 both sides ask whether the query has anything below the
key, through one versioned function. The new slot
`proof.subquery_descent_on_key` is 0 in V1..V4, which prove and verify as
6.1.1 does, and 1 in V5.

Raised by review on #1061.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@QuantumExplorer QuantumExplorer changed the title fix(proof)!: charge an empty tree row the verifier does not report (GROVE_V5) fix(proof)!: count and report tree result rows as the trusted read does (GROVE_V5) Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Waiting for bot review — coderabbitai not yet · thepastaclaw 1 thread unresolved — resolve it. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions

Copy link
Copy Markdown

Your move: thepastaclaw left review threads unresolved; resolve them.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. and removed waiting-bots Waiting for the review bots to report on this head labels Nov 18, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — Final validation — Phase 2 only (no Phase 1 for this repository)

The current head correctly aligns GROVE_V5 proof generation and verification for conditional branches without subqueries and for unreported empty plain-tree rows. The prior terminal empty-tree charging issue is fixed, historical GROVE_V1–V4 behavior remains explicitly gated, and no new in-scope correctness, security, architecture, or quality findings were identified. Build, test, lint, and formatting checks were still pending in the supplied CI snapshot, with no failed code checks reported.

🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)

Review provenance

Source: reviewer 1: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); reviewer 5: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 6: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 7: gpt-6.2-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 8: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.2-sol (effort low) — This is a substantial, cross-cutting proof-generation and verification behavior change with extensive version-gated tests, but it does not directly modify the listed critical surfaces such as consensus rules, cryptography, key handling, or storage migrations.
  • Phase 1 reviewers: not run (disabled for this repository)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.2-sol — rust-quality (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.

No unresolved findings remain from the prior review on this head.

@github-actions

Copy link
Copy Markdown

Your move: thepastaclaw left review threads unresolved; resolve them.
Full checklist in the description.

@QuantumExplorer
QuantumExplorer merged commit f101691 into develop Nov 18, 2026
18 of 19 checks passed
@QuantumExplorer
QuantumExplorer deleted the fix/unreported-empty-tree-row-charge branch November 18, 2026 13:10
QuantumExplorer added a commit that referenced this pull request Nov 18, 2026
Conflicts: the version tables and their test (both PRs added proof slots,
all kept) and the row walk in generate.rs (kept develop's descent check).

develop now carries #1061: under GROVE_V5 the verifier charges an empty
plain Tree result row it does not report, as the prover does. With the two
sides counting the same rows against the instance budget, the guard this
branch carried for that mismatch is removed: V1LimitState's
empty_plain_tree_rows counter and the truncation's early return. A page
such a row helps fill is now cut like any other and verifies; the test is
an_empty_tree_row_counts_toward_the_cut.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
PastaPastaPasta added a commit that referenced this pull request Nov 18, 2026
Takes develop up to f101691: #1056 (a failed parent read is a storage
error), #1059 (the referrer list of a bidirectional-reference target is out
of node hashes), #1055 (CountBigSumTree and ProvableBigSumTree) and #1061
(a verifier counts tree result rows as the trusted read does).

#1056 and the NodeStore seam both rewrote the two direct element reads in
merk/src/element/get.rs. The reads stay on the seam (`get_node_for_read`,
the same storage call and cost), and the seam's error mapping now keeps a
storage error typed, as #1056 requires, while a record that does not decode
is still `CorruptedData` with the same text. The adapter test of that
mapping and the error paragraph of the NodeStore contract follow.

git merged merk/src/merk/restore.rs without a conflict and wrongly: #1055's
new `KVBigSum` arm took the lines the seam had rewritten in the
`KVCountBigSum` arm before it, which was left writing through a batch that
no longer exists. Both arms now write through the change set.

lignin-testkit names the two new element variants and tree types where it
lists every one (`workload::coverage`, the stream encoding of a tree type),
and its coverage test expects them as not yet produced.

Part of #1052.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
PastaPastaPasta added a commit that referenced this pull request Nov 18, 2026
…d from it

Takes #1056, #1059, #1055 and #1061 from develop. The seams keep their
behaviour and upstream's: a failed parent read is a storage error through
the NodeStore read, and the restore arms of the new big sum trees write
through the change set. The layout observer reads a record whose referrer
list changed under an unchanged hash, the cost model knows the two new
aggregates, and the golden corpus is recorded from the engine at
f101691; it replays 290 of 290 and 5 of 5 on the merged tree.

Part of #1052.

Lignin-Tasks: SEAM-01, BASE-02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants