20 #ifndef RIPPLE_CONSENSUS_CONSENSUS_TYPES_H_INCLUDED
21 #define RIPPLE_CONSENSUS_CONSENSUS_TYPES_H_INCLUDED
23 #include <ripple/basics/chrono.h>
24 #include <ripple/consensus/ConsensusProposal.h>
25 #include <ripple/consensus/DisputedTx.h>
81 return "switchedLedger";
164 dur_ = duration_cast<milliseconds>(tp -
start_);
200 template <
class Traits>
207 using Tx_t =
typename TxSet_t::Tx;
210 typename Ledger_t::ID,
211 typename TxSet_t::ID>;
215 : txns{std::move(s)}, position{std::move(p)}
217 assert(txns.id() == position.position());
ConsensusState
Whether we have or don't have a consensus.
typename Traits::Ledger_t Ledger_t
void tick(std::chrono::milliseconds fixed)
@ proposing
We are normal participant in consensus and propose our position.
Measures the duration of phases of consensus.
@ wrongLedger
We have the wrong ledger and are attempting to acquire it.
typename Traits::NodeID_t NodeID_t
@ Yes
We have consensus along with the network.
@ open
We haven't closed our ledger yet, but others might have.
@ switchedLedger
We switched ledgers since we started this consensus round but are now running on what we believe is t...
std::chrono::steady_clock::time_point time_point
@ accepted
We have accepted a new last closed ledger and are waiting on a call to startRound to begin the next c...
Encapsulates the result of consensus.
std::map< NetClock::time_point, int > peers
Close time estimates, keep ordered for predictable traverse.
@ observing
We are observing peer positions, but not proposing our position.
hash_map< typename Tx_t::ID, Dispute_t > disputes
Transactions which are under dispute with our peers.
std::chrono::milliseconds dur_
std::chrono::milliseconds read() const
void reset(time_point tp)
ConsensusPhase
Phases of consensus for a single ledger round.
@ No
We do not have consensus.
@ MovedOn
The network has consensus without us.
typename TxSet_t::Tx Tx_t
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
ConsensusMode
Represents how a node currently participates in Consensus.
typename Traits::TxSet_t TxSet_t
Proposal_t position
Our proposed position on transactions/close time.
hash_set< typename TxSet_t::ID > compares
ConsensusResult(TxSet_t &&s, Proposal_t &&p)
@ establish
Establishing consensus by exchanging proposals with our peers.
A transaction discovered to be in dispute during consensus.
TxSet_t txns
The set of transactions consensus agrees go in the ledger.
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Stores the set of initial close times.