Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
babe.hpp
Go to the documentation of this file.
1
6
#ifndef KAGOME_BABE_HPP
7
#define KAGOME_BABE_HPP
8
9
#include <optional>
10
11
#include "
consensus/babe/common.hpp
"
12
#include "
consensus/babe/types/epoch_descriptor.hpp
"
13
#include "
network/block_announce_observer.hpp
"
14
15
namespace
kagome::consensus::babe
{
21
class
Babe
:
public
network::BlockAnnounceObserver
{
22
public
:
23
~Babe
()
override
=
default
;
24
25
enum class
State
{
26
WAIT_REMOTE_STATUS
,
// Node is just launched and waits status of remote
27
// peer to sync missing blocks
28
HEADERS_LOADING
,
// Fast sync requested; phase of headers downloading
29
HEADERS_LOADED
,
// Fast sync requested; headers downloaded, ready to
30
// syncing of state
31
STATE_LOADING
,
// Fast sync requested; phase of state downloading
32
CATCHING_UP
,
// Node recognized the missing blocks and started fetching
33
// blocks between the best missing one and one of the
34
// available ones
35
WAIT_BLOCK_ANNOUNCE
,
// Node is fetched missed blocks and wait block
36
// announce with next block to confirm state
37
// 'synchronized'
38
SYNCHRONIZED
// All missing blocks were received and applied, current
39
// peer doing block production
40
};
41
56
virtual
void
runEpoch
(
EpochDescriptor
epoch) = 0;
57
61
virtual
State
getCurrentState
()
const
= 0;
62
69
virtual
bool
wasSynchronized
()
const
= 0;
70
};
71
}
// namespace kagome::consensus::babe
72
73
#endif // KAGOME_BABE_HPP
kagome::consensus::babe::Babe::State::CATCHING_UP
kagome::consensus::babe::Babe::getCurrentState
virtual State getCurrentState() const =0
epoch_descriptor.hpp
common.hpp
kagome::consensus::babe
Definition:
babe.hpp:15
kagome::consensus::babe::Babe::State::HEADERS_LOADED
kagome::consensus::babe::Babe::runEpoch
virtual void runEpoch(EpochDescriptor epoch)=0
kagome::network::BlockAnnounceObserver
Definition:
block_announce_observer.hpp:18
kagome::consensus::babe::Babe::State::WAIT_REMOTE_STATUS
kagome::consensus::babe::Babe::State::SYNCHRONIZED
kagome::consensus::EpochDescriptor
Definition:
epoch_descriptor.hpp:17
kagome::consensus::babe::Babe
Definition:
babe.hpp:21
block_announce_observer.hpp
kagome::consensus::babe::Babe::State::STATE_LOADING
kagome::consensus::babe::Babe::State
State
Definition:
babe.hpp:25
kagome::consensus::babe::Babe::~Babe
~Babe() override=default
kagome::consensus::babe::Babe::State::HEADERS_LOADING
kagome::consensus::babe::Babe::State::WAIT_BLOCK_ANNOUNCE
kagome::consensus::babe::Babe::wasSynchronized
virtual bool wasSynchronized() const =0
core
consensus
babe
babe.hpp
Generated by
1.8.11