Skip to content

harden: always enforce canonical proof size in Bundle::try_from_parts - #11

Merged
QuantumExplorer merged 1 commit into
dashifiedfrom
claude/orchard-ironwood-v15-03ad13
Jul 13, 2026
Merged

QuantumExplorer merged 1 commit into
dashifiedfrom
claude/orchard-ironwood-v15-03ad13

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Removes the ProofSizeEnforcement enum and its parameter on Bundle::<Authorized, V>::try_from_parts, making canonical proof-size validation (GHSA-2x4w-pxqw-58v9) unconditional.

The Unenforced variant only existed upstream for lenience toward pre-NU6.2 Zcash history, which this fork does not carry — so keeping a bypass for the check has no legitimate caller here. Upstream zcash/orchard likewise removed the enum in 0.15.0, but did so as part of the larger explicit-circuit-version / BundleVersion refactor for the Ironwood (NU6.3) upgrade; this PR is the equivalent targeted change without pulling in that machinery.

Changes

  • Delete orchard::bundle::ProofSizeEnforcement.
  • Bundle::<Authorized, V>::try_from_parts drops the size_enforcement parameter and always validates the proof length against Proof::expected_proof_size.
  • Update the two internal call sites (test utilities), which already passed Strict.
  • Add an [Unreleased] changelog entry.

Impact

Semver-breaking for downstream callers of try_from_parts (delete the last argument at each call site). Any caller that previously passed Unenforced now gets real validation — that is the point of the change.

Testing

  • cargo test try_from_parts — proof-size proptest passes (canonical accepted, padded and truncated rejected)
  • cargo test bundle — bundle/builder/PCZT/DashMemo tests pass
  • cargo clippy --all-features clean, cargo fmt -- --check clean

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Breaking Changes
    • Authorized bundle construction no longer accepts configurable proof-size enforcement options.
    • Proof sizes are now always validated against the canonical length for the bundle’s actions.
    • Removed the obsolete proof-size enforcement configuration type.
  • Documentation
    • Updated the unreleased changelog to describe the API changes and canonical enforcement behavior.

Remove the ProofSizeEnforcement enum and its parameter on
Bundle::<Authorized, V>::try_from_parts. The Unenforced variant only
existed upstream for lenience toward pre-NU6.2 Zcash history, which
this fork does not carry, so proof-size validation
(GHSA-2x4w-pxqw-58v9) is now unconditional and cannot be bypassed.
Upstream removed the enum in orchard 0.15.0 as part of the explicit
circuit-version refactor; this is the equivalent targeted change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9a39333b-18b5-4ba4-8ca8-44cbeb240dad

📥 Commits

Reviewing files that changed from the base of the PR and between 38ac9c1 and df38ed2.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/bundle.rs

📝 Walkthrough

Walkthrough

Changes

Canonical proof size enforcement

Layer / File(s) Summary
Bundle API and validation
src/bundle.rs
Removes ProofSizeEnforcement and makes authorized bundle construction always validate canonical proof size.
Call sites and release documentation
src/bundle.rs, CHANGELOG.md
Updates test construction calls and documents the revised API and removed enum.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: nuttycom, daira, czarcas7ic, str4d

🚥 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 title clearly summarizes the main API hardening change: canonical proof size is now always enforced in Bundle::try_from_parts.
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.
✨ 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 claude/orchard-ironwood-v15-03ad13

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.

@QuantumExplorer QuantumExplorer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant