rippled
RCLConsensus.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef RIPPLE_APP_CONSENSUS_RCLCONSENSUS_H_INCLUDED
21 #define RIPPLE_APP_CONSENSUS_RCLCONSENSUS_H_INCLUDED
22 
23 #include <ripple/app/consensus/RCLCensorshipDetector.h>
24 #include <ripple/app/consensus/RCLCxLedger.h>
25 #include <ripple/app/consensus/RCLCxPeerPos.h>
26 #include <ripple/app/consensus/RCLCxTx.h>
27 #include <ripple/app/misc/FeeVote.h>
28 #include <ripple/app/misc/NegativeUNLVote.h>
29 #include <ripple/basics/CountedObject.h>
30 #include <ripple/basics/Log.h>
31 #include <ripple/basics/chrono.h>
32 #include <ripple/beast/utility/Journal.h>
33 #include <ripple/consensus/Consensus.h>
34 #include <ripple/core/JobQueue.h>
35 #include <ripple/overlay/Message.h>
36 #include <ripple/protocol/RippleLedgerHash.h>
37 #include <ripple/protocol/STValidation.h>
38 #include <ripple/shamap/SHAMap.h>
39 #include <atomic>
40 #include <chrono>
41 #include <mutex>
42 #include <optional>
43 #include <set>
44 
45 namespace ripple {
46 
47 class InboundTransactions;
48 class LocalTxs;
49 class LedgerMaster;
50 class ValidatorKeys;
51 
55 {
58  constexpr static unsigned int censorshipWarnInternal = 15;
59 
60  // Implements the Adaptor template interface required by Consensus.
61  class Adaptor
62  {
66 
70 
71  // If the server is validating, the necessary keying information:
73 
74  // A randomly selected non-zero value used to tag our validations
76 
77  // Ledger we most recently needed to acquire
80 
81  // The timestamp of the last validation we used
83 
84  // These members are queried via public accesors and are atomic for
85  // thread safety.
90 
93 
94  // Since Consensus does not provide intrinsic thread-safety, this mutex
95  // needs to guard all calls to consensus_. One reason it is recursive
96  // is because logic in phaseEstablish() around buildAndValidate()
97  // needs to lock and unlock to protect Consensus data members.
102 
103  public:
105  using NodeID_t = NodeID;
107  using TxSet_t = RCLTxSet;
110 
113 
114  Adaptor(
115  Application& app,
116  std::unique_ptr<FeeVote>&& feeVote,
117  LedgerMaster& ledgerMaster,
118  LocalTxs& localTxs,
119  InboundTransactions& inboundTransactions,
120  ValidatorKeys const& validatorKeys,
121  beast::Journal journal);
122 
123  bool
124  validating() const
125  {
126  return validating_;
127  }
128 
131  {
132  return prevProposers_;
133  }
134 
137  {
138  return prevRoundTime_;
139  }
140 
142  mode() const
143  {
144  return mode_;
145  }
146 
153  bool
155  RCLCxLedger const& prevLedger,
156  hash_set<NodeID> const& nowTrusted);
157 
158  bool
159  haveValidated() const;
160 
162  getValidLedgerIndex() const;
163 
165  getQuorumKeys() const;
166 
168  quorum() const;
169 
171  laggards(Ledger_t::Seq const seq, hash_set<NodeKey_t>& trustedKeys)
172  const;
173 
178  bool
179  validator() const;
180 
188  void
189  updateOperatingMode(std::size_t const positions) const;
190 
193  ConsensusParms const&
194  parms() const
195  {
196  return parms_;
197  }
198 
200  peekMutex() const
201  {
202  return mutex_;
203  }
204 
205  LedgerMaster&
207  {
208  return ledgerMaster_;
209  }
210 
211  void
213  {
214  validating_ = false;
215  }
216 
234  bool
235  retryAccept(
236  Ledger_t const& newLedger,
238  start) const;
239 
246  {
247  return validationDelay_;
248  }
249 
256  void
259  {
260  validationDelay_ = vd;
261  }
262 
269  {
270  return timerDelay_;
271  }
272 
279  void
282  {
283  timerDelay_ = td;
284  }
285 
286  private:
287  //---------------------------------------------------------------------
288  // The following members implement the generic Consensus requirements
289  // and are marked private to indicate ONLY Consensus<Adaptor> will call
290  // them (via friendship). Since they are called only from
291  // Consensus<Adaptor> methods and since RCLConsensus::consensus_ should
292  // only be accessed under lock, these will only be called under lock.
293  //
294  // In general, the idea is that there is only ONE thread that is running
295  // consensus code at anytime. The only special case is the dispatched
296  // onAccept call, which does not take a lock and relies on Consensus not
297  // changing state until a future call to startRound.
298  friend class Consensus<Adaptor>;
299 
308  acquireLedger(LedgerHash const& hash);
309 
314  void
315  share(RCLCxPeerPos const& peerPos);
316 
323  void
324  share(RCLCxTx const& tx);
325 
335  acquireTxSet(RCLTxSet::ID const& setId);
336 
339  bool
340  hasOpenTransactions() const;
341 
348  proposersValidated(LedgerHash const& h) const;
349 
359  proposersFinished(RCLCxLedger const& ledger, LedgerHash const& h) const;
360 
365  void
366  propose(RCLCxPeerPos::Proposal const& proposal);
367 
372  void
373  share(RCLTxSet const& txns);
374 
386  uint256
388  uint256 ledgerID,
389  RCLCxLedger const& ledger,
391 
397  void
399 
408  Result
409  onClose(
410  RCLCxLedger const& ledger,
411  NetClock::time_point const& closeTime,
413  clock_type& clock);
414 
426  void
427  onAccept(
428  Result const& result,
429  ConsensusCloseTimes const& rawCloseTimes,
430  ConsensusMode const& mode,
431  Json::Value&& consensusJson,
433 
439  void
441  Result const& result,
442  RCLCxLedger const& prevLedger,
443  NetClock::duration const& closeResolution,
444  ConsensusCloseTimes const& rawCloseTimes,
445  ConsensusMode const& mode,
446  Json::Value&& consensusJson);
447 
454  void
455  notify(
456  protocol::NodeEvent ne,
457  RCLCxLedger const& ledger,
458  bool haveCorrectLCL);
459 
473  Result const& result,
474  Ledger_t const& prevLedger,
475  NetClock::duration const& closeResolution,
476  ConsensusMode const& mode,
477  Json::Value&& consensusJson);
478 
488  void
491  Result const& result,
492  ConsensusCloseTimes const& rawCloseTimes,
493  ConsensusMode const& mode);
494 
517  buildLCL(
518  RCLCxLedger const& previousLedger,
519  CanonicalTXSet& retriableTxs,
520  NetClock::time_point closeTime,
521  bool closeTimeCorrect,
522  NetClock::duration closeResolution,
523  std::chrono::milliseconds roundTime,
524  std::set<TxID>& failedTxs);
525 
536  void
537  validate(
538  RCLCxLedger const& ledger,
539  RCLTxSet const& txns,
540  bool proposing);
541  };
542 
543 public:
545  RCLConsensus(
546  Application& app,
547  std::unique_ptr<FeeVote>&& feeVote,
548  LedgerMaster& ledgerMaster,
549  LocalTxs& localTxs,
550  InboundTransactions& inboundTransactions,
552  ValidatorKeys const& validatorKeys,
553  beast::Journal journal);
554 
555  RCLConsensus(RCLConsensus const&) = delete;
556 
557  RCLConsensus&
558  operator=(RCLConsensus const&) = delete;
559 
561  bool
562  validating() const
563  {
564  return adaptor_.validating();
565  }
566 
571  {
572  return adaptor_.prevProposers();
573  }
574 
584  {
585  return adaptor_.prevRoundTime();
586  }
587 
590  mode() const
591  {
592  return adaptor_.mode();
593  }
594 
596  phase() const
597  {
598  return consensus_.phase();
599  }
600 
603  getJson(bool full) const;
604 
608  void
609  startRound(
610  NetClock::time_point const& now,
611  RCLCxLedger::ID const& prevLgrId,
612  RCLCxLedger const& prevLgr,
613  hash_set<NodeID> const& nowUntrusted,
614  hash_set<NodeID> const& nowTrusted);
615 
617  void
618  timerEntry(NetClock::time_point const& now);
619 
621  void
622  gotTxSet(NetClock::time_point const& now, RCLTxSet const& txSet);
623 
624  // @see Consensus::prevLedgerID
626  prevLedgerID() const
627  {
629  return consensus_.prevLedgerID();
630  }
631 
633  void
634  simulate(
635  NetClock::time_point const& now,
637 
639  bool
640  peerProposal(
641  NetClock::time_point const& now,
642  RCLCxPeerPos const& newProposal);
643 
644  ConsensusParms const&
645  parms() const
646  {
647  return adaptor_.parms();
648  }
649 
652  {
653  return adaptor_.getTimerDelay();
654  }
655 
656  void
658  {
660  }
661 
662 private:
666 };
667 } // namespace ripple
668 
669 #endif
ripple::RCLConsensus::prevLedgerID
RCLCxLedger::ID prevLedgerID() const
Definition: RCLConsensus.h:626
ripple::RCLConsensus::phase
ConsensusPhase phase() const
Definition: RCLConsensus.h:596
ripple::Application
Definition: Application.h:116
ripple::RCLConsensus::Adaptor::prevRoundTime_
std::atomic< std::chrono::milliseconds > prevRoundTime_
Definition: RCLConsensus.h:87
ripple::RCLConsensus::setTimerDelay
void setTimerDelay(std::optional< std::chrono::milliseconds > td=std::nullopt)
Definition: RCLConsensus.h:657
ripple::RCLCxPeerPos
A peer's signed, proposed position for use in RCLConsensus.
Definition: RCLCxPeerPos.h:44
ripple::RCLConsensus::Adaptor::valCookie_
const std::uint64_t valCookie_
Definition: RCLConsensus.h:75
ripple::RCLCxLedger::Seq
LedgerIndex Seq
Sequence number of a ledger.
Definition: RCLCxLedger.h:41
ripple::RCLConsensus::Adaptor::prevRoundTime
std::chrono::milliseconds prevRoundTime() const
Definition: RCLConsensus.h:136
ripple::RCLConsensus::Adaptor
Definition: RCLConsensus.h:61
ripple::RCLConsensus::getJson
Json::Value getJson(bool full) const
Definition: RCLConsensus.cpp:924
ripple::RCLConsensus::Adaptor::mode_
std::atomic< ConsensusMode > mode_
Definition: RCLConsensus.h:89
ripple::RCLConsensus::Adaptor::feeVote_
std::unique_ptr< FeeVote > feeVote_
Definition: RCLConsensus.h:64
ripple::RCLConsensus::startRound
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.
Definition: RCLConsensus.cpp:1084
ripple::NodeID
base_uint< 160, detail::NodeIDTag > NodeID
NodeID is a 160-bit hash representing one node.
Definition: UintTypes.h:59
ripple::RCLConsensus::Adaptor::mutex_
std::recursive_mutex mutex_
Definition: RCLConsensus.h:98
ripple::RCLConsensus::Adaptor::acquireLedger
std::optional< RCLCxLedger > acquireLedger(LedgerHash const &hash)
Attempt to acquire a specific ledger.
Definition: RCLConsensus.cpp:121
ripple::RCLConsensus::consensus_
Consensus< Adaptor > consensus_
Definition: RCLConsensus.h:664
ripple::RCLConsensus::Adaptor::getValidationDelay
std::optional< std::chrono::milliseconds > getValidationDelay() const
Amount of time delayed waiting to confirm validation.
Definition: RCLConsensus.h:245
std::unordered_set
STL class.
std::pair
ripple::RCLConsensus::Adaptor::setValidationDelay
void setValidationDelay(std::optional< std::chrono::milliseconds > vd=std::nullopt)
Set amount of time that has been delayed waiting for validation.
Definition: RCLConsensus.h:257
ripple::RCLConsensus::Adaptor::preStartRound
bool preStartRound(RCLCxLedger const &prevLedger, hash_set< NodeID > const &nowTrusted)
Called before kicking off a new consensus round.
Definition: RCLConsensus.cpp:988
ripple::LedgerMaster
Definition: LedgerMaster.h:70
ripple::RCLConsensus::Adaptor::hasOpenTransactions
bool hasOpenTransactions() const
Whether the open ledger has any transactions.
Definition: RCLConsensus.cpp:257
ripple::RCLConsensus::RCLConsensus
RCLConsensus(Application &app, std::unique_ptr< FeeVote > &&feeVote, LedgerMaster &ledgerMaster, LocalTxs &localTxs, InboundTransactions &inboundTransactions, Consensus< Adaptor >::clock_type &clock, ValidatorKeys const &validatorKeys, beast::Journal journal)
Constructor.
Definition: RCLConsensus.cpp:52
ripple::Consensus
Generic implementation of consensus algorithm.
Definition: Consensus.h:314
ripple::RCLConsensus::gotTxSet
void gotTxSet(NetClock::time_point const &now, RCLTxSet const &txSet)
Definition: RCLConsensus.cpp:952
std::chrono::milliseconds
ripple::RCLConsensus::Adaptor::getPrevLedger
uint256 getPrevLedger(uint256 ledgerID, RCLCxLedger const &ledger, ConsensusMode mode)
Get the ID of the previous ledger/last closed ledger(LCL) on the network.
Definition: RCLConsensus.cpp:279
ripple::RCLConsensus::Adaptor::onAccept
void onAccept(Result const &result, ConsensusCloseTimes const &rawCloseTimes, ConsensusMode const &mode, Json::Value &&consensusJson, std::pair< CanonicalTxSet_t, Ledger_t > &&txsBuilt)
Process the accepted ledger.
Definition: RCLConsensus.cpp:415
std::recursive_mutex
STL class.
std::lock_guard
STL class.
ripple::RCLConsensus::j_
const beast::Journal j_
Definition: RCLConsensus.h:665
ripple::RCLConsensus::timerEntry
void timerEntry(NetClock::time_point const &now)
Definition: RCLConsensus.cpp:936
ripple::RCLConsensus::Adaptor::nUnlVote_
NegativeUNLVote nUnlVote_
Definition: RCLConsensus.h:92
ripple::RCLConsensus::Adaptor::validationDelay_
std::optional< std::chrono::milliseconds > validationDelay_
Definition: RCLConsensus.h:99
ripple::ConsensusResult
Encapsulates the result of consensus.
Definition: ConsensusTypes.h:202
ripple::RCLConsensus::Adaptor::parms
ConsensusParms const & parms() const
Consensus simulation parameters.
Definition: RCLConsensus.h:194
ripple::ValidatorKeys
Validator keys and manifest as set in configuration file.
Definition: ValidatorKeys.h:36
ripple::RCLConsensus::Adaptor::quorum
std::size_t quorum() const
Definition: RCLConsensus.cpp:1057
ripple::CanonicalTXSet
Holds transactions which were deferred to the next pass of consensus.
Definition: CanonicalTXSet.h:38
ripple::RCLConsensus::simulate
void simulate(NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
Definition: RCLConsensus.cpp:970
ripple::ConsensusMode::observing
@ observing
We are observing peer positions, but not proposing our position.
ripple::RCLConsensus::getTimerDelay
std::optional< std::chrono::milliseconds > getTimerDelay() const
Definition: RCLConsensus.h:651
ripple::base_uint< 256 >
ripple::RCLConsensus::Adaptor::updateOperatingMode
void updateOperatingMode(std::size_t const positions) const
Update operating mode based on current peer positions.
Definition: RCLConsensus.cpp:1077
ripple::RCLConsensus
Manages the generic consensus algorithm for use by the RCL.
Definition: RCLConsensus.h:54
ripple::RCLConsensus::Adaptor::timerDelay_
std::optional< std::chrono::milliseconds > timerDelay_
Definition: RCLConsensus.h:100
ripple::RCLConsensus::Adaptor::haveValidated
bool haveValidated() const
Definition: RCLConsensus.cpp:1039
ripple::RCLConsensus::Adaptor::prevProposers
std::size_t prevProposers() const
Definition: RCLConsensus.h:130
ripple::RCLConsensus::Adaptor::laggards
std::size_t laggards(Ledger_t::Seq const seq, hash_set< NodeKey_t > &trustedKeys) const
Definition: RCLConsensus.cpp:1063
ripple::RCLConsensus::Adaptor::share
void share(RCLCxPeerPos const &peerPos)
Share the given proposal with all peers.
Definition: RCLConsensus.cpp:154
ripple::RCLConsensus::Adaptor::onClose
Result onClose(RCLCxLedger const &ledger, NetClock::time_point const &closeTime, ConsensusMode mode, clock_type &clock)
Close the open ledger and return initial consensus position.
Definition: RCLConsensus.cpp:301
ripple::RCLConsensus::Adaptor::buildAndValidate
std::pair< CanonicalTxSet_t, Ledger_t > buildAndValidate(Result const &result, Ledger_t const &prevLedger, NetClock::duration const &closeResolution, ConsensusMode const &mode, Json::Value &&consensusJson)
Build and attempt to validate a new ledger.
Definition: RCLConsensus.cpp:442
ripple::PublicKey
A public key.
Definition: PublicKey.h:59
ripple::RCLConsensus::peerProposal
bool peerProposal(NetClock::time_point const &now, RCLCxPeerPos const &newProposal)
Definition: RCLConsensus.cpp:979
chrono
ripple::RCLTxSet
Represents a set of transactions in RCLConsensus.
Definition: RCLCxTx.h:65
ripple::RCLConsensus::Adaptor::validate
void validate(RCLCxLedger const &ledger, RCLTxSet const &txns, bool proposing)
Validate the given ledger and share with peers as necessary.
Definition: RCLConsensus.cpp:803
ripple::RCLConsensus::Adaptor::mode
ConsensusMode mode() const
Definition: RCLConsensus.h:142
ripple::RCLConsensus::Adaptor::getLedgerMaster
LedgerMaster & getLedgerMaster() const
Definition: RCLConsensus.h:206
ripple::ConsensusPhase
ConsensusPhase
Phases of consensus for a single ledger round.
Definition: ConsensusTypes.h:102
ripple::RCLConsensus::Adaptor::Adaptor
Adaptor(Application &app, std::unique_ptr< FeeVote > &&feeVote, LedgerMaster &ledgerMaster, LocalTxs &localTxs, InboundTransactions &inboundTransactions, ValidatorKeys const &validatorKeys, beast::Journal journal)
Definition: RCLConsensus.cpp:74
std::chrono::time_point
ripple::RCLConsensus::mode
ConsensusMode mode() const
Definition: RCLConsensus.h:590
ripple::LocalTxs
Definition: LocalTxs.h:33
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
std::uint64_t
ripple::RCLConsensus::Adaptor::censorshipDetector_
RCLCensorshipDetector< TxID, LedgerIndex > censorshipDetector_
Definition: RCLConsensus.h:91
atomic
ripple::RCLConsensus::Adaptor::notify
void notify(protocol::NodeEvent ne, RCLCxLedger const &ledger, bool haveCorrectLCL)
Notify peers of a consensus state change.
Definition: RCLConsensus.cpp:723
ripple::RCLConsensus::adaptor_
Adaptor adaptor_
Definition: RCLConsensus.h:663
ripple::RCLConsensus::Adaptor::validator
bool validator() const
Whether I am a validator.
Definition: RCLConsensus.cpp:1071
ripple::RCLConsensus::parms
ConsensusParms const & parms() const
Definition: RCLConsensus.h:645
ripple::RCLConsensus::Adaptor::parms_
ConsensusParms parms_
Definition: RCLConsensus.h:79
beast::abstract_clock< std::chrono::steady_clock >
ripple::RCLConsensus::Adaptor::j_
const beast::Journal j_
Definition: RCLConsensus.h:69
ripple::RCLConsensus::Adaptor::acquireTxSet
std::optional< RCLTxSet > acquireTxSet(RCLTxSet::ID const &setId)
Acquire the transaction set associated with a proposal.
Definition: RCLConsensus.cpp:247
ripple::RCLConsensus::Adaptor::buildLCL
RCLCxLedger buildLCL(RCLCxLedger const &previousLedger, CanonicalTXSet &retriableTxs, NetClock::time_point closeTime, bool closeTimeCorrect, NetClock::duration closeResolution, std::chrono::milliseconds roundTime, std::set< TxID > &failedTxs)
Build the new last closed ledger.
Definition: RCLConsensus.cpp:762
ripple::RCLConsensus::Adaptor::clearValidating
void clearValidating()
Definition: RCLConsensus.h:212
ripple::RCLConsensus::censorshipWarnInternal
constexpr static unsigned int censorshipWarnInternal
Warn for transactions that haven't been included every so many ledgers.
Definition: RCLConsensus.h:58
ripple::RCLConsensus::Adaptor::onModeChange
void onModeChange(ConsensusMode before, ConsensusMode after)
Notified of change in consensus mode.
Definition: RCLConsensus.cpp:890
ripple::RCLCxLedger
Represents a ledger in RCLConsensus.
Definition: RCLCxLedger.h:35
ripple::RCLConsensus::operator=
RCLConsensus & operator=(RCLConsensus const &)=delete
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RCLConsensus::prevRoundTime
std::chrono::milliseconds prevRoundTime() const
Get duration of the previous round.
Definition: RCLConsensus.h:583
ripple::ConsensusMode
ConsensusMode
Represents how a node currently participates in Consensus.
Definition: ConsensusTypes.h:54
ripple::RCLConsensus::Adaptor::getValidLedgerIndex
LedgerIndex getValidLedgerIndex() const
Definition: RCLConsensus.cpp:1045
ripple::RCLCensorshipDetector
Definition: RCLCensorshipDetector.h:32
ripple::ConsensusParms
Consensus algorithm parameters.
Definition: ConsensusParms.h:33
ripple::RCLConsensus::Adaptor::peekMutex
std::recursive_mutex & peekMutex() const
Definition: RCLConsensus.h:200
ripple::RCLConsensus::Adaptor::acquiringLedger_
LedgerHash acquiringLedger_
Definition: RCLConsensus.h:78
ripple::RCLConsensus::Adaptor::retryAccept
bool retryAccept(Ledger_t const &newLedger, std::optional< std::chrono::time_point< std::chrono::steady_clock >> &start) const
Whether to try building another ledger to validate.
Definition: RCLConsensus.cpp:906
ripple::RCLConsensus::Adaptor::validating_
std::atomic< bool > validating_
Definition: RCLConsensus.h:101
ripple::RCLConsensus::prevProposers
std::size_t prevProposers() const
Get the number of proposing peers that participated in the previous round.
Definition: RCLConsensus.h:570
ripple::RCLConsensus::Adaptor::ledgerMaster_
LedgerMaster & ledgerMaster_
Definition: RCLConsensus.h:65
ripple::RCLConsensus::Adaptor::proposersValidated
std::size_t proposersValidated(LedgerHash const &h) const
Number of proposers that have validated the given ledger.
Definition: RCLConsensus.cpp:263
optional
mutex
ripple::after
static bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: Escrow.cpp:88
std::size_t
ripple::RCLConsensus::Adaptor::prepareOpenLedger
void prepareOpenLedger(std::pair< CanonicalTxSet_t, Ledger_t > &&txsBuilt, Result const &result, ConsensusCloseTimes const &rawCloseTimes, ConsensusMode const &mode)
Prepare the next open ledger.
Definition: RCLConsensus.cpp:585
ripple::NegativeUNLVote
Manager to create NegativeUNL votes.
Definition: NegativeUNLVote.h:46
ripple::RCLConsensus::Adaptor::inboundTransactions_
InboundTransactions & inboundTransactions_
Definition: RCLConsensus.h:68
ripple::RCLConsensus::validating
bool validating() const
Whether we are validating consensus ledgers.
Definition: RCLConsensus.h:562
ripple::RCLConsensus::Adaptor::getTimerDelay
std::optional< std::chrono::milliseconds > getTimerDelay() const
Amount of time to wait for heartbeat.
Definition: RCLConsensus.h:268
ripple::RCLCxTx
Represents a transaction in RCLConsensus.
Definition: RCLCxTx.h:35
ripple::RCLConsensus::Adaptor::Ledger_t
RCLCxLedger Ledger_t
Definition: RCLConsensus.h:104
ripple::RCLConsensus::Adaptor::app_
Application & app_
Definition: RCLConsensus.h:63
ripple::RCLConsensus::Adaptor::setTimerDelay
void setTimerDelay(std::optional< std::chrono::milliseconds > td=std::nullopt)
Set amount of time to wait for next heartbeat.
Definition: RCLConsensus.h:280
std::unique_ptr
STL class.
ripple::RCLConsensus::Adaptor::propose
void propose(RCLCxPeerPos::Proposal const &proposal)
Propose the given position to my peers.
Definition: RCLConsensus.cpp:202
ripple::RCLConsensus::Adaptor::localTxs_
LocalTxs & localTxs_
Definition: RCLConsensus.h:67
ripple::RCLConsensus::Adaptor::lastValidationTime_
NetClock::time_point lastValidationTime_
Definition: RCLConsensus.h:82
ripple::RCLConsensus::Adaptor::proposersFinished
std::size_t proposersFinished(RCLCxLedger const &ledger, LedgerHash const &h) const
Number of proposers that have validated a ledger descended from requested ledger.
Definition: RCLConsensus.cpp:269
ripple::Stopwatch
beast::abstract_clock< std::chrono::steady_clock > Stopwatch
A clock for measuring elapsed time.
Definition: chrono.h:81
ripple::RCLConsensus::Adaptor::prevProposers_
std::atomic< std::size_t > prevProposers_
Definition: RCLConsensus.h:86
ripple::RCLConsensus::Adaptor::validatorKeys_
ValidatorKeys const & validatorKeys_
Definition: RCLConsensus.h:72
ripple::RCLConsensus::Adaptor::onForceAccept
void onForceAccept(Result const &result, RCLCxLedger const &prevLedger, NetClock::duration const &closeResolution, ConsensusCloseTimes const &rawCloseTimes, ConsensusMode const &mode, Json::Value &&consensusJson)
Process the accepted ledger that was a result of simulation/force accept.
Definition: RCLConsensus.cpp:401
set
ripple::RCLConsensus::Adaptor::getQuorumKeys
std::pair< std::size_t, hash_set< NodeKey_t > > getQuorumKeys() const
Definition: RCLConsensus.cpp:1051
ripple::RCLConsensus::Adaptor::validating
bool validating() const
Definition: RCLConsensus.h:124
ripple::ConsensusCloseTimes
Stores the set of initial close times.
Definition: ConsensusTypes.h:173
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::InboundTransactions
Manages the acquisition and lifetime of transaction sets.
Definition: InboundTransactions.h:35
ripple::ConsensusProposal< NodeID, uint256, uint256, LedgerIndex >