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;
30
31use common::{api, enactment_state};
32use std::sync::Arc;
33
34pub use api::FullChainApi;
35pub use builder::{
36	Builder, ClientForTransactionPool, FullClientTransactionPool, TransactionPoolHandle,
37	TransactionPoolOptions, TransactionPoolType,
38};
39pub use common::{error, notification_future};
40pub use fork_aware_txpool::{ForkAwareTxPool, ForkAwareTxPoolTask};
41pub use graph::{
42	base_pool::{Limit as PoolLimit, TimedTransactionSource, Transaction},
43	ChainApi, Options, Pool, ValidateTransactionPriority,
44};
45use single_state_txpool::prune_known_txs_for_block;
46pub use single_state_txpool::{BasicPool, RevalidationType};
47
48type BoxedReadyIterator<Hash, Data> = Box<
49	dyn sc_transaction_pool_api::ReadyTransactions<
50			Item = Arc<graph::base_pool::Transaction<Hash, Data>>,
51		> + Send,
52>;
53
54type ReadyIteratorFor<PoolApi> =
55	BoxedReadyIterator<graph::ExtrinsicHash<PoolApi>, graph::ExtrinsicFor<PoolApi>>;
56
57/// Log target for transaction pool.
58///
59/// It can be used by other components for logging functionality strictly related to txpool (e.g.
60/// importing transaction).
61pub const LOG_TARGET: &str = "txpool";
62const LOG_TARGET_STAT: &str = "txpoolstats";