Skip to content

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Nov 6, 2025

Summary of changes

During fork handling, is_ready_for_validation could return true for a tipset whose grandparent is validated but parent is not, which potentially causes a deadlock.

This will likely fix #6042 (comment)

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.

Summary by CodeRabbit

  • Refactor

    • Internal helper renamed; behavior and user-facing logic unchanged.
  • Documentation

    • Changelog updated to include the fix; duplicate entry placement corrected.
  • Chores

    • No user-visible changes or new functionality in this release.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

Renamed an internal helper in SyncStateMachine from is_validated to is_parent_validated in src/chain_sync/chain_follower.rs; logic unchanged and all internal call sites updated. Also added a changelog entry for PR 6235 in CHANGELOG.md.

Changes

Cohort / File(s) Change Summary
SyncStateMachine method rename
src/chain_sync/chain_follower.rs
Renamed internal helper is_validatedis_parent_validated; preserved logic (checks stateless_mode or parent_state presence); updated all internal callers.
Changelog updates
CHANGELOG.md
Added PR 6235 entry ("Fixed a potential deadlock in chain follower when handling fork(s)") in unreleased and Forest v0.30.2 "Garuda" sections (duplicate entries).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single, localized rename with consistent caller updates.
  • Minor documentation/changelog edits.

Files/areas to spot-check:

  • src/chain_sync/chain_follower.rs — ensure no external/public API break and tests/uses updated.
  • CHANGELOG.md — verify duplicate entries are intentional.

Suggested reviewers

  • elmattic
  • LesnyRumcajs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Linked Issues check ❓ Inconclusive The PR addresses a deadlock in fork handling by renaming is_validated to is_parent_validated, which aligns with fixing the root cause of desynchronization in issue #6042 but does not comprehensively address all stated objectives (future-dated blocks, state-root versions, F3 handling). Clarify whether this incremental deadlock fix is a complete solution to issue #6042 or a partial fix that requires additional changes to address all identified root causes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: fixing a potential deadlock in chain follower fork handling, which directly relates to the root cause identified in the PR description.
Out of Scope Changes check ✅ Passed All changes are focused on the deadlock issue: renaming the internal helper method and updating the CHANGELOG accordingly, with no unrelated modifications detected.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hm/potential-deadlock-in-fork-handling

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e39f2f and 10b0ae1.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: All lint checks
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: Build Ubuntu
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build MacOS
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: Check

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

@hanabi1224 hanabi1224 force-pushed the hm/potential-deadlock-in-fork-handling branch from da6fde3 to 0e39f2f Compare November 6, 2025 12:38
@hanabi1224 hanabi1224 marked this pull request as ready for review November 6, 2025 12:43
@hanabi1224 hanabi1224 requested a review from a team as a code owner November 6, 2025 12:43
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and sudo-shashank and removed request for a team November 6, 2025 12:43
LesnyRumcajs
LesnyRumcajs previously approved these changes Nov 6, 2025
Copy link
Member

@LesnyRumcajs LesnyRumcajs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog?

@hanabi1224
Copy link
Contributor Author

changelog?

@LesnyRumcajs updated

@hanabi1224 hanabi1224 added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit e31b3cb Nov 6, 2025
51 checks passed
@hanabi1224 hanabi1224 deleted the hm/potential-deadlock-in-fork-handling branch November 6, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Synchronization backwards cannot be restored

4 participants