Repository navigation
harden: always enforce canonical proof size in Bundle::try_from_parts - #11
Merged
Merged
Conversation
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesCanonical proof size enforcement
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the
ProofSizeEnforcementenum and its parameter onBundle::<Authorized, V>::try_from_parts, making canonical proof-size validation (GHSA-2x4w-pxqw-58v9) unconditional.The
Unenforcedvariant 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 /BundleVersionrefactor for the Ironwood (NU6.3) upgrade; this PR is the equivalent targeted change without pulling in that machinery.Changes
orchard::bundle::ProofSizeEnforcement.Bundle::<Authorized, V>::try_from_partsdrops thesize_enforcementparameter and always validates the proof length againstProof::expected_proof_size.Strict.[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 passedUnenforcednow 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 passcargo clippy --all-featuresclean,cargo fmt -- --checkclean🤖 Generated with Claude Code
Summary by CodeRabbit