fix: node crashing on lagged events and log actor nonce errors#7020
fix: node crashing on lagged events and log actor nonce errors#7020akaladarshi merged 3 commits intomainfrom
Conversation
WalkthroughHead-change subscription and message processing now explicitly handle receive errors and state lookup failures across the indexer daemon and message pool, replacing error propagation with graceful logging and continuation for lag events and state sequence lookup failures. ChangesHead-change Error Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/daemon/mod.rs (1)
620-625: ⚡ Quick winAdd error context to indexer processing failures.
These
?propagations lose tipset-specific context, which makes service-failure triage harder.🔧 Suggested patch
- let delegated_messages = chain_store - .headers_delegated_messages(ts.block_headers().iter())?; - chain_store.process_signed_messages(&delegated_messages)?; + let delegated_messages = chain_store + .headers_delegated_messages(ts.block_headers().iter()) + .with_context(|| { + format!( + "indexer: failed to load delegated messages for tipset {}", + ts.key() + ) + })?; + chain_store + .process_signed_messages(&delegated_messages) + .with_context(|| { + format!( + "indexer: failed to process signed messages for tipset {}", + ts.key() + ) + })?;As per coding guidelines: "Use
anyhow::Result<T>for most operations and add context with.context()when errors occur".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/daemon/mod.rs` around lines 620 - 625, The current loop over changes.applies uses fallible calls chain_store.headers_delegated_messages(...) and chain_store.process_signed_messages(...) with plain `?`, losing tipset context; update both calls to use anyhow::Context (e.g., .context(...) or .with_context(...)) to append tipset-specific information (use ts.key()) to the error messages so failures include which tipset failed, and ensure anyhow::Context is imported; locate the block iterating `for ts in changes.applies` and change the two calls to add contextual messages referencing `ts.key()` for easier triage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/message_pool/msgpool/mod.rs`:
- Around line 309-315: The debug log in the Err branch of
mpool_ctx.get_state_sequence(state_nonce_cache, &msg.from()) omits message
identity, making dropped reorg messages hard to trace; change the tracing::debug
call inside the Err(e) arm to include the message sender and CID (use msg.from()
and msg.cid() or the appropriate CID accessor on msg) along with the error so
the log reads something like "Failed to get the state sequence for msg from {}
cid {}: {}", then continue as before.
---
Nitpick comments:
In `@src/daemon/mod.rs`:
- Around line 620-625: The current loop over changes.applies uses fallible calls
chain_store.headers_delegated_messages(...) and
chain_store.process_signed_messages(...) with plain `?`, losing tipset context;
update both calls to use anyhow::Context (e.g., .context(...) or
.with_context(...)) to append tipset-specific information (use ts.key()) to the
error messages so failures include which tipset failed, and ensure
anyhow::Context is imported; locate the block iterating `for ts in
changes.applies` and change the two calls to add contextual messages referencing
`ts.key()` for easier triage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 607c7846-20fb-4377-b3c2-ec40e1312043
📒 Files selected for processing (3)
src/daemon/mod.rssrc/message_pool/msgpool/mod.rssrc/message_pool/msgpool/msg_pool.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Summary of changes
Changes introduced in this pull request:
head_changeget state nonce instead of erroring out and continue to apply rest of the message:Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Outside contributions
Summary by CodeRabbit