Kagome
Polkadot Runtime Engine in C++17
|
#include <environment.hpp>
Public Types | |
using | CompleteHandler = std::function< void(outcome::result< MovableRoundState >)> |
Public Member Functions | |
~Environment () override=default | |
virtual void | setJustificationObserver (std::weak_ptr< JustificationObserver > justification_observer)=0 |
virtual outcome::result< void > | onCatchUpRequested (const libp2p::peer::PeerId &peer_id, VoterSetId set_id, RoundNumber round_number)=0 |
virtual outcome::result< void > | onCatchUpRespond (const libp2p::peer::PeerId &peer_id, VoterSetId set_id, RoundNumber round_number, std::vector< SignedPrevote > prevote_justification, std::vector< SignedPrecommit > precommit_justification, BlockInfo best_final_candidate)=0 |
virtual void | sendState (const libp2p::peer::PeerId &peer_id, const MovableRoundState &state, VoterSetId voter_set_id)=0 |
virtual outcome::result< void > | onVoted (RoundNumber round, VoterSetId set_id, const SignedMessage &vote)=0 |
virtual outcome::result< void > | onCommitted (RoundNumber round, VoterSetId voter_ser_id, const BlockInfo &vote, const GrandpaJustification &justification)=0 |
virtual outcome::result< void > | onNeighborMessageSent (RoundNumber round, VoterSetId set_id, BlockNumber last_finalized)=0 |
virtual outcome::result< void > | applyJustification (const BlockInfo &block_info, const primitives::Justification &justification)=0 |
virtual outcome::result< void > | finalize (VoterSetId id, const GrandpaJustification &justification)=0 |
virtual outcome::result< GrandpaJustification > | getJustification (const BlockHash &block_hash)=0 |
Public Member Functions inherited from kagome::consensus::grandpa::Chain | |
virtual | ~Chain ()=default |
virtual outcome::result< bool > | hasBlock (const primitives::BlockHash &block) const =0 |
Checks if {. More... | |
virtual outcome::result< std::vector< primitives::BlockHash > > | getAncestry (const primitives::BlockHash &base, const primitives::BlockHash &block) const =0 |
Get the ancestry of a {. More... | |
virtual bool | hasAncestry (const primitives::BlockHash &base, const primitives::BlockHash &block) const =0 |
Check if block is ancestor for second one. More... | |
virtual outcome::result< BlockInfo > | bestChainContaining (const primitives::BlockHash &base, std::optional< VoterSetId > voter_set_id) const =0 |
bool | isEqualOrDescendOf (const primitives::BlockHash &base, const primitives::BlockHash &block) const |
Necessary environment for a voter. This encapsulates the database and networking layers of the chain.
Definition at line 42 of file environment.hpp.
using kagome::consensus::grandpa::Environment::CompleteHandler = std::function<void(outcome::result<MovableRoundState>)> |
Definition at line 44 of file environment.hpp.
|
overridedefault |
|
pure virtual |
Validate provided {
justification} | for finalization { |
block}. | If it valid finalize { |
block} | and save { |
justification} | in storage. |
block | is observed block info |
justification | justification of finalization of provided block |
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Triggered when blovk
block | justified by |
justification | should be applied to the storage |
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Returns justification for given block
block_hash | hash of the block that we are trying to get justification for |
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Make catch-up-request
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Make catch-up-response
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Triggered when current peer appears in given round and has given voter_ser_id intends to send committed vote justified by provided justification
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Triggered when current peer should send neighbor message
round | current round |
set_id | id of actual voter set |
last_finalized | last known finalized block |
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Note that we've done a vote in the given round. Triggered when current peer appears in provided round with provided set_id and given vote is ready to be sent.
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Propagate round state
Implemented in kagome::consensus::grandpa::EnvironmentImpl.
|
pure virtual |
Sets back-link to Grandpa
Implemented in kagome::consensus::grandpa::EnvironmentImpl.