Kagome
Polkadot Runtime Engine in C++17
kagome::consensus::BlockExecutorImpl Class Reference

#include <block_executor_impl.hpp>

Inheritance diagram for kagome::consensus::BlockExecutorImpl:
Collaboration diagram for kagome::consensus::BlockExecutorImpl:

Public Types

enum  Error { Error::INVALID_BLOCK = 1, Error::PARENT_NOT_FOUND, Error::INTERNAL_ERROR }
 

Public Member Functions

 BlockExecutorImpl (std::shared_ptr< blockchain::BlockTree > block_tree, std::shared_ptr< runtime::Core > core, std::shared_ptr< consensus::babe::BabeConfigRepository > babe_config_repo, std::shared_ptr< BlockValidator > block_validator, std::shared_ptr< grandpa::Environment > grandpa_environment, std::shared_ptr< transaction_pool::TransactionPool > tx_pool, std::shared_ptr< crypto::Hasher > hasher, std::shared_ptr< blockchain::DigestTracker > digest_tracker, std::shared_ptr< BabeUtil > babe_util, std::shared_ptr< runtime::OffchainWorkerApi > offchain_worker_api, std::shared_ptr< babe::ConsistencyKeeper > consistency_keeper)
 
outcome::result< void > applyBlock (primitives::BlockData &&block) override
 
outcome::result< void > applyJustification (const primitives::BlockInfo &block_info, const primitives::Justification &justification) override
 
- Public Member Functions inherited from kagome::consensus::BlockExecutor
virtual ~BlockExecutor ()=default
 

Private Attributes

std::shared_ptr< blockchain::BlockTreeblock_tree_
 
std::shared_ptr< runtime::Corecore_
 
std::shared_ptr< consensus::babe::BabeConfigRepositorybabe_config_repo_
 
std::shared_ptr< BlockValidatorblock_validator_
 
std::shared_ptr< grandpa::Environmentgrandpa_environment_
 
std::shared_ptr< transaction_pool::TransactionPooltx_pool_
 
std::shared_ptr< crypto::Hasherhasher_
 
std::shared_ptr< blockchain::DigestTrackerdigest_tracker_
 
std::shared_ptr< BabeUtilbabe_util_
 
std::shared_ptr< runtime::OffchainWorkerApioffchain_worker_api_
 
std::shared_ptr< babe::ConsistencyKeeperconsistency_keeper_
 
std::map< primitives::BlockInfo, primitives::Justificationjustifications_
 
metrics::RegistryPtr metrics_registry_ = metrics::createRegistry()
 
metrics::Histogrammetric_block_execution_time_
 
log::Logger logger_
 
telemetry::Telemetry telemetry_
 

Detailed Description

Definition at line 42 of file block_executor_impl.hpp.

Member Enumeration Documentation

Enumerator
INVALID_BLOCK 
PARENT_NOT_FOUND 
INTERNAL_ERROR 

Definition at line 46 of file block_executor_impl.hpp.

Constructor & Destructor Documentation

kagome::consensus::BlockExecutorImpl::BlockExecutorImpl ( std::shared_ptr< blockchain::BlockTree block_tree,
std::shared_ptr< runtime::Core core,
std::shared_ptr< consensus::babe::BabeConfigRepository babe_config_repo,
std::shared_ptr< BlockValidator block_validator,
std::shared_ptr< grandpa::Environment grandpa_environment,
std::shared_ptr< transaction_pool::TransactionPool tx_pool,
std::shared_ptr< crypto::Hasher hasher,
std::shared_ptr< blockchain::DigestTracker digest_tracker,
std::shared_ptr< BabeUtil babe_util,
std::shared_ptr< runtime::OffchainWorkerApi offchain_worker_api,
std::shared_ptr< babe::ConsistencyKeeper consistency_keeper 
)

Definition at line 44 of file block_executor_impl.cpp.

Member Function Documentation

outcome::result< void > kagome::consensus::BlockExecutorImpl::applyBlock ( primitives::BlockData &&  block)
overridevirtual

Implements kagome::consensus::BlockExecutor.

Definition at line 91 of file block_executor_impl.cpp.

outcome::result< void > kagome::consensus::BlockExecutorImpl::applyJustification ( const primitives::BlockInfo block_info,
const primitives::Justification justification 
)
overridevirtual

Implements kagome::consensus::BlockExecutor.

Definition at line 342 of file block_executor_impl.cpp.

Member Data Documentation

std::shared_ptr<consensus::babe::BabeConfigRepository> kagome::consensus::BlockExecutorImpl::babe_config_repo_
private

Definition at line 70 of file block_executor_impl.hpp.

std::shared_ptr<BabeUtil> kagome::consensus::BlockExecutorImpl::babe_util_
private

Definition at line 76 of file block_executor_impl.hpp.

std::shared_ptr<blockchain::BlockTree> kagome::consensus::BlockExecutorImpl::block_tree_
private

Definition at line 68 of file block_executor_impl.hpp.

std::shared_ptr<BlockValidator> kagome::consensus::BlockExecutorImpl::block_validator_
private

Definition at line 71 of file block_executor_impl.hpp.

std::shared_ptr<babe::ConsistencyKeeper> kagome::consensus::BlockExecutorImpl::consistency_keeper_
private

Definition at line 78 of file block_executor_impl.hpp.

std::shared_ptr<runtime::Core> kagome::consensus::BlockExecutorImpl::core_
private

Definition at line 69 of file block_executor_impl.hpp.

std::shared_ptr<blockchain::DigestTracker> kagome::consensus::BlockExecutorImpl::digest_tracker_
private

Definition at line 75 of file block_executor_impl.hpp.

std::shared_ptr<grandpa::Environment> kagome::consensus::BlockExecutorImpl::grandpa_environment_
private

Definition at line 72 of file block_executor_impl.hpp.

std::shared_ptr<crypto::Hasher> kagome::consensus::BlockExecutorImpl::hasher_
private

Definition at line 74 of file block_executor_impl.hpp.

std::map<primitives::BlockInfo, primitives::Justification> kagome::consensus::BlockExecutorImpl::justifications_
private

Definition at line 81 of file block_executor_impl.hpp.

log::Logger kagome::consensus::BlockExecutorImpl::logger_
private

Definition at line 87 of file block_executor_impl.hpp.

metrics::Histogram* kagome::consensus::BlockExecutorImpl::metric_block_execution_time_
private

Definition at line 85 of file block_executor_impl.hpp.

metrics::RegistryPtr kagome::consensus::BlockExecutorImpl::metrics_registry_ = metrics::createRegistry()
private

Definition at line 84 of file block_executor_impl.hpp.

std::shared_ptr<runtime::OffchainWorkerApi> kagome::consensus::BlockExecutorImpl::offchain_worker_api_
private

Definition at line 77 of file block_executor_impl.hpp.

telemetry::Telemetry kagome::consensus::BlockExecutorImpl::telemetry_
private

Definition at line 88 of file block_executor_impl.hpp.

std::shared_ptr<transaction_pool::TransactionPool> kagome::consensus::BlockExecutorImpl::tx_pool_
private

Definition at line 73 of file block_executor_impl.hpp.


The documentation for this class was generated from the following files: