fix(mpool): resolve_to_key error handling#6890
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughConvert address-resolution failures in the message pool to debug-level logs and continue processing instead of returning errors; no public APIs or signatures changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
🧹 Nitpick comments (1)
src/message_pool/msgpool/mod.rs (1)
347-351: Nice resilience improvement in head-change removal path.This prevents
head_changefrom failing hard on a single address-resolution error and keeps processing moving.Optional: add a metric counter for skipped removals due to resolution failure, so this is visible even when debug logs are off.
Based on learnings: In Forest'shead_changefunction (src/message_pool/msgpool/mod.rs), re-resolvingmsg.from()at re-add time is intentional and matches Lotus behavior.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/message_pool/msgpool/mod.rs` around lines 347 - 351, The head-change removal now swallows address-resolution errors by using resolve_to_key(self.api, self.key_cache, from, self.ts).inspect_err(...) so removals continue; update the block around resolve_to_key/remove (symbols: resolve_to_key, remove, self.api, self.key_cache, from, self.ts, pending, sequence) to also increment a metric counter when resolution fails (e.g., a skipped_removals or head_change_resolve_fail counter) and keep the existing tracing::debug log—i.e., on Err path call the metric increment before returning/continuing, and on Ok continue to call remove(&resolved, self.pending, sequence, true)?.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/message_pool/msgpool/mod.rs`:
- Around line 347-351: The head-change removal now swallows address-resolution
errors by using resolve_to_key(self.api, self.key_cache, from,
self.ts).inspect_err(...) so removals continue; update the block around
resolve_to_key/remove (symbols: resolve_to_key, remove, self.api,
self.key_cache, from, self.ts, pending, sequence) to also increment a metric
counter when resolution fails (e.g., a skipped_removals or
head_change_resolve_fail counter) and keep the existing tracing::debug log—i.e.,
on Err path call the metric increment before returning/continuing, and on Ok
continue to call remove(&resolved, self.pending, sequence, true)?.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 890f9f73-6dbb-4a53-a8bd-0d80aa5d55fb
📒 Files selected for processing (2)
src/message_pool/msgpool/mod.rssrc/message_pool/msgpool/msg_pool.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
ad1d4fa to
b727d5f
Compare
Summary of changes
Changes introduced in this pull request:
resolve_to_keyfails.Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Outside contributions
Summary by CodeRabbit
Bug Fixes
Refactor