fix(rpc): require non-empty tipset key in MinerGetBaseInfo - #7438
Conversation
Filecoin.MinerGetBaseInfo accepted a null or empty tipset key and silently fell back to the heaviest tipset, while Lotus rejects it with "NewTipSet called with zero length array of blocks". Reject the empty key with an invalid-params error so the method matches Lotus. Closes ChainSafe#7422
Assert both Forest and Lotus reject a MinerGetBaseInfo request with an empty tipset key in the RPC conformance suite.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Walkthrough
ChangesMinerGetBaseInfo tipset key validation
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 10 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Summary of changes
Filecoin.MinerGetBaseInfoaccepted anullor empty tipset key and silently fell back to the heaviest tipset. Lotus instead treats the tipset key as required and rejects an empty one withfailed to load tipset for mining base: NewTipSet called with zero length array of blocks. This aligns Forest with Lotus.Changes introduced in this pull request:
MinerGetBaseInfonow returns an invalid params error when the tipset key isnullor empty, instead of defaulting to the heaviest tipset.Reference issue to close (if applicable)
Closes #7422
Other information and links
Behaviour mapped against Lotus, where
MinerGetBaseInfotakes a requiredtypes.TipSetKeyand errors on an empty key rather than defaulting to the chain head.Change checklist
Outside contributions
Summary by CodeRabbit
Bug Fixes
MinerGetBaseInfonow rejects requests with missing or empty tipset keys instead of defaulting to the heaviest tipset.Documentation