hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::consensus::yac Namespace Reference

Classes

class  ClusterOrdering
 
struct  CommitMessage
 
class  CryptoProviderImpl
 
class  HashGate
 
class  NetworkImpl
 
class  PbConverters
 
class  PeerOrdererImpl
 
struct  RejectMessage
 
class  SupermajorityChecker
 
class  SupermajorityCheckerImpl
 
class  Timer
 
class  TimerImpl
 
struct  VoteMessage
 
class  Yac
 
class  YacBlockStorage
 
class  YacCryptoProvider
 
class  YacGate
 
class  YacGateImpl
 
class  YacHash
 
class  YacHashProvider
 
class  YacHashProviderImpl
 
class  YacInit
 
class  YacNetwork
 
class  YacNetworkNotifications
 
class  YacPeerOrderer
 
class  YacProposalStorage
 
class  YacVoteStorage
 

Typedefs

using Answer = boost::variant< CommitMessage, RejectMessage >
 
using ProposalHash = std::string
 
using BlockHash = std::string
 
using PeersNumberType = size_t
 Type for number of peers in round. More...
 

Enumerations

enum  ProposalState { ProposalState::kNotSentNotProcessed, ProposalState::kSentNotProcessed, ProposalState::kSentProcessed }
 

Functions

template<typename T >
static std::string cryptoError (const T &votes)
 
bool sameKeys (const std::vector< VoteMessage > &votes)
 
boost::optional< RoundgetKey (const std::vector< VoteMessage > &votes)
 
boost::optional< YacHashgetHash (const std::vector< VoteMessage > &votes)
 

Typedef Documentation

using iroha::consensus::yac::Answer = typedef boost::variant<CommitMessage, RejectMessage>

Contains proof of supermajority for all purposes;

Type for number of peers in round.

Enumeration Type Documentation

Proposal outcome states for multicast propagation strategy

Outcome is either CommitMessage, which guarantees that supermajority of votes for the proposal-block hashes is collected, or RejectMessage, which states that supermajority of votes for a block hash cannot be achieved

kNotSentNotProcessed - outcome was not propagated in the network AND it was not passed to pipeline. Initial state after receiving an outcome from storage. Outcome with votes is propagated to the network in this state.

kSentNotProcessed - outcome was propagated in the network AND it was not passed to pipeline. State can be set in two cases:

  1. Outcome is received from the network. Some node has already achieved an outcome and has propagated it to the network, so the first state is skipped.
  2. Outcome was propagated to the network Outcome is passed to pipeline in this state.

kSentProcessed - outcome was propagated in the network AND it was passed to pipeline. Set after passing proposal to pipeline. This state is final. Receiving a network message in this state results in direct propagation of outcome to message sender.

Enumerator
kNotSentNotProcessed 
kSentNotProcessed 
kSentProcessed 

Function Documentation

template<typename T >
static std::string iroha::consensus::yac::cryptoError ( const T &  votes)
static

Here is the call graph for this function:

Here is the caller graph for this function:

boost::optional< YacHash > iroha::consensus::yac::getHash ( const std::vector< VoteMessage > &  votes)

Get common hash from collection

Parameters
votes- collection with votes
Returns
hash, if collection elements have same hash, otherwise boost::none

Here is the call graph for this function:

Here is the caller graph for this function:

boost::optional< Round > iroha::consensus::yac::getKey ( const std::vector< VoteMessage > &  votes)

Provide key common for whole collection

Parameters
votes- collection with votes
Returns
vote round, if collection shared the same round, otherwise boost::none

Here is the call graph for this function:

bool iroha::consensus::yac::sameKeys ( const std::vector< VoteMessage > &  votes)

Check that all votes in collection have the same key

Parameters
votes- collection of votes
Returns
true, if rounds of those votes are the same

Here is the caller graph for this function: