xrpld
Loading...
Searching...
No Matches
LedgerHistory.cpp
1#include <xrpld/app/ledger/LedgerHistory.h>
2
3#include <xrpld/app/ledger/LedgerPersistence.h>
4#include <xrpld/app/ledger/LedgerToJson.h>
5#include <xrpld/app/main/Application.h>
6#include <xrpld/core/Config.h>
7
8#include <xrpl/basics/Log.h>
9#include <xrpl/basics/base_uint.h>
10#include <xrpl/basics/chrono.h>
11#include <xrpl/basics/contract.h>
12#include <xrpl/beast/insight/Collector.h>
13#include <xrpl/beast/utility/Journal.h>
14#include <xrpl/beast/utility/instrumentation.h>
15#include <xrpl/json/json_value.h>
16#include <xrpl/json/json_writer.h>
17#include <xrpl/ledger/Ledger.h>
18#include <xrpl/ledger/ReadView.h>
19#include <xrpl/protocol/Protocol.h>
20#include <xrpl/protocol/RippleLedgerHash.h>
21#include <xrpl/protocol/Rules.h>
22#include <xrpl/protocol/TxMeta.h>
23#include <xrpl/shamap/SHAMapItem.h>
24
25#include <algorithm>
26#include <cstddef>
27#include <memory>
28#include <optional>
29#include <utility>
30#include <vector>
31
32namespace xrpl {
33
35 : app_(app)
36 , collector_(collector)
37 , mismatchCounter_(collector->makeCounter("ledger.history", "mismatch"))
39 "ConsensusValidated",
40 64,
41 std::chrono::minutes{5},
42 stopwatch(),
43 app_.getJournal("TaggedCache"))
44 , j_(app.getJournal("LedgerHistory"))
45{
46 auto lockedMaps = ledgerMaps_.lock();
48 "LedgerCache",
49 app_.config().getValueFor(SizedItem::LedgerSize),
50 std::chrono::seconds{app_.config().getValueFor(SizedItem::LedgerAge)},
51 stopwatch(),
52 app_.getJournal("TaggedCache"));
53}
54
55bool
57{
58 if (!ledger->isImmutable())
59 logicError("mutable Ledger in insert");
60
61 XRPL_ASSERT(
62 ledger->stateMap().getHash().isNonZero(), "xrpl::LedgerHistory::insert : nonzero hash");
63
64 auto lockedMaps = ledgerMaps_.lock();
65 bool const alreadyHad =
66 lockedMaps->byHash->canonicalizeReplaceCache(ledger->header().hash, ledger);
67 if (validated)
68 lockedMaps->byIndex[ledger->header().seq] = ledger->header().hash;
69
70 return alreadyHad;
71}
72
75{
76 auto lockedMaps = ledgerMaps_.lock();
77 if (auto const it = lockedMaps->byIndex.find(index); it != lockedMaps->byIndex.end())
78 return it->second;
79 return {};
80}
81
84{
85 UInt256 hash;
86 {
87 auto lockedMaps = ledgerMaps_.lock();
88 if (auto const it = lockedMaps->byIndex.find(index); it != lockedMaps->byIndex.end())
89 hash = it->second;
90 }
91
92 if (!hash.isZero())
93 return getLedgerByHash(hash);
94
95 Rules const rules{app_.config().features};
96 Fees const fees = app_.config().fees.toFees();
97 std::shared_ptr<Ledger const> ret = loadByIndex(index, rules, fees, app_);
98
99 if (!ret)
100 return ret;
101
102 XRPL_ASSERT(
103 ret->header().seq == index, "xrpl::LedgerHistory::getLedgerBySeq : result sequence match");
104
105 {
106 // Add this ledger to the local tracking by index
107 auto lockedMaps = ledgerMaps_.lock();
108 XRPL_ASSERT(
109 ret->isImmutable(), "xrpl::LedgerHistory::getLedgerBySeq : immutable result ledger");
110 lockedMaps->byHash->canonicalizeReplaceClient(ret->header().hash, ret);
111 lockedMaps->byIndex[ret->header().seq] = ret->header().hash;
112 return (ret->header().seq == index) ? ret : nullptr;
113 }
114}
115
118{
120 {
121 auto lockedMaps = ledgerMaps_.lock();
122 ret = lockedMaps->byHash->fetch(hash);
123 }
124
125 if (ret)
126 {
127 XRPL_ASSERT(
128 ret->isImmutable(),
129 "xrpl::LedgerHistory::getLedgerByHash : immutable fetched "
130 "ledger");
131 XRPL_ASSERT(
132 ret->header().hash == hash,
133 "xrpl::LedgerHistory::getLedgerByHash : fetched ledger hash "
134 "match");
135 return ret;
136 }
137
138 Rules const rules{app_.config().features};
139 Fees const fees = app_.config().fees.toFees();
140 ret = loadByHash(hash, rules, fees, app_);
141
142 if (!ret)
143 return ret;
144
145 XRPL_ASSERT(
146 ret->isImmutable(), "xrpl::LedgerHistory::getLedgerByHash : immutable loaded ledger");
147 XRPL_ASSERT(
148 ret->header().hash == hash,
149 "xrpl::LedgerHistory::getLedgerByHash : loaded ledger hash match");
150 {
151 auto lockedMaps = ledgerMaps_.lock();
152 lockedMaps->byHash->canonicalizeReplaceClient(ret->header().hash, ret);
153 }
154 XRPL_ASSERT(
155 ret->header().hash == hash, "xrpl::LedgerHistory::getLedgerByHash : result hash match");
156
157 return ret;
158}
159
160namespace {
161
162// Captures the sibling's contribution when builtLedger or validatedLedger
163// detects a hash mismatch, so handleMismatch can run outside the cache lock.
164struct MismatchInputs
165{
166 LedgerHash otherHash;
167 std::optional<UInt256> otherConsensusHash;
168 json::Value consensus;
169};
170
171} // namespace
172
173static void
174logOne(ReadView const& ledger, UInt256 const& tx, char const* msg, beast::Journal const& j)
175{
176 auto const metaData = ledger.txRead(tx).second;
177
178 if (metaData != nullptr)
179 {
180 JLOG(j.debug()) << "MISMATCH on TX " << tx << ": " << msg
181 << " is missing this transaction:\n"
182 << metaData->getJson(JsonOptions::Values::None);
183 }
184 else
185 {
186 JLOG(j.debug()) << "MISMATCH on TX " << tx << ": " << msg
187 << " is missing this transaction.";
188 }
189}
190
191static void
193 ReadView const& builtLedger,
194 ReadView const& validLedger,
195 UInt256 const& tx,
197{
198 auto const getMeta = [](ReadView const& ledger, UInt256 const& txID) {
200 if (auto const meta = ledger.txRead(txID).second)
201 ret.emplace(txID, ledger.seq(), *meta);
202 return ret;
203 };
204
205 auto validMetaData = getMeta(validLedger, tx);
206 auto builtMetaData = getMeta(builtLedger, tx);
207
208 XRPL_ASSERT(
209 validMetaData || builtMetaData, "xrpl::logMetadataDifference : some metadata present");
210
211 if (validMetaData && builtMetaData)
212 {
213 auto const& validNodes = validMetaData->getNodes();
214 auto const& builtNodes = builtMetaData->getNodes();
215
216 bool const resultDiff = validMetaData->getResultTER() != builtMetaData->getResultTER();
217
218 bool const indexDiff = validMetaData->getIndex() != builtMetaData->getIndex();
219
220 bool const nodesDiff = validNodes != builtNodes;
221
222 if (!resultDiff && !indexDiff && !nodesDiff)
223 {
224 JLOG(j.error()) << "MISMATCH on TX " << tx << ": No apparent mismatches detected!";
225 return;
226 }
227
228 if (!nodesDiff)
229 {
230 if (resultDiff && indexDiff)
231 {
232 JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different result and index!";
233 JLOG(j.debug()) << " Built:"
234 << " Result: " << builtMetaData->getResult()
235 << " Index: " << builtMetaData->getIndex();
236 JLOG(j.debug()) << " Valid:"
237 << " Result: " << validMetaData->getResult()
238 << " Index: " << validMetaData->getIndex();
239 }
240 else if (resultDiff)
241 {
242 JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different result!";
243 JLOG(j.debug()) << " Built:"
244 << " Result: " << builtMetaData->getResult();
245 JLOG(j.debug()) << " Valid:"
246 << " Result: " << validMetaData->getResult();
247 }
248 else if (indexDiff)
249 {
250 JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different index!";
251 JLOG(j.debug()) << " Built:"
252 << " Index: " << builtMetaData->getIndex();
253 JLOG(j.debug()) << " Valid:"
254 << " Index: " << validMetaData->getIndex();
255 }
256 }
257 else
258 {
259 if (resultDiff && indexDiff)
260 {
261 JLOG(j.debug()) << "MISMATCH on TX " << tx
262 << ": Different result, index and nodes!";
263 JLOG(j.debug()) << " Built:\n" << builtMetaData->getJson(JsonOptions::Values::None);
264 JLOG(j.debug()) << " Valid:\n" << validMetaData->getJson(JsonOptions::Values::None);
265 }
266 else if (resultDiff)
267 {
268 JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different result and nodes!";
269 JLOG(j.debug()) << " Built:"
270 << " Result: " << builtMetaData->getResult() << " Nodes:\n"
271 << builtNodes.getJson(JsonOptions::Values::None);
272 JLOG(j.debug()) << " Valid:"
273 << " Result: " << validMetaData->getResult() << " Nodes:\n"
274 << validNodes.getJson(JsonOptions::Values::None);
275 }
276 else if (indexDiff)
277 {
278 JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different index and nodes!";
279 JLOG(j.debug()) << " Built:"
280 << " Index: " << builtMetaData->getIndex() << " Nodes:\n"
281 << builtNodes.getJson(JsonOptions::Values::None);
282 JLOG(j.debug()) << " Valid:"
283 << " Index: " << validMetaData->getIndex() << " Nodes:\n"
284 << validNodes.getJson(JsonOptions::Values::None);
285 }
286 else // nodesDiff
287 {
288 JLOG(j.debug()) << "MISMATCH on TX " << tx << ": Different nodes!";
289 JLOG(j.debug()) << " Built:"
290 << " Nodes:\n"
291 << builtNodes.getJson(JsonOptions::Values::None);
292 JLOG(j.debug()) << " Valid:"
293 << " Nodes:\n"
294 << validNodes.getJson(JsonOptions::Values::None);
295 }
296 }
297
298 return;
299 }
300
301 if (validMetaData)
302 {
303 JLOG(j.error()) << "MISMATCH on TX " << tx << ": Metadata Difference. Valid=\n"
304 << validMetaData->getJson(JsonOptions::Values::None);
305 }
306
307 if (builtMetaData)
308 {
309 JLOG(j.error()) << "MISMATCH on TX " << tx << ": Metadata Difference. Built=\n"
310 << builtMetaData->getJson(JsonOptions::Values::None);
311 }
312}
313
314//------------------------------------------------------------------------------
315
316// Return list of leaves sorted by key
318leaves(SHAMap const& sm)
319{
321 for (auto const& item : sm)
322 v.push_back(&item);
324 v, [](SHAMapItem const* lhs, SHAMapItem const* rhs) { return lhs->key() < rhs->key(); });
325 return v;
326}
327
328void
330 LedgerHash const& built,
331 LedgerHash const& valid,
332 std::optional<UInt256> const& builtConsensusHash,
333 std::optional<UInt256> const& validatedConsensusHash,
334 json::Value const& consensus)
335{
336 XRPL_ASSERT(built != valid, "xrpl::LedgerHistory::handleMismatch : unequal hashes");
338
339 auto const builtLedger = getLedgerByHash(built);
340 auto const validLedger = getLedgerByHash(valid);
341
342 if (!builtLedger || !validLedger)
343 {
344 JLOG(j_.error()) << "MISMATCH cannot be analyzed:"
345 << " builtLedger: " << to_string(built) << " -> " << builtLedger
346 << " validLedger: " << to_string(valid) << " -> " << validLedger;
347 return;
348 }
349
350 XRPL_ASSERT(
351 builtLedger->header().seq == validLedger->header().seq,
352 "xrpl::LedgerHistory::handleMismatch : sequence match");
353
354 if (auto const stream = j_.debug())
355 {
356 stream << "Built: " << getJson({*builtLedger, {}});
357 stream << "Valid: " << getJson({*validLedger, {}});
358 stream << "Consensus: " << consensus;
359 }
360
361 // Determine the mismatch reason, distinguishing Byzantine
362 // failure from transaction processing difference
363
364 // Disagreement over prior ledger indicates sync issue
365 if (builtLedger->header().parentHash != validLedger->header().parentHash)
366 {
367 JLOG(j_.error()) << "MISMATCH on prior ledger";
368 return;
369 }
370
371 // Disagreement over close time indicates Byzantine failure
372 if (builtLedger->header().closeTime != validLedger->header().closeTime)
373 {
374 JLOG(j_.error()) << "MISMATCH on close time";
375 return;
376 }
377
378 if (builtConsensusHash && validatedConsensusHash)
379 {
380 if (builtConsensusHash != validatedConsensusHash)
381 {
382 JLOG(j_.error()) << "MISMATCH on consensus transaction set "
383 << " built: " << to_string(*builtConsensusHash)
384 << " validated: " << to_string(*validatedConsensusHash);
385 }
386 else
387 {
388 JLOG(j_.error()) << "MISMATCH with same consensus transaction set: "
389 << to_string(*builtConsensusHash);
390 }
391 }
392
393 // Find differences between built and valid ledgers
394 auto const builtTx = leaves(builtLedger->txMap());
395 auto const validTx = leaves(validLedger->txMap());
396
397 if (builtTx == validTx)
398 {
399 JLOG(j_.error()) << "MISMATCH with same " << builtTx.size() << " transactions";
400 }
401 else
402 {
403 JLOG(j_.error()) << "MISMATCH with " << builtTx.size() << " built and " << validTx.size()
404 << " valid transactions.";
405 }
406
407 JLOG(j_.error()) << "built\n" << getJson({*builtLedger, {}});
408 JLOG(j_.error()) << "valid\n" << getJson({*validLedger, {}});
409
410 // Log all differences between built and valid ledgers
411 auto b = builtTx.begin();
412 auto v = validTx.begin();
413 while (b != builtTx.end() && v != validTx.end())
414 {
415 if ((*b)->key() < (*v)->key())
416 {
417 logOne(*builtLedger, (*b)->key(), "valid", j_);
418 ++b;
419 }
420 else if ((*b)->key() > (*v)->key())
421 {
422 logOne(*validLedger, (*v)->key(), "built", j_);
423 ++v;
424 }
425 else
426 {
427 if ((*b)->slice() != (*v)->slice())
428 {
429 // Same transaction with different metadata
430 logMetadataDifference(*builtLedger, *validLedger, (*b)->key(), j_);
431 }
432 ++b;
433 ++v;
434 }
435 }
436 for (; b != builtTx.end(); ++b)
437 logOne(*builtLedger, (*b)->key(), "valid", j_);
438 for (; v != validTx.end(); ++v)
439 logOne(*validLedger, (*v)->key(), "built", j_);
440}
441
442void
444 std::shared_ptr<Ledger const> const& ledger,
445 UInt256 const& consensusHash,
446 json::Value consensus)
447{
448 LedgerIndex const index = ledger->header().seq;
449 LedgerHash const hash = ledger->header().hash;
450 XRPL_ASSERT(!hash.isZero(), "xrpl::LedgerHistory::builtLedger : nonzero hash");
451
453
454 consensusValidated_.fetchAndModify(index, [&](CvEntry& entry) {
455 if (entry.validated && !entry.built)
456 {
457 SOMETIMES(
458 entry.validated.value() != hash,
459 "xrpl::LedgerHistory::builtLedger : validated-first mismatch");
460 if (entry.validated.value() != hash)
461 {
462 JLOG(j_.error()) << "MISMATCH: seq=" << index
463 << " validated:" << entry.validated.value() << " then:" << hash;
464 mismatch = MismatchInputs{
465 .otherHash = entry.validated.value(),
466 .otherConsensusHash = entry.validatedConsensusHash,
467 .consensus = consensus,
468 };
469 }
470 else
471 {
472 // We validated a ledger and then built it locally
473 JLOG(j_.debug()) << "MATCH: seq=" << index << " late";
474 }
475 }
476
477 entry.built.emplace(hash);
478 entry.builtConsensusHash.emplace(consensusHash);
479 entry.consensus.emplace(std::move(consensus));
480 });
481
482 if (mismatch)
483 {
485 hash,
486 mismatch->otherHash,
487 consensusHash,
488 mismatch->otherConsensusHash,
489 mismatch->consensus);
490 }
491}
492
493void
495 std::shared_ptr<Ledger const> const& ledger,
496 std::optional<UInt256> const& consensusHash)
497{
498 LedgerIndex const index = ledger->header().seq;
499 LedgerHash const hash = ledger->header().hash;
500 XRPL_ASSERT(!hash.isZero(), "xrpl::LedgerHistory::validatedLedger : nonzero hash");
501
503
504 consensusValidated_.fetchAndModify(index, [&](CvEntry& entry) {
505 if (entry.built && !entry.validated)
506 {
507 XRPL_ASSERT(
508 entry.consensus.has_value(),
509 "xrpl::LedgerHistory::validatedLedger : consensus set when built set");
510 SOMETIMES(
511 entry.built.value() != hash,
512 "xrpl::LedgerHistory::validatedLedger : built-first mismatch");
513 if (entry.built.value() != hash)
514 {
515 JLOG(j_.error()) << "MISMATCH: seq=" << index << " built:" << entry.built.value()
516 << " then:" << hash;
517 mismatch = MismatchInputs{
518 .otherHash = entry.built.value(),
519 .otherConsensusHash = entry.builtConsensusHash,
520 // NOLINTNEXTLINE(bugprone-unchecked-optional-access) set with built
521 .consensus = entry.consensus.value(),
522 };
523 }
524 else
525 {
526 // We built a ledger locally and then validated it
527 JLOG(j_.debug()) << "MATCH: seq=" << index;
528 }
529 }
530
531 entry.validated.emplace(hash);
532 entry.validatedConsensusHash = consensusHash;
533 });
534
535 if (mismatch)
536 {
538 mismatch->otherHash,
539 hash,
540 mismatch->otherConsensusHash,
541 consensusHash,
542 mismatch->consensus);
543 }
544}
545
549bool
550LedgerHistory::fixIndex(LedgerIndex ledgerIndex, LedgerHash const& ledgerHash)
551{
552 auto lockedMaps = ledgerMaps_.lock();
553 if (auto const it = lockedMaps->byIndex.find(ledgerIndex); it != lockedMaps->byIndex.end())
554 {
555 if (it->second != ledgerHash)
556 {
557 it->second = ledgerHash;
558 return false;
559 }
560 }
561 return true;
562}
563
564void
566{
567 std::size_t hashesCleared = 0;
568 std::size_t indexesCleared = 0;
569 std::size_t cacheSize = 0;
570 std::size_t indexSize = 0;
571
572 // Snapshot the keys outside ledgerMaps_: getKeys() releases the cache
573 // mutex around its allocation, and holding the outer lock across that
574 // would block every other LedgerHistory call for the duration. byHash is
575 // assigned once in the constructor and never reset (see sweep()).
576 auto const* const byHash = [this] {
577 auto lockedMaps = ledgerMaps_.lock();
578 return lockedMaps->byHash.get();
579 }();
580 std::vector<LedgerHash> const keys = byHash->getKeys();
581
582 for (LedgerHash const& it : keys)
583 {
584 auto const ledger = getLedgerByHash(it);
585 if (!ledger || ledger->header().seq < seq)
586 {
587 auto lockedMaps = ledgerMaps_.lock();
588 lockedMaps->byHash->del(it, false);
589 ++hashesCleared;
590 }
591 }
592
593 {
594 auto lockedMaps = ledgerMaps_.lock();
595 cacheSize = lockedMaps->byHash->size();
596
597 auto& byIndex = lockedMaps->byIndex;
598 std::size_t const sizeBefore = byIndex.size();
599 byIndex.erase(byIndex.begin(), byIndex.lower_bound(seq));
600 indexSize = byIndex.size();
601 indexesCleared = sizeBefore - indexSize;
602
603 ALWAYS(
604 byIndex.empty() || byIndex.begin()->first >= seq,
605 "xrpl::LedgerHistory::clearLedgerCachePrior : byIndex pruned to seq");
606 }
607
608 JLOG(j_.debug()) << "LedgersByHash: cleared " << hashesCleared << " entries before seq " << seq
609 << " (total now " << cacheSize << ")";
610
611 JLOG(j_.debug()) << "LedgersByIndex: cleared " << indexesCleared << " index entries before seq "
612 << seq << " (total now " << indexSize << ")";
613}
614
615} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
Stream error() const
Definition Journal.h:362
Stream debug() const
Definition Journal.h:344
std::shared_ptr< Collector > Ptr
Definition Collector.h:29
Represents a JSON value.
Definition json_value.h:121
const_iterator begin() const
bool isZero() const
Definition base_uint.h:563
xrpl::Mutex< LedgerMaps > ledgerMaps_
ConsensusValidated consensusValidated_
beast::insight::Collector::Ptr collector_
bool insert(std::shared_ptr< Ledger const > const &ledger, bool validated)
Track a ledger.
LedgerHash getLedgerHash(LedgerIndex ledgerIndex)
Get a ledger's hash given its sequence number.
void handleMismatch(LedgerHash const &built, LedgerHash const &valid, std::optional< UInt256 > const &builtConsensusHash, std::optional< UInt256 > const &validatedConsensusHash, json::Value const &consensus)
Log details in the case where we build one ledger but validate a different one.
bool fixIndex(LedgerIndex ledgerIndex, LedgerHash const &ledgerHash)
Repair a hash to index mapping.
std::shared_ptr< Ledger const > getLedgerByHash(LedgerHash const &ledgerHash)
Retrieve a ledger given its hash.
void builtLedger(std::shared_ptr< Ledger const > const &, UInt256 const &consensusHash, json::Value)
Report that we have locally built a particular ledger.
LedgerHistory(beast::insight::Collector::Ptr const &collector, Application &app)
beast::insight::Counter mismatchCounter_
std::shared_ptr< Ledger const > getLedgerBySeq(LedgerIndex ledgerIndex)
Get a ledger given its sequence number.
void validatedLedger(std::shared_ptr< Ledger const > const &, std::optional< UInt256 > const &consensusHash)
Report that we have validated a particular ledger.
beast::Journal j_
void clearLedgerCachePrior(LedgerIndex seq)
A view into a ledger.
Definition ReadView.h:41
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition ReadView.h:115
virtual TxType txRead(key_type const &key) const =0
Read a transaction from the tx map.
Rules controlling protocol behavior.
Definition Rules.h:40
UInt256 const & key() const
Definition SHAMapItem.h:74
T emplace(T... args)
T make_unique(T... args)
STL namespace.
TER valid(STTx const &tx, ReadView const &view, AccountID const &src, beast::Journal j)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::uint32_t LedgerIndex
A ledger index.
Definition Protocol.h:409
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Definition chrono.h:101
static void logOne(ReadView const &ledger, UInt256 const &tx, char const *msg, beast::Journal const &j)
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire)
Load a ledger by its sequence number.
UInt256 LedgerHash
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition base_uint.h:658
void logicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
BaseUInt< 256 > UInt256
Definition base_uint.h:581
std::shared_ptr< Ledger > loadByHash(UInt256 const &ledgerHash, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire)
Load a ledger by its hash.
static std::vector< SHAMapItem const * > leaves(SHAMap const &sm)
json::Value getJson(LedgerFill const &fill)
Return a new json::Value representing the ledger with given options.
static void logMetadataDifference(ReadView const &builtLedger, ReadView const &validLedger, UInt256 const &tx, beast::Journal j)
RCLValidatedLedger::Seq mismatch(RCLValidatedLedger const &a, RCLValidatedLedger const &b)
T push_back(T... args)
T sort(T... args)
Reflects the fee settings for a particular ledger.