rippled
LedgerMaster.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_LEDGER_LEDGERMASTER_H_INCLUDED
21 #define RIPPLE_APP_LEDGER_LEDGERMASTER_H_INCLUDED
22 
23 #include <ripple/app/ledger/AbstractFetchPackContainer.h>
24 #include <ripple/app/ledger/InboundLedgers.h>
25 #include <ripple/app/ledger/Ledger.h>
26 #include <ripple/app/ledger/LedgerCleaner.h>
27 #include <ripple/app/ledger/LedgerHistory.h>
28 #include <ripple/app/ledger/LedgerHolder.h>
29 #include <ripple/app/ledger/LedgerReplay.h>
30 #include <ripple/app/main/Application.h>
31 #include <ripple/app/misc/CanonicalTXSet.h>
32 #include <ripple/basics/RangeSet.h>
33 #include <ripple/basics/StringUtilities.h>
34 #include <ripple/basics/chrono.h>
35 #include <ripple/beast/insight/Collector.h>
36 #include <ripple/beast/utility/PropertyStream.h>
37 #include <ripple/core/Stoppable.h>
38 #include <ripple/protocol/Protocol.h>
39 #include <ripple/protocol/RippleLedgerHash.h>
40 #include <ripple/protocol/STValidation.h>
41 #include <ripple/protocol/messages.h>
42 #include <boost/optional.hpp>
43 
44 #include <mutex>
45 
46 namespace ripple {
47 
48 class Peer;
49 class Transaction;
50 
51 // Tracks the current ledger and any ledgers in the process of closing
52 // Tracks ledger history
53 // Tracks held transactions
55 {
56 public:
57  explicit LedgerMaster(
58  Application& app,
60  Stoppable& parent,
61  beast::insight::Collector::ptr const& collector,
62  beast::Journal journal);
63 
64  virtual ~LedgerMaster() = default;
65 
70 
71  bool
72  isCompatible(ReadView const&, beast::Journal::Stream, char const* reason);
73 
75  peekMutex();
76 
77  // The current ledger is the ledger we believe new transactions should go in
80 
81  // The finalized ledger is the last closed/accepted ledger
84  {
85  return mClosedLedger.get();
86  }
87 
88  // The validated ledger is the last fully validated ledger
91  {
92  return mValidLedger.get();
93  }
94 
95  // The Rules are in the last fully validated ledger if there is one.
96  Rules
98 
99  // This is the last ledger we published to clients and can lag the validated
100  // ledger
103 
108  bool
109  isCaughtUp(std::string& reason);
110 
113 
114  bool
116 
117  void
119  std::shared_ptr<Ledger const> const& ledger,
120  bool isSynchronous,
121  bool isCurrent);
122 
127  bool
129 
130  void
131  switchLCL(std::shared_ptr<Ledger const> const& lastClosed);
132 
133  void
134  failedSave(std::uint32_t seq, uint256 const& hash);
135 
138 
144  void
146 
154  pruneHeldTransactions(AccountID const& account, std::uint32_t const seq);
155 
158  uint256
160 
162  boost::optional<LedgerHash>
164 
172  boost::optional<LedgerHash>
174  std::uint32_t index,
175  std::shared_ptr<ReadView const> const& referenceLedger);
176 
179 
181  getLedgerByHash(uint256 const& hash);
182 
183  void
185 
186  boost::optional<LedgerHash>
188  std::uint32_t desiredSeq,
189  std::shared_ptr<ReadView const> const& knownGoodLedger);
190 
191  boost::optional<NetClock::time_point>
192  getCloseTimeBySeq(LedgerIndex ledgerIndex);
193 
194  boost::optional<NetClock::time_point>
195  getCloseTimeByHash(LedgerHash const& ledgerHash, LedgerIndex ledgerIndex);
196 
197  void
199  void
200  fixMismatch(ReadView const& ledger);
201 
202  bool
204  void
206  bool
208  bool
210 
211  void
212  tune(int size, std::chrono::seconds age);
213  void
214  sweep();
215  float
216  getCacheHitRate();
217 
218  void
220  void
221  checkAccept(uint256 const& hash, std::uint32_t seq);
222  void
224  std::shared_ptr<Ledger const> const& ledger,
225  uint256 const& consensusHash,
226  Json::Value consensus);
227 
230  void
232 
233  void
234  tryAdvance();
235  bool
236  newPathRequest(); // Returns true if path request successfully placed.
237  bool
239  bool
240  newOrderBookDB(); // Returns true if able to fulfill request.
241 
242  bool
243  fixIndex(LedgerIndex ledgerIndex, LedgerHash const& ledgerHash);
244  void
245  doLedgerCleaner(Json::Value const& parameters);
246 
249 
250  void
252 
253  void
255 
256  // ledger replay
257  void
260  releaseReplay();
261 
262  // Fetch Packs
263  void
264  gotFetchPack(bool progress, std::uint32_t seq);
265 
266  void
267  addFetchPack(uint256 const& hash, std::shared_ptr<Blob>& data);
268 
269  boost::optional<Blob>
270  getFetchPack(uint256 const& hash) override;
271 
272  void
274  std::weak_ptr<Peer> const& wPeer,
276  uint256 haveLedgerHash,
277  UptimeClock::time_point uptime);
278 
280  getFetchPackCacheSize() const;
281 
283  bool
285  {
286  return !mValidLedger.empty();
287  }
288 
289 private:
290  void
292  void
294 
295  void
297 
298  void
300 
301  boost::optional<LedgerHash>
303 
306  void
307  advanceThread();
308  void
310  std::uint32_t missing,
311  bool& progress,
312  InboundLedger::Reason reason,
314  // Try to publish ledgers, acquire missing ledgers. Always called with
315  // m_mutex locked. The passed lock is a reminder to callers.
316  void
318 
321 
322  void
323  updatePaths(Job& job);
324 
325  // Returns true if work started. Always called with m_mutex locked.
326  // The passed lock is a reminder to callers.
327  bool
329 
332 
334 
335  // The ledger that most recently closed.
337 
338  // The highest-sequence ledger we have fully accepted.
340 
341  // The last ledger we have published.
343 
344  // The last ledger we did pathfinding against.
346 
347  // The last ledger we handled fetching history
349 
350  // The last ledger we handled fetching for a shard
352 
353  // Fully validated ledger, whether or not we have the ledger resident.
355 
357 
359 
360  // A set of transactions to replay during the next close
362 
365 
367 
368  // Publish thread is running.
369  bool mAdvanceThread{false};
370 
371  // Publish thread has work to do.
372  bool mAdvanceWork{false};
374 
375  int mPathFindThread{0}; // Pathfinder jobs dispatched
376  bool mPathFindNewRequest{false};
377 
379  ATOMIC_FLAG_INIT; // GotFetchPack jobs dispatched
380 
386 
387  // The server is in standalone mode
388  bool const standalone_;
389 
390  // How many ledgers before the current ledger do we allow peers to request?
392 
393  // How much history do we want to keep
395 
397 
399 
401 
402  // Try to keep a validator from switching from test to live network
403  // without first wiping the database.
405 
406 private:
407  struct Stats
408  {
409  template <class Handler>
411  Handler const& handler,
412  beast::insight::Collector::ptr const& collector)
413  : hook(collector->make_hook(handler))
415  collector->make_gauge("LedgerMaster", "Validated_Ledger_Age"))
417  collector->make_gauge("LedgerMaster", "Published_Ledger_Age"))
418  {
419  }
420 
424  };
425 
427 
428 private:
429  void
431  {
432  std::lock_guard lock(m_mutex);
435  }
436 };
437 
438 } // namespace ripple
439 
440 #endif
ripple::LedgerMaster::getValidatedRange
bool getValidatedRange(std::uint32_t &minVal, std::uint32_t &maxVal)
Definition: LedgerMaster.cpp:627
ripple::LedgerMaster::mPubLedger
std::shared_ptr< Ledger const > mPubLedger
Definition: LedgerMaster.h:342
ripple::Application
Definition: Application.h:94
ripple::LedgerMaster::mClosedLedger
LedgerHolder mClosedLedger
Definition: LedgerMaster.h:336
ripple::LedgerMaster::getPublishedLedger
std::shared_ptr< ReadView const > getPublishedLedger()
Definition: LedgerMaster.cpp:1514
ripple::LedgerMaster::fetch_packs_
TaggedCache< uint256, Blob > fetch_packs_
Definition: LedgerMaster.h:398
ripple::LedgerMaster::makeFetchPack
void makeFetchPack(std::weak_ptr< Peer > const &wPeer, std::shared_ptr< protocol::TMGetObjectByHash > const &request, uint256 haveLedgerHash, UptimeClock::time_point uptime)
Definition: LedgerMaster.cpp:2001
ripple::LedgerMaster::clearLedgerCachePrior
void clearLedgerCachePrior(LedgerIndex seq)
Definition: LedgerMaster.cpp:1726
std::string
STL class.
std::shared_ptr< Collector >
ripple::TaggedCache
Map/cache combination.
Definition: TaggedCache.h:52
ripple::LedgerMaster::sweep
void sweep()
Definition: LedgerMaster.cpp:1699
ripple::LedgerMaster::mBuildingLedgerSeq
std::atomic< LedgerIndex > mBuildingLedgerSeq
Definition: LedgerMaster.h:385
ripple::LedgerMaster::app_
Application & app_
Definition: LedgerMaster.h:330
ripple::LedgerMaster::Stats::Stats
Stats(Handler const &handler, beast::insight::Collector::ptr const &collector)
Definition: LedgerMaster.h:410
ripple::LedgerMaster::advanceThread
void advanceThread()
Definition: LedgerMaster.cpp:1162
ripple::LedgerMaster::pruneHeldTransactions
std::vector< std::shared_ptr< STTx const > > pruneHeldTransactions(AccountID const &account, std::uint32_t const seq)
Get all the transactions held for a particular account.
Definition: LedgerMaster.cpp:562
ripple::LedgerMaster::mLedgerHistory
LedgerHistory mLedgerHistory
Definition: LedgerMaster.h:356
ripple::LedgerMaster::getLedgerHashForHistory
boost::optional< LedgerHash > getLedgerHashForHistory(LedgerIndex index, InboundLedger::Reason reason)
Definition: LedgerMaster.cpp:1183
ripple::LedgerMaster::mHeldTransactions
CanonicalTXSet mHeldTransactions
Definition: LedgerMaster.h:358
std::pair
beast::PropertyStream::Source
Subclasses can be called to write to a stream and have children.
Definition: PropertyStream.h:342
ripple::LedgerMaster
Definition: LedgerMaster.h:54
ripple::LedgerMaster::getValidLedgerIndex
LedgerIndex getValidLedgerIndex()
Definition: LedgerMaster.cpp:227
std::vector
STL class.
ripple::LedgerMaster::mHistLedger
std::shared_ptr< Ledger const > mHistLedger
Definition: LedgerMaster.h:348
ripple::LedgerMaster::Stats::hook
beast::insight::Hook hook
Definition: LedgerMaster.h:421
ripple::LedgerMaster::getPublishedLedgerAge
std::chrono::seconds getPublishedLedgerAge()
Definition: LedgerMaster.cpp:264
ripple::LedgerMaster::releaseReplay
std::unique_ptr< LedgerReplay > releaseReplay()
Definition: LedgerMaster.cpp:1738
std::chrono::seconds
ripple::LedgerMaster::getValidatedRules
Rules getValidatedRules()
Definition: LedgerMaster.cpp:1499
ripple::LedgerMaster::mCompleteLock
std::recursive_mutex mCompleteLock
Definition: LedgerMaster.h:363
ripple::LedgerMaster::applyHeldTransactions
void applyHeldTransactions()
Apply held transactions to the open ledger This is normally called as we close the ledger.
Definition: LedgerMaster.cpp:537
ripple::LedgerMaster::switchLCL
void switchLCL(std::shared_ptr< Ledger const > const &lastClosed)
Definition: LedgerMaster.cpp:493
std::recursive_mutex
STL class.
ripple::LedgerMaster::newPFWork
bool newPFWork(const char *name, std::unique_lock< std::recursive_mutex > &)
A thread needs to be dispatched to handle pathfinding work of some kind.
Definition: LedgerMaster.cpp:1468
std::lock_guard
STL class.
ripple::LedgerMaster::getLedgerByHash
std::shared_ptr< Ledger const > getLedgerByHash(uint256 const &hash)
Definition: LedgerMaster.cpp:1667
ripple::LedgerMaster::isNewPathRequest
bool isNewPathRequest()
Definition: LedgerMaster.cpp:1446
ripple::stopwatch
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Definition: chrono.h:86
ripple::LedgerMaster::getCloseTimeByHash
boost::optional< NetClock::time_point > getCloseTimeByHash(LedgerHash const &ledgerHash, LedgerIndex ledgerIndex)
Definition: LedgerMaster.cpp:1536
ripple::LedgerMaster::getEarliestFetch
std::uint32_t getEarliestFetch()
Definition: LedgerMaster.cpp:668
ripple::LedgerHistory
Retains historical ledgers.
Definition: LedgerHistory.h:34
ripple::LedgerMaster::setFullLedger
void setFullLedger(std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Definition: LedgerMaster.cpp:869
ripple::LedgerMaster::tune
void tune(int size, std::chrono::seconds age)
Definition: LedgerMaster.cpp:1693
std::atomic_flag
ripple::LedgerMaster::fixMismatch
void fixMismatch(ReadView const &ledger)
Definition: LedgerMaster.cpp:815
ripple::LedgerMaster::fetch_depth_
const std::uint32_t fetch_depth_
Definition: LedgerMaster.h:391
ripple::CanonicalTXSet
Holds transactions which were deferred to the next pass of consensus.
Definition: CanonicalTXSet.h:36
ripple::LedgerMaster::getCompleteLedgers
std::string getCompleteLedgers()
Definition: LedgerMaster.cpp:1521
ripple::LedgerMaster::ledger_fetch_size_
const std::uint32_t ledger_fetch_size_
Definition: LedgerMaster.h:396
ripple::LedgerMaster::Stats::validatedLedgerAge
beast::insight::Gauge validatedLedgerAge
Definition: LedgerMaster.h:422
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:493
ripple::LedgerMaster::peekMutex
std::recursive_mutex & peekMutex()
Definition: LedgerMaster.cpp:1486
ripple::LedgerMaster::mGotFetchPackThread
std::atomic_flag mGotFetchPackThread
Definition: LedgerMaster.h:378
ripple::base_uint< 256 >
ripple::LedgerMaster::mCompleteLedgers
RangeSet< std::uint32_t > mCompleteLedgers
Definition: LedgerMaster.h:364
ripple::LedgerMaster::getPropertySource
beast::PropertyStream::Source & getPropertySource()
Definition: LedgerMaster.cpp:1712
ripple::LedgerMaster::LedgerMaster
LedgerMaster(Application &app, Stopwatch &stopwatch, Stoppable &parent, beast::insight::Collector::ptr const &collector, beast::Journal journal)
Definition: LedgerMaster.cpp:193
ripple::Stoppable
Provides an interface for starting and stopping.
Definition: Stoppable.h:200
ripple::LedgerMaster::mFillInProgress
int mFillInProgress
Definition: LedgerMaster.h:373
ripple::LedgerMaster::replayData
std::unique_ptr< LedgerReplay > replayData
Definition: LedgerMaster.h:361
ripple::LedgerMaster::gotFetchPack
void gotFetchPack(bool progress, std::uint32_t seq)
Definition: LedgerMaster.cpp:1989
ripple::LedgerMaster::fetchForHistory
void fetchForHistory(std::uint32_t missing, bool &progress, InboundLedger::Reason reason, std::unique_lock< std::recursive_mutex > &)
Definition: LedgerMaster.cpp:1744
ripple::LedgerMaster::failedSave
void failedSave(std::uint32_t seq, uint256 const &hash)
Definition: LedgerMaster.cpp:929
ripple::LedgerHolder::empty
bool empty()
Definition: LedgerHolder.h:62
ripple::LedgerMaster::getFetchPack
boost::optional< Blob > getFetchPack(uint256 const &hash) override
Retrieves partial ledger data of the coresponding hash from peers.
Definition: LedgerMaster.cpp:1976
ripple::LedgerMaster::getFullValidatedRange
bool getFullValidatedRange(std::uint32_t &minVal, std::uint32_t &maxVal)
Definition: LedgerMaster.cpp:600
ripple::LedgerMaster::fixIndex
bool fixIndex(LedgerIndex ledgerIndex, LedgerHash const &ledgerHash)
Definition: LedgerMaster.cpp:519
ripple::isCurrent
bool isCurrent(ValidationParms const &p, NetClock::time_point now, NetClock::time_point signTime, NetClock::time_point seenTime)
Whether a validation is still current.
Definition: Validations.h:145
std::unique_lock
STL class.
ripple::LedgerMaster::canBeCurrent
bool canBeCurrent(std::shared_ptr< Ledger const > const &ledger)
Check the sequence number and parent close time of a ledger against our clock and last validated ledg...
Definition: LedgerMaster.cpp:425
ripple::AbstractFetchPackContainer
An interface facilitating retrieval of fetch packs without an application or ledgermaster object.
Definition: AbstractFetchPackContainer.h:32
ripple::LedgerMaster::haveLedger
bool haveLedger(std::uint32_t seq)
Definition: LedgerMaster.cpp:585
ripple::LedgerMaster::getValidatedLedger
std::shared_ptr< Ledger const > getValidatedLedger()
Definition: LedgerMaster.h:90
beast::Journal::Stream
Provide a light-weight way to check active() before string formatting.
Definition: Journal.h:194
ripple::LedgerMaster::isCompatible
bool isCompatible(ReadView const &, beast::Journal::Stream, char const *reason)
Definition: LedgerMaster.cpp:233
std::chrono::time_point
ripple::LedgerMaster::getLedgerBySeq
std::shared_ptr< Ledger const > getLedgerBySeq(std::uint32_t index)
Definition: LedgerMaster.cpp:1631
ripple::LedgerMaster::newPathRequest
bool newPathRequest()
Definition: LedgerMaster.cpp:1438
ripple::Job
Definition: Job.h:82
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
std::uint32_t
ripple::LedgerMaster::mLedgerCleaner
std::unique_ptr< detail::LedgerCleaner > mLedgerCleaner
Definition: LedgerMaster.h:366
ripple::LedgerMaster::addHeldTransaction
void addHeldTransaction(std::shared_ptr< Transaction > const &trans)
Definition: LedgerMaster.cpp:414
ripple::LedgerMaster::setValidLedger
void setValidLedger(std::shared_ptr< Ledger const > const &l)
Definition: LedgerMaster.cpp:326
std::atomic< std::uint32_t >
ripple::LedgerMaster::mPathFindNewRequest
bool mPathFindNewRequest
Definition: LedgerMaster.h:376
ripple::LedgerHolder::get
std::shared_ptr< Ledger const > get()
Definition: LedgerHolder.h:55
ripple::LedgerMaster::getCurrentLedger
std::shared_ptr< ReadView const > getCurrentLedger()
Definition: LedgerMaster.cpp:1493
ripple::LedgerMaster::newOrderBookDB
bool newOrderBookDB()
Definition: LedgerMaster.cpp:1457
ripple::LedgerMaster::getNeededValidations
std::size_t getNeededValidations()
Determines how many validations are needed to fully validate a ledger.
Definition: LedgerMaster.cpp:992
beast::abstract_clock< std::chrono::steady_clock >
ripple::LedgerMaster::mAdvanceThread
bool mAdvanceThread
Definition: LedgerMaster.h:369
ripple::LedgerMaster::getLedgerHash
boost::optional< LedgerHash > getLedgerHash(std::uint32_t desiredSeq, std::shared_ptr< ReadView const > const &knownGoodLedger)
Definition: LedgerMaster.cpp:1327
ripple::LedgerMaster::checkAccept
void checkAccept(std::shared_ptr< Ledger const > const &ledger)
Definition: LedgerMaster.cpp:998
beast::insight::Gauge
A metric for measuring an integral value.
Definition: Gauge.h:39
std::weak_ptr
STL class.
ripple::LedgerMaster::max_ledger_difference_
const LedgerIndex max_ledger_difference_
Definition: LedgerMaster.h:404
ripple::LedgerMaster::getFetchPackCacheSize
std::size_t getFetchPackCacheSize() const
Definition: LedgerMaster.cpp:2147
ripple::LedgerMaster::doLedgerCleaner
void doLedgerCleaner(Json::Value const &parameters)
Definition: LedgerMaster.cpp:1680
ripple::LedgerMaster::mPathLedger
std::shared_ptr< Ledger const > mPathLedger
Definition: LedgerMaster.h:345
ripple::LedgerMaster::haveValidated
bool haveValidated()
Whether we have ever fully validated a ledger.
Definition: LedgerMaster.h:284
ripple::LedgerMaster::getValidatedLedgerAge
std::chrono::seconds getValidatedLedgerAge()
Definition: LedgerMaster.cpp:283
ripple::LedgerMaster::getClosedLedger
std::shared_ptr< Ledger const > getClosedLedger()
Definition: LedgerMaster.h:83
ripple::LedgerMaster::mAdvanceWork
bool mAdvanceWork
Definition: LedgerMaster.h:372
ripple::ReadView
A view into a ledger.
Definition: ReadView.h:188
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::LedgerMaster::Stats::publishedLedgerAge
beast::insight::Gauge publishedLedgerAge
Definition: LedgerMaster.h:423
ripple::LedgerMaster::mPubLedgerClose
std::atomic< std::uint32_t > mPubLedgerClose
Definition: LedgerMaster.h:381
ripple::LedgerMaster::ledger_history_
const std::uint32_t ledger_history_
Definition: LedgerMaster.h:394
ripple::LedgerMaster::mPubLedgerSeq
std::atomic< LedgerIndex > mPubLedgerSeq
Definition: LedgerMaster.h:382
ripple::LedgerMaster::~LedgerMaster
virtual ~LedgerMaster()=default
ripple::LedgerMaster::getBuildingLedger
LedgerIndex getBuildingLedger()
Definition: LedgerMaster.cpp:572
ripple::LedgerMaster::clearLedger
void clearLedger(std::uint32_t seq)
Definition: LedgerMaster.cpp:592
ripple::LedgerMaster::m_journal
beast::Journal m_journal
Definition: LedgerMaster.h:331
ripple::LedgerMaster::getCloseTimeBySeq
boost::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
Definition: LedgerMaster.cpp:1528
ripple::LedgerMaster::mValidLedgerSeq
std::atomic< LedgerIndex > mValidLedgerSeq
Definition: LedgerMaster.h:384
ripple::LedgerMaster::getCurrentLedgerIndex
LedgerIndex getCurrentLedgerIndex()
Definition: LedgerMaster.cpp:221
ripple::LedgerHolder
Hold a ledger in a thread-safe way.
Definition: LedgerHolder.h:38
ripple::LedgerMaster::takeReplay
void takeReplay(std::unique_ptr< LedgerReplay > replay)
Definition: LedgerMaster.cpp:1732
ripple::LedgerMaster::mLastValidLedger
std::pair< uint256, LedgerIndex > mLastValidLedger
Definition: LedgerMaster.h:354
ripple::Rules
Rules controlling protocol behavior.
Definition: ReadView.h:127
ripple::LedgerMaster::m_stats
Stats m_stats
Definition: LedgerMaster.h:426
mutex
ripple::LedgerMaster::mShardLedger
std::shared_ptr< Ledger const > mShardLedger
Definition: LedgerMaster.h:351
ripple::LedgerMaster::updatePaths
void updatePaths(Job &job)
Definition: LedgerMaster.cpp:1360
std::size_t
ripple::LedgerMaster::storeLedger
bool storeLedger(std::shared_ptr< Ledger const > ledger)
Definition: LedgerMaster.cpp:525
ripple::InboundLedger::Reason
Reason
Definition: InboundLedger.h:51
ripple::RangeSet
boost::icl::interval_set< T, std::less, ClosedInterval< T > > RangeSet
A set of closed intervals over the domain T.
Definition: RangeSet.h:69
ripple::LedgerMaster::setLedgerRangePresent
void setLedgerRangePresent(std::uint32_t minV, std::uint32_t maxV)
Definition: LedgerMaster.cpp:1686
ripple::LedgerMaster::consensusBuilt
void consensusBuilt(std::shared_ptr< Ledger const > const &ledger, uint256 const &consensusHash, Json::Value consensus)
Report that the consensus process built a particular ledger.
Definition: LedgerMaster.cpp:1062
ripple::LedgerMaster::mValidLedger
LedgerHolder mValidLedger
Definition: LedgerMaster.h:339
ripple::LedgerMaster::fetch_seq_
std::uint32_t fetch_seq_
Definition: LedgerMaster.h:400
ripple::LedgerMaster::getHashBySeq
uint256 getHashBySeq(std::uint32_t index)
Get a ledger's hash by sequence number using the cache.
Definition: LedgerMaster.cpp:1557
ripple::LedgerMaster::findNewLedgersToPublish
std::vector< std::shared_ptr< Ledger const > > findNewLedgersToPublish(std::unique_lock< std::recursive_mutex > &)
Definition: LedgerMaster.cpp:1206
ripple::LedgerMaster::isCaughtUp
bool isCaughtUp(std::string &reason)
Definition: LedgerMaster.cpp:302
std::unique_ptr
STL class.
ripple::LedgerMaster::mPathFindThread
int mPathFindThread
Definition: LedgerMaster.h:375
ripple::LedgerMaster::mValidLedgerSign
std::atomic< std::uint32_t > mValidLedgerSign
Definition: LedgerMaster.h:383
ripple::LedgerMaster::setBuildingLedger
void setBuildingLedger(LedgerIndex index)
Definition: LedgerMaster.cpp:579
ripple::LedgerMaster::walkHashBySeq
boost::optional< LedgerHash > walkHashBySeq(std::uint32_t index)
Walk to a ledger's hash using the skip list.
Definition: LedgerMaster.cpp:1568
ripple::LedgerMaster::doAdvance
void doAdvance(std::unique_lock< std::recursive_mutex > &)
Definition: LedgerMaster.cpp:1868
ripple::LedgerMaster::tryAdvance
void tryAdvance()
Definition: LedgerMaster.cpp:1310
ripple::LedgerMaster::clearPriorLedgers
void clearPriorLedgers(LedgerIndex seq)
Definition: LedgerMaster.cpp:1718
ripple::LedgerMaster::setPubLedger
void setPubLedger(std::shared_ptr< Ledger const > const &l)
Definition: LedgerMaster.cpp:406
beast::insight::Hook
A reference to a handler for performing polled collection.
Definition: Hook.h:31
ripple::LedgerMaster::tryFill
void tryFill(Job &job, std::shared_ptr< Ledger const > ledger)
Definition: LedgerMaster.cpp:682
ripple::LedgerMaster::addFetchPack
void addFetchPack(uint256 const &hash, std::shared_ptr< Blob > &data)
Definition: LedgerMaster.cpp:1970
ripple::LedgerMaster::getCacheHitRate
float getCacheHitRate()
Definition: LedgerMaster.cpp:1706
Json::Value
Represents a JSON value.
Definition: json_value.h:145
beast::insight::Gauge::set
void set(value_type value) const
Set the value on the gauge.
Definition: Gauge.h:68
ripple::LedgerMaster::m_mutex
std::recursive_mutex m_mutex
Definition: LedgerMaster.h:333
ripple::LedgerMaster::Stats
Definition: LedgerMaster.h:407
ripple::LedgerMaster::collect_metrics
void collect_metrics()
Definition: LedgerMaster.h:430
ripple::LedgerMaster::standalone_
const bool standalone_
Definition: LedgerMaster.h:388