fix:modified utils.py to remove merkle sibling#47
fix:modified utils.py to remove merkle sibling#47Arpitsh7 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughRefactored Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 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 |
Fix: Replace XOR Sibling Index with Explicit Parity Check in
generate_merkle_proof()fixes #45
What this PR does
As described in the issue,
generate_merkle_proof()andcompute_merkle_root()used two different strategies for handling odd-length tree levels:compute_merkle_root()right = left if i+1 >= len(leaves)generate_merkle_proof()leaves.append(leaves[-1])compute_merkle_root()Changes Made
Why this is safe
verify_merkle_proof()is unchanged — existing proofs remain verifiableTesting Checklist
verify_merkle_proof()returnsTruefor valid proof against rootverify_merkle_proof()returnsFalsefor tampered chunkLabels:
bug,merkle-tree,cryptographyChecklist
Summary by CodeRabbit