Skip to content

feat(commitment-tree): re-export ProofSizeEnforcement + ActionFromPartsError - #760

Merged
QuantumExplorer merged 1 commit into
developfrom
fix/commitment-tree-reexport-orchard-bundle-symbols
Jun 4, 2026
Merged

feat(commitment-tree): re-export ProofSizeEnforcement + ActionFromPartsError#760
QuantumExplorer merged 1 commit into
developfrom
fix/commitment-tree-reexport-orchard-bundle-symbols

Conversation

@shumkov

@shumkov shumkov commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What

Re-export two orchard symbols from grovedb-commitment-tree that were missed:

  • orchard::bundle::ProofSizeEnforcement
  • orchard::ActionFromPartsError

Why

grovedb-commitment-tree already re-exports the full orchard verification API used by downstream consumers — Action, Bundle, Authorized, Flags, BatchValidator, ExtractedNoteCommitment, Nullifier, TransmittedNoteCiphertext, VerifyingKey, etc. — so consumers can reconstruct and verify Orchard bundles without depending on orchard directly.

Under orchard 0.14, reconstructing a Bundle<Authorized> from serialized parts requires two more symbols this crate doesn't yet re-export:

  • ProofSizeEnforcement — the required argument of Bundle::try_from_parts, the only public constructor for Bundle<Authorized> (the old generic Bundle::from_parts is gone in 0.14).
  • ActionFromPartsError — the error Action::from_parts now returns (was Option in 0.13), needed to distinguish the IdentityRk vs InvalidEpk rejection causes.

Without these, a consumer (Dash Platform's shielded-proof verifier in rs-drive-abci) has to add a direct orchard dependency just to name them, duplicating the dependency the commitment tree already owns. Re-exporting them lets the verifier go entirely through grovedb-commitment-tree.

Change

Two pub use lines added next to the existing orchard::bundle / orchard::{...} re-exports. No behavior change.

Summary by CodeRabbit

  • New Features
    • Extended public API to re-export additional Orchard types: ProofSizeEnforcement and ActionFromPartsError, expanding available functionality for library users.

…tsError

grovedb-commitment-tree already re-exports the orchard verification API
(Action, Bundle, Authorized, Flags, BatchValidator, ExtractedNoteCommitment,
Nullifier, TransmittedNoteCiphertext, VerifyingKey, ...). Two symbols needed to
reconstruct an Authorized bundle from serialized parts under orchard 0.14 were
missed:

- orchard::bundle::ProofSizeEnforcement -- required argument of
  Bundle::try_from_parts (the only public constructor for Bundle<Authorized>).
- orchard::ActionFromPartsError -- the error Action::from_parts now returns,
  needed to distinguish IdentityRk vs InvalidEpk rejections.

Re-exporting them lets downstream consumers (Dash Platform's shielded-proof
verifier) reconstruct + verify bundles entirely through grovedb-commitment-tree,
with no direct orchard dependency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shumkov
shumkov requested a review from QuantumExplorer as a code owner June 4, 2026 13:22
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds two public re-exports from the Orchard crate to grovedb-commitment-tree/src/lib.rs. The changes expose ProofSizeEnforcement to support bundle reconstruction proof-size policies, and extend the existing Orchard re-export list to include ActionFromPartsError for error handling. No logic, tests, or configuration changes are included.

Changes

Orchard bundle and action type re-exports

Layer / File(s) Summary
Orchard bundle and action type re-exports
grovedb-commitment-tree/src/lib.rs
Added public re-export of ProofSizeEnforcement from orchard::bundle (lines 109–110) and extended the Orchard re-export list to include ActionFromPartsError (lines 140–141) for bundle construction and error handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hops through orchard gates,
Bringing tools to reconstruct fates,
Proofs and errors, bundled tight,
Public exports, shining bright! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main changes: adding public re-exports of ProofSizeEnforcement and ActionFromPartsError from the orchard crate in grovedb-commitment-tree.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/commitment-tree-reexport-orchard-bundle-symbols

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@grovedb-commitment-tree/src/lib.rs`:
- Around line 140-141: The re-export list includes ActionFromPartsError which
doesn't exist in the orchard crate API; either remove ActionFromPartsError from
the export (since there are no callers) or replace it with the actual error type
provided by the configured orchard dependency (look up the orchard crate API for
the correct error type for Action::from_parts and re-export that instead).
Update the list that contains Action, ActionFromPartsError, Address as
PaymentAddress, Bundle, Note, Proof, NOTE_COMMITMENT_TREE_DEPTH accordingly and
ensure there are no remaining references to ActionFromPartsError in the
codebase.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5dfb36e6-8ba4-458f-b6fd-c2778f3ccf16

📥 Commits

Reviewing files that changed from the base of the PR and between 41786da and ffdaf82.

📒 Files selected for processing (1)
  • grovedb-commitment-tree/src/lib.rs

Comment thread grovedb-commitment-tree/src/lib.rs
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.47%. Comparing base (41786da) to head (ffdaf82).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #760   +/-   ##
========================================
  Coverage    91.47%   91.47%           
========================================
  Files          240      240           
  Lines        67570    67570           
========================================
  Hits         61807    61807           
  Misses        5763     5763           
Components Coverage Δ
grovedb-core 89.06% <ø> (ø)
merk 92.26% <ø> (ø)
storage 86.20% <ø> (ø)
commitment-tree 96.03% <ø> (ø)
mmr 96.79% <ø> (ø)
bulk-append-tree 89.82% <ø> (ø)
element 97.38% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shumkov shumkov self-assigned this Jun 4, 2026
@shumkov shumkov moved this to In review / testing in Platform team Jun 4, 2026
@QuantumExplorer
QuantumExplorer merged commit 40521b8 into develop Jun 4, 2026
11 checks passed
@QuantumExplorer
QuantumExplorer deleted the fix/commitment-tree-reexport-orchard-bundle-symbols branch June 4, 2026 14:01
@github-project-automation github-project-automation Bot moved this from In review / testing to Done in Platform team Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants