Kagome
Polkadot Runtime Engine in C++17
kagome::consensus::grandpa Namespace Reference

Namespaces

 detail
 

Classes

class  CatchUpObserver
 observes incoming catch-up messages. Abstraction of a network. More...
 
struct  Chain
 
struct  Commit
 A commit message which is an aggregate of precommits. More...
 
struct  CompactCommit
 
struct  Environment
 
class  EnvironmentImpl
 
struct  Equivocated
 
class  Grandpa
 
struct  GrandpaConfig
 
class  GrandpaContext
 
class  GrandpaImpl
 
struct  GrandpaJustification
 
class  GrandpaObserver
 
class  JustificationObserver
 observes justification assigned to syncing blocks. More...
 
struct  MovableRoundState
 Stores the current state of the round. More...
 
class  NeighborObserver
 observes incoming neighbor messages. Abstraction of a network. More...
 
class  RoundObserver
 observes incoming messages. Abstraction of a network. More...
 
struct  SignedMessage
 
class  SignedPrecommit
 
class  SignedPrevote
 
struct  TotalWeight
 
class  VoteCryptoProvider
 
class  VoteCryptoProviderImpl
 
struct  VoteGraph
 
class  VoteGraphImpl
 
struct  VoteMessage
 
struct  VoterSet
 
class  VoteTracker
 
class  VoteTrackerImpl
 
class  VoteWeight
 
class  VotingRound
 
class  VotingRoundImpl
 

Typedefs

using Id = crypto::Ed25519PublicKey
 
using Signature = crypto::Ed25519Signature
 
using BlockHash = primitives::BlockHash
 
using BlockNumber = primitives::BlockNumber
 
using RoundNumber = uint64_t
 
using VoterSetId = uint64_t
 
using Clock = clock::SteadyClock
 
using Duration = Clock::Duration
 
using TimePoint = Clock::TimePoint
 
using Timer = boost::asio::basic_waitable_timer< std::chrono::steady_clock >
 
using BlockInfo = primitives::BlockInfo
 
using Precommit = primitives::detail::BlockInfoT< struct PrecommitTag >
 
using Prevote = primitives::detail::BlockInfoT< struct PrevoteTag >
 
using PrimaryPropose = primitives::detail::BlockInfoT< struct PrimaryProposeTag >
 
using Vote = boost::variant< Prevote, Precommit, PrimaryPropose >
 Note: order of types in variant matters. More...
 
using EquivocatorySignedMessage = std::pair< SignedMessage, SignedMessage >
 
using VoteVariant = boost::variant< SignedMessage, EquivocatorySignedMessage >
 
using PrevoteEquivocation = detail::Equivocation< Prevote >
 
using PrecommitEquivocation = detail::Equivocation< Precommit >
 

Enumerations

enum  VoteGraphError { RECEIVED_BLOCK_LESS_THAN_BASE = 1 }
 
enum  VoteType { VoteType::Prevote, VoteType::Precommit }
 
enum  VotingRoundError {
  VotingRoundError::INVALID_SIGNATURE = 1, VotingRoundError::REDUNDANT_EQUIVOCATION, VotingRoundError::NOT_ENOUGH_WEIGHT, VotingRoundError::JUSTIFICATION_FOR_ROUND_IN_PAST,
  VotingRoundError::JUSTIFICATION_FOR_BLOCK_IN_PAST, VotingRoundError::JUSTIFICATION_FOR_AUTHORITY_SET_IN_PAST, VotingRoundError::JUSTIFIED_BLOCK_IS_GREATER_THAN_ACTUALLY_FINALIZED, VotingRoundError::NO_KNOWN_AUTHORITIES_FOR_BLOCK,
  VotingRoundError::WRONG_ORDER_OF_VOTER_SET_ID, VotingRoundError::LAST_ESTIMATE_BETTER_THAN_PREVOTE, VotingRoundError::UNKNOWN_VOTER, VotingRoundError::ZERO_WEIGHT_VOTER,
  VotingRoundError::DUPLICATED_VOTE, VotingRoundError::EQUIVOCATED_VOTE, VotingRoundError::VOTE_OF_KNOWN_EQUIVOCATOR, VotingRoundError::NO_PREVOTE_CANDIDATE,
  VotingRoundError::ROUND_IS_NOT_FINALIZABLE
}
 

Functions

template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream & operator<< (Stream &s, const SignedMessage &signed_msg)
 
template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream & operator>> (Stream &s, SignedMessage &signed_msg)
 
template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream & operator<< (Stream &s, const SignedPrevote &signed_msg)
 
template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream & operator>> (Stream &s, SignedPrevote &signed_msg)
 
template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream & operator<< (Stream &s, const SignedPrecommit &signed_msg)
 
template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream & operator>> (Stream &s, SignedPrecommit &signed_msg)
 
template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream & operator<< (Stream &s, const VoterSet &voters)
 
template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream & operator>> (Stream &s, VoterSet &voters)
 

Detailed Description

Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0


Class Documentation

struct kagome::consensus::grandpa::Commit

A commit message which is an aggregate of precommits.

