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(rpc): remove use of extensible transaction + receipt types #9774

Merged
merged 114 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 113 commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
64777ff
Add EthApiTypes with error as AT and helper traits for conversion fro…
emhane Jul 17, 2024
2f9b4d4
Make it possible to reference EthApiTypes via EthApiServer helper traits
emhane Jul 18, 2024
494b3d9
Fix rpc API impls
emhane Jul 18, 2024
e05fd6f
Merge branch 'main' into emhane/rpc-error
emhane Jul 18, 2024
916e509
Fix OpEthApi impl
emhane Jul 18, 2024
f1d02a7
Merge branch 'main' into emhane/rpc-error
emhane Jul 24, 2024
09a4192
Merge branch 'main' into emhane/rpc-error
emhane Jul 24, 2024
20fae32
Extend EthApiTypes with alloy_network::Network AT
emhane Jul 24, 2024
ade6b8f
Merge branch 'emhane/rpc-error' into emhane/ethapi-types
emhane Jul 24, 2024
8a631dc
Merge branch 'main' into emhane/ethapi-types
emhane Jul 26, 2024
83bd53b
Import OP rpc types from op-alloy-network
emhane Jul 26, 2024
ad29246
Rename EthApiTypes::Types to EthApiTypes::NetworkTypes
emhane Jul 26, 2024
6bd0f60
Remove optimism feature from reth-rpc-types-compat lib
emhane Jul 26, 2024
e248a65
Incorporate TransactionBuilder into EthTransactions
emhane Jul 26, 2024
624e938
Revert unrelated change
emhane Jul 27, 2024
91ace3a
Fix conflicts from making rpc comapt generic over network for transac…
emhane Jul 27, 2024
c506e8e
Add trait for building rpc block response
emhane Jul 27, 2024
0860e1c
Add adapter for network type builders to EthApi and OpEthApi
emhane Jul 27, 2024
f48038e
Fix conflicts, resp ty has non-unique builder
emhane Jul 29, 2024
91fe6e0
Merge branch 'main' into emhane/ethapi-types
emhane Aug 1, 2024
b052000
Add generics to EthApi trait that are compatible with jsonrpsee
emhane Aug 1, 2024
359eae7
Add temp constraint Network::TransactionResponse = reth_rpc_types::Tr…
emhane Aug 1, 2024
e12d811
Replace EthFilterApi and EthPubSubApi generics with jsonrpsee compati…
emhane Aug 1, 2024
fa58787
Fix lint
emhane Aug 1, 2024
ce48b0f
Merge branch 'main' into emhane/ethapi-types
emhane Aug 2, 2024
4e1d95f
Remove redundant trait bounds
emhane Aug 2, 2024
d859c5e
Flatten trait ResponseTypeBuilders into EthApiTypes
emhane Aug 2, 2024
b733699
Remove duplicate file
emhane Aug 2, 2024
179bd6b
Add noop impl for EthApiTypes
emhane Aug 2, 2024
626c877
Add EthApiTypes trait bounds to node builder
emhane Aug 2, 2024
f24dee5
fixup! Flatten trait ResponseTypeBuilders into EthApiTypes
emhane Aug 2, 2024
34c56e6
Fix tests
emhane Aug 2, 2024
fe0297f
Fix optimism crates
emhane Aug 2, 2024
f7c7206
Set explicit Ethereum network for reth_e2e_test_utils::TransactionTes…
emhane Aug 2, 2024
75ff7da
Fix docs
emhane Aug 2, 2024
de9f909
Merge branch 'main' into emhane/ethapi-types
emhane Aug 3, 2024
43f6808
Remove redundant autotrait impls for EthApi
emhane Aug 3, 2024
57995de
Remove redundant attribute
emhane Aug 3, 2024
b62ec37
Make generic naming unfiorm
emhane Aug 3, 2024
7e11a17
Merge branch 'main' into emhane/ethapi-types
emhane Aug 5, 2024
1cb4f44
Merge branch 'main' into emhane/ethapi-types
emhane Aug 5, 2024
a499898
Merge branch 'main' into emhane/ethapi-types
emhane Aug 8, 2024
7121475
Merge branch 'main' into emhane/ethapi-types
emhane Aug 14, 2024
474367c
Merge branch 'main' into emhane/ethapi-types
emhane Aug 15, 2024
1b8197f
Remove trait bound TransactionBuilder on EthApiTypes::TransationBuilder
emhane Aug 15, 2024
61ce9bf
Merge branch 'main' into emhane/ethapi-types
emhane Aug 20, 2024
a186867
fixup! Remove trait bound TransactionBuilder on EthApiTypes::Transati…
emhane Aug 20, 2024
a784b7a
Fix lint
emhane Aug 20, 2024
856f37e
Rename TransactionBuilder to TransactionCompat
emhane Aug 20, 2024
9d911bb
Rename BlockBuilder to BlockCompat
emhane Aug 21, 2024
2bb8a75
Delay trait bound for EthApiTypes::BlockCompat
emhane Aug 21, 2024
e5b47e8
Merge branch 'main' into emhane/ethapi-types
emhane Aug 21, 2024
b6a2cc9
Remove EthApiTypes::BlockCompat
emhane Aug 21, 2024
9705100
Fix lint
emhane Aug 21, 2024
729716e
Merge branch 'emhane/fix-lint' into emhane/ethapi-types
emhane Aug 21, 2024
a5d95bd
Fix lint
emhane Aug 21, 2024
16cc68e
Fix docs
emhane Aug 21, 2024
a0a2f35
Checkout EthApiTypes::NetworkTypes from emhane/ethapi-types
emhane Aug 21, 2024
e991d9e
Merge branch 'emhane/ethapi-networktypes' into emhane/ethapi-types
emhane Aug 21, 2024
2d6d702
Shrink scope of TransactionCompat trait
emhane Aug 21, 2024
443e9b2
Rename reth_rpc_eth_api::Transaction to RpcTransaction
emhane Aug 22, 2024
fe2bf75
Move crates/rpc/rpc-eth-api/src/helpers/types.rs up one dir
emhane Aug 22, 2024
02b38c7
Update docs
emhane Aug 22, 2024
689c67c
Merge branch 'main' into emhane/ethapi-networktypes
emhane Aug 22, 2024
46bad2e
Fix lint
emhane Aug 22, 2024
d50649e
Merge branch 'emhane/ethapi-networktypes' into emhane/ethapi-types
emhane Aug 22, 2024
64facc7
Merge branch 'main' into emhane/ethapi-types
emhane Aug 22, 2024
5e09011
Revert unrelated change
emhane Aug 22, 2024
148d4e3
Fix lint
emhane Aug 22, 2024
406848d
Merge branch 'main' into emhane/ethapi-types
emhane Aug 24, 2024
145b71d
Merge branch 'main' into emhane/ethapi-types
emhane Sep 6, 2024
07f2e9f
Fix merge conflicts
emhane Sep 6, 2024
cc4dddc
Merge branch 'main' into emhane/ethapi-types
emhane Sep 8, 2024
2dff25a
Fix merge conflicts
emhane Sep 8, 2024
963dab3
Define type reth_optimism_rpc::OpReceiptBuilder
emhane Sep 9, 2024
4ff2ab2
Merge branch 'emhane/op-receipt' into emhane/ethapi-types
emhane Sep 9, 2024
ecddc97
Move EthBlocks::block_receipts default impl to impl for EthApi
emhane Sep 9, 2024
a0b5cfd
Move LoadReceipt::build_transaction_receipt default impl to impl for …
emhane Sep 9, 2024
2d735fa
Merge branch 'emhane/mv-block-receipts' into emhane/ethapi-types
emhane Sep 9, 2024
7d53b1b
Merge branch 'emhane/mv-build-tx-receipt' into emhane/ethapi-types
emhane Sep 9, 2024
b6ad116
Merge branch 'main' into emhane/ethapi-types
emhane Sep 11, 2024
30bd98e
Fix merge conflicts
emhane Sep 11, 2024
00c5adc
Merge branch 'main' into emhane/ethapi-types
emhane Sep 11, 2024
3187093
Merge branch 'main' into emhane/ethapi-types
emhane Sep 11, 2024
79de341
Revert formatting changes
emhane Sep 11, 2024
604df14
Add helper trait FullEthApiTypes linking EthApiTypes::NetworkTypes to…
emhane Sep 11, 2024
68d5c9a
Fix merge conflicts
emhane Sep 11, 2024
3841450
Revert formatting changes
emhane Sep 11, 2024
1756510
Revert formatting changes
emhane Sep 11, 2024
3c1b2cd
Revert bad formatting changes
emhane Sep 11, 2024
472a338
Remove redundant trait bound on RPC transaction response type
emhane Sep 11, 2024
509939f
Bump deps
emhane Sep 13, 2024
fd4d588
Merge branch 'emhane/bump-deps' into emhane/ethapi-types
emhane Sep 13, 2024
dd61e57
Fix lint
emhane Sep 13, 2024
769fb0a
Merge branch 'main' into emhane/ethapi-types
emhane Sep 16, 2024
237a78a
Fix conflicts eth filter API
emhane Sep 16, 2024
461e7a7
Fix conflicts eth pubsub API
emhane Sep 16, 2024
89ba917
Fix conflicts rpc builder
emhane Sep 16, 2024
011b80b
Fix conflicts tx pool API
emhane Sep 16, 2024
87f8f51
Fix conflicts otterscan API
emhane Sep 16, 2024
15112eb
Fix conflicts optimism
emhane Sep 16, 2024
4794fd4
Fix lint
emhane Sep 16, 2024
a430d61
Fix lint
emhane Sep 16, 2024
e51f52a
Remove completed todos
emhane Sep 16, 2024
67d4ba8
Revert unrelated changes
emhane Sep 16, 2024
a3c203b
Merge branch 'main' into emhane/ethapi-types
emhane Sep 18, 2024
d24e7f5
Merge branch 'main' into emhane/ethapi-types
emhane Sep 18, 2024
9ccf619
Update docs
emhane Sep 19, 2024
dc7d4d1
Add lost code comment
emhane Sep 19, 2024
a625312
Add todo
emhane Sep 19, 2024
5555173
Merge branch 'main' into emhane/ethapi-types
emhane Sep 19, 2024
614cb7f
Fix merge conflicts
emhane Sep 19, 2024
2c6bb1d
Fix merge conflicts
emhane Sep 19, 2024
16dc6df
Merge branch 'main' into emhane/ethapi-types
emhane Sep 20, 2024
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
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions crates/e2e-test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

