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

chore: add PayloadBuilder to RpcNodeCore #12428

Merged
merged 2 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/optimism/rpc/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ where
type Pool = N::Pool;
type Evm = <N as RpcNodeCore>::Evm;
type Network = <N as RpcNodeCore>::Network;
type PayloadBuilder = ();

#[inline]
fn pool(&self) -> &Self::Pool {
Expand All @@ -137,6 +138,11 @@ where
self.inner.network()
}

#[inline]
fn payload_builder(&self) -> &Self::PayloadBuilder {
&()
}

#[inline]
fn provider(&self) -> &Self::Provider {
self.inner.provider()
Expand Down
12 changes: 12 additions & 0 deletions crates/rpc/rpc-eth-api/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ pub trait RpcNodeCore: Clone + Send + Sync {
/// Network API.
type Network: Send + Sync + Clone;

/// Builds new blocks.
type PayloadBuilder: Send + Sync + Clone;

/// Returns the transaction pool of the node.
fn pool(&self) -> &Self::Pool;

Expand All @@ -28,6 +31,9 @@ pub trait RpcNodeCore: Clone + Send + Sync {
/// Returns the handle to the network
fn network(&self) -> &Self::Network;

/// Returns the handle to the payload builder service.
fn payload_builder(&self) -> &Self::PayloadBuilder;

/// Returns the provider of the node.
fn provider(&self) -> &Self::Provider;
}
Expand All @@ -40,6 +46,7 @@ where
type Pool = T::Pool;
type Evm = <T as FullNodeComponents>::Evm;
type Network = <T as FullNodeComponents>::Network;
type PayloadBuilder = <T as FullNodeComponents>::PayloadBuilder;

#[inline]
fn pool(&self) -> &Self::Pool {
Expand All @@ -56,6 +63,11 @@ where
FullNodeComponents::network(self)
}

#[inline]
fn payload_builder(&self) -> &Self::PayloadBuilder {
FullNodeComponents::payload_builder(self)
}

#[inline]
fn provider(&self) -> &Self::Provider {
FullNodeComponents::provider(self)
Expand Down
5 changes: 5 additions & 0 deletions crates/rpc/rpc/src/eth/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ where
type Pool = Pool;
type Evm = EvmConfig;
type Network = Network;
type PayloadBuilder = ();

fn pool(&self) -> &Self::Pool {
self.inner.pool()
Expand All @@ -164,6 +165,10 @@ where
self.inner.network()
}

fn payload_builder(&self) -> &Self::PayloadBuilder {
&()
}

fn provider(&self) -> &Self::Provider {
self.inner.provider()
}
Expand Down
Loading