feat(commitment-tree): re-export ProofSizeEnforcement + ActionFromPartsError - #760
Conversation
…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>
📝 WalkthroughWalkthroughThis PR adds two public re-exports from the Orchard crate to ChangesOrchard bundle and action type re-exports
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
grovedb-commitment-tree/src/lib.rs
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
What
Re-export two orchard symbols from
grovedb-commitment-treethat were missed:orchard::bundle::ProofSizeEnforcementorchard::ActionFromPartsErrorWhy
grovedb-commitment-treealready 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 onorcharddirectly.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 ofBundle::try_from_parts, the only public constructor forBundle<Authorized>(the old genericBundle::from_partsis gone in 0.14).ActionFromPartsError— the errorAction::from_partsnow returns (wasOptionin 0.13), needed to distinguish theIdentityRkvsInvalidEpkrejection causes.Without these, a consumer (Dash Platform's shielded-proof verifier in
rs-drive-abci) has to add a directorcharddependency just to name them, duplicating the dependency the commitment tree already owns. Re-exporting them lets the verifier go entirely throughgrovedb-commitment-tree.Change
Two
pub uselines added next to the existingorchard::bundle/orchard::{...}re-exports. No behavior change.Summary by CodeRabbit
ProofSizeEnforcementandActionFromPartsError, expanding available functionality for library users.