use std::sync::Arc;

use alloy_network::Network;
use node::NodeTestContext;
use reth::{
args::{DiscoveryArgs, NetworkArgs, RpcServerArgs},
builder::{NodeBuilder, NodeConfig, NodeHandle},
network::PeersHandleProvider,
rpc::{
api::eth::{helpers::AddDevSigners, FullEthApiServer},
types::AnyTransactionReceipt,
},
rpc::api::eth::{helpers::AddDevSigners, FullEthApiServer},
tasks::TaskManager,
};
use reth_chainspec::ChainSpec;
Expand Down Expand Up @@ -62,13 +58,7 @@ where
>,
N::AddOns: NodeAddOns<
Adapter<N>,
EthApi: FullEthApiServer<
NetworkTypes: Network<
TransactionResponse = reth_rpc_types::WithOtherFields<reth_rpc_types::Transaction>,
ReceiptResponse = AnyTransactionReceipt,
>,
> + AddDevSigners
+ EthApiBuilderProvider<Adapter<N>>,
EthApi: FullEthApiServer + AddDevSigners + EthApiBuilderProvider<Adapter<N>>,
>,
{
let tasks = TaskManager::current();
Expand Down
20 changes: 8 additions & 12 deletions crates/e2e-test-utils/src/node.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{marker::PhantomData, pin::Pin};

use alloy_network::Network;
use alloy_primitives::{BlockHash, BlockNumber, Bytes, B256};
use alloy_rpc_types::BlockNumberOrTag;
use eyre::Ok;
Expand All @@ -11,13 +10,15 @@ use reth::{
network::PeersHandleProvider,
providers::{BlockReader, BlockReaderIdExt, CanonStateSubscriptions, StageCheckpointReader},
rpc::{
api::eth::helpers::{EthApiSpec, EthTransactions, TraceExt},
types::{engine::PayloadStatusEnum, AnyTransactionReceipt},
api::eth::{
helpers::{EthApiSpec, EthTransactions, TraceExt},
FullEthApiTypes,
},
types::engine::PayloadStatusEnum,
},
};
use reth_chainspec::ChainSpec;
use reth_node_builder::{EthApiTypes, NodeAddOns, NodeTypesWithEngine};
use reth_rpc_types::WithOtherFields;
use reth_node_builder::{NodeAddOns, NodeTypesWithEngine};
use reth_stages_types::StageId;
use tokio_stream::StreamExt;

Expand Down Expand Up @@ -87,13 +88,8 @@ where
attributes_generator: impl Fn(u64) -> Engine::PayloadBuilderAttributes + Copy,
) -> eyre::Result<Vec<(Engine::BuiltPayload, Engine::PayloadBuilderAttributes)>>
where
<Engine as EngineTypes>::ExecutionPayloadV3:
From<Engine::BuiltPayload> + PayloadEnvelopeExt,
AddOns::EthApi: EthApiSpec + EthTransactions + TraceExt,
<AddOns::EthApi as EthApiTypes>::NetworkTypes: Network<
TransactionResponse = WithOtherFields<alloy_rpc_types::Transaction>,
ReceiptResponse = AnyTransactionReceipt,
>,
Engine::ExecutionPayloadV3: From<Engine::BuiltPayload> + PayloadEnvelopeExt,
AddOns::EthApi: EthApiSpec + EthTransactions + TraceExt + FullEthApiTypes,
{
let mut chain = Vec::with_capacity(length as usize);
for i in 0..length {
Expand Down
11 changes: 2 additions & 9 deletions crates/e2e-test-utils/src/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_consensus::TxEnvelope;
use alloy_network::{eip2718::Decodable2718, Network};
use alloy_network::eip2718::Decodable2718;
use alloy_primitives::{Bytes, B256};
use reth::{
builder::{rpc::RpcRegistry, FullNodeComponents},
Expand All @@ -10,7 +10,6 @@ use reth::{
};
use reth_chainspec::ChainSpec;
use reth_node_builder::{EthApiTypes, NodeTypes};
use reth_rpc_types::{AnyTransactionReceipt, WithOtherFields};

#[allow(missing_debug_implementations)]
pub struct RpcTestContext<Node: FullNodeComponents, EthApi: EthApiTypes> {
Expand All @@ -20,13 +19,7 @@ pub struct RpcTestContext<Node: FullNodeComponents, EthApi: EthApiTypes> {
impl<Node, EthApi> RpcTestContext<Node, EthApi>
where
Node: FullNodeComponents<Types: NodeTypes<ChainSpec = ChainSpec>>,
EthApi: EthApiSpec
+ EthTransactions<
NetworkTypes: Network<
TransactionResponse = WithOtherFields<alloy_rpc_types::Transaction>,
ReceiptResponse = AnyTransactionReceipt,
>,
> + TraceExt,
EthApi: EthApiSpec + EthTransactions + TraceExt,
{
/// Injects a raw transaction into the node tx pool via RPC server
pub async fn inject_tx(&self, raw_tx: Bytes) -> Result<B256, EthApi::Error> {
Expand Down
1 change: 0 additions & 1 deletion crates/node/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ reth-tracing.workspace = true
reth-transaction-pool.workspace = true

## ethereum
alloy-network.workspace = true
alloy-primitives.workspace = true

## async
Expand Down
21 changes: 4 additions & 17 deletions crates/node/builder/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
pub mod add_ons;
mod states;

use reth_rpc_types::WithOtherFields;
pub use states::*;

use std::sync::Arc;
Expand All @@ -30,10 +29,7 @@ use reth_node_core::{
dirs::{ChainPath, DataDirPath},
node_config::NodeConfig,
primitives::Head,
rpc::{
eth::{helpers::AddDevSigners, FullEthApiServer},
types::AnyTransactionReceipt,
},
rpc::eth::{helpers::AddDevSigners, FullEthApiServer},
};
use reth_primitives::revm_primitives::EnvKzgSettings;
use reth_provider::{providers::BlockchainProvider, ChainSpecProvider, FullProvider};
Expand Down Expand Up @@ -346,12 +342,7 @@ where
<N::ComponentsBuilder as NodeComponentsBuilder<RethFullAdapter<DB, N>>>::Components,
>
>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
ReceiptResponse = AnyTransactionReceipt,
>,
>
+ FullEthApiServer
+ AddDevSigners
>,
{
Expand Down Expand Up @@ -497,12 +488,8 @@ where
AO: NodeAddOns<
NodeAdapter<RethFullAdapter<DB, T>, CB::Components>,
EthApi: EthApiBuilderProvider<NodeAdapter<RethFullAdapter<DB, T>, CB::Components>>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
ReceiptResponse = AnyTransactionReceipt,
>,
> + AddDevSigners,
+ FullEthApiServer
+ AddDevSigners,
>,
{
/// Launches the node with the [`DefaultNodeLauncher`] that sets up engine API consensus and rpc
Expand Down
15 changes: 4 additions & 11 deletions crates/node/builder/src/launch/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ use reth_node_core::{
dirs::{ChainPath, DataDirPath},
exit::NodeExitFuture,
primitives::Head,
rpc::{
eth::{helpers::AddDevSigners, FullEthApiServer},
types::AnyTransactionReceipt,
},
rpc::eth::{helpers::AddDevSigners, FullEthApiServer},
version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA},
};
use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
use reth_provider::providers::BlockchainProvider2;
use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi};
use reth_rpc_types::{engine::ClientVersionV1, WithOtherFields};
use reth_rpc_types::engine::ClientVersionV1;
use reth_tasks::TaskExecutor;
use reth_tokio_util::EventSender;
use reth_tracing::tracing::{debug, error, info};
Expand Down Expand Up @@ -80,12 +77,8 @@ where
AO: NodeAddOns<
NodeAdapter<T, CB::Components>,
EthApi: EthApiBuilderProvider<NodeAdapter<T, CB::Components>>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
ReceiptResponse = AnyTransactionReceipt,
>,
> + AddDevSigners,
+ FullEthApiServer
+ AddDevSigners,
>,
{
type Node = NodeHandle<NodeAdapter<T, CB::Components>, AO>;
Expand Down
18 changes: 6 additions & 12 deletions crates/node/builder/src/launch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ use reth_node_api::{
use reth_node_core::{
dirs::{ChainPath, DataDirPath},
exit::NodeExitFuture,
rpc::{
eth::{helpers::AddDevSigners, FullEthApiServer},
types::AnyTransactionReceipt,
},
rpc::eth::{helpers::AddDevSigners, FullEthApiServer},
version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA},
};
use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
use reth_primitives::format_ether;
use reth_provider::providers::BlockchainProvider;
use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi};
use reth_rpc_types::{engine::ClientVersionV1, WithOtherFields};
use reth_rpc_types::engine::ClientVersionV1;
use reth_tasks::TaskExecutor;
use reth_tracing::tracing::{debug, info};
use reth_transaction_pool::TransactionPool;
Expand All @@ -55,13 +52,14 @@ use crate::{
};

/// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`FullNodeComponents`].
pub type EthApiBuilderCtx<N> = reth_rpc_eth_types::EthApiBuilderCtx<
pub type EthApiBuilderCtx<N, Eth> = reth_rpc_eth_types::EthApiBuilderCtx<
<N as FullNodeTypes>::Provider,
<N as FullNodeComponents>::Pool,
<N as FullNodeComponents>::Evm,
<N as FullNodeComponents>::Network,
TaskExecutor,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd actually like to remove the Tasks generic everywhere and use Box dyn (followup)

Copy link
Member Author

Choose a reason for hiding this comment

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

it's an unnecessary perf downgrade to use dynamic dispatch for types that are called (i) often and (ii) always return a trait object originating from the same type. I'd try to reserve dynamic dispatch for builders that are called once. or where trait objects are returned that originate from different types for each call.

<N as FullNodeTypes>::Provider,
Eth,
>;

/// A general purpose trait that launches a new node of any kind.
Expand Down Expand Up @@ -114,12 +112,8 @@ where
AO: NodeAddOns<
NodeAdapter<T, CB::Components>,
EthApi: EthApiBuilderProvider<NodeAdapter<T, CB::Components>>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
ReceiptResponse = AnyTransactionReceipt,
>,
> + AddDevSigners,
+ FullEthApiServer
+ AddDevSigners,
>,
{
type Node = NodeHandle<NodeAdapter<T, CB::Components>, AO>;
Expand Down
16 changes: 4 additions & 12 deletions crates/node/builder/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use reth_node_core::{
rpc::{
api::EngineApiServer,
eth::{EthApiTypes, FullEthApiServer},
types::AnyTransactionReceipt,
},
};
use reth_payload_builder::PayloadBuilderHandle;
Expand All @@ -25,7 +24,6 @@ use reth_rpc_builder::{
RpcModuleBuilder, RpcRegistryInner, RpcServerHandle, TransportRpcModules,
};
use reth_rpc_layer::JwtSecret;
use reth_rpc_types::WithOtherFields;
use reth_tasks::TaskExecutor;
use reth_tracing::tracing::{debug, info};

Expand Down Expand Up @@ -305,13 +303,7 @@ pub async fn launch_rpc_servers<Node, Engine, EthApi>(
where
Node: FullNodeComponents<Types: NodeTypesWithDB<ChainSpec = ChainSpec>> + Clone,
Engine: EngineApiServer<<Node::Types as NodeTypesWithEngine>::Engine>,
EthApi: EthApiBuilderProvider<Node>
+ FullEthApiServer<
NetworkTypes: alloy_network::Network<
TransactionResponse = WithOtherFields<reth_rpc_types::Transaction>,
ReceiptResponse = AnyTransactionReceipt,
>,
>,
EthApi: EthApiBuilderProvider<Node> + FullEthApiServer,
{
let auth_config = config.rpc.auth_server_config(jwt_secret)?;
let module_config = config.rpc.transport_rpc_module_config();
Expand Down Expand Up @@ -386,15 +378,15 @@ where
pub trait EthApiBuilderProvider<N: FullNodeComponents>: BuilderProvider<N> + EthApiTypes {
/// Returns the eth api builder.
#[allow(clippy::type_complexity)]
fn eth_api_builder() -> Box<dyn Fn(&EthApiBuilderCtx<N>) -> Self + Send>;
fn eth_api_builder() -> Box<dyn Fn(&EthApiBuilderCtx<N, Self>) -> Self + Send>;
}
emhane marked this conversation as resolved.
Show resolved Hide resolved

impl<N, F> EthApiBuilderProvider<N> for F
where
N: FullNodeComponents,
for<'a> F: BuilderProvider<N, Ctx<'a> = &'a EthApiBuilderCtx<N>> + EthApiTypes,
for<'a> F: BuilderProvider<N, Ctx<'a> = &'a EthApiBuilderCtx<N, Self>> + EthApiTypes,
{
fn eth_api_builder() -> Box<dyn Fn(&EthApiBuilderCtx<N>) -> Self + Send> {
fn eth_api_builder() -> Box<dyn Fn(&EthApiBuilderCtx<N, Self>) -> Self + Send> {
F::builder()
}
}
1 change: 1 addition & 0 deletions crates/optimism/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ serde_json.workspace = true
# misc
thiserror.workspace = true
tracing.workspace = true
derive_more.workspace = true

[dev-dependencies]
reth-optimism-chainspec.workspace = true
Expand Down
Loading
Loading