Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

feat(node/service): Introduce backpressure in DA watcher channels#2030

Merged
clabby merged 1 commit intomainfrom
cl/da-watcher-backpressure
Jun 6, 2025
Merged

feat(node/service): Introduce backpressure in DA watcher channels#2030
clabby merged 1 commit intomainfrom
cl/da-watcher-backpressure

Conversation

@clabby
Copy link
Contributor

@clabby clabby commented Jun 6, 2025

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

@clabby clabby self-assigned this Jun 6, 2025
Copilot AI review requested due to automatic review settings June 6, 2025 13:10
@clabby clabby added K-feature Kind: feature A-node Area: cl node (eq. Go op-node) handles single-chain consensus labels Jun 6, 2025
@clabby clabby requested review from emhane and refcell as code owners June 6, 2025 13:10
@clabby clabby added the W-node Workstream: kona-node label Jun 6, 2025
@clabby clabby requested a review from theochap as a code owner June 6, 2025 13:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?;

Comment on lines +93 to +91
let (new_head_tx, new_head_rx) = mpsc::channel(16);
let (new_finalized_tx, new_finalized_rx) = mpsc::channel(16);
Copy link

Copilot AI Jun 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.1%. Comparing base (3bf631f) to head (9ae9ef6).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@clabby clabby force-pushed the cl/da-watcher-backpressure branch from dee4328 to 76eb769 Compare June 6, 2025 20:56
@clabby clabby force-pushed the cl/da-watcher-backpressure branch from 76eb769 to 9ae9ef6 Compare June 6, 2025 20:57
@clabby clabby enabled auto-merge June 6, 2025 20:57
@clabby clabby added this pull request to the merge queue Jun 6, 2025
Merged via the queue into main with commit e0375ed Jun 6, 2025
23 checks passed
@clabby clabby deleted the cl/da-watcher-backpressure branch June 6, 2025 21:22
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
…-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
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
…-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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A-node Area: cl node (eq. Go op-node) handles single-chain consensus K-feature Kind: feature W-node Workstream: kona-node

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants