referrerpolicy=no-referrer-when-downgrade

sc_transaction_pool/
lib.rs

1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
5
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19//! Substrate transaction pool implementation.
20
21#![recursion_limit = "256"]
22#![warn(missing_docs)]
23#![warn(unused_extern_crates)]
24
25mod builder;
26mod common;
27mod fork_aware_txpool;
28mod graph;
29mod single_state_txpool;
30mod transaction_pool_wrapper;
31
32use common::{api, enactment_state};
33use std::sync::Arc;
34
35pub use api::FullChainApi;
36pub use builder::{Builder, TransactionPoolHandle, TransactionPoolOptions, TransactionPoolType};
37pub use common::notification_future;
38pub use fork_aware_txpool::{ForkAwareTxPool, ForkAwareTxPoolTask};
39pub use graph::{
40	base_pool::{Limit as PoolLimit, TimedTransactionSource},
41	ChainApi, Options, Pool, ValidateTransactionPriority,
42};
43use single_state_txpool::prune_known_txs_for_block;
44pub use single_state_txpool::{BasicPool, RevalidationType};
45pub use transaction_pool_wrapper::TransactionPoolWrapper;
46
47type BoxedReadyIterator<Hash, Data> = Box<
48	dyn sc_transaction_pool_api::ReadyTransactions<
49			Item = Arc<graph::base_pool::Transaction<Hash, Data>>,
50		> + Send,
51>;
52
53type ReadyIteratorFor<PoolApi> =
54	BoxedReadyIterator<graph::ExtrinsicHash<PoolApi>, graph::ExtrinsicFor<PoolApi>>;
55
56/// Log target for transaction pool.
57///
58/// It can be used by other components for logging functionality strictly related to txpool (e.g.
59/// importing transaction).
60pub const LOG_TARGET: &str = "txpool";
61const LOG_TARGET_STAT: &str = "txpoolstats";