Skip to content

fix: RPC cache prefilling for eth pending tag#7165

Merged
hanabi1224 merged 1 commit into
mainfrom
hm/fix-rpc-cache-prefill
Jun 11, 2026
Merged

fix: RPC cache prefilling for eth pending tag#7165
hanabi1224 merged 1 commit into
mainfrom
hm/fix-rpc-cache-prefill

Conversation

@hanabi1224

@hanabi1224 hanabi1224 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

The validated tipset key might be expanded before updating chain head, we should warm up with the expanded key or eth pending tipset might not be warmed up

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

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

  • Bug Fixes
    • Corrected the validated tipset broadcast during chain synchronization to ensure consistent use of the current heaviest tipset information, improving alignment in head-key expansion scenarios.

@hanabi1224 hanabi1224 added the RPC requires calibnet RPC checks to run on CI label Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: dfa9b180-0446-4e97-9fd7-7df92be128a6

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1f7e6 and 39518c3.

📒 Files selected for processing (1)
  • src/chain_sync/chain_follower.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • filecoin-project/lotus (manual)

Walkthrough

The change modifies SyncStateMachine::update to broadcast the heaviest tipset key from the chain store rather than the validated tipset key to validated_tipset_broadcast_tx subscribers, aligning the broadcast with any head-key expansion when the validated tipset is the proposed head.

Changes

Validated Tipset Broadcast Key

Layer / File(s) Summary
Broadcast heaviest tipset key instead of validated tipset key
src/chain_sync/chain_follower.rs
SyncStateMachine::update broadcasts self.cs.heaviest_tipset().key().clone() instead of the validated tipset.key() to subscribers, maintaining subscription checks and error handling while aligning with head-key expansion logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • ChainSafe/forest#7068: Both PRs modify src/chain_sync/chain_follower.rs to change how validated_tipset_broadcast_tx/SyncStateMachine::update selects and emits the validated_tipset key to subscribers (this PR adjusts the heaviest-key used; related PR adds/conditions the broadcast itself).

Suggested reviewers

  • LesnyRumcajs
  • akaladarshi
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title mentions 'RPC cache prefilling for eth pending tag', but the actual changes focus on broadcasting the validated tipset using the current heaviest tipset key from the chain store rather than the key from the tipset being validated. Update the title to accurately reflect that the fix addresses tipset key expansion in chain sync validation, not specifically RPC cache prefilling. For example: 'fix: use expanded tipset key when broadcasting validated tipset' or 'fix: broadcast tipset with current heaviest chain key for proper head expansion handling'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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/fix-rpc-cache-prefill
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hm/fix-rpc-cache-prefill

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

@hanabi1224 hanabi1224 marked this pull request as ready for review June 11, 2026 09:12
@hanabi1224 hanabi1224 requested a review from a team as a code owner June 11, 2026 09:12
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and akaladarshi and removed request for a team June 11, 2026 09:12
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.32%. Comparing base (2c1f7e6) to head (39518c3).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/chain_sync/chain_follower.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/chain_sync/chain_follower.rs 33.62% <0.00%> (+0.04%) ⬆️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c1f7e6...39518c3. 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.

@hanabi1224 hanabi1224 enabled auto-merge June 11, 2026 09:36
@hanabi1224 hanabi1224 added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit a340717 Jun 11, 2026
40 of 62 checks passed
@hanabi1224 hanabi1224 deleted the hm/fix-rpc-cache-prefill branch June 11, 2026 09:56
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.

2 participants