Kagome
Polkadot Runtime Engine in C++17
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 
14 
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
virtual State getCurrentState() const =0
virtual void runEpoch(EpochDescriptor epoch)=0
~Babe() override=default
virtual bool wasSynchronized() const =0