Skip to content

Fix resolve_to_key in message pool to be reorg stable #6910

Merged
sudo-shashank merged 14 commits intomainfrom
shashank/fix-resolve-to-key-mpool
Apr 22, 2026
Merged

Fix resolve_to_key in message pool to be reorg stable #6910
sudo-shashank merged 14 commits intomainfrom
shashank/fix-resolve-to-key-mpool

Conversation

@sudo-shashank
Copy link
Copy Markdown
Contributor

@sudo-shashank sudo-shashank commented Apr 15, 2026

Summary of changes

Changes introduced in this pull request:

  • Resolve to deterministic address at finality, to ensure the resolved address is reorg-stable.

Reference issue to close (if applicable)

Closes #6891

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

Release Notes

  • Bug Fixes

    • Updated address resolution to respect chain finality window; addresses beyond the finality lookback window are now properly validated.
  • Tests

    • Added test coverage for address resolution with finality lookback behavior.

@sudo-shashank sudo-shashank added the RPC requires calibnet RPC checks to run on CI label Apr 15, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 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: 26c99b46-6449-4fed-84a5-b6550783c3eb

📥 Commits

Reviewing files that changed from the base of the PR and between dc748f6 and 9239e78.

📒 Files selected for processing (1)
  • src/message_pool/msgpool/provider.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/message_pool/msgpool/provider.rs

Walkthrough

This pull request implements finality-based address resolution in the message pool to improve reorg-safety, aligning with Lotus behavior. The resolve_to_key function now looks back to the finality epoch when resolving addresses beyond the configured finality window, and a comprehensive test validates this new behavior.

Changes

Cohort / File(s) Summary
Address Resolution Logic
src/message_pool/msgpool/provider.rs
Modified resolve_to_key to perform finality lookback when resolving addresses. Returns addresses unchanged for BLS, Secp256k1, and Delegated protocols; errors for Actor protocol; and computes a lookback tipset for other protocols when beyond the finality epoch. Updated imports to include ResolveNullTipset and protocol variants.
Test Suite Expansion
src/message_pool/msgpool/msg_pool.rs
Expanded #[cfg(test)] module imports with types for chain/state construction (RawBlockHeader, ChainStore, MemoryDB, ChainConfig). Added resolve_to_key_uses_finality_lookback test that validates lookback behavior using distinct state roots and finality configuration, and removed redundant local import from existing test.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • LesnyRumcajs
  • hanabi1224
🚥 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 'Fix resolve_to_key in message pool to be reorg stable' clearly and concisely describes the main change: making resolve_to_key reorg-stable, which aligns with the primary objective.
Linked Issues check ✅ Passed The PR fully implements the requirements from issue #6891: it resolves addresses at finality rather than at the tipset's parent state, ensures reorg-safety via deterministic resolution at the finality lookback, and aligns with Lotus behavior.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the objective: the provider.rs changes implement the finality-based resolution logic, and the test additions validate the new behavior with appropriate integration tests.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% 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 shashank/fix-resolve-to-key-mpool
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch shashank/fix-resolve-to-key-mpool

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

@sudo-shashank sudo-shashank marked this pull request as ready for review April 16, 2026 07:52
@sudo-shashank sudo-shashank requested a review from a team as a code owner April 16, 2026 07:52
@sudo-shashank sudo-shashank requested review from LesnyRumcajs and hanabi1224 and removed request for a team April 16, 2026 07:52
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 90.27778% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.60%. Comparing base (799007a) to head (9239e78).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/message_pool/msgpool/provider.rs 63.15% 5 Missing and 2 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/message_pool/msgpool/msg_pool.rs 89.45% <100.00%> (+0.80%) ⬆️
src/message_pool/msgpool/provider.rs 57.14% <63.15%> (+2.04%) ⬆️

... and 9 files with indirect coverage changes


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 799007a...9239e78. 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.

Comment thread src/message_pool/msgpool/msg_pool.rs
Comment thread src/message_pool/msgpool/provider.rs
@sudo-shashank sudo-shashank marked this pull request as draft April 21, 2026 10:30
@sudo-shashank sudo-shashank marked this pull request as ready for review April 22, 2026 01:02
@sudo-shashank sudo-shashank added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit b4dd6a2 Apr 22, 2026
85 of 88 checks passed
@sudo-shashank sudo-shashank deleted the shashank/fix-resolve-to-key-mpool branch April 22, 2026 08:15
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.

resolve_to_key in message pool should resolve at finality for reorg-safety

2 participants