|
xrpld
|
Retains historical ledgers. More...
#include <LedgerHistory.h>

Classes | |
| struct | LedgerMaps |
| struct | CvEntry |
Public Member Functions | |
| LedgerHistory (beast::insight::Collector::Ptr const &collector, Application &app) | |
| bool | insert (std::shared_ptr< Ledger const > const &ledger, bool validated) |
| Track a ledger. | |
| float | getCacheHitRate () |
| Get the byHash cache hit rate. | |
| std::shared_ptr< Ledger const > | getLedgerBySeq (LedgerIndex ledgerIndex) |
| Get a ledger given its sequence number. | |
| std::shared_ptr< Ledger const > | getLedgerByHash (LedgerHash const &ledgerHash) |
| Retrieve a ledger given its hash. | |
| LedgerHash | getLedgerHash (LedgerIndex ledgerIndex) |
| Get a ledger's hash given its sequence number. | |
| void | sweep () |
| Remove stale cache entries. | |
| void | builtLedger (std::shared_ptr< Ledger const > const &, UInt256 const &consensusHash, json::Value) |
| Report that we have locally built a particular ledger. | |
| void | validatedLedger (std::shared_ptr< Ledger const > const &, std::optional< UInt256 > const &consensusHash) |
| Report that we have validated a particular ledger. | |
| bool | fixIndex (LedgerIndex ledgerIndex, LedgerHash const &ledgerHash) |
| Repair a hash to index mapping. | |
| void | clearLedgerCachePrior (LedgerIndex seq) |
Private Types | |
| using | ConsensusValidated = TaggedCache<LedgerIndex, CvEntry> |
Private Member Functions | |
| 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. | |
Private Attributes | |
| Application & | app_ |
| beast::insight::Collector::Ptr | collector_ |
| beast::insight::Counter | mismatchCounter_ |
| xrpl::Mutex< LedgerMaps > | ledgerMaps_ |
| ConsensusValidated | consensusValidated_ |
| beast::Journal | j_ |
Retains historical ledgers.
Definition at line 27 of file LedgerHistory.h.
|
private |
Definition at line 172 of file LedgerHistory.h.
| xrpl::LedgerHistory::LedgerHistory | ( | beast::insight::Collector::Ptr const & | collector, |
| Application & | app ) |
Definition at line 34 of file LedgerHistory.cpp.
| bool xrpl::LedgerHistory::insert | ( | std::shared_ptr< Ledger const > const & | ledger, |
| bool | validated ) |
Track a ledger.
Definition at line 56 of file LedgerHistory.cpp.
| float xrpl::LedgerHistory::getCacheHitRate | ( | ) |
| std::shared_ptr< Ledger const > xrpl::LedgerHistory::getLedgerBySeq | ( | LedgerIndex | ledgerIndex | ) |
Get a ledger given its sequence number.
Definition at line 83 of file LedgerHistory.cpp.
| std::shared_ptr< Ledger const > xrpl::LedgerHistory::getLedgerByHash | ( | LedgerHash const & | ledgerHash | ) |
Retrieve a ledger given its hash.
Definition at line 117 of file LedgerHistory.cpp.
| LedgerHash xrpl::LedgerHistory::getLedgerHash | ( | LedgerIndex | ledgerIndex | ) |
Get a ledger's hash given its sequence number.
| ledgerIndex | The sequence number of the desired ledger |
Definition at line 74 of file LedgerHistory.cpp.
| void xrpl::LedgerHistory::sweep | ( | ) |
Remove stale cache entries.
Definition at line 74 of file LedgerHistory.h.
| void xrpl::LedgerHistory::builtLedger | ( | std::shared_ptr< Ledger const > const & | ledger, |
| UInt256 const & | consensusHash, | ||
| json::Value | consensus ) |
Report that we have locally built a particular ledger.
Definition at line 443 of file LedgerHistory.cpp.
| void xrpl::LedgerHistory::validatedLedger | ( | std::shared_ptr< Ledger const > const & | ledger, |
| std::optional< UInt256 > const & | consensusHash ) |
Report that we have validated a particular ledger.
Definition at line 494 of file LedgerHistory.cpp.
| bool xrpl::LedgerHistory::fixIndex | ( | LedgerIndex | ledgerIndex, |
| LedgerHash const & | ledgerHash ) |
Repair a hash to index mapping.
Ensure byHash doesn't have the wrong hash for a particular index.
| ledgerIndex | The index whose mapping is to be repaired |
| ledgerHash | The hash it is to be mapped to |
Definition at line 550 of file LedgerHistory.cpp.
| void xrpl::LedgerHistory::clearLedgerCachePrior | ( | LedgerIndex | seq | ) |
Definition at line 565 of file LedgerHistory.cpp.
|
private |
Log details in the case where we build one ledger but validate a different one.
| built | The hash of the ledger we built |
| valid | The hash of the ledger we deemed fully valid |
| builtConsensusHash | The hash of the consensus transaction for the ledger we built |
| validatedConsensusHash | The hash of the validated ledger's consensus transaction set |
| consensus | The status of the consensus round |
Definition at line 329 of file LedgerHistory.cpp.
|
private |
Definition at line 130 of file LedgerHistory.h.
|
private |
Definition at line 131 of file LedgerHistory.h.
|
private |
Definition at line 132 of file LedgerHistory.h.
|
private |
Definition at line 155 of file LedgerHistory.h.
|
private |
Definition at line 173 of file LedgerHistory.h.
|
private |
Definition at line 175 of file LedgerHistory.h.