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

chore(node/service): refactor and simplify the RollupNodeService trait#2284

Merged
theochap merged 1 commit intomainfrom
theo/improve-traits-2
Jun 25, 2025
Merged

chore(node/service): refactor and simplify the RollupNodeService trait#2284
theochap merged 1 commit intomainfrom
theo/improve-traits-2

Conversation

@theochap
Copy link
Member

Description

This PR builds up on the changes introduced by #2271 to simplify/unify further the structure of the node service crates. In particular this PR:

  • Adds two associated types to the NodeActor trait. OutboundData and State which are used to specify a new build method for the actor that aims to replace single calls of the new methods. The build method has the following signature:
fn build(initial_state: Self::State) -> (Self::OutboundData, Self);
  • Takes out the output channels from the ActorContext back into the Actor struct. This allows to drastically reduce the number of arguments to provide to the build methods and remove the need to define channels inside the implementation of the RollupNodeService trait. Instead this is done inside the NodeActor themselves
  • Add an associated type to the RollupNodeService for each actor and call the build methods from the associated types. That will make it much easier to have a modular architecture where we can easily swap out components if needed

Follow-ups

Most of the heavy lifting is done in this PR, but I would like to do some quick follow-ups to refactor/simplify/improve the inner structure of actors even further.
We should also think about which types we want to expose to the public api and try to cut down the number of public exports in our libraries.

@theochap theochap self-assigned this Jun 25, 2025
@theochap theochap added K-chore Kind: chore A-node Area: cl node (eq. Go op-node) handles single-chain consensus labels Jun 25, 2025
@theochap theochap moved this to In Review in Project Tracking Jun 25, 2025
@codecov
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 81.3%. Comparing base (83ae526) to head (2717d48).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/node/rpc/src/rollup.rs 0.0% 5 Missing ⚠️

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

Copy link
Contributor

@clabby clabby left a comment

Choose a reason for hiding this comment

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

Really like this, nice work.

Follow-up items that'd be really nice are:

  1. Removing the *Launcher patterns entirely
  2. Removing process methods + Inbound<Actor>Message enums, splitting up action dispatch.

@theochap theochap force-pushed the theo/improve-traits-2 branch 2 times, most recently from e63f065 to 6a007b2 Compare June 25, 2025 15:06
@theochap theochap changed the base branch from theo/improve-traits to main June 25, 2025 15:29
@theochap theochap added this pull request to the merge queue Jun 25, 2025
@theochap theochap removed this pull request from the merge queue due to a manual request Jun 25, 2025
@theochap theochap force-pushed the theo/improve-traits-2 branch from 6a007b2 to 645155f Compare June 25, 2025 15:31
@theochap theochap enabled auto-merge June 25, 2025 15:31
@theochap theochap force-pushed the theo/improve-traits-2 branch from 645155f to 2717d48 Compare June 25, 2025 15:38
@theochap theochap added this pull request to the merge queue Jun 25, 2025
Merged via the queue into main with commit 65eafcc Jun 25, 2025
24 of 25 checks passed
@theochap theochap deleted the theo/improve-traits-2 branch June 25, 2025 16:06
@github-project-automation github-project-automation bot moved this from In Review to Done in Project Tracking Jun 25, 2025
theochap added a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
…ait (op-rs/kona#2284)

## Description

This PR builds up on the changes introduced by op-rs/kona#2271 to simplify/unify
further the structure of the node service crates. In particular this PR:

- Adds two associated types to the `NodeActor` trait. `OutboundData` and
`State` which are used to specify a new build method for the actor that
aims to replace single calls of the `new` methods. The build method has
the following signature:
```
fn build(initial_state: Self::State) -> (Self::OutboundData, Self);
```

- Takes out the output channels from the `ActorContext` back into the
`Actor` struct. This allows to drastically reduce the number of
arguments to provide to the `build` methods and remove the need to
define channels inside the implementation of the `RollupNodeService`
trait. Instead this is done inside the `NodeActor` themselves
- Add an associated type to the `RollupNodeService` for each actor and
call the build methods from the associated types. That will make it much
easier to have a modular architecture where we can easily swap out
components if needed

## Follow-ups

Most of the heavy lifting is done in this PR, but I would like to do
some quick follow-ups to refactor/simplify/improve the inner structure
of actors even further.
We should also think about which types we want to expose to the public
api and try to cut down the number of public exports in our libraries.
theochap added a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
…ait (op-rs/kona#2284)

## Description

This PR builds up on the changes introduced by #2271 to simplify/unify
further the structure of the node service crates. In particular this PR:

- Adds two associated types to the `NodeActor` trait. `OutboundData` and
`State` which are used to specify a new build method for the actor that
aims to replace single calls of the `new` methods. The build method has
the following signature:
```
fn build(initial_state: Self::State) -> (Self::OutboundData, Self);
```

- Takes out the output channels from the `ActorContext` back into the
`Actor` struct. This allows to drastically reduce the number of
arguments to provide to the `build` methods and remove the need to
define channels inside the implementation of the `RollupNodeService`
trait. Instead this is done inside the `NodeActor` themselves
- Add an associated type to the `RollupNodeService` for each actor and
call the build methods from the associated types. That will make it much
easier to have a modular architecture where we can easily swap out
components if needed

## Follow-ups

Most of the heavy lifting is done in this PR, but I would like to do
some quick follow-ups to refactor/simplify/improve the inner structure
of actors even further.
We should also think about which types we want to expose to the public
api and try to cut down the number of public exports in our libraries.
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-chore Kind: chore

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants