Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote Rpc to a node component #10769

Closed
Tracked by #9554 ...
mattsse opened this issue Sep 7, 2024 · 3 comments
Closed
Tracked by #9554 ...

Promote Rpc to a node component #10769

mattsse opened this issue Sep 7, 2024 · 3 comments
Labels
A-rpc Related to the RPC implementation A-sdk Related to reth's use as a library S-needs-design This issue requires design work to think about how it would best be accomplished

Comments

@mattsse
Copy link
Collaborator

mattsse commented Sep 7, 2024

this part is slightly confusing:

/// Returns the builder for type.
pub trait BuilderProvider<N: FullNodeComponents>: Send {
/// Context required to build type.
type Ctx<'a>;
/// Returns builder for type.
#[allow(clippy::type_complexity)]
fn builder() -> Box<dyn for<'a> Fn(Self::Ctx<'a>) -> Self + Send>;
}
impl<N: FullNodeComponents> BuilderProvider<N> for () {
type Ctx<'a> = ();
fn builder() -> Box<dyn for<'a> Fn(Self::Ctx<'a>) -> Self + Send> {
Box::new(noop_builder)
}
}

this is more like a helper trait to create the ethapi component.

atm the rpc is not stateful:

/// Add-ons w.r.t. l1 ethereum.
#[derive(Debug, Clone)]
pub struct EthereumAddOns;
impl<N: FullNodeComponents> NodeAddOns<N> for EthereumAddOns {
type EthApi = EthApi<N::Provider, N::Pool, NetworkHandle, N::Evm>;
}

we should make this stateful similar to a trait RpcBuilder, like we do with:

type ComponentsBuilder = ComponentsBuilder<
N,
EthereumPoolBuilder,
EthereumPayloadBuilder,
EthereumNetworkBuilder,
EthereumExecutorBuilder,
EthereumConsensusBuilder,
>;

this way the rpc setup can be customized entirely, not only the ethapi part.

this also allows us to separate engine server setup from regular rpc.

First we can make the Addons stateful

@mattsse mattsse added S-needs-design This issue requires design work to think about how it would best be accomplished A-rpc Related to the RPC implementation labels Sep 7, 2024
@emhane
Copy link
Member

emhane commented Sep 9, 2024

ref #8987

Copy link
Contributor

This issue is stale because it has been open for 21 days with no activity.

@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Oct 17, 2024
@emhane emhane removed the S-stale This issue/PR is stale and will close with no further activity label Oct 17, 2024
@mattsse
Copy link
Collaborator Author

mattsse commented Oct 17, 2024

with #11532 we now have this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation A-sdk Related to reth's use as a library S-needs-design This issue requires design work to think about how it would best be accomplished
Projects
Archived in project
Development

No branches or pull requests

2 participants