mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: relax pool maintain future (#13455)
This commit is contained in:
@ -19,9 +19,7 @@ use reth_chain_state::CanonStateNotification;
|
|||||||
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
|
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
|
||||||
use reth_execution_types::ChangedAccount;
|
use reth_execution_types::ChangedAccount;
|
||||||
use reth_fs_util::FsPathError;
|
use reth_fs_util::FsPathError;
|
||||||
use reth_primitives::{
|
use reth_primitives::{transaction::SignedTransactionIntoRecoveredExt, SealedHeader};
|
||||||
transaction::SignedTransactionIntoRecoveredExt, SealedHeader, TransactionSigned,
|
|
||||||
};
|
|
||||||
use reth_primitives_traits::{NodePrimitives, SignedTransaction};
|
use reth_primitives_traits::{NodePrimitives, SignedTransaction};
|
||||||
use reth_storage_api::{errors::provider::ProviderError, BlockReaderIdExt, StateProviderFactory};
|
use reth_storage_api::{errors::provider::ProviderError, BlockReaderIdExt, StateProviderFactory};
|
||||||
use reth_tasks::TaskSpawner;
|
use reth_tasks::TaskSpawner;
|
||||||
@ -78,13 +76,9 @@ pub fn maintain_transaction_pool_future<N, Client, P, St, Tasks>(
|
|||||||
config: MaintainPoolConfig,
|
config: MaintainPoolConfig,
|
||||||
) -> BoxFuture<'static, ()>
|
) -> BoxFuture<'static, ()>
|
||||||
where
|
where
|
||||||
N: NodePrimitives<
|
N: NodePrimitives,
|
||||||
BlockHeader = reth_primitives::Header,
|
|
||||||
BlockBody = reth_primitives::BlockBody,
|
|
||||||
SignedTx = TransactionSigned,
|
|
||||||
>,
|
|
||||||
Client: StateProviderFactory + BlockReaderIdExt + ChainSpecProvider + Clone + 'static,
|
Client: StateProviderFactory + BlockReaderIdExt + ChainSpecProvider + Clone + 'static,
|
||||||
P: TransactionPoolExt<Transaction: PoolTransaction<Consensus = TransactionSigned>> + 'static,
|
P: TransactionPoolExt<Transaction: PoolTransaction<Consensus = N::SignedTx>> + 'static,
|
||||||
St: Stream<Item = CanonStateNotification<N>> + Send + Unpin + 'static,
|
St: Stream<Item = CanonStateNotification<N>> + Send + Unpin + 'static,
|
||||||
Tasks: TaskSpawner + 'static,
|
Tasks: TaskSpawner + 'static,
|
||||||
{
|
{
|
||||||
@ -104,13 +98,9 @@ pub async fn maintain_transaction_pool<N, Client, P, St, Tasks>(
|
|||||||
task_spawner: Tasks,
|
task_spawner: Tasks,
|
||||||
config: MaintainPoolConfig,
|
config: MaintainPoolConfig,
|
||||||
) where
|
) where
|
||||||
N: NodePrimitives<
|
N: NodePrimitives,
|
||||||
BlockHeader = reth_primitives::Header,
|
|
||||||
BlockBody = reth_primitives::BlockBody,
|
|
||||||
SignedTx = TransactionSigned,
|
|
||||||
>,
|
|
||||||
Client: StateProviderFactory + BlockReaderIdExt + ChainSpecProvider + Clone + 'static,
|
Client: StateProviderFactory + BlockReaderIdExt + ChainSpecProvider + Clone + 'static,
|
||||||
P: TransactionPoolExt<Transaction: PoolTransaction<Consensus = TransactionSigned>> + 'static,
|
P: TransactionPoolExt<Transaction: PoolTransaction<Consensus = N::SignedTx>> + 'static,
|
||||||
St: Stream<Item = CanonStateNotification<N>> + Send + Unpin + 'static,
|
St: Stream<Item = CanonStateNotification<N>> + Send + Unpin + 'static,
|
||||||
Tasks: TaskSpawner + 'static,
|
Tasks: TaskSpawner + 'static,
|
||||||
{
|
{
|
||||||
@ -339,7 +329,7 @@ pub async fn maintain_transaction_pool<N, Client, P, St, Tasks>(
|
|||||||
// been validated previously, we still need the blob in order to
|
// been validated previously, we still need the blob in order to
|
||||||
// accurately set the transaction's
|
// accurately set the transaction's
|
||||||
// encoded-length which is propagated over the network.
|
// encoded-length which is propagated over the network.
|
||||||
pool.get_blob(TransactionSigned::hash(&tx))
|
pool.get_blob(*tx.tx_hash())
|
||||||
.ok()
|
.ok()
|
||||||
.flatten()
|
.flatten()
|
||||||
.map(Arc::unwrap_or_clone)
|
.map(Arc::unwrap_or_clone)
|
||||||
@ -680,7 +670,7 @@ mod tests {
|
|||||||
use alloy_primitives::{hex, U256};
|
use alloy_primitives::{hex, U256};
|
||||||
use reth_chainspec::MAINNET;
|
use reth_chainspec::MAINNET;
|
||||||
use reth_fs_util as fs;
|
use reth_fs_util as fs;
|
||||||
use reth_primitives::PooledTransaction;
|
use reth_primitives::{PooledTransaction, TransactionSigned};
|
||||||
use reth_provider::test_utils::{ExtendedAccount, MockEthProvider};
|
use reth_provider::test_utils::{ExtendedAccount, MockEthProvider};
|
||||||
use reth_tasks::TaskManager;
|
use reth_tasks::TaskManager;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user