This repository was archived by the owner on Jan 16, 2026. It is now read-only.
chore(node/service): refactor node actor trait. take context out of the actor#2271
Merged
chore(node/service): refactor node actor trait. take context out of the actor#2271
Conversation
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:
|
clabby
reviewed
Jun 25, 2025
Contributor
clabby
left a comment
There was a problem hiding this comment.
I'm generally a fan of this pattern 😄
What do you think about adding builders for the ActorContext implementations, and instead passing the actor contexts directly into new (rather than all the channels?)
Right now, the new functions are still very bloated.
clabby
reviewed
Jun 25, 2025
clabby
reviewed
Jun 25, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jun 25, 2025
…ait (#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.
This was referenced Jun 25, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jun 26, 2025
## Description Small PR to refactor the process method out of the engine actor. See #2271 (comment)
matrix-rider609op
added a commit
to matrix-rider609op/kona
that referenced
this pull request
Sep 29, 2025
## Description Small PR to refactor the process method out of the engine actor. See op-rs/kona#2271 (comment)
aPTRDgvm5ui3dkEtFYWc
added a commit
to aPTRDgvm5ui3dkEtFYWc/kona
that referenced
this pull request
Oct 2, 2025
## Description Small PR to refactor the process method out of the engine actor. See op-rs/kona#2271 (comment)
theochap
added a commit
to ethereum-optimism/optimism
that referenced
this pull request
Dec 10, 2025
…he actor (op-rs/kona#2271) ## Description First attempt to decouple channel handling from the individual actors. This PR merely refactors the `NodeActor` trait to add a `Context` associated type that gets passed to the `start` method in the trait. I think from here we can make the structure simpler by: - Refactoring the `process` private methods into separate methods. That should remove the extra arguments for the `EngineActor` - Abstracting the actor building process behind the `new` methods of the individual actors. In particular, split up the context using inbound/outbound associated types and define channels inside the actor's `new` methods.
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
Dec 10, 2025
## Description Small PR to refactor the process method out of the engine actor. See op-rs/kona#2271 (comment)
theochap
added a commit
to ethereum-optimism/optimism
that referenced
this pull request
Jan 14, 2026
…he actor (op-rs/kona#2271) ## Description First attempt to decouple channel handling from the individual actors. This PR merely refactors the `NodeActor` trait to add a `Context` associated type that gets passed to the `start` method in the trait. I think from here we can make the structure simpler by: - Refactoring the `process` private methods into separate methods. That should remove the extra arguments for the `EngineActor` - Abstracting the actor building process behind the `new` methods of the individual actors. In particular, split up the context using inbound/outbound associated types and define channels inside the actor's `new` methods.
theochap
added a commit
to ethereum-optimism/optimism
that referenced
this pull request
Jan 14, 2026
## Description Small PR to refactor the process method out of the engine actor. See op-rs/kona#2271 (comment)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
First attempt to decouple channel handling from the individual actors. This PR merely refactors the
NodeActortrait to add aContextassociated type that gets passed to thestartmethod in the trait.I think from here we can make the structure simpler by:
processprivate methods into separate methods. That should remove the extra arguments for theEngineActornewmethods of the individual actors. In particular, split up the context using inbound/outbound associated types and define channels inside the actor'snewmethods.