Repository navigation
feat: axis-ordered reads embedded in the GroveDBProof V1 envelope #799
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
Changes from 2 commits
4cd44ba
f680b08
eaa9f45
817148a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -178,6 +178,26 @@ impl AxisEntries { | |||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| /// Whether the result list is empty. | ||||||||||||||||||||||||||||||||||||
| /// An empty entry list of the right variant for `axis`. | ||||||||||||||||||||||||||||||||||||
| pub fn empty_for_axis(axis: grovedb_element::indexed::IndexAxis) -> Self { | ||||||||||||||||||||||||||||||||||||
| match axis { | ||||||||||||||||||||||||||||||||||||
| grovedb_element::indexed::IndexAxis::Count => AxisEntries::Count(Vec::new()), | ||||||||||||||||||||||||||||||||||||
| grovedb_element::indexed::IndexAxis::Sum => AxisEntries::Sum(Vec::new()), | ||||||||||||||||||||||||||||||||||||
| grovedb_element::indexed::IndexAxis::Avg => AxisEntries::Avg(Vec::new()), | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
180
to
+188
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Remove the leftover doc line above Line 180 still holds 📝 Proposed fix- /// Whether the result list is empty.
/// An empty entry list of the right variant for `axis`.
pub fn empty_for_axis(axis: grovedb_element::indexed::IndexAxis) -> Self {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| /// The first entry's original (primary) key, if any — the yielded | ||||||||||||||||||||||||||||||||||||
| /// item of a `k = 1` page, used by rank verification. | ||||||||||||||||||||||||||||||||||||
| pub fn first_original_key(&self) -> Option<&[u8]> { | ||||||||||||||||||||||||||||||||||||
| match self { | ||||||||||||||||||||||||||||||||||||
| AxisEntries::Count(entries) => entries.first().map(|(_, key)| key.as_slice()), | ||||||||||||||||||||||||||||||||||||
| AxisEntries::Sum(entries) => entries.first().map(|(_, key)| key.as_slice()), | ||||||||||||||||||||||||||||||||||||
| AxisEntries::Avg(entries) => entries.first().map(|(_, key)| key.as_slice()), | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| /// Whether there are no entries. | ||||||||||||||||||||||||||||||||||||
| pub fn is_empty(&self) -> bool { | ||||||||||||||||||||||||||||||||||||
| self.len() == 0 | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Do not emit unverifiable single-axis proofs
For a single-path axis query whose target is missing or non-indexed, this arm never runs, but the generic proof walk still returns
Okwith no axis-descent layer. I reproduced a missing target whereprove_querysucceeded andverify_path_queryrejected the result with “must verify exactly one axis layer, got 0.” Please preflight the single-axis target or fail generation when no descent is produced.