From b271f0cc6dbdcbbc2e5438dda1cd5e0dedd83079 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Thu, 19 Dec 2024 16:57:51 +0200 Subject: [PATCH] chore: relax pool maintain future (#13455) --- crates/transaction-pool/src/maintain.rs | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/crates/transaction-pool/src/maintain.rs b/crates/transaction-pool/src/maintain.rs index 23bf75b01..dfcd22fd6 100644 --- a/crates/transaction-pool/src/maintain.rs +++ b/crates/transaction-pool/src/maintain.rs @@ -19,9 +19,7 @@ use reth_chain_state::CanonStateNotification; use reth_chainspec::{ChainSpecProvider, EthChainSpec}; use reth_execution_types::ChangedAccount; use reth_fs_util::FsPathError; -use reth_primitives::{ - transaction::SignedTransactionIntoRecoveredExt, SealedHeader, TransactionSigned, -}; +use reth_primitives::{transaction::SignedTransactionIntoRecoveredExt, SealedHeader}; use reth_primitives_traits::{NodePrimitives, SignedTransaction}; use reth_storage_api::{errors::provider::ProviderError, BlockReaderIdExt, StateProviderFactory}; use reth_tasks::TaskSpawner; @@ -78,13 +76,9 @@ pub fn maintain_transaction_pool_future( config: MaintainPoolConfig, ) -> BoxFuture<'static, ()> where - N: NodePrimitives< - BlockHeader = reth_primitives::Header, - BlockBody = reth_primitives::BlockBody, - SignedTx = TransactionSigned, - >, + N: NodePrimitives, Client: StateProviderFactory + BlockReaderIdExt + ChainSpecProvider + Clone + 'static, - P: TransactionPoolExt> + 'static, + P: TransactionPoolExt> + 'static, St: Stream> + Send + Unpin + 'static, Tasks: TaskSpawner + 'static, { @@ -104,13 +98,9 @@ pub async fn maintain_transaction_pool( task_spawner: Tasks, config: MaintainPoolConfig, ) where - N: NodePrimitives< - BlockHeader = reth_primitives::Header, - BlockBody = reth_primitives::BlockBody, - SignedTx = TransactionSigned, - >, + N: NodePrimitives, Client: StateProviderFactory + BlockReaderIdExt + ChainSpecProvider + Clone + 'static, - P: TransactionPoolExt> + 'static, + P: TransactionPoolExt> + 'static, St: Stream> + Send + Unpin + 'static, Tasks: TaskSpawner + 'static, { @@ -339,7 +329,7 @@ pub async fn maintain_transaction_pool( // been validated previously, we still need the blob in order to // accurately set the transaction's // encoded-length which is propagated over the network. - pool.get_blob(TransactionSigned::hash(&tx)) + pool.get_blob(*tx.tx_hash()) .ok() .flatten() .map(Arc::unwrap_or_clone) @@ -680,7 +670,7 @@ mod tests { use alloy_primitives::{hex, U256}; use reth_chainspec::MAINNET; use reth_fs_util as fs; - use reth_primitives::PooledTransaction; + use reth_primitives::{PooledTransaction, TransactionSigned}; use reth_provider::test_utils::{ExtendedAccount, MockEthProvider}; use reth_tasks::TaskManager;