Skip to main content

soil_txpool/
lib.rs

1// This file is part of Soil.
2
3// Copyright (C) Soil contributors.
4// Copyright (C) Parity Technologies (UK) Ltd.
5// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
6
7//! Substrate transaction pool implementation.
8
9#![recursion_limit = "256"]
10#![warn(missing_docs)]
11#![warn(unused_extern_crates)]
12
13mod builder;
14mod common;
15mod fork_aware_txpool;
16mod graph;
17mod single_state_txpool;
18mod transaction_pool_wrapper;
19
20use common::{api, enactment_state};
21use std::sync::Arc;
22
23pub use api::FullChainApi;
24pub use builder::{Builder, TransactionPoolHandle, TransactionPoolOptions, TransactionPoolType};
25pub use common::notification_future;
26pub use fork_aware_txpool::{ForkAwareTxPool, ForkAwareTxPoolTask};
27pub use graph::{
28	base_pool::{Limit as PoolLimit, TimedTransactionSource},
29	ChainApi, Options, Pool, ValidateTransactionPriority,
30};
31use single_state_txpool::prune_known_txs_for_block;
32pub use single_state_txpool::{BasicPool, RevalidationType};
33pub use transaction_pool_wrapper::TransactionPoolWrapper;
34
35type BoxedReadyIterator<Hash, Data> = Box<
36	dyn soil_client::transaction_pool::ReadyTransactions<
37			Item = Arc<graph::base_pool::Transaction<Hash, Data>>,
38		> + Send,
39>;
40
41type ReadyIteratorFor<PoolApi> =
42	BoxedReadyIterator<graph::ExtrinsicHash<PoolApi>, graph::ExtrinsicFor<PoolApi>>;
43
44/// Log target for transaction pool.
45///
46/// It can be used by other components for logging functionality strictly related to txpool (e.g.
47/// importing transaction).
48pub const LOG_TARGET: &str = "txpool";
49const LOG_TARGET_STAT: &str = "txpoolstats";