rippled
Classes | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
ripple::RCLConsensus Class Reference

Manages the generic consensus algorithm for use by the RCL. More...

Collaboration diagram for ripple::RCLConsensus:
Collaboration graph
[legend]

Classes

class  Adaptor
 

Public Member Functions

 RCLConsensus (Application &app, std::unique_ptr< FeeVote > &&feeVote, LedgerMaster &ledgerMaster, LocalTxs &localTxs, InboundTransactions &inboundTransactions, Consensus< Adaptor >::clock_type const &clock, ValidatorKeys const &validatorKeys, beast::Journal journal)
 Constructor. More...
 
 RCLConsensus (RCLConsensus const &)=delete
 
RCLConsensusoperator= (RCLConsensus const &)=delete
 
bool validating () const
 Whether we are validating consensus ledgers. More...
 
std::size_t prevProposers () const
 Get the number of proposing peers that participated in the previous round. More...
 
std::chrono::milliseconds prevRoundTime () const
 Get duration of the previous round. More...
 
ConsensusMode mode () const
 
ConsensusPhase phase () const
 
Json::Value getJson (bool full) const
 
void startRound (NetClock::time_point const &now, RCLCxLedger::ID const &prevLgrId, RCLCxLedger const &prevLgr, hash_set< NodeID > const &nowUntrusted, hash_set< NodeID > const &nowTrusted)
 Adjust the set of trusted validators and kick-off the next round of consensus. More...
 
void timerEntry (NetClock::time_point const &now)
 
void gotTxSet (NetClock::time_point const &now, RCLTxSet const &txSet)
 
RCLCxLedger::ID prevLedgerID () const
 
void simulate (NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
 
bool peerProposal (NetClock::time_point const &now, RCLCxPeerPos const &newProposal)
 
ConsensusParms const & parms () const
 

Private Attributes

std::recursive_mutex mutex_
 
Adaptor adaptor_
 
Consensus< Adaptorconsensus_
 
const beast::Journal j_
 

Static Private Attributes

constexpr static unsigned int censorshipWarnInternal = 15
 Warn for transactions that haven't been included every so many ledgers. More...
 

Detailed Description

Manages the generic consensus algorithm for use by the RCL.

Definition at line 50 of file RCLConsensus.h.

Constructor & Destructor Documentation

◆ RCLConsensus() [1/2]

ripple::RCLConsensus::RCLConsensus ( Application app,
std::unique_ptr< FeeVote > &&  feeVote,
LedgerMaster ledgerMaster,
LocalTxs localTxs,
InboundTransactions inboundTransactions,
Consensus< Adaptor >::clock_type const &  clock,
ValidatorKeys const &  validatorKeys,
beast::Journal  journal 
)

Constructor.

Definition at line 52 of file RCLConsensus.cpp.

◆ RCLConsensus() [2/2]

ripple::RCLConsensus::RCLConsensus ( RCLConsensus const &  )
delete

Member Function Documentation

◆ operator=()

RCLConsensus& ripple::RCLConsensus::operator= ( RCLConsensus const &  )
delete

◆ validating()

bool ripple::RCLConsensus::validating ( ) const

Whether we are validating consensus ledgers.

Definition at line 435 of file RCLConsensus.h.

◆ prevProposers()

std::size_t ripple::RCLConsensus::prevProposers ( ) const

Get the number of proposing peers that participated in the previous round.

Definition at line 443 of file RCLConsensus.h.

◆ prevRoundTime()

std::chrono::milliseconds ripple::RCLConsensus::prevRoundTime ( ) const

Get duration of the previous round.

The duration of the round is the establish phase, measured from closing the open ledger to accepting the consensus result.

Returns
Last round duration in milliseconds

Definition at line 456 of file RCLConsensus.h.

◆ mode()

ConsensusMode ripple::RCLConsensus::mode ( ) const
See also
Consensus::mode

Definition at line 463 of file RCLConsensus.h.

◆ phase()

ConsensusPhase ripple::RCLConsensus::phase ( ) const

Definition at line 469 of file RCLConsensus.h.

◆ getJson()

Json::Value ripple::RCLConsensus::getJson ( bool  full) const
See also
Consensus::getJson

Definition at line 893 of file RCLConsensus.cpp.

◆ startRound()

void ripple::RCLConsensus::startRound ( NetClock::time_point const &  now,
RCLCxLedger::ID const &  prevLgrId,
RCLCxLedger const &  prevLgr,
hash_set< NodeID > const &  nowUntrusted,
hash_set< NodeID > const &  nowTrusted 
)

Adjust the set of trusted validators and kick-off the next round of consensus.

For more details,

See also
Consensus::startRound

Definition at line 1047 of file RCLConsensus.cpp.

◆ timerEntry()

void ripple::RCLConsensus::timerEntry ( NetClock::time_point const &  now)
See also
Consensus::timerEntry

Definition at line 905 of file RCLConsensus.cpp.

◆ gotTxSet()

void ripple::RCLConsensus::gotTxSet ( NetClock::time_point const &  now,
RCLTxSet const &  txSet 
)
See also
Consensus::gotTxSet

Definition at line 921 of file RCLConsensus.cpp.

◆ prevLedgerID()

RCLCxLedger::ID ripple::RCLConsensus::prevLedgerID ( ) const

Definition at line 499 of file RCLConsensus.h.

◆ simulate()

void ripple::RCLConsensus::simulate ( NetClock::time_point const &  now,
std::optional< std::chrono::milliseconds consensusDelay 
)
See also
Consensus::simulate

Definition at line 939 of file RCLConsensus.cpp.

◆ peerProposal()

bool ripple::RCLConsensus::peerProposal ( NetClock::time_point const &  now,
RCLCxPeerPos const &  newProposal 
)
See also
Consensus::proposal

Definition at line 948 of file RCLConsensus.cpp.

◆ parms()

ConsensusParms const& ripple::RCLConsensus::parms ( ) const

Definition at line 518 of file RCLConsensus.h.

Member Data Documentation

◆ censorshipWarnInternal

constexpr static unsigned int ripple::RCLConsensus::censorshipWarnInternal = 15
staticconstexprprivate

Warn for transactions that haven't been included every so many ledgers.

Definition at line 54 of file RCLConsensus.h.

◆ mutex_

std::recursive_mutex ripple::RCLConsensus::mutex_
mutableprivate

Definition at line 527 of file RCLConsensus.h.

◆ adaptor_

Adaptor ripple::RCLConsensus::adaptor_
private

Definition at line 529 of file RCLConsensus.h.

◆ consensus_

Consensus<Adaptor> ripple::RCLConsensus::consensus_
private

Definition at line 530 of file RCLConsensus.h.

◆ j_

const beast::Journal ripple::RCLConsensus::j_
private

Definition at line 531 of file RCLConsensus.h.