You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b3f203d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(count_offset): address CodeRabbit review on PR #669
Six follow-ups from the review:
**Actionable (3)**
1. `check_count_offset_target_tree_type` in
`grovedb/src/operations/proof/generate.rs` now normalizes
`open_transactional_merk_at_path` errors to
`Error::InvalidQuery`. Previously a missing path or other
storage-layer error leaked through verbatim while a
wrong-tree-type case got the intended message — callers got two
different error contracts for the same actionable meaning ("you
can't run count-offset against this path"). Captured comment
explains why we don't propagate the raw open error.
2. Removed a stale rustdoc block describing
`prove_aggregate_sum_on_range` that ended up sitting above
`prove_count_offset_on_range` after the previous insertion in
`merk/src/merk/prove.rs`. The function's own docstring is
unchanged.
3. Phase-2 verifier call in
`merk/src/proofs/query/count_offset/verify.rs` now uses
`cost_return_on_error_no_add!` instead of an open-coded
`match` early-return, matching the project standard. The
`_no_add` variant is right here because
`verify_count_offset_shape` returns a plain `Result<u64, Error>`
without accumulating internal cost.
**Nitpicks (3)**
4. Two end-to-end rejection tests now assert `Err(Error::InvalidQuery(_))`
via `matches!` instead of bare `is_err()`. Catches regressions
where some unrelated error (storage I/O, etc.) accidentally
satisfies the assertion.
5. Both `subtree.prove_count_offset_on_range(...)` call sites in
`generate.rs` (v0 and v1 short-circuits) now wrap downstream
merk failures via `Error::CorruptedData(format!("prove_count_offset_on_range
failed: {}", e))` instead of bare `Error::MerkError(_)`, matching
the wrapping the existing `prove_aggregate_sum_on_range` calls
use a few hundred lines up.
6. `verify_query_with_options`'s entry-level offset check switched
from the inline `query.query.offset.is_some() && query.query.offset
!= Some(0)` to `query.has_non_zero_offset()`, matching the
leaf-level dispatches in the same file.
Test totals unchanged: merk count_offset 17/17, grovedb count_offset
18/18, full merk 510/510, full grovedb 1731/1731.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
0 commit comments