#include <transaction_pool_impl.hpp>
|
| TransactionPoolImpl (std::shared_ptr< runtime::TaggedTransactionQueue > ttq, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< network::TransactionsTransmitter > tx_transmitter, std::unique_ptr< PoolModerator > moderator, std::shared_ptr< blockchain::BlockHeaderRepository > header_repo, std::shared_ptr< primitives::events::ExtrinsicSubscriptionEngine > sub_engine, std::shared_ptr< subscription::ExtrinsicEventKeyRepository > ext_key_repo, Limits limits) |
|
| TransactionPoolImpl (TransactionPoolImpl &&)=default |
|
| TransactionPoolImpl (const TransactionPoolImpl &)=delete |
|
| ~TransactionPoolImpl () override=default |
|
TransactionPoolImpl & | operator= (TransactionPoolImpl &&)=delete |
|
TransactionPoolImpl & | operator= (const TransactionPoolImpl &)=delete |
|
const std::unordered_map< Transaction::Hash, std::shared_ptr< Transaction > > & | getPendingTransactions () const override |
|
outcome::result< Transaction::Hash > | submitExtrinsic (primitives::TransactionSource source, primitives::Extrinsic extrinsic) override |
|
outcome::result< void > | submitOne (Transaction &&tx) override |
|
outcome::result< Transaction > | removeOne (const Transaction::Hash &tx_hash) override |
|
std::map< Transaction::Hash, std::shared_ptr< Transaction > > | getReadyTransactions () const override |
|
outcome::result< std::vector< Transaction > > | removeStale (const primitives::BlockId &at) override |
|
Status | getStatus () const override |
|
outcome::result< primitives::Transaction > | constructTransaction (primitives::TransactionSource source, primitives::Extrinsic extrinsic) const override |
|
virtual | ~TransactionPool ()=default |
|
Definition at line 31 of file transaction_pool_impl.hpp.
kagome::transaction_pool::TransactionPoolImpl::TransactionPoolImpl |
( |
const TransactionPoolImpl & |
| ) |
|
|
delete |
kagome::transaction_pool::TransactionPoolImpl::~TransactionPoolImpl |
( |
| ) |
|
|
overridedefault |
void kagome::transaction_pool::TransactionPoolImpl::addTransactionAsWaiting |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
bool kagome::transaction_pool::TransactionPoolImpl::checkForReady |
( |
const std::shared_ptr< const Transaction > & |
tx | ) |
const |
|
private |
void kagome::transaction_pool::TransactionPoolImpl::commitProvidedTags |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
void kagome::transaction_pool::TransactionPoolImpl::commitRequiredTags |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
void kagome::transaction_pool::TransactionPoolImpl::delTransactionAsWaiting |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
outcome::result< void > kagome::transaction_pool::TransactionPoolImpl::ensureSpace |
( |
| ) |
const |
|
private |
const std::unordered_map< Transaction::Hash, std::shared_ptr< Transaction > > & kagome::transaction_pool::TransactionPoolImpl::getPendingTransactions |
( |
| ) |
const |
|
overridevirtual |
std::map< Transaction::Hash, std::shared_ptr< Transaction > > kagome::transaction_pool::TransactionPoolImpl::getReadyTransactions |
( |
| ) |
const |
|
overridevirtual |
bool kagome::transaction_pool::TransactionPoolImpl::hasSpaceInReady |
( |
| ) |
const |
|
private |
bool kagome::transaction_pool::TransactionPoolImpl::isInReady |
( |
const std::shared_ptr< const Transaction > & |
tx | ) |
const |
|
private |
void kagome::transaction_pool::TransactionPoolImpl::postponeTransaction |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
void kagome::transaction_pool::TransactionPoolImpl::processPostponedTransactions |
( |
| ) |
|
|
private |
outcome::result< void > kagome::transaction_pool::TransactionPoolImpl::processTransaction |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
outcome::result< void > kagome::transaction_pool::TransactionPoolImpl::processTransactionAsReady |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
outcome::result< void > kagome::transaction_pool::TransactionPoolImpl::processTransactionAsWaiting |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
void kagome::transaction_pool::TransactionPoolImpl::provideTag |
( |
const Transaction::Tag & |
tag | ) |
|
|
private |
outcome::result< Transaction > kagome::transaction_pool::TransactionPoolImpl::removeOne |
( |
const Transaction::Hash & |
txHash | ) |
|
|
overridevirtual |
outcome::result< std::vector< Transaction > > kagome::transaction_pool::TransactionPoolImpl::removeStale |
( |
const primitives::BlockId & |
at | ) |
|
|
overridevirtual |
Remove from the pool and temporarily ban transactions which longevity is expired
- Parameters
-
at | a block that is considered current for removal (transaction t is banned if 'block number when t got to pool' + 't.longevity' <= block number of at) |
- Returns
- removed transactions
Implements kagome::transaction_pool::TransactionPool.
Definition at line 271 of file transaction_pool_impl.cpp.
void kagome::transaction_pool::TransactionPoolImpl::rollbackProvidedTags |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
void kagome::transaction_pool::TransactionPoolImpl::rollbackRequiredTags |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
void kagome::transaction_pool::TransactionPoolImpl::setReady |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
Builds and validates transaction for provided extrinsic, and submit result transaction into pool
- Parameters
-
source | how extrinsic was received (for example external or submitted through offchain worker) |
extrinsic | set of bytes representing either transaction or inherent |
- Returns
- hash of successfully submitted transaction or error if state is invalid or unknown
Implements kagome::transaction_pool::TransactionPool.
Definition at line 96 of file transaction_pool_impl.cpp.
outcome::result< void > kagome::transaction_pool::TransactionPoolImpl::submitOne |
( |
Transaction && |
tx | ) |
|
|
overridevirtual |
Import one verified transaction to the pool. If it has unresolved dependencies (requires tags of transactions that are not in the pool yet), it will wait in the pool until its dependencies are solved, in which case it becomes ready and may be pruned, or it is banned from the pool for some amount of time as its longevity is reached or the pool is overflown
Implements kagome::transaction_pool::TransactionPool.
Definition at line 110 of file transaction_pool_impl.cpp.
outcome::result< void > kagome::transaction_pool::TransactionPoolImpl::submitOne |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
void kagome::transaction_pool::TransactionPoolImpl::unprovideTag |
( |
const Transaction::Tag & |
tag | ) |
|
|
private |
void kagome::transaction_pool::TransactionPoolImpl::unsetReady |
( |
const std::shared_ptr< Transaction > & |
tx | ) |
|
|
private |
std::shared_ptr<crypto::Hasher> kagome::transaction_pool::TransactionPoolImpl::hasher_ |
|
private |
std::unordered_map<Transaction::Hash, std::shared_ptr<Transaction> > kagome::transaction_pool::TransactionPoolImpl::imported_txs_ |
|
private |
Limits kagome::transaction_pool::TransactionPoolImpl::limits_ |
|
private |
metrics::Gauge* kagome::transaction_pool::TransactionPoolImpl::metric_ready_txs_ |
|
private |
std::unique_ptr<PoolModerator> kagome::transaction_pool::TransactionPoolImpl::moderator_ |
|
private |
std::list<std::weak_ptr<Transaction> > kagome::transaction_pool::TransactionPoolImpl::postponed_txs_ |
|
private |
std::unordered_map<Transaction::Hash, std::weak_ptr<Transaction> > kagome::transaction_pool::TransactionPoolImpl::ready_txs_ |
|
private |
std::multimap<Transaction::Tag, std::weak_ptr<Transaction> > kagome::transaction_pool::TransactionPoolImpl::tx_depends_on_tag_ |
|
private |
std::multimap<Transaction::Tag, std::weak_ptr<Transaction> > kagome::transaction_pool::TransactionPoolImpl::tx_provides_tag_ |
|
private |
std::multimap<Transaction::Tag, std::weak_ptr<Transaction> > kagome::transaction_pool::TransactionPoolImpl::tx_waits_tag_ |
|
private |
The documentation for this class was generated from the following files: