deps(commitment-tree): migrate orchard to 0.14.0 (circuit soundness fix) - #758
Conversation
Pin `orchard` to the `dashified-0.14.0` tag (orchard 0.14.0 + Dash `MemoSize` commits, commit f0555739), replacing the previous 0.13.1-based `rev` pin. orchard 0.14.0 / halo2_gadgets 0.5.0 contain the disclosed soundness fix for the Orchard zero-knowledge circuit (variable-base scalar multiplication was unconstrained), plus proof-size bounding (GHSA-2x4w-pxqw-58v9) and an `epk` validity check. This crate enables the `circuit` feature and uses `builder::Builder`, `bundle::{Authorized, Flags, BatchValidator}`, and `circuit::{ProvingKey, VerifyingKey}`, so it is directly exposed. No source/API changes were required: the 0.14.0 breaking changes (`Action::from_parts` -> Result, removal of `Bundle::from_parts`, `OrchardCircuitVersion` threading) are not used directly by this crate or its benches. `Builder::new` and `ProvingKey/VerifyingKey::build` default to the secure `FixedPostNu6_2` circuit, so proofs are built and verified against the fixed VK automatically. The crate commits no keys, VK fingerprints, or serialized proof vectors, so nothing needs regeneration. No crate version bump (never shipped to production). Verified: cargo build --all-features (lib + benches), cargo test -p grovedb-commitment-tree --all-features (108 passed, 0 failed), cargo clippy --all-features --all-targets (no warnings), cargo fmt --check (clean). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughUpdated the ChangesOrchard 0.14.0 dependency update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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/Cargo.toml`:
- Line 20: Replace the mutable git tag pin for the orchard dependency with an
immutable commit SHA: in the Cargo.toml dependency entry for orchard (the line
currently using tag = "dashified-0.14.0"), change it to use rev =
"f05557390a5843bc4eb04c66d8140bc9ef0fe9b7" while keeping the same git URL and
features = ["circuit"] so the dependency is immutably pinned to that commit.
🪄 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: 99106356-fbbd-4887-a25b-0e836cdf2607
📒 Files selected for processing (1)
grovedb-commitment-tree/Cargo.toml
|
|
||
| [dependencies] | ||
| orchard = { git = "https://github.com/dashpay/orchard.git", rev = "898258d76aab2822249492aede59a02d49278fff", features = ["circuit"] } | ||
| orchard = { git = "https://github.com/dashpay/orchard.git", tag = "dashified-0.14.0", features = ["circuit"] } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify what commit the current remote tag points to (repeat over time to detect drift).
git ls-remote --tags https://github.com/dashpay/orchard.git 'refs/tags/dashified-0.14.0'
git ls-remote --tags https://github.com/dashpay/orchard.git 'refs/tags/dashified-0.14.0^{}'
# Optional: compare with expected commit from PR notes.
# Replace EXPECTED with the intended immutable commit (e.g., f0555739...).
EXPECTED="f0555739"
ACTUAL="$(git ls-remote --tags https://github.com/dashpay/orchard.git 'refs/tags/dashified-0.14.0^{}' | awk '{print $1}' | head -n1)"
echo "actual=$ACTUAL expected_prefix=$EXPECTED"
[[ "$ACTUAL" == "$EXPECTED"* ]] && echo "OK: tag currently matches expected commit" || echo "MISMATCH: tag target differs"Repository: dashpay/grovedb
Length of output: 313
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Cargo.lock tracked?"
git ls-files | rg -n 'Cargo\.lock$' || true
echo "== grovedb-commitment-tree/Cargo.toml (lines 1-80)"
nl -ba grovedb-commitment-tree/Cargo.toml | sed -n '1,80p'
echo "== Orchard dependency lines (manifest)"
rg -n 'orchard\s*=.*(git|rev|tag)' grovedb-commitment-tree/Cargo.toml || true
echo "== Workspace Cargo.lock presence (if any)"
ls -la | rg -n 'Cargo\.lock$' || true
find . -maxdepth 3 -name 'Cargo.lock' -printRepository: dashpay/grovedb
Length of output: 194
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Cargo.lock tracked?"
git ls-files | rg -n '(^|/)Cargo\.lock$' || true
echo "== grovedb-commitment-tree/Cargo.toml (lines 1-80)"
cat -n grovedb-commitment-tree/Cargo.toml | sed -n '1,80p'
echo "== Orchard dependency lines (manifest)"
rg -n 'orchard\s*=.*(git|rev|tag)' grovedb-commitment-tree/Cargo.toml || true
echo "== Cargo.lock files in repo (anywhere)"
find . -maxdepth 4 -name 'Cargo.lock' -printRepository: dashpay/grovedb
Length of output: 2364
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== grovedb-commitment-tree/src/lib.rs (lines 60-130)"
cat -n grovedb-commitment-tree/src/lib.rs | sed -n '60,130p'Repository: dashpay/grovedb
Length of output: 3649
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Resolve tag target (including peeled commit) and ensure it matches the intended immutable commit.
git ls-remote --tags https://github.com/dashpay/orchard.git 'refs/tags/dashified-0.14.0'
git ls-remote --tags https://github.com/dashpay/orchard.git 'refs/tags/dashified-0.14.0^{}'
EXPECTED="f0555739"
ACTUAL="$(git ls-remote --tags https://github.com/dashpay/orchard.git 'refs/tags/dashified-0.14.0^{}' | awk '{print $1}' | head -n1)"
[[ "$ACTUAL" == "$EXPECTED"* ]] && echo "OK: tag currently matches expected commit" || echo "MISMATCH: tag target differs"Repository: dashpay/grovedb
Length of output: 240
🏁 Script executed:
#!/bin/bash
set -euo pipefail
EXPECTED="f05557390a5843bc4eb04c66d8140bc9ef0fe9b7"
ACTUAL="$(git ls-remote --tags https://github.com/dashpay/orchard.git 'refs/tags/dashified-0.14.0^{}' | awk '{print $1}' | head -n1)"
[[ "$ACTUAL" == "$EXPECTED" ]] || { echo "MISMATCH: $ACTUAL != $EXPECTED"; exit 1; }
echo "OK: tag target matches expected commit"Repository: dashpay/grovedb
Length of output: 98
Pin Orchard with an immutable git rev instead of a (mutable) tag
grovedb-commitment-tree/Cargo.toml (line 20) uses tag = "dashified-0.14.0" for the security-critical orchard dependency whose bundle/circuit APIs are re-exported. This repo does not track any Cargo.lock, so builds rely on the tag’s current target; tags can be retargeted over time (even though dashified-0.14.0^{} currently resolves to f05557390a5843bc4eb04c66d8140bc9ef0fe9b7). Switching to rev = "f05557390a5843bc4eb04c66d8140bc9ef0fe9b7" restores immutable pinning.
🤖 Prompt for 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.
In `@grovedb-commitment-tree/Cargo.toml` at line 20, Replace the mutable git tag
pin for the orchard dependency with an immutable commit SHA: in the Cargo.toml
dependency entry for orchard (the line currently using tag =
"dashified-0.14.0"), change it to use rev =
"f05557390a5843bc4eb04c66d8140bc9ef0fe9b7" while keeping the same git URL and
features = ["circuit"] so the dependency is immutably pinned to that commit.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #758 +/- ##
========================================
Coverage 91.44% 91.44%
========================================
Files 237 237
Lines 67298 67298
========================================
Hits 61540 61540
Misses 5758 5758
🚀 New features to boost your workflow:
|
Closes #756.
What
Pins
orchardingrovedb-commitment-tree/Cargo.tomlto thedashified-0.14.0tag, replacing the previous 0.13.1-basedrevpin:The tag dereferences to commit
f0555739— orchard 0.14.0 + the DashMemoSizecommits, pulling in halo2_gadgets 0.5.0.Cargo.lockis gitignored in this workspace, so this is the sole tracked change.Why (security)
orchard
< 0.14.0/ halo2_gadgets< 0.5.0contain a disclosed soundness bug in the Orchard zero-knowledge circuit: variable-base scalar multiplication (ecc::chip::mul) never constrained the incomplete double-and-add loop's per-iteration base to the real base, so a prover could compute[a]·base + [b]·B'instead of[scalar]·base— potentially enabling double-spends within an Orchard pool. The fix changes the circuit and therefore requires a new verifying key.0.14.0 also adds proof-size bounding for bundles from untrusted parts (GHSA-2x4w-pxqw-58v9) and an
epkvalidity check inAction::from_parts.This crate enables the
circuitfeature and usesbuilder::Builder,bundle::{Authorized, Flags, BatchValidator}, andcircuit::{ProvingKey, VerifyingKey}, so it is directly exposed.Why no code/API changes were needed
Action::from_parts→Result, removal ofBundle::from_parts(→try_from_parts+ProofSizeEnforcement),OrchardCircuitVersionthreading — are not used directly anywhere in this crate or its benches.Builder::new/build/create_proof/apply_signatures/BatchValidatorsignatures are unchanged.Builder::newandProvingKey::build/VerifyingKey::buildall default to the secureFixedPostNu6_2circuit, so proofs are built and verified against the fixed VK automatically.stable; orchard's 1.85.1 MSRV is satisfied.grovedb-commitment-treehas never shipped to production.Verification
cargo build -p grovedb-commitment-tree --all-features(lib + benches) ✓cargo test -p grovedb-commitment-tree --all-features→ 108 passed, 0 failed, 2 ignored ✓cargo clippy -p grovedb-commitment-tree --all-features --all-targets→ no warnings ✓cargo fmt -p grovedb-commitment-tree -- --check→ clean ✓git+https://github.com/dashpay/orchard.git?tag=dashified-0.14.0#f0555739✓Coordination (follow-up, not in this PR)
dashpay/platformanddashpay/dash-evo-toolalso depend on thedashpay/orchardfork — they should pin the samedashified-0.14.0tag so versions stay consistent across the stack.🤖 Generated with Claude Code
Summary by CodeRabbit