Definition at line 160 of file structs.hpp.

Collaboration diagram for kagome::consensus::grandpa::Commit:
Class Members
GrandpaJustification justification
BlockInfo vote
struct kagome::consensus::grandpa::Equivocated

template<typename Message>
struct kagome::consensus::grandpa::Equivocated< Message >

Definition at line 89 of file structs.hpp.

Collaboration diagram for kagome::consensus::grandpa::Equivocated< Message >:
Class Members
Message first
Message second
struct kagome::consensus::grandpa::GrandpaConfig

Structure containing necessary information for running grandpa voting round

Definition at line 15 of file grandpa_config.hpp.

Collaboration diagram for kagome::consensus::grandpa::GrandpaConfig:
Class Members
Duration duration Time bound which is enough to gossip messages to everyone.
optional< Id > id Key of the peer, do not confuse with libp2p peerid.
RoundNumber round_number Number of round.
shared_ptr< VoterSet > voters Current round's authorities.
struct kagome::consensus::grandpa::TotalWeight

Definition at line 181 of file structs.hpp.

Collaboration diagram for kagome::consensus::grandpa::TotalWeight:
Class Members
uint64_t precommit
uint64_t prevote

Typedef Documentation

Definition at line 23 of file common.hpp.

Definition at line 29 of file structs.hpp.

Definition at line 28 of file common.hpp.

Definition at line 29 of file common.hpp.

Definition at line 94 of file structs.hpp.

using kagome::consensus::grandpa::Id = typedef crypto::Ed25519PublicKey

Definition at line 19 of file common.hpp.

Definition at line 30 of file structs.hpp.

Definition at line 31 of file structs.hpp.

Definition at line 33 of file structs.hpp.

using kagome::consensus::grandpa::RoundNumber = typedef uint64_t

Definition at line 25 of file common.hpp.

using kagome::consensus::grandpa::Signature = typedef crypto::Ed25519Signature

Definition at line 22 of file common.hpp.

Definition at line 30 of file common.hpp.

using kagome::consensus::grandpa::Timer = typedef boost::asio::basic_waitable_timer<std::chrono::steady_clock>

Definition at line 27 of file structs.hpp.

Note: order of types in variant matters.

Definition at line 38 of file structs.hpp.

using kagome::consensus::grandpa::VoterSetId = typedef uint64_t

Definition at line 26 of file common.hpp.

Definition at line 95 of file structs.hpp.

Enumeration Type Documentation

Enumerator
RECEIVED_BLOCK_LESS_THAN_BASE 

Definition at line 13 of file vote_graph_error.hpp.

Enumerator
Prevote 
Precommit 

Definition at line 10 of file vote_types.hpp.

Enumerator
INVALID_SIGNATURE 
REDUNDANT_EQUIVOCATION 
NOT_ENOUGH_WEIGHT 
JUSTIFICATION_FOR_ROUND_IN_PAST 
JUSTIFICATION_FOR_BLOCK_IN_PAST 
JUSTIFICATION_FOR_AUTHORITY_SET_IN_PAST 
JUSTIFIED_BLOCK_IS_GREATER_THAN_ACTUALLY_FINALIZED 
NO_KNOWN_AUTHORITIES_FOR_BLOCK 
WRONG_ORDER_OF_VOTER_SET_ID 
LAST_ESTIMATE_BETTER_THAN_PREVOTE 
UNKNOWN_VOTER 
ZERO_WEIGHT_VOTER 
DUPLICATED_VOTE 
EQUIVOCATED_VOTE 
VOTE_OF_KNOWN_EQUIVOCATOR 
NO_PREVOTE_CANDIDATE 
ROUND_IS_NOT_FINALIZABLE 

Definition at line 13 of file voting_round_error.hpp.

Function Documentation

template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream& kagome::consensus::grandpa::operator<< ( Stream &  s,
const SignedMessage signed_msg 
)

Definition at line 78 of file structs.hpp.

template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream& kagome::consensus::grandpa::operator<< ( Stream &  s,
const VoterSet voters 
)

Definition at line 94 of file voter_set.hpp.

template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream& kagome::consensus::grandpa::operator<< ( Stream &  s,
const SignedPrevote signed_msg 
)

Definition at line 115 of file structs.hpp.

template<class Stream , typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream& kagome::consensus::grandpa::operator<< ( Stream &  s,
const SignedPrecommit signed_msg 
)

Definition at line 135 of file structs.hpp.

template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream& kagome::consensus::grandpa::operator>> ( Stream &  s,
SignedMessage signed_msg 
)

Definition at line 84 of file structs.hpp.

template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream& kagome::consensus::grandpa::operator>> ( Stream &  s,
VoterSet voters 
)

Definition at line 100 of file voter_set.hpp.

template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream& kagome::consensus::grandpa::operator>> ( Stream &  s,
SignedPrevote signed_msg 
)

Definition at line 123 of file structs.hpp.

template<class Stream , typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream& kagome::consensus::grandpa::operator>> ( Stream &  s,
SignedPrecommit signed_msg 
)

Definition at line 143 of file structs.hpp.