Kagome
Polkadot Runtime Engine in C++17
kagome::authorship::ProposerImpl Class Reference

#include <proposer_impl.hpp>

Inheritance diagram for kagome::authorship::ProposerImpl:
Collaboration diagram for kagome::authorship::ProposerImpl:

Public Member Functions

 ~ProposerImpl () override=default
 
 ProposerImpl (std::shared_ptr< BlockBuilderFactory > block_builder_factory, std::shared_ptr< transaction_pool::TransactionPool > transaction_pool, std::shared_ptr< primitives::events::ExtrinsicSubscriptionEngine > ext_sub_engine, std::shared_ptr< subscription::ExtrinsicEventKeyRepository > extrinsic_event_key_repo)
 
outcome::result< primitives::Blockpropose (const primitives::BlockInfo &parent_block, const primitives::InherentData &inherent_data, const primitives::Digest &inherent_digest) override
 
- Public Member Functions inherited from kagome::authorship::Proposer
virtual ~Proposer ()=default
 

Static Public Attributes

static constexpr auto kMaxSkippedTransactions = 8
 
static constexpr size_t kBlockSizeLimit = 4 * 1024 * 1024 + 512
 Default block size limit in bytes. More...
 

Private Attributes

std::shared_ptr< BlockBuilderFactoryblock_builder_factory_
 
std::shared_ptr< transaction_pool::TransactionPooltransaction_pool_
 
std::shared_ptr< primitives::events::ExtrinsicSubscriptionEngineext_sub_engine_
 
std::shared_ptr< subscription::ExtrinsicEventKeyRepositoryextrinsic_event_key_repo_
 
metrics::RegistryPtr metrics_registry_ = metrics::createRegistry()
 
metrics::Gaugemetric_tx_included_in_block_
 
log::Logger logger_ = log::createLogger("Proposer", "authorship")
 

Detailed Description

Definition at line 20 of file proposer_impl.hpp.

Constructor & Destructor Documentation

kagome::authorship::ProposerImpl::~ProposerImpl ( )
overridedefault
kagome::authorship::ProposerImpl::ProposerImpl ( std::shared_ptr< BlockBuilderFactory block_builder_factory,
std::shared_ptr< transaction_pool::TransactionPool transaction_pool,
std::shared_ptr< primitives::events::ExtrinsicSubscriptionEngine ext_sub_engine,
std::shared_ptr< subscription::ExtrinsicEventKeyRepository extrinsic_event_key_repo 
)

Definition at line 17 of file proposer_impl.cpp.

Member Function Documentation

outcome::result< primitives::Block > kagome::authorship::ProposerImpl::propose ( const primitives::BlockInfo parent_block,
const primitives::InherentData inherent_data,
const primitives::Digest inherent_digest 
)
overridevirtual

Creates block from provided parameters

Parameters
parent_blocknumber and hash of parent block
inherent_dataadditional data on block from unsigned extrinsics
inherent_digests- chain-specific block auxiliary data
Returns
proposed block or error

Max varint size in bytes when encoded

Implements kagome::authorship::Proposer.

Definition at line 40 of file proposer_impl.cpp.

Member Data Documentation

std::shared_ptr<BlockBuilderFactory> kagome::authorship::ProposerImpl::block_builder_factory_
private

Definition at line 45 of file proposer_impl.hpp.

std::shared_ptr<primitives::events::ExtrinsicSubscriptionEngine> kagome::authorship::ProposerImpl::ext_sub_engine_
private

Definition at line 48 of file proposer_impl.hpp.

std::shared_ptr<subscription::ExtrinsicEventKeyRepository> kagome::authorship::ProposerImpl::extrinsic_event_key_repo_
private

Definition at line 50 of file proposer_impl.hpp.

constexpr size_t kagome::authorship::ProposerImpl::kBlockSizeLimit = 4 * 1024 * 1024 + 512
static

Default block size limit in bytes.

Definition at line 27 of file proposer_impl.hpp.

constexpr auto kagome::authorship::ProposerImpl::kMaxSkippedTransactions = 8
static

Maximum transactions quantity to try to push into the block before finalization when resources are exhausted (block size limit reached)

Definition at line 24 of file proposer_impl.hpp.

log::Logger kagome::authorship::ProposerImpl::logger_ = log::createLogger("Proposer", "authorship")
private

Definition at line 56 of file proposer_impl.hpp.

metrics::Gauge* kagome::authorship::ProposerImpl::metric_tx_included_in_block_
private

Definition at line 54 of file proposer_impl.hpp.

metrics::RegistryPtr kagome::authorship::ProposerImpl::metrics_registry_ = metrics::createRegistry()
private

Definition at line 53 of file proposer_impl.hpp.

std::shared_ptr<transaction_pool::TransactionPool> kagome::authorship::ProposerImpl::transaction_pool_
private

Definition at line 46 of file proposer_impl.hpp.


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