feat(node/service): Introduce backpressure in DA watcher channels#2030
feat(node/service): Introduce backpressure in DA watcher channels#2030
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces backpressure within DA watcher channels by replacing unbounded mpsc channels with bounded ones and updating send operations to use asynchronous awaits.
- Changed channel types from unbounded to bounded (with a capacity of 16 or specified value) across multiple services and actors.
- Updated send-calls to use await to properly support backpressure in event propagation.
- Applied consistent mpsc type usage within validator, standard node service, and various actors (network, L1 watcher, engine, and derivation).
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/node/service/src/service/validator.rs | Replaced unbounded channels with bounded channels to enforce backpressure; updated function signature accordingly. |
| crates/node/service/src/service/standard/node.rs | Updated channel types to use bounded channels for improved flow control. |
| crates/node/service/src/actors/network.rs | Modified channel types for consistent bounded behavior in network actor. |
| crates/node/service/src/actors/l1_watcher_rpc.rs | Updated channel send calls to use await, aligning with bounded channel behavior. |
| crates/node/service/src/actors/engine/finalizer.rs | Changed channel type for finalized block updates from unbounded to bounded. |
| crates/node/service/src/actors/engine/actor.rs | Updated channel types to support backpressure within engine actor events. |
| crates/node/service/src/actors/derivation.rs | Modified channel types in derivation logic to use bounded channels. |
Comments suppressed due to low confidence (1)
crates/node/service/src/actors/l1_watcher_rpc.rs:186
- [nitpick] Ensure that awaiting on bounded channel sends does not introduce unintended bottlenecks if consumers are slow; consider reviewing consumer performance during peak activity.
self.head_sender.send(head_block_info).await?;
| let (new_head_tx, new_head_rx) = mpsc::channel(16); | ||
| let (new_finalized_tx, new_finalized_rx) = mpsc::channel(16); |
There was a problem hiding this comment.
[nitpick] Consider if the fixed channel capacity of 16 is adequate under peak load; making this capacity configurable might help improve resilience in variable workload conditions.
| let (new_head_tx, new_head_rx) = mpsc::channel(16); | |
| let (new_finalized_tx, new_finalized_rx) = mpsc::channel(16); | |
| let (new_head_tx, new_head_rx) = mpsc::channel(config.channel_capacity); | |
| let (new_finalized_tx, new_finalized_rx) = mpsc::channel(config.channel_capacity); |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dee4328 to
76eb769
Compare
76eb769 to
9ae9ef6
Compare
…-rs/kona#2030) ## Overview Introduces backpressure within the DA watcher channels. This change ensures that if the consumers of the DA watcher events (L1 {head/finalized} updates, unsafe block signer updates) do not process their events in a timely manner, the DA watcher doesn't endlessly fill up the channel queue, and yields until the other actors can process its pending updates. progress on op-rs/kona#1993
…-rs/kona#2030) ## Overview Introduces backpressure within the DA watcher channels. This change ensures that if the consumers of the DA watcher events (L1 {head/finalized} updates, unsafe block signer updates) do not process their events in a timely manner, the DA watcher doesn't endlessly fill up the channel queue, and yields until the other actors can process its pending updates. progress on #1993
Overview
Introduces backpressure within the DA watcher channels. This change ensures that if the consumers of the DA watcher events (L1 {head/finalized} updates, unsafe block signer updates) do not process their events in a timely manner, the DA watcher doesn't endlessly fill up the channel queue, and yields until the other actors can process its pending updates.
progress on #1993