Skip to content

fix(mpool): removing the applied tipset from pending store should advance with correct nonce#7180

Open
akaladarshi wants to merge 1 commit into
mainfrom
akaladarshi/mpool-rm-fix
Open

fix(mpool): removing the applied tipset from pending store should advance with correct nonce#7180
akaladarshi wants to merge 1 commit into
mainfrom
akaladarshi/mpool-rm-fix

Conversation

@akaladarshi

@akaladarshi akaladarshi commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Changes introduced in this pull request:

  • If tipset message is applied then while removing the message from the pending store we should advance the next sequence past the buffered successors (pending message sequence).

Reference issue to close (if applicable)

Closes #6974

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
    • Fixed an issue where the message pool incorrectly reported a pending nonce as the next sequence number after an applied message was removed. The system now properly advances past all consecutive pending messages when calculating the next available nonce.

@akaladarshi akaladarshi requested a review from a team as a code owner June 15, 2026 10:43
@akaladarshi akaladarshi requested review from LesnyRumcajs and hanabi1224 and removed request for a team June 15, 2026 10:43
@akaladarshi akaladarshi added the RPC requires calibnet RPC checks to run on CI label Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 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: 356e1469-c837-499b-a2dd-f8e6173a3e66

📥 Commits

Reviewing files that changed from the base of the PR and between 194e6c7 and e0b26ef.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/message_pool/msgpool/msg_set.rs
🔗 Linked repositories identified

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

  • filecoin-project/lotus (manual)

Walkthrough

The MsgSet::rm doc comment and inline comments are updated to clarify that the gap-filling loop runs after advancing next_sequence to sequence + 1 on applied removal. A regression test is added to assert next_sequence advances past consecutive pending successors. A changelog entry records the fix for issue #6974.

Changes

MsgSet::rm next_sequence gap-filling fix

Layer / File(s) Summary
rm doc comment and inline comment clarification
src/message_pool/msgpool/msg_set.rs
Updates the rm doc comment to state that next_sequence advances to sequence + 1 and then the gap-filling loop runs; adjusts inline comments in the applied-removal branch to describe advancing past the applied message and any consecutive pending successors.
Regression test for applied-removal gap-filling
src/message_pool/msgpool/msg_set.rs
Adds rm_applied_known_advances_past_pending_successors which initializes a MsgSet with a non-zero next_sequence, inserts gapped successors, calls rm(sequence, true), and asserts next_sequence advances past still-pending higher nonces.
Changelog entry
CHANGELOG.md
Adds a Fixed bullet under Forest unreleased for issue #6974 describing the message pool next-nonce reporting fix.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • ChainSafe/forest#6965: Introduced the MsgSet::rm implementation and next_sequence advancement logic that this PR's fix and regression test directly address.

Suggested reviewers

  • 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 title clearly and specifically describes the main fix: correcting the nonce advancement when removing applied tipset messages from the pending store.
Linked Issues check ✅ Passed The PR fully addresses the requirements from issue #6974 by implementing the gap-filling loop to advance past consecutive buffered successors when removing applied messages.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the nonce advancement bug in message pool removal; no out-of-scope modifications were introduced.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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 akaladarshi/mpool-rm-fix
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch akaladarshi/mpool-rm-fix

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

@LesnyRumcajs

Copy link
Copy Markdown
Member

no green checkmark, no review

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.

bug: MsgSet::rm() does not advance next_sequence past buffered successors on applied removal

3 participants