Skip to content

Commit d97449d

Browse files
authored
fix: bounds for BundleApi (#13267)
1 parent 36c0142 commit d97449d

File tree

4 files changed

+37
-13
lines changed

4 files changed

+37
-13
lines changed

crates/node/builder/src/rpc.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use reth_node_core::{
1818
version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA},
1919
};
2020
use reth_payload_builder::PayloadStore;
21-
use reth_primitives::EthPrimitives;
21+
use reth_primitives::{EthPrimitives, PooledTransactionsElement};
2222
use reth_provider::providers::ProviderNodeTypes;
2323
use reth_rpc::{
2424
eth::{EthApiTypes, FullEthApiServer},
@@ -33,6 +33,7 @@ use reth_rpc_builder::{
3333
use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi};
3434
use reth_tasks::TaskExecutor;
3535
use reth_tracing::tracing::{debug, info};
36+
use reth_transaction_pool::{PoolTransaction, TransactionPool};
3637
use std::sync::Arc;
3738

3839
use crate::EthApiBuilderCtx;
@@ -403,7 +404,9 @@ where
403404

404405
impl<N, EthApi, EV> RpcAddOns<N, EthApi, EV>
405406
where
406-
N: FullNodeComponents,
407+
N: FullNodeComponents<
408+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
409+
>,
407410
EthApi: EthApiTypes
408411
+ FullEthApiServer<Provider = N::Provider, Pool = N::Pool, Network = N::Network>
409412
+ AddDevSigners
@@ -531,7 +534,10 @@ where
531534

532535
impl<N, EthApi, EV> NodeAddOns<N> for RpcAddOns<N, EthApi, EV>
533536
where
534-
N: FullNodeComponents<Types: ProviderNodeTypes<Primitives = EthPrimitives>>,
537+
N: FullNodeComponents<
538+
Types: ProviderNodeTypes<Primitives = EthPrimitives>,
539+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
540+
>,
535541
EthApi: EthApiTypes
536542
+ FullEthApiServer<Provider = N::Provider, Pool = N::Pool, Network = N::Network>
537543
+ AddDevSigners

crates/optimism/node/src/node.rs

+2
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ where
244244
Storage = OpStorage,
245245
Engine = OpEngineTypes,
246246
>,
247+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
247248
>,
248249
OpEngineValidator: EngineValidator<<N::Types as NodeTypesWithEngine>::Engine>,
249250
{
@@ -294,6 +295,7 @@ where
294295
Storage = OpStorage,
295296
Engine = OpEngineTypes,
296297
>,
298+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
297299
>,
298300
OpEngineValidator: EngineValidator<<N::Types as NodeTypesWithEngine>::Engine>,
299301
{

crates/rpc/rpc-builder/src/lib.rs

+20-8
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! use reth_engine_primitives::PayloadValidator;
2020
//! use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm};
2121
//! use reth_network_api::{NetworkInfo, Peers};
22-
//! use reth_primitives::{Header, TransactionSigned};
22+
//! use reth_primitives::{Header, PooledTransactionsElement, TransactionSigned};
2323
//! use reth_provider::{AccountReader, CanonStateSubscriptions, ChangeSetReader, FullRpcProvider};
2424
//! use reth_rpc::EthApi;
2525
//! use reth_rpc_builder::{
@@ -55,8 +55,12 @@
5555
//! Header = reth_primitives::Header,
5656
//! > + AccountReader
5757
//! + ChangeSetReader,
58-
//! Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>
59-
//! + Unpin
58+
//! Pool: TransactionPool<
59+
//! Transaction: PoolTransaction<
60+
//! Consensus = TransactionSigned,
61+
//! Pooled = PooledTransactionsElement,
62+
//! >,
63+
//! > + Unpin
6064
//! + 'static,
6165
//! Network: NetworkInfo + Peers + Clone + 'static,
6266
//! Events:
@@ -98,7 +102,7 @@
98102
//! use reth_engine_primitives::{EngineTypes, PayloadValidator};
99103
//! use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm};
100104
//! use reth_network_api::{NetworkInfo, Peers};
101-
//! use reth_primitives::{Header, TransactionSigned};
105+
//! use reth_primitives::{Header, PooledTransactionsElement, TransactionSigned};
102106
//! use reth_provider::{AccountReader, CanonStateSubscriptions, ChangeSetReader, FullRpcProvider};
103107
//! use reth_rpc::EthApi;
104108
//! use reth_rpc_api::EngineApiServer;
@@ -141,8 +145,12 @@
141145
//! Header = reth_primitives::Header,
142146
//! > + AccountReader
143147
//! + ChangeSetReader,
144-
//! Pool: TransactionPool<Transaction: PoolTransaction<Consensus = TransactionSigned>>
145-
//! + Unpin
148+
//! Pool: TransactionPool<
149+
//! Transaction: PoolTransaction<
150+
//! Consensus = TransactionSigned,
151+
//! Pooled = PooledTransactionsElement,
152+
//! >,
153+
//! > + Unpin
146154
//! + 'static,
147155
//! Network: NetworkInfo + Peers + Clone + 'static,
148156
//! Events:
@@ -222,7 +230,7 @@ use reth_consensus::FullConsensus;
222230
use reth_engine_primitives::{EngineTypes, PayloadValidator};
223231
use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm};
224232
use reth_network_api::{noop::NoopNetwork, NetworkInfo, Peers};
225-
use reth_primitives::NodePrimitives;
233+
use reth_primitives::{NodePrimitives, PooledTransactionsElement};
226234
use reth_provider::{
227235
AccountReader, BlockReader, CanonStateSubscriptions, ChainSpecProvider, ChangeSetReader,
228236
EvmEnvProvider, FullRpcProvider, ProviderBlock, ProviderHeader, ProviderReceipt,
@@ -240,7 +248,7 @@ use reth_rpc_eth_api::{
240248
use reth_rpc_eth_types::{EthConfig, EthStateCache, EthSubscriptionIdProvider};
241249
use reth_rpc_layer::{AuthLayer, Claims, CompressionLayer, JwtAuthValidator, JwtSecret};
242250
use reth_tasks::{pool::BlockingTaskGuard, TaskSpawner, TokioTaskExecutor};
243-
use reth_transaction_pool::{noop::NoopTransactionPool, TransactionPool};
251+
use reth_transaction_pool::{noop::NoopTransactionPool, PoolTransaction, TransactionPool};
244252
use serde::{Deserialize, Serialize};
245253
use tower::Layer;
246254
use tower_http::cors::CorsLayer;
@@ -315,6 +323,7 @@ where
315323
Receipt = <BlockExecutor::Primitives as NodePrimitives>::Receipt,
316324
Header = <BlockExecutor::Primitives as NodePrimitives>::BlockHeader,
317325
>,
326+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
318327
>,
319328
BlockExecutor: BlockExecutorProvider,
320329
{
@@ -706,6 +715,7 @@ where
706715
Receipt = <Events::Primitives as NodePrimitives>::Receipt,
707716
Header = <Events::Primitives as NodePrimitives>::BlockHeader,
708717
>,
718+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
709719
>,
710720
{
711721
let Self {
@@ -831,6 +841,7 @@ where
831841
Block = <Events::Primitives as NodePrimitives>::Block,
832842
Header = <Events::Primitives as NodePrimitives>::BlockHeader,
833843
>,
844+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
834845
>,
835846
Pool: TransactionPool<Transaction = <EthApi::Pool as TransactionPool>::Transaction>,
836847
{
@@ -1371,6 +1382,7 @@ where
13711382
Receipt = <BlockExecutor::Primitives as NodePrimitives>::Receipt,
13721383
Header = <BlockExecutor::Primitives as NodePrimitives>::BlockHeader,
13731384
>,
1385+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
13741386
>,
13751387
BlockExecutor: BlockExecutorProvider,
13761388
Consensus: reth_consensus::FullConsensus<BlockExecutor::Primitives> + Clone + 'static,

crates/rpc/rpc/src/eth/bundle.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,14 @@ where
285285
#[async_trait::async_trait]
286286
impl<Eth> EthCallBundleApiServer for EthBundle<Eth>
287287
where
288-
Eth: EthTransactions + LoadPendingBlock + Call + 'static,
288+
Eth: EthTransactions<
289+
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransactionsElement>>,
290+
> + LoadPendingBlock
291+
+ Call
292+
+ 'static,
289293
{
290294
async fn call_bundle(&self, request: EthCallBundle) -> RpcResult<EthCallBundleResponse> {
291-
Self::call_bundle(self, request).await.map_err(Into::into)
295+
self.call_bundle(request).await.map_err(Into::into)
292296
}
293297
}
294298

0 commit comments

Comments
 (0)