fix(net): validate decoded peer IDs - #192
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: getoptimum/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthrough
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to The PR validates serialized peer IDs while preserving valid address round trips and adds coverage for malformed input; no actionable merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
Full details: Scope DisciplineExplanation PASS. The PR changes only Full details: Behavior SafetyExplanation PASS: The behavior change is explicit and intentional. Full details: Over-EngineeringExplanation The change does not introduce an unnecessary cache, helper layer, or signature churn. It replaces direct base58 decoding with the existing Full details: SecurityExplanation PASS. The diff replaces raw base58 byte casting with
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
2aced99 to
2394425
Compare
Summary
AddressInfoFromString now parses the serialized peer ID with libp2p's peer.Decode instead of decoding the string as raw base58 bytes and casting the result to peer.ID.
That keeps the JSON round trip behavior the same for valid peer.AddrInfo values, while rejecting malformed peer IDs such as an empty peerID field.
Changes
Summary by CodeRabbit
Bug Fixes
Tests