6 #ifndef KAGOME_CONSENSUS_BABE_BABECONFIGREPOSITORYIMPL 7 #define KAGOME_CONSENSUS_BABE_BABECONFIGREPOSITORYIMPL 19 class AppStateManager;
23 class BlockHeaderRepository;
38 public std::enable_shared_from_this<BabeConfigRepositoryImpl> {
43 const std::shared_ptr<application::AppStateManager> &app_state_manager,
44 std::shared_ptr<storage::BufferStorage> persistent_storage,
45 std::shared_ptr<blockchain::BlockTree> block_tree,
46 std::shared_ptr<blockchain::BlockHeaderRepository> header_repo,
47 std::shared_ptr<runtime::BabeApi> babe_api,
48 std::shared_ptr<crypto::Hasher> hasher,
57 outcome::result<void> onDigest(
61 outcome::result<void> onDigest(
73 std::shared_ptr<const primitives::BabeConfiguration> config(
80 std::function<std::tuple<BabeSlotNumber, bool>()> &&f)
override;
93 outcome::result<void> load();
94 outcome::result<void> save();
101 outcome::result<void> onNextConfigData(
110 std::shared_ptr<BabeConfigNode> getNode(
129 std::shared_ptr<primitives::events::ChainEventSubscriber>
chain_sub_;
135 std::shared_ptr<BabeConfigNode>
root_;
140 bool is_first_block_finalized_ =
false;
147 #endif // KAGOME_CONSENSUS_BABE_BABECONFIGREPOSITORYIMPL
std::shared_ptr< crypto::Hasher > hasher_
std::shared_ptr< storage::BufferStorage > persistent_storage_
std::shared_ptr< runtime::BabeApi > babe_api_
Keeps actual babe configuration.
std::shared_ptr< BabeConfigNode > root_
std::shared_ptr< ChainSubscriptionEngine > ChainSubscriptionEnginePtr
std::shared_ptr< blockchain::BlockHeaderRepository > header_repo_
std::shared_ptr< soralog::Logger > Logger
BabeClock::TimePoint BabeTimePoint
BABE uses system clock's time points.
std::shared_ptr< primitives::events::ChainEventSubscriber > chain_sub_
std::optional< BabeSlotNumber > first_block_slot_number_
uint64_t BabeSlotNumber
slot number of the Babe production
std::shared_ptr< blockchain::BlockTree > block_tree_
boost::variant< Unused< 0 >, NextEpochData, OnDisabled, NextConfigData > BabeDigest
https://github.com/paritytech/substrate/blob/polkadot-v0.9.8/primitives/consensus/babe/src/lib.rs#L130
primitives::BlockHash genesis_block_hash_
uint64_t EpochNumber
number of the epoch in the Babe production
BabeClock::Duration BabeDuration