Kagome
Polkadot Runtime Engine in C++17
proposer_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_AUTHORSHIP_IMPL_AITHORING_IMPL_HPP
7 #define KAGOME_CORE_AUTHORSHIP_IMPL_AITHORING_IMPL_HPP
8 
10 
12 #include "log/logger.hpp"
13 #include "metrics/metrics.hpp"
17 
18 namespace kagome::authorship {
19 
20  class ProposerImpl : public Proposer {
21  public:
24  static constexpr auto kMaxSkippedTransactions = 8;
25 
27  static constexpr size_t kBlockSizeLimit = 4 * 1024 * 1024 + 512;
28 
29  ~ProposerImpl() override = default;
30 
32  std::shared_ptr<BlockBuilderFactory> block_builder_factory,
33  std::shared_ptr<transaction_pool::TransactionPool> transaction_pool,
34  std::shared_ptr<primitives::events::ExtrinsicSubscriptionEngine>
35  ext_sub_engine,
36  std::shared_ptr<subscription::ExtrinsicEventKeyRepository>
37  extrinsic_event_key_repo);
38 
39  outcome::result<primitives::Block> propose(
40  const primitives::BlockInfo &parent_block,
41  const primitives::InherentData &inherent_data,
42  const primitives::Digest &inherent_digest) override;
43 
44  private:
45  std::shared_ptr<BlockBuilderFactory> block_builder_factory_;
46  std::shared_ptr<transaction_pool::TransactionPool> transaction_pool_;
47  std::shared_ptr<primitives::events::ExtrinsicSubscriptionEngine>
49  std::shared_ptr<subscription::ExtrinsicEventKeyRepository>
51 
52  // Metrics
55 
56  log::Logger logger_ = log::createLogger("Proposer", "authorship");
57  };
58 
59 } // namespace kagome::authorship
60 
61 #endif // KAGOME_CORE_AUTHORSHIP_IMPL_AITHORING_IMPL_HPP
std::shared_ptr< BlockBuilderFactory > block_builder_factory_
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)
std::shared_ptr< subscription::ExtrinsicEventKeyRepository > extrinsic_event_key_repo_
static constexpr size_t kBlockSizeLimit
Default block size limit in bytes.
std::shared_ptr< transaction_pool::TransactionPool > transaction_pool_
std::shared_ptr< primitives::events::ExtrinsicSubscriptionEngine > ext_sub_engine_
metrics::Gauge * metric_tx_included_in_block_
metrics::RegistryPtr metrics_registry_
std::unique_ptr< Registry > RegistryPtr
Definition: metrics.hpp:15
~ProposerImpl() override=default
RegistryPtr createRegistry()
static constexpr auto kMaxSkippedTransactions
std::shared_ptr< soralog::Logger > Logger
Definition: logger.hpp:23
outcome::result< primitives::Block > propose(const primitives::BlockInfo &parent_block, const primitives::InherentData &inherent_data, const primitives::Digest &inherent_digest) override
Logger createLogger(const std::string &tag)
Definition: logger.cpp:112
A gauge metric to represent a value that can arbitrarily go up and down.
Definition: metrics.hpp:49