Repository navigation
fix: head change publisher - #7485
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 (12)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
WalkthroughThe PR adds a thread-safe ChangesHead-change delivery
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change is merge-ready after normal checks and review; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant Client
participant chain_notify_inner
participant ChainStore
participant Publisher
Client->>chain_notify_inner: request chain notifications
chain_notify_inner->>ChainStore: subscribe before sampling current head
ChainStore-->>chain_notify_inner: return flume receiver
chain_notify_inner->>Client: send current head
Publisher-->>chain_notify_inner: deliver HeadChanges
chain_notify_inner->>Client: forward head changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
016f67e to
2af7f6f
Compare
2af7f6f to
ae3a4b3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files
... and 9 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Summary of changes
Changes introduced in this pull request:
tokio::broadcastwith a flume-based publisher. Each subscriber gets its own queue. This also made the consumer code more ergonomic. The change proposed in the linked issue wouldn't really help; it'd just push the loss elsewhere.ChainNotifysampled the current head the subscribed, then skipped the first head-change message. Not sure why this behavior was introduced in the first place, but it doesn't match Lotus (tested on live nodes). It now subscribes before sampling and forwards every change. Added some regression tests around it. Pretty sure it'd messcuriointegration.Reference issue to close (if applicable)
Closes #7442
Other information and links
Change checklist
Outside contributions
Summary by CodeRabbit
Bug Fixes
Improvements
newHeadssubscriptions to protect against slow clients.Documentation