diff --git a/crates/net/network/src/transactions.rs b/crates/net/network/src/transactions.rs index dc0458ced5..376c924be2 100644 --- a/crates/net/network/src/transactions.rs +++ b/crates/net/network/src/transactions.rs @@ -107,7 +107,7 @@ pub struct TransactionsManager { impl TransactionsManager where - Pool: TransactionPool + Clone, + Pool: TransactionPool + 'static, ::Transaction: IntoRecoveredTransaction, { /// Sets up a new instance. @@ -377,7 +377,7 @@ where /// This should be spawned or used as part of `tokio::select!`. impl Future for TransactionsManager where - Pool: TransactionPool + Clone + Unpin, + Pool: TransactionPool + Unpin + 'static, ::Transaction: IntoRecoveredTransaction, { type Output = (); diff --git a/crates/net/rpc/src/eth/api/mod.rs b/crates/net/rpc/src/eth/api/mod.rs index 33628ab3e7..f0f4d72ed5 100644 --- a/crates/net/rpc/src/eth/api/mod.rs +++ b/crates/net/rpc/src/eth/api/mod.rs @@ -1,7 +1,7 @@ //! Provides everything related to `eth_` namespace use reth_interfaces::Result; -use reth_primitives::{Transaction, U256, U64}; +use reth_primitives::{U256, U64}; use reth_provider::{BlockProvider, StateProviderFactory}; use reth_transaction_pool::TransactionPool; use std::sync::Arc; @@ -24,8 +24,8 @@ pub struct EthApi { impl EthApi where - Pool: TransactionPool + Clone, - Client: BlockProvider + StateProviderFactory, + Pool: TransactionPool + 'static, + Client: BlockProvider + StateProviderFactory + 'static, { /// Creates a new, shareable instance. pub fn new(client: Arc, pool: Pool) -> Self { diff --git a/crates/net/rpc/src/eth/api/server.rs b/crates/net/rpc/src/eth/api/server.rs index fd33c4ee44..5e7151a59a 100644 --- a/crates/net/rpc/src/eth/api/server.rs +++ b/crates/net/rpc/src/eth/api/server.rs @@ -5,7 +5,7 @@ use crate::{eth::api::EthApi, result::ToRpcResult}; use jsonrpsee::core::RpcResult as Result; use reth_primitives::{ rpc::{transaction::eip2930::AccessListWithGasUsed, BlockId}, - Address, BlockNumber, Bytes, Transaction, H256, H64, U256, U64, + Address, BlockNumber, Bytes, H256, H64, U256, U64, }; use reth_provider::{BlockProvider, StateProviderFactory}; use reth_rpc_api::EthApiServer; @@ -19,7 +19,7 @@ use serde_json::Value; #[async_trait::async_trait] impl EthApiServer for EthApi where - Pool: TransactionPool + Clone + 'static, + Pool: TransactionPool + 'static, Client: BlockProvider + StateProviderFactory + 'static, { fn protocol_version(&self) -> Result { diff --git a/crates/net/rpc/src/eth/pubsub.rs b/crates/net/rpc/src/eth/pubsub.rs index afdfbfab28..8ec28507c5 100644 --- a/crates/net/rpc/src/eth/pubsub.rs +++ b/crates/net/rpc/src/eth/pubsub.rs @@ -28,7 +28,7 @@ impl EthPubSub { impl EthPubSubApiServer for EthPubSub where - Pool: TransactionPool + Clone, + Pool: TransactionPool + 'static, Client: BlockProvider + 'static, { fn subscribe( diff --git a/crates/transaction-pool/src/traits.rs b/crates/transaction-pool/src/traits.rs index 0fa14fe7bf..52a9fb1e5d 100644 --- a/crates/transaction-pool/src/traits.rs +++ b/crates/transaction-pool/src/traits.rs @@ -9,8 +9,11 @@ use tokio::sync::mpsc::Receiver; /// This is intended to be used by API-consumers such as RPC that need inject new incoming, /// unverified transactions. And by block production that needs to get transactions to execute in a /// new block. +/// +/// Note: This requires `Clone` for convenience, since it is assumed that this will be implemented +/// for a wrapped `Arc` type, see also [`Pool`](crate::Pool). #[async_trait::async_trait] -pub trait TransactionPool: Send + Sync + 'static { +pub trait TransactionPool: Send + Sync + Clone { /// The transaction type of the pool type Transaction: PoolTransaction;