Skip to content

Commit

Permalink
fix: bounds for BundleApi (#13267)
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr authored Dec 10, 2024
1 parent 36c0142 commit d97449d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
12 changes: 9 additions & 3 deletions crates/node/builder/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use reth_node_core::{
version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA},
};
use reth_payload_builder::PayloadStore;
use reth_primitives::EthPrimitives;
use reth_primitives::{EthPrimitives, PooledTransactionsElement};
use reth_provider::providers::ProviderNodeTypes;
use reth_rpc::{
eth::{EthApiTypes, FullEthApiServer},
Expand All @@ -33,6 +33,7 @@ use reth_rpc_builder::{
use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi};
use reth_tasks::TaskExecutor;
use reth_tracing::tracing::{debug, info};
use reth_transaction_pool::{PoolTransaction, TransactionPool};
use std::sync::Arc;

use crate::EthApiBuilderCtx;
Expand Down Expand Up @@ -403,7 +404,9 @@ where

impl<N, EthApi, EV> RpcAddOns<N, EthApi, EV>
where
N: FullNodeComponents,
N: FullNodeComponents<
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
>,
EthApi: EthApiTypes
+ FullEthApiServer<Provider = N::Provider, Pool = N::Pool, Network = N::Network>
+ AddDevSigners
Expand Down Expand Up @@ -531,7 +534,10 @@ where

impl<N, EthApi, EV> NodeAddOns<N> for RpcAddOns<N, EthApi, EV>
where
N: FullNodeComponents<Types: ProviderNodeTypes<Primitives = EthPrimitives>>,
N: FullNodeComponents<
Types: ProviderNodeTypes<Primitives = EthPrimitives>,
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
>,
EthApi: EthApiTypes
+ FullEthApiServer<Provider = N::Provider, Pool = N::Pool, Network = N::Network>
+ AddDevSigners
Expand Down
2 changes: 2 additions & 0 deletions crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ where
Storage = OpStorage,
Engine = OpEngineTypes,
>,
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
>,
OpEngineValidator: EngineValidator<<N::Types as NodeTypesWithEngine>::Engine>,
{
Expand Down Expand Up @@ -294,6 +295,7 @@ where
Storage = OpStorage,
Engine = OpEngineTypes,
>,
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
>,
OpEngineValidator: EngineValidator<<N::Types as NodeTypesWithEngine>::Engine>,
{
Expand Down
28 changes: 20 additions & 8 deletions crates/rpc/rpc-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! use reth_engine_primitives::PayloadValidator;
//! use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm};
//! use reth_network_api::{NetworkInfo, Peers};
//! use reth_primitives::{Header, TransactionSigned};
//! use reth_primitives::{Header, PooledTransactionsElement, TransactionSigned};
//! use reth_provider::{AccountReader, CanonStateSubscriptions, ChangeSetReader, FullRpcProvider};
//! use reth_rpc::EthApi;
//! use reth_rpc_builder::{
Expand Down Expand Up @@ -55,8 +55,12 @@
//! Header = reth_primitives::Header,
//! > + AccountReader
//! + ChangeSetReader,
//! Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>
//! + Unpin
//! Pool: TransactionPool<
//! Transaction: PoolTransaction<
//! Consensus = TransactionSigned,
//! Pooled = PooledTransactionsElement,
//! >,
//! > + Unpin
//! + 'static,
//! Network: NetworkInfo + Peers + Clone + 'static,
//! Events:
Expand Down Expand Up @@ -98,7 +102,7 @@
//! use reth_engine_primitives::{EngineTypes, PayloadValidator};
//! use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm};
//! use reth_network_api::{NetworkInfo, Peers};
//! use reth_primitives::{Header, TransactionSigned};
//! use reth_primitives::{Header, PooledTransactionsElement, TransactionSigned};
//! use reth_provider::{AccountReader, CanonStateSubscriptions, ChangeSetReader, FullRpcProvider};
//! use reth_rpc::EthApi;
//! use reth_rpc_api::EngineApiServer;
Expand Down Expand Up @@ -141,8 +145,12 @@
//! Header = reth_primitives::Header,
//! > + AccountReader
//! + ChangeSetReader,
//! Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>
//! + Unpin
//! Pool: TransactionPool<
//! Transaction: PoolTransaction<
//! Consensus = TransactionSigned,
//! Pooled = PooledTransactionsElement,
//! >,
//! > + Unpin
//! + 'static,
//! Network: NetworkInfo + Peers + Clone + 'static,
//! Events:
Expand Down Expand Up @@ -222,7 +230,7 @@ use reth_consensus::FullConsensus;
use reth_engine_primitives::{EngineTypes, PayloadValidator};
use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm};
use reth_network_api::{noop::NoopNetwork, NetworkInfo, Peers};
use reth_primitives::NodePrimitives;
use reth_primitives::{NodePrimitives, PooledTransactionsElement};
use reth_provider::{
AccountReader, BlockReader, CanonStateSubscriptions, ChainSpecProvider, ChangeSetReader,
EvmEnvProvider, FullRpcProvider, ProviderBlock, ProviderHeader, ProviderReceipt,
Expand All @@ -240,7 +248,7 @@ use reth_rpc_eth_api::{
use reth_rpc_eth_types::{EthConfig, EthStateCache, EthSubscriptionIdProvider};
use reth_rpc_layer::{AuthLayer, Claims, CompressionLayer, JwtAuthValidator, JwtSecret};
use reth_tasks::{pool::BlockingTaskGuard, TaskSpawner, TokioTaskExecutor};
use reth_transaction_pool::{noop::NoopTransactionPool, TransactionPool};
use reth_transaction_pool::{noop::NoopTransactionPool, PoolTransaction, TransactionPool};
use serde::{Deserialize, Serialize};
use tower::Layer;
use tower_http::cors::CorsLayer;
Expand Down Expand Up @@ -315,6 +323,7 @@ where
Receipt = <BlockExecutor::Primitives as NodePrimitives>::Receipt,
Header = <BlockExecutor::Primitives as NodePrimitives>::BlockHeader,
>,
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
>,
BlockExecutor: BlockExecutorProvider,
{
Expand Down Expand Up @@ -706,6 +715,7 @@ where
Receipt = <Events::Primitives as NodePrimitives>::Receipt,
Header = <Events::Primitives as NodePrimitives>::BlockHeader,
>,
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
>,
{
let Self {
Expand Down Expand Up @@ -831,6 +841,7 @@ where
Block = <Events::Primitives as NodePrimitives>::Block,
Header = <Events::Primitives as NodePrimitives>::BlockHeader,
>,
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
>,
Pool: TransactionPool<Transaction = <EthApi::Pool as TransactionPool>::Transaction>,
{
Expand Down Expand Up @@ -1371,6 +1382,7 @@ where
Receipt = <BlockExecutor::Primitives as NodePrimitives>::Receipt,
Header = <BlockExecutor::Primitives as NodePrimitives>::BlockHeader,
>,
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
>,
BlockExecutor: BlockExecutorProvider,
Consensus: reth_consensus::FullConsensus<BlockExecutor::Primitives> + Clone + 'static,
Expand Down
8 changes: 6 additions & 2 deletions crates/rpc/rpc/src/eth/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,14 @@ where
#[async_trait::async_trait]
impl<Eth> EthCallBundleApiServer for EthBundle<Eth>
where
Eth: EthTransactions + LoadPendingBlock + Call + 'static,
Eth: EthTransactions<
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
> + LoadPendingBlock
+ Call
+ 'static,
{
async fn call_bundle(&self, request: EthCallBundle) -> RpcResult<EthCallBundleResponse> {
Self::call_bundle(self, request).await.map_err(Into::into)
self.call_bundle(request).await.map_err(Into::into)
}
}

Expand Down

0 comments on commit d97449d

Please sign in to comment.