Skip to content

fix: unify logic of getting finalized tipset#6797

Merged
LesnyRumcajs merged 1 commit intomainfrom
hm/unify-logic-of-get-finalized-tipset
Mar 26, 2026
Merged

fix: unify logic of getting finalized tipset#6797
LesnyRumcajs merged 1 commit intomainfrom
hm/unify-logic-of-get-finalized-tipset

Conversation

@hanabi1224
Copy link
Copy Markdown
Contributor

@hanabi1224 hanabi1224 commented Mar 25, 2026

Summary of changes

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes #6792

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Refactor
    • Simplified the internal process for retrieving finalized chain state information by consolidating finality selection logic, reducing code complexity and improving maintainability.

@hanabi1224 hanabi1224 added the RPC requires calibnet RPC checks to run on CI label Mar 25, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4c8069c5-3039-4e94-839f-85d21184ce5a

📥 Commits

Reviewing files that changed from the base of the PR and between f34ffd1 and a6cee81.

📒 Files selected for processing (1)
  • src/rpc/methods/chain.rs

Walkthrough

The ChainGetFinalizedTipset RPC handler is simplified to delegate finalized tipset resolution to ChainGetTipSetV2::get_latest_finalized_tipset, removing separate F3-fallback logic and eliminating the get_f3_finality_tipset helper function to unify finality resolution across both RPC endpoints.

Changes

Cohort / File(s) Summary
ChainGetFinalizedTipset Handler Simplification
src/rpc/methods/chain.rs
Removed EC finality epoch computation and F3→EC fallback logic from ChainGetFinalizedTipset::handle, replacing it with a direct delegation to ChainGetTipSetV2::get_latest_finalized_tipset. Deleted the private get_f3_finality_tipset helper function that previously fetched F3 certificates and validated finality compatibility.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • LesnyRumcajs
  • akaladarshi
  • sudo-shashank
🚥 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 PR title 'fix: unify logic of getting finalized tipset' directly and accurately describes the main change: consolidating finalized tipset retrieval logic across RPC methods.
Linked Issues check ✅ Passed The PR successfully implements the proposed fix from issue #6792 by routing ChainGetFinalizedTipset through ChainGetTipSetV2::get_latest_finalized_tipset, unifying finalized tipset resolution logic and removing divergent F3 fallback logic.
Out of Scope Changes check ✅ Passed All changes are scoped to unifying finalized tipset logic: the handler delegation and removal of the private get_f3_finality_tipset helper are directly aligned with issue #6792 requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 hm/unify-logic-of-get-finalized-tipset
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hm/unify-logic-of-get-finalized-tipset

Comment @coderabbitai help to get the list of available commands and usage tips.

@hanabi1224 hanabi1224 marked this pull request as ready for review March 25, 2026 20:47
@hanabi1224 hanabi1224 requested a review from a team as a code owner March 25, 2026 20:47
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and akaladarshi and removed request for a team March 25, 2026 20:47
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@f34ffd1). Learn more about missing BASE report.
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/rpc/methods/chain.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/rpc/methods/chain.rs 53.18% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f34ffd1...a6cee81. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit 23bd46a Mar 26, 2026
41 of 66 checks passed
@LesnyRumcajs LesnyRumcajs deleted the hm/unify-logic-of-get-finalized-tipset branch March 26, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC requires calibnet RPC checks to run on CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: unify finalized tipset resolution between ChainGetFinalizedTipSet and ChainGetTipSetV2

2 participants