From 347333206d47ccc9f264eebdb5bc0c5cf693074e Mon Sep 17 00:00:00 2001 From: bthomee Date: Wed, 11 Feb 2026 05:45:44 -0800 Subject: [PATCH] deploy: ef284692db4588082eac8106b1f5262bf1ad7534 --- AMMExtended__test_8cpp_source.html | 4 +- AMMLiquidity_8cpp_source.html | 17 +- AccountTxPaging_8cpp_source.html | 4 +- AccountTx_8cpp_source.html | 2 +- AmendmentTable_8cpp_source.html | 30 +- Application_8cpp_source.html | 4557 +++++++++-------- Application_8h_source.html | 136 +- BaseWSPeer_8h_source.html | 12 +- BookStep_8cpp_source.html | 22 +- CancelCheck_8cpp_source.html | 7 +- CancelOffer_8cpp_source.html | 4 +- CashCheck_8cpp_source.html | 4 +- Change_8cpp_source.html | 2 +- ClosureCounter__test_8cpp_source.html | 4 +- Config_8cpp_source.html | 293 +- Config_8h_source.html | 792 +-- Config__test_8cpp_source.html | 26 +- ConnectAttempt_8cpp_source.html | 8 +- Connect_8cpp_source.html | 2 +- Consensus_8h_source.html | 82 +- CreateCheck_8cpp_source.html | 4 +- CreateOffer_8cpp_source.html | 6 +- CreateTicket_8cpp_source.html | 4 +- DBInit_8h_source.html | 2 +- DNS__test_8cpp_source.html | 6 +- DatabaseCon_8cpp_source.html | 407 +- DatabaseCon_8h_source.html | 584 ++- Database__test_8cpp_source.html | 1439 +++--- DirectStep_8cpp_source.html | 33 +- DisputedTx_8h_source.html | 18 +- DoManifest_8cpp_source.html | 10 +- Door_8h_source.html | 7 +- Env_8cpp_source.html | 10 +- Env__test_8cpp_source.html | 2 +- FeeVoteImpl_8cpp_source.html | 12 +- FeeVote_8h_source.html | 2 +- FeeVote__test_8cpp_source.html | 18 +- Flow__test_8cpp_source.html | 4 +- GRPCServer_8cpp_source.html | 10 +- GetCounts_8cpp_source.html | 2 +- Handshake_8cpp_source.html | 10 +- HashRouter_8cpp_source.html | 2 +- HashRouter_8h_source.html | 2 +- HashRouter__test_8cpp_source.html | 2 +- InfoSub_8cpp_source.html | 20 +- InfoSub_8h_source.html | 443 +- JSONRPCClient_8cpp_source.html | 2 +- LedgerAccept_8cpp_source.html | 2 +- LedgerCleaner_8cpp_source.html | 8 +- LedgerEntry__test_8cpp_source.html | 6 +- LedgerHistory_8cpp_source.html | 6 +- LedgerHistory__test_8cpp_source.html | 2 +- LedgerLoad__test_8cpp_source.html | 34 +- LedgerMaster_8cpp_source.html | 24 +- LedgerReplayMsgHandler_8cpp_source.html | 2 +- LedgerReplay__test_8cpp_source.html | 12 +- LedgerReplayer_8cpp_source.html | 12 +- Ledger_8cpp_source.html | 2335 +++++---- Ledger_8h_source.html | 88 +- LoadFeeTrack__test_8cpp_source.html | 6 +- LogLevel_8cpp_source.html | 12 +- LogRotate_8cpp_source.html | 4 +- Main_8cpp_source.html | 50 +- Manifest_8cpp_source.html | 1203 +++-- Manifest_8h_source.html | 36 +- Manifest__test_8cpp_source.html | 50 +- NegativeUNLVote_8h_source.html | 2 +- NegativeUNL__test_8cpp_source.html | 2 +- NetworkID__test_8cpp_source.html | 2 +- NetworkOPs_8cpp_source.html | 24 +- NetworkOPs_8h_source.html | 2 +- NoRippleCheck__test_8cpp_source.html | 2 +- NodeFamily_8cpp_source.html | 2 +- NodeIdentity_8cpp_source.html | 95 +- NodeIdentity_8h_source.html | 4 +- Node_8cpp_source.html | 54 +- Node_8h_source.html | 8 +- OfferStream_8cpp_source.html | 25 +- OrderBookDB_8cpp_source.html | 8 +- OverlayImpl_8cpp_source.html | 66 +- PathFind_8cpp_source.html | 2 +- PathRequest_8cpp_source.html | 12 +- PathRequest_8h_source.html | 2 +- PathRequests_8cpp_source.html | 6 +- Pathfinder_8cpp_source.html | 6 +- PayChanClaim_8cpp_source.html | 2 +- PayChan_8cpp_source.html | 8 +- PayStrand__test_8cpp_source.html | 22 +- PaymentSandbox__test_8cpp_source.html | 4 +- Payment_8cpp_source.html | 4 +- PeerFinder_8cpp_source.html | 4 +- PeerFinder_8h_source.html | 37 +- PeerFinder__test_8cpp_source.html | 8 +- PeerImp_8cpp_source.html | 10 +- PeerImp_8h_source.html | 2 +- PeerReservationTable_8cpp_source.html | 26 +- PeerReservationTable_8h_source.html | 4 +- PeerfinderConfig_8cpp_source.html | 12 +- PeerfinderManager_8cpp_source.html | 4 +- PeerfinderManager_8h_source.html | 2 +- PerfLog__test_8cpp_source.html | 4 +- RCLValidations_8cpp_source.html | 2 +- RCLValidations__test_8cpp_source.html | 4 +- RPCCall_8cpp_source.html | 6 +- RPCLedgerHelpers_8cpp_source.html | 6 +- RPCSub_8cpp_source.html | 6 +- RPCSub_8h_source.html | 4 +- Regression__test_8cpp_source.html | 2 +- RelationalDatabase_8cpp_source.html | 89 +- RelationalDatabase_8h_source.html | 22 +- RipplePathFind_8cpp_source.html | 4 +- RocksDBFactory_8cpp_source.html | 4 +- SHAMapStoreImp_8cpp_source.html | 42 +- SHAMapStoreImp_8h_source.html | 14 +- SHAMapStore__test_8cpp_source.html | 6 +- SQLiteDatabase_8cpp_source.html | 475 +- ServerHandler_8cpp_source.html | 16 +- ServerStatus__test_8cpp_source.html | 2 +- ServiceRegistry_8h_source.html | 353 +- SetSignerList_8cpp_source.html | 6 +- SetTrust_8cpp_source.html | 4 +- SignFor_8cpp_source.html | 2 +- SignHandler_8cpp_source.html | 2 +- Simulate_8cpp_source.html | 6 +- SkipList__test_8cpp_source.html | 4 +- SociDB_8cpp_source.html | 606 +-- SociDB_8h_source.html | 12 +- SociDB__test_8cpp_source.html | 717 ++- StartUpType_8h_source.html | 120 + State_8cpp_source.html | 20 +- State_8h_source.html | 82 +- StoreSqdb_8h_source.html | 205 +- Submit_8cpp_source.html | 2 +- Subscribe_8cpp_source.html | 10 +- Subscribe__test_8cpp_source.html | 4 +- TMGetObjectByHash__test_8cpp_source.html | 4 +- TransactionSign_8cpp_source.html | 30 +- Transactor_8cpp_source.html | 12 +- TxHistory_8cpp_source.html | 2 +- TxQ_8cpp_source.html | 28 +- TxQ_8h_source.html | 2 +- Tx_8cpp_source.html | 4 +- Vacuum_8cpp_source.html | 99 +- Vacuum_8h_source.html | 8 +- ValidatorInfo_8cpp_source.html | 8 +- ValidatorKeys_8cpp_source.html | 22 +- ValidatorKeys_8h_source.html | 2 +- ValidatorKeys__test_8cpp_source.html | 18 +- ValidatorList_8cpp_source.html | 20 +- ValidatorList_8h_source.html | 18 +- ValidatorList__test_8cpp_source.html | 8 +- ValidatorSite_8cpp_source.html | 8 +- ValidatorSite__test_8cpp_source.html | 4 +- Version__test_8cpp_source.html | 4 +- View__test_8cpp_source.html | 10 +- WSClient_8cpp_source.html | 2 +- WSClient_8h_source.html | 2 +- WSInfoSub_8h_source.html | 4 +- Wallet_8cpp_source.html | 581 +-- Wallet_8h_source.html | 151 +- WorkSSL_8cpp_source.html | 2 +- WorkSSL_8h_source.html | 2 +- XChain__test_8cpp_source.html | 2 +- XRPEndpointStep_8cpp_source.html | 15 +- apply_8cpp_source.html | 2 +- classxrpl_1_1Application-members.html | 170 +- classxrpl_1_1Application.html | 292 +- classxrpl_1_1ApplicationImp-members.html | 320 +- classxrpl_1_1ApplicationImp.html | 301 +- ...pplicationImp_1_1io__latency__sampler.html | 22 +- classxrpl_1_1CheckpointersCollection.html | 14 +- classxrpl_1_1Config-members.html | 111 +- classxrpl_1_1Config.html | 198 +- classxrpl_1_1DBConfig.html | 8 +- classxrpl_1_1DatabaseCon.html | 28 +- classxrpl_1_1InfoSub.html | 30 +- classxrpl_1_1InfoSubRequest.html | 4 +- classxrpl_1_1InfoSub_1_1Source.html | 2 +- classxrpl_1_1Ledger.html | 80 +- classxrpl_1_1LedgerLoad__test-members.html | 2 +- classxrpl_1_1LedgerLoad__test.html | 10 +- classxrpl_1_1Ledger_1_1sles__iter__impl.html | 14 +- classxrpl_1_1Ledger_1_1txs__iter__impl.html | 16 +- classxrpl_1_1LockedSociSession.html | 20 +- classxrpl_1_1ManifestCache.html | 20 +- classxrpl_1_1NodeStore_1_1Database__test.html | 14 +- classxrpl_1_1PeerFinder_1_1StoreSqdb.html | 22 +- classxrpl_1_1RPCSub.html | 28 +- classxrpl_1_1RPCSubImp.html | 26 +- classxrpl_1_1RelationalDatabase-members.html | 2 +- classxrpl_1_1RelationalDatabase.html | 18 +- classxrpl_1_1SQLiteDatabase-members.html | 2 +- classxrpl_1_1SQLiteDatabase.html | 18 +- classxrpl_1_1SQLiteDatabaseImp-members.html | 102 +- classxrpl_1_1SQLiteDatabaseImp.html | 138 +- ...xrpl_1_1SQLiteDatabaseImp__coll__graph.map | 76 +- ...xrpl_1_1SQLiteDatabaseImp__coll__graph.md5 | 2 +- ...xrpl_1_1SQLiteDatabaseImp__coll__graph.png | Bin 121600 -> 60630 bytes classxrpl_1_1ServiceRegistry-members.html | 47 +- classxrpl_1_1ServiceRegistry.html | 148 +- classxrpl_1_1SociDB__test.html | 24 +- classxrpl_1_1WSInfoSub.html | 28 +- compression__test_8cpp_source.html | 6 +- dir_0103a8ad82dcc2c51f5cde661b4b5cb7.html | 27 +- dir_0103a8ad82dcc2c51f5cde661b4b5cb7_dep.map | 31 +- dir_0103a8ad82dcc2c51f5cde661b4b5cb7_dep.md5 | 2 +- dir_0103a8ad82dcc2c51f5cde661b4b5cb7_dep.png | Bin 10563 -> 10562 bytes dir_0f80512df79895ffedf045da85679f77.html | 102 + dir_0f80512df79895ffedf045da85679f77_dep.map | 4 + dir_0f80512df79895ffedf045da85679f77_dep.md5 | 1 + dir_0f80512df79895ffedf045da85679f77_dep.png | Bin 0 -> 1411 bytes dir_12f61dd819fd86862696b124db74f9af.html | 4 + dir_277bea21925992682601d52395f208df.html | 104 + dir_277bea21925992682601d52395f208df_dep.map | 4 + dir_277bea21925992682601d52395f208df_dep.md5 | 1 + dir_277bea21925992682601d52395f208df_dep.png | Bin 0 -> 1412 bytes dir_2860c73e71f9ef894ba4acb1eeae5483.html | 2 - dir_2e610841efb4e959cb432e522736434e.html | 6 - dir_90ffdbabf412cfdffe6b2193e0ce938a.html | 2 + dir_9b11620f1e8d276666da5c65752897e4.html | 6 + dir_9ce43f199f7837b2bc54444bf73b9bab.html | 6 - dir_9d7e4921ea2f62e76f4d31f5afd6d533.html | 8 + dir_ba227d129a24ecf2cd1f513aa6e21996.html | 4 - dir_ba3df07e81ea6c232f7f0c8823316f62.html | 4 - dir_c1a59f40492cf594814ad34c94ddc6cd.html | 2 - dir_c4f38cd849aa2a8e7280b7c5f705957a.html | 2 - envconfig_8cpp_source.html | 14 +- envconfig_8h_source.html | 2 +- functions_a.html | 12 +- functions_c.html | 12 +- functions_d.html | 4 +- functions_e.html | 10 +- functions_enum.html | 1 - functions_eval_f.html | 1 - functions_eval_l.html | 2 - functions_eval_n.html | 2 - functions_eval_r.html | 1 - functions_f.html | 13 +- functions_func.html | 30 +- functions_func_b.html | 4 +- functions_func_c.html | 6 +- functions_func_e.html | 6 +- functions_func_g.html | 4 +- functions_func_h.html | 2 +- functions_func_i.html | 4 +- functions_func_j.html | 8 +- functions_func_k.html | 2 +- functions_func_l.html | 13 +- functions_func_m.html | 2 +- functions_func_o.html | 20 +- functions_func_r.html | 6 +- functions_func_s.html | 12 +- functions_func_t.html | 8 +- functions_func_v.html | 14 +- functions_func_~.html | 1 - functions_g.html | 4 +- functions_h.html | 2 +- functions_i.html | 4 +- functions_j.html | 8 +- functions_k.html | 4 +- functions_l.html | 20 +- functions_m.html | 2 +- functions_n.html | 4 +- functions_o.html | 30 +- functions_p.html | 9 +- functions_r.html | 14 +- functions_s.html | 35 +- functions_v.html | 9 +- functions_vars.html | 2 +- functions_vars_r.html | 1 + functions_vars_s.html | 2 +- functions_w.html | 2 +- functions_~.html | 1 - namespacemembers.html | 2 +- namespacemembers_b.html | 2 +- namespacemembers_d.html | 4 +- namespacemembers_enum.html | 1 + namespacemembers_f.html | 3 +- namespacemembers_func.html | 2 +- namespacemembers_func_d.html | 4 +- namespacemembers_func_g.html | 6 +- namespacemembers_func_i.html | 4 +- namespacemembers_func_l.html | 2 +- namespacemembers_func_m.html | 8 +- namespacemembers_func_o.html | 14 +- namespacemembers_func_r.html | 2 +- namespacemembers_func_s.html | 4 +- namespacemembers_func_v.html | 2 +- namespacemembers_g.html | 6 +- namespacemembers_i.html | 4 +- namespacemembers_l.html | 2 +- namespacemembers_m.html | 5 +- namespacemembers_o.html | 14 +- namespacemembers_r.html | 2 +- namespacemembers_s.html | 17 +- namespacemembers_v.html | 2 +- namespacexrpl.html | 4161 +++++++-------- namespacexrpl_1_1detail.html | 140 +- namespacexrpl_1_1jss.html | 4 +- overlay_2Slot_8h_source.html | 2 +- paths_8cpp_source.html | 4 +- reduce__relay__test_8cpp_source.html | 8 +- search/all_10.js | 16 +- search/all_11.js | 8 +- search/all_12.js | 2 +- search/all_13.js | 104 +- search/all_14.js | 16 +- search/all_15.js | 104 +- search/all_16.js | 102 +- search/all_17.js | 18 +- search/all_19.js | 959 ++-- search/all_1a.js | 254 +- search/all_1b.js | 24 +- search/all_1c.js | 2 +- search/all_1d.js | 12 +- search/all_1e.js | 6 +- search/all_1f.js | 2 +- search/all_20.js | 2 +- search/all_22.js | 737 ++- search/all_8.js | 36 +- search/all_9.js | 8 +- search/all_a.js | 20 +- search/all_b.js | 12 +- search/all_c.js | 10 +- search/all_d.js | 52 +- search/all_e.js | 14 +- search/all_f.js | 10 +- search/enums_12.js | 2 +- search/enumvalues_1.js | 2 +- search/enumvalues_12.js | 2 +- search/enumvalues_13.js | 4 +- search/enumvalues_18.js | 2 +- search/enumvalues_19.js | 2 +- search/enumvalues_3.js | 2 +- search/enumvalues_6.js | 4 +- search/enumvalues_9.js | 4 +- search/enumvalues_c.js | 4 +- search/enumvalues_e.js | 12 +- search/enumvalues_f.js | 2 +- search/functions_1.js | 34 +- search/functions_10.js | 8 +- search/functions_12.js | 10 +- search/functions_13.js | 26 +- search/functions_14.js | 8 +- search/functions_15.js | 2 +- search/functions_16.js | 6 +- search/functions_17.js | 2 +- search/functions_1b.js | 737 ++- search/functions_2.js | 4 +- search/functions_3.js | 6 +- search/functions_4.js | 4 +- search/functions_5.js | 4 +- search/functions_6.js | 2 +- search/functions_7.js | 14 +- search/functions_8.js | 2 +- search/functions_9.js | 14 +- search/functions_a.js | 4 +- search/functions_b.js | 2 +- search/functions_c.js | 10 +- search/functions_d.js | 8 +- search/functions_e.js | 4 +- search/functions_f.js | 58 +- search/related_5.js | 2 +- search/related_9.js | 2 +- search/typedefs_2.js | 2 +- search/variables_0.js | 6 +- search/variables_11.js | 197 +- search/variables_12.js | 8 +- search/variables_13.js | 4 +- search/variables_16.js | 2 +- search/variables_3.js | 4 +- search/variables_9.js | 4 +- search/variables_b.js | 2 +- search/variables_c.js | 6 +- search/variables_d.js | 4 +- search/variables_f.js | 2 +- ...l_1_1DatabaseCon_1_1CheckpointerSetup.html | 6 +- ...txrpl_1_1DatabaseCon_1_1Setup-members.html | 2 +- structxrpl_1_1DatabaseCon_1_1Setup.html | 28 +- structxrpl_1_1FeeSetup.html | 8 +- structxrpl_1_1Manifest.html | 12 +- structxrpl_1_1SavedState.html | 8 +- tx__reduce__relay__test_8cpp_source.html | 14 +- 383 files changed, 14616 insertions(+), 14104 deletions(-) create mode 100644 StartUpType_8h_source.html create mode 100644 dir_0f80512df79895ffedf045da85679f77.html create mode 100644 dir_0f80512df79895ffedf045da85679f77_dep.map create mode 100644 dir_0f80512df79895ffedf045da85679f77_dep.md5 create mode 100644 dir_0f80512df79895ffedf045da85679f77_dep.png create mode 100644 dir_277bea21925992682601d52395f208df.html create mode 100644 dir_277bea21925992682601d52395f208df_dep.map create mode 100644 dir_277bea21925992682601d52395f208df_dep.md5 create mode 100644 dir_277bea21925992682601d52395f208df_dep.png diff --git a/AMMExtended__test_8cpp_source.html b/AMMExtended__test_8cpp_source.html index c63a21e511..e39ad28017 100644 --- a/AMMExtended__test_8cpp_source.html +++ b/AMMExtended__test_8cpp_source.html @@ -2031,7 +2031,7 @@ $(document).ready(function() { init_codefold(0); });
1885 BEAST_EXPECT(isOffer(env, carol, BTC(1'000), EUR(1)));
1886 BEAST_EXPECT(isOffer(env, bob, EUR(50), USD(50)));
1887
-
1888 auto flowJournal = env.app().logs().journal("Flow");
+
1888 auto flowJournal = env.app().logs().journal("Flow");
1889 auto const flowResult = [&] {
1890 STAmount deliver(USD(51));
1891 STAmount smax(BTC(61));
@@ -3645,7 +3645,6 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:130
A generic endpoint for log messages.
Definition Journal.h:40
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
-
virtual Logs & logs()=0
Definition Feature.h:143
Floating point representation of amounts with high dynamic range.
Definition IOUAmount.h:25
A currency issued by an account.
Definition Issue.h:13
@@ -3663,6 +3662,7 @@ $(document).ready(function() { init_codefold(0); });
Definition STPathSet.h:95
Discardable, editable view to a ledger.
Definition Sandbox.h:15
void apply(RawView &to)
Definition Sandbox.h:35
+
virtual Logs & logs()=0
virtual OpenLedger & openLedger()=0
Definition XRPAmount.h:23
diff --git a/AMMLiquidity_8cpp_source.html b/AMMLiquidity_8cpp_source.html index f3ec693585..04c66b4259 100644 --- a/AMMLiquidity_8cpp_source.html +++ b/AMMLiquidity_8cpp_source.html @@ -216,11 +216,11 @@ $(document).ready(function() { init_codefold(0); });
124 // Frozen accounts
125 if (balances.in == beast::zero || balances.out == beast::zero)
126 {
-
127 JLOG(j_.debug()) << "AMMLiquidity::getOffer, frozen accounts";
+
127 JLOG(j_.debug()) << "AMMLiquidity::getOffer, frozen accounts";
128 return std::nullopt;
129 }
130
-
131 JLOG(j_.trace()) << "AMMLiquidity::getOffer balances " << to_string(initialBalances_.in) << " "
+
131 JLOG(j_.trace()) << "AMMLiquidity::getOffer balances " << to_string(initialBalances_.in) << " "
132 << to_string(initialBalances_.out) << " new balances " << to_string(balances.in) << " "
133 << to_string(balances.out);
134
@@ -235,7 +235,7 @@ $(document).ready(function() { init_codefold(0); });
143 if (auto const spotPriceQ = Quality{balances};
144 clobQuality && (spotPriceQ <= clobQuality || withinRelativeDistance(spotPriceQ, *clobQuality, Number(1, -7))))
145 {
-
146 JLOG(j_.trace()) << "AMMLiquidity::getOffer, higher clob quality";
+
146 JLOG(j_.trace()) << "AMMLiquidity::getOffer, higher clob quality";
147 return std::nullopt;
148 }
149
@@ -271,7 +271,7 @@ $(document).ready(function() { init_codefold(0); });
179 }
180 catch (std::overflow_error const& e)
181 {
-
182 JLOG(j_.error()) << "AMMLiquidity::getOffer overflow " << e.what();
+
182 JLOG(j_.error()) << "AMMLiquidity::getOffer overflow " << e.what();
183 if (!view.rules().enabled(fixAMMOverflowOffer))
184 return maxOffer(balances, view.rules());
185 else
@@ -279,7 +279,7 @@ $(document).ready(function() { init_codefold(0); });
187 }
188 catch (std::exception const& e)
189 {
-
190 JLOG(j_.error()) << "AMMLiquidity::getOffer exception " << e.what();
+
190 JLOG(j_.error()) << "AMMLiquidity::getOffer exception " << e.what();
191 }
192 return std::nullopt;
193 }();
@@ -288,12 +288,12 @@ $(document).ready(function() { init_codefold(0); });
196 {
197 if (offer->amount().in > beast::zero && offer->amount().out > beast::zero)
198 {
-
199 JLOG(j_.trace()) << "AMMLiquidity::getOffer, created " << to_string(offer->amount().in) << "/" << issueIn_
+
199 JLOG(j_.trace()) << "AMMLiquidity::getOffer, created " << to_string(offer->amount().in) << "/" << issueIn_
200 << " " << to_string(offer->amount().out) << "/" << issueOut_;
201 return offer;
202 }
203
-
204 JLOG(j_.debug()) << "AMMLiquidity::getOffer, no valid offer " << ammContext_.multiPath() << " "
+
204 JLOG(j_.debug()) << "AMMLiquidity::getOffer, no valid offer " << ammContext_.multiPath() << " "
205 << ammContext_.curIters() << " " << (clobQuality ? clobQuality->rate() : STAmount{}) << " "
206 << to_string(balances.in) << " " << to_string(balances.out);
207 }
@@ -309,6 +309,9 @@ $(document).ready(function() { init_codefold(0); });
216
217} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
+
Stream error() const
Definition Journal.h:318
+
Stream debug() const
Definition Journal.h:300
+
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
Maintains AMM info per overall payment engine execution and individual iteration.
Definition AMMContext.h:16
static constexpr std::uint8_t MaxIterations
Definition AMMContext.h:21
AMMLiquidity class provides AMM offers to BookStep class.
diff --git a/AccountTxPaging_8cpp_source.html b/AccountTxPaging_8cpp_source.html index f14bafe028..a39c2c210b 100644 --- a/AccountTxPaging_8cpp_source.html +++ b/AccountTxPaging_8cpp_source.html @@ -135,7 +135,7 @@ $(document).ready(function() { init_codefold(0); });
Definition Application.h:95
virtual Config & config()=0
-
uint32_t NETWORK_ID
Definition Config.h:137
+
uint32_t NETWORK_ID
Definition Config.h:138
std::shared_ptr< Ledger const > getLedgerBySeq(std::uint32_t index)
Definition Serializer.h:319
virtual LedgerMaster & getLedgerMaster()=0
@@ -146,7 +146,7 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
void saveLedgerAsync(Application &app, std::uint32_t seq)
void convertBlobsToTxResult(RelationalDatabase::AccountTxs &to, std::uint32_t ledger_index, std::string const &status, Blob const &rawTxn, Blob const &rawMeta, Application &app)
-
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:924
+
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:923
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition Slice.h:213
diff --git a/AccountTx_8cpp_source.html b/AccountTx_8cpp_source.html index 27262ad11d..92c3243c6e 100644 --- a/AccountTx_8cpp_source.html +++ b/AccountTx_8cpp_source.html @@ -533,7 +533,7 @@ $(document).ready(function() { init_codefold(0); });
bool isMember(char const *key) const
Return true if the object has a member named key.
Stream debug() const
Definition Journal.h:300
virtual Config & config()=0
-
bool useTxTables() const
Definition Config.h:317
+
bool useTxTables() const
Definition Config.h:318
bool getValidatedRange(std::uint32_t &minVal, std::uint32_t &maxVal)
uint256 getHashBySeq(std::uint32_t index)
Get a ledger's hash by sequence number using the cache.
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
diff --git a/AmendmentTable_8cpp_source.html b/AmendmentTable_8cpp_source.html index a8657f8306..23d207ffe0 100644 --- a/AmendmentTable_8cpp_source.html +++ b/AmendmentTable_8cpp_source.html @@ -83,13 +83,13 @@ $(document).ready(function() { init_codefold(0); });
1#include <xrpld/app/main/Application.h>
2#include <xrpld/app/misc/AmendmentTable.h>
-
3#include <xrpld/app/rdb/Wallet.h>
-
4#include <xrpld/core/ConfigSections.h>
-
5
-
6#include <xrpl/protocol/Feature.h>
-
7#include <xrpl/protocol/STValidation.h>
-
8#include <xrpl/protocol/TxFlags.h>
-
9#include <xrpl/protocol/jss.h>
+
3#include <xrpld/core/ConfigSections.h>
+
4
+
5#include <xrpl/protocol/Feature.h>
+
6#include <xrpl/protocol/STValidation.h>
+
7#include <xrpl/protocol/TxFlags.h>
+
8#include <xrpl/protocol/jss.h>
+
9#include <xrpl/server/Wallet.h>
10
11#include <boost/algorithm/string.hpp>
12#include <boost/format.hpp>
@@ -616,7 +616,7 @@ $(document).ready(function() { init_codefold(0); });
546
547 // Read amendment votes from wallet.db
548 auto db = db_.checkoutDb();
- +
550 *db,
551 [&](boost::optional<std::string> amendment_hash,
552 boost::optional<std::string> amendment_name,
@@ -713,7 +713,7 @@ $(document).ready(function() { init_codefold(0); });
633{
634 XRPL_ASSERT(vote != AmendmentVote::obsolete, "xrpl::AmendmentTableImpl::persistVote : valid vote input");
635 auto db = db_.checkoutDb();
-
636 voteAmendment(*db, amendment, name, vote);
+
636 voteAmendment(*db, amendment, name, vote);
637}
638
@@ -1133,8 +1133,8 @@ $(document).ready(function() { init_codefold(0); });
hash_map< uint256, AmendmentState > amendmentMap_
The amendment table stores the list of enabled and potential amendments.
- -
LockedSociSession checkoutDb()
+ +
LockedSociSession checkoutDb()
Rules controlling protocol behavior.
Definition Rules.h:18
Holds a collection of configuration values.
Definition BasicConfig.h:24
std::string const & name() const
Returns the name of this section.
Definition BasicConfig.h:40
@@ -1166,7 +1166,6 @@ $(document).ready(function() { init_codefold(0); });
@ objectValue
object value (collection of name/value pairs).
Definition json_value.h:26
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
void voteAmendment(soci::session &session, uint256 const &amendment, std::string const &name, AmendmentVote vote)
voteAmendment Set the veto value for a particular amendment.
Definition Wallet.cpp:243
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
@@ -1179,15 +1178,16 @@ $(document).ready(function() { init_codefold(0); });
bool isAdmin(Port const &port, Json::Value const &params, beast::IP::Address const &remoteIp)
Definition Role.cpp:63
constexpr std::uint32_t tfLostMajority
Definition TxFlags.h:109
constexpr std::uint32_t tfGotMajority
Definition TxFlags.h:108
-
void readAmendments(soci::session &session, std::function< void(boost::optional< std::string > amendment_hash, boost::optional< std::string > amendment_name, boost::optional< AmendmentVote > vote)> const &callback)
readAmendments Reads all amendments from the FeatureVotes table.
Definition Wallet.cpp:211
-
bool createFeatureVotes(soci::session &session)
createFeatureVotes Creates the FeatureVote table if it does not exist.
Definition Wallet.cpp:187
+
void readAmendments(soci::session &session, std::function< void(boost::optional< std::string > amendment_hash, boost::optional< std::string > amendment_name, boost::optional< AmendmentVote > vote)> const &callback)
readAmendments Reads all amendments from the FeatureVotes table.
Definition Wallet.cpp:212
+
bool createFeatureVotes(soci::session &session)
createFeatureVotes Creates the FeatureVote table if it does not exist.
Definition Wallet.cpp:188
-
AmendmentVote
Definition Wallet.h:120
+
AmendmentVote
Definition Wallet.h:119
constexpr std::ratio< 80, 100 > amendmentMajorityCalcThreshold
The minimum amount of support an amendment should have.
+
void voteAmendment(soci::session &session, uint256 const &amendment, std::string const &name, AmendmentVote vote)
voteAmendment Set the veto value for a particular amendment.
Definition Wallet.cpp:244
static std::vector< std::pair< uint256, std::string > > parseSection(Section const &section)
diff --git a/Application_8cpp_source.html b/Application_8cpp_source.html index 0ea4213145..ece829eb32 100644 --- a/Application_8cpp_source.html +++ b/Application_8cpp_source.html @@ -94,2178 +94,2188 @@ $(document).ready(function() { init_codefold(0); });
11#include <xrpld/app/ledger/TransactionMaster.h>
12#include <xrpld/app/main/Application.h>
13#include <xrpld/app/main/BasicApp.h>
-
14#include <xrpld/app/main/DBInit.h>
-
15#include <xrpld/app/main/GRPCServer.h>
-
16#include <xrpld/app/main/LoadManager.h>
-
17#include <xrpld/app/main/NodeIdentity.h>
-
18#include <xrpld/app/main/NodeStoreScheduler.h>
-
19#include <xrpld/app/misc/AmendmentTable.h>
-
20#include <xrpld/app/misc/HashRouter.h>
-
21#include <xrpld/app/misc/LoadFeeTrack.h>
-
22#include <xrpld/app/misc/NetworkOPs.h>
-
23#include <xrpld/app/misc/SHAMapStore.h>
-
24#include <xrpld/app/misc/TxQ.h>
-
25#include <xrpld/app/misc/ValidatorKeys.h>
-
26#include <xrpld/app/misc/ValidatorSite.h>
-
27#include <xrpld/app/paths/PathRequests.h>
-
28#include <xrpld/app/rdb/RelationalDatabase.h>
-
29#include <xrpld/app/rdb/Wallet.h>
-
30#include <xrpld/app/tx/apply.h>
-
31#include <xrpld/core/DatabaseCon.h>
-
32#include <xrpld/overlay/Cluster.h>
-
33#include <xrpld/overlay/PeerReservationTable.h>
-
34#include <xrpld/overlay/PeerSet.h>
-
35#include <xrpld/overlay/make_Overlay.h>
-
36#include <xrpld/shamap/NodeFamily.h>
-
37
-
38#include <xrpl/basics/ByteUtilities.h>
-
39#include <xrpl/basics/ResolverAsio.h>
-
40#include <xrpl/basics/random.h>
-
41#include <xrpl/beast/asio/io_latency_probe.h>
-
42#include <xrpl/beast/core/LexicalCast.h>
-
43#include <xrpl/core/PerfLog.h>
-
44#include <xrpl/crypto/csprng.h>
-
45#include <xrpl/json/json_reader.h>
-
46#include <xrpl/nodestore/DummyScheduler.h>
-
47#include <xrpl/protocol/ApiVersion.h>
-
48#include <xrpl/protocol/BuildInfo.h>
-
49#include <xrpl/protocol/Feature.h>
-
50#include <xrpl/protocol/Protocol.h>
-
51#include <xrpl/protocol/STParsedJSON.h>
-
52#include <xrpl/resource/Fees.h>
-
53
-
54#include <boost/algorithm/string/predicate.hpp>
-
55#include <boost/asio/steady_timer.hpp>
-
56#include <boost/system/error_code.hpp>
-
57
-
58#include <date/date.h>
-
59
-
60#include <chrono>
-
61#include <condition_variable>
-
62#include <cstring>
-
63#include <fstream>
-
64#include <limits>
-
65#include <mutex>
-
66#include <optional>
-
67#include <utility>
-
68
-
69namespace xrpl {
-
70
-
71static void
-
72fixConfigPorts(Config& config, Endpoints const& endpoints);
-
73
-
74// VFALCO TODO Move the function definitions into the class declaration
-
-
75class ApplicationImp : public Application, public BasicApp
-
76{
-
77private:
-
- -
79 {
-
80 private:
- - - - -
85
-
86 public:
-
- - - - -
91 boost::asio::io_context& ios)
-
92 : m_event(ev), m_journal(journal), m_probe(interval, ios), lastSample_{}
-
93 {
-
94 }
-
-
95
-
96 void
-
- -
98 {
-
99 m_probe.sample(std::ref(*this));
-
100 }
-
-
101
-
102 template <class Duration>
-
103 void
-
-
104 operator()(Duration const& elapsed)
-
105 {
-
106 using namespace std::chrono;
-
107 auto const lastSample = ceil<milliseconds>(elapsed);
-
108
-
109 lastSample_ = lastSample;
-
110
-
111 if (lastSample >= 10ms)
-
112 m_event.notify(lastSample);
-
113 if (lastSample >= 500ms)
-
114 {
-
115 JLOG(m_journal.warn()) << "io_context latency = " << lastSample.count();
-
116 }
-
117 }
-
-
118
- -
-
120 get() const
-
121 {
-
122 return lastSample_.load();
-
123 }
-
-
124
-
125 void
-
- -
127 {
-
128 m_probe.cancel();
-
129 }
-
-
130
-
131 void
-
- -
133 {
- -
135 }
-
-
136 };
-
-
137
-
138public:
- - - -
142
- -
144
- - - -
148
-
149 // Required by the SHAMapStore
- -
151
- - - - - - -
158
- - - - -
163
- -
165
- - -
168 // VFALCO TODO Make OrderBookDB abstract
- - - - - - - - - - - - - - - - - - - - - - - -
192 boost::asio::steady_timer sweepTimer_;
-
193 boost::asio::steady_timer entropyTimer_;
-
194
- - - - -
199
-
200 boost::asio::signal_set m_signals;
-
201
- -
203
- -
205
- -
207
- -
209
- -
211
-
212 //--------------------------------------------------------------------------
-
213
-
214 static std::size_t
-
- -
216 {
-
217#if XRPL_SINGLE_IO_SERVICE_THREAD
-
218 return 1;
-
219#else
-
220
-
221 if (config.IO_WORKERS > 0)
-
222 return config.IO_WORKERS;
-
223
-
224 auto const cores = std::thread::hardware_concurrency();
-
225
-
226 // Use a single thread when running on under-provisioned systems
-
227 // or if we are configured to use minimal resources.
-
228 if ((cores == 1) || ((config.NODE_SIZE == 0) && (cores == 2)))
-
229 return 1;
-
230
-
231 // Otherwise, prefer six threads.
-
232 return 6;
-
233#endif
-
234 }
-
-
235
-
236 //--------------------------------------------------------------------------
-
237
-
- - -
240 , config_(std::move(config))
-
241 , logs_(std::move(logs))
-
242 , timeKeeper_(std::move(timeKeeper))
- -
244 , m_journal(logs_->journal("Application"))
-
245
-
246 // PerfLog must be started before any other threads are launched.
-
247 , perfLog_(perf::make_PerfLog(
-
248 perf::setup_PerfLog(config_->section("perf"), config_->CONFIG_DIR),
-
249 *this,
-
250 logs_->journal("PerfLog"),
-
251 [this] { signalStop("PerfLog"); }))
-
252
-
253 , m_txMaster(*this)
-
254
-
255 , m_collectorManager(make_CollectorManager(config_->section(SECTION_INSIGHT), logs_->journal("Collector")))
-
256
- - - -
260 return 1;
-
261
-
262 if (config->WORKERS)
-
263 return config->WORKERS;
-
264
-
265 auto count = static_cast<int>(std::thread::hardware_concurrency());
-
266
-
267 // Be more aggressive about the number of threads to use
-
268 // for the job queue if the server is configured as
-
269 // "large" or "huge" if there are enough cores.
-
270 if (config->NODE_SIZE >= 4 && count >= 16)
-
271 count = 6 + std::min(count, 8);
-
272 else if (config->NODE_SIZE >= 3 && count >= 8)
-
273 count = 4 + std::min(count, 6);
-
274 else
-
275 count = 2 + std::min(count, 4);
-
276
-
277 return count;
-
278 }(config_),
-
279 m_collectorManager->group("jobq"),
-
280 logs_->journal("JobQueue"),
-
281 *logs_,
-
282 *perfLog_))
-
283
- -
285
-
286 , m_shaMapStore(make_SHAMapStore(*this, m_nodeStoreScheduler, logs_->journal("SHAMapStore")))
-
287
-
288 , m_tempNodeCache("NodeCache", 16384, std::chrono::seconds{90}, stopwatch(), logs_->journal("TaggedCache"))
-
289
-
290 , cachedSLEs_("Cached SLEs", 0, std::chrono::minutes(1), stopwatch(), logs_->journal("CachedSLEs"))
-
291
- -
293
-
294 , m_resourceManager(Resource::make_Manager(m_collectorManager->collector(), logs_->journal("Resource")))
-
295
-
296 , m_nodeStore(m_shaMapStore->makeNodeStore(config_->PREFETCH_WORKERS > 0 ? config_->PREFETCH_WORKERS : 4))
-
297
- -
299
-
300 , m_orderBookDB(*this)
-
301
- -
303 std::make_unique<PathRequests>(*this, logs_->journal("PathRequest"), m_collectorManager->collector()))
-
304
-
305 , m_ledgerMaster(std::make_unique<LedgerMaster>(
-
306 *this,
-
307 stopwatch(),
-
308 m_collectorManager->collector(),
-
309 logs_->journal("LedgerMaster")))
-
310
-
311 , ledgerCleaner_(make_LedgerCleaner(*this, logs_->journal("LedgerCleaner")))
-
312
-
313 // VFALCO NOTE must come before NetworkOPs to prevent a crash due
-
314 // to dependencies in the destructor.
-
315 //
- -
317
- -
319 *this,
-
320 m_collectorManager->collector(),
-
321 [this](std::shared_ptr<SHAMap> const& set, bool fromAcquire) { gotTXSet(set, fromAcquire); }))
-
322
- -
324
- -
326 "AcceptedLedger",
-
327 4,
- -
329 stopwatch(),
-
330 logs_->journal("TaggedCache"))
-
331
- -
333 *this,
-
334 stopwatch(),
-
335 config_->standalone(),
-
336 config_->NETWORK_QUORUM,
-
337 config_->START_VALID,
-
338 *m_jobQueue,
- - - -
342 logs_->journal("NetworkOPs"),
-
343 m_collectorManager->collector()))
-
344
-
345 , cluster_(std::make_unique<Cluster>(logs_->journal("Overlay")))
-
346
-
347 , peerReservations_(std::make_unique<PeerReservationTable>(logs_->journal("PeerReservationTable")))
-
348
-
349 , validatorManifests_(std::make_unique<ManifestCache>(logs_->journal("ManifestCache")))
-
350
-
351 , publisherManifests_(std::make_unique<ManifestCache>(logs_->journal("ManifestCache")))
-
352
- - - - -
357 config_->legacy("database_path"),
-
358 logs_->journal("ValidatorList"),
-
359 config_->VALIDATION_QUORUM))
-
360
- -
362
- -
364 *this,
- -
366 *m_jobQueue,
- - - -
370
-
371 , mFeeTrack(std::make_unique<LoadFeeTrack>(logs_->journal("LoadManager")))
-
372
- -
374
-
375 , mValidations(ValidationParms(), stopwatch(), *this, logs_->journal("Validations"))
-
376
-
377 , m_loadManager(make_LoadManager(*this, logs_->journal("LoadManager")))
-
378
-
379 , txQ_(std::make_unique<TxQ>(setup_TxQ(*config_), logs_->journal("TxQ")))
-
380
- -
382
- -
384
- -
386
-
387 , checkSigs_(true)
-
388
-
389 , m_resolver(ResolverAsio::New(get_io_context(), logs_->journal("Resolver")))
-
390
- -
392 m_collectorManager->collector()->make_event("ios_latency"),
-
393 logs_->journal("Application"),
- - - -
397 {
- -
399
-
400 add(m_resourceManager.get());
-
401
-
402 //
-
403 // VFALCO - READ THIS!
-
404 //
-
405 // Do not start threads, open sockets, or do any sort of "real work"
-
406 // inside the constructor. Put it in start instead. Or if you must,
-
407 // put it in setup (but everything in setup should be moved to start
-
408 // anyway.
-
409 //
-
410 // The reason is that the unit tests require an Application object to
-
411 // be created. But we don't actually start all the threads, sockets,
-
412 // and services when running the unit tests. Therefore anything which
-
413 // needs to be stopped will not get stopped correctly if it is
-
414 // started in this constructor.
-
415 //
-
416
-
417 add(ledgerCleaner_.get());
-
418 }
-
-
419
-
420 //--------------------------------------------------------------------------
-
421
-
422 bool
-
423 setup(boost::program_options::variables_map const& cmdline) override;
-
424 void
-
425 start(bool withTimers) override;
-
426 void
-
427 run() override;
-
428 void
-
429 signalStop(std::string msg) override;
-
430 bool
-
431 checkSigs() const override;
-
432 void
-
433 checkSigs(bool) override;
-
434 bool
-
435 isStopping() const override;
-
436 int
-
437 fdRequired() const override;
-
438
-
439 //--------------------------------------------------------------------------
-
440
- -
-
442 instanceID() const override
-
443 {
-
444 return instanceCookie_;
-
445 }
-
-
446
-
447 Logs&
-
-
448 logs() override
-
449 {
-
450 return *logs_;
-
451 }
-
-
452
-
453 Config&
-
-
454 config() override
-
455 {
-
456 return *config_;
-
457 }
-
-
458
- -
- -
461 {
-
462 return *m_collectorManager;
-
463 }
-
-
464
-
465 Family&
-
-
466 getNodeFamily() override
-
467 {
-
468 return nodeFamily_;
-
469 }
-
-
470
- -
-
472 timeKeeper() override
-
473 {
-
474 return *timeKeeper_;
-
475 }
-
-
476
-
477 JobQueue&
-
-
478 getJobQueue() override
-
479 {
-
480 return *m_jobQueue;
-
481 }
-
-
482
- -
-
484 nodeIdentity() override
-
485 {
-
486 if (nodeIdentity_)
-
487 return *nodeIdentity_;
-
488
-
489 LogicError("Accessing Application::nodeIdentity() before it is initialized.");
-
490 }
-
-
491
- -
-
493 getValidationPublicKey() const override
-
494 {
-
495 if (!validatorKeys_.keys)
-
496 return {};
-
497
-
498 return validatorKeys_.keys->publicKey;
-
499 }
-
-
500
- -
-
502 getOPs() override
-
503 {
-
504 return *m_networkOPs;
-
505 }
-
-
506
-
507 virtual ServerHandler&
-
- -
509 {
-
510 XRPL_ASSERT(
- -
512 "xrpl::ApplicationImp::getServerHandler : non-null server "
-
513 "handle");
-
514 return *serverHandler_;
-
515 }
-
-
516
-
517 boost::asio::io_context&
-
-
518 getIOContext() override
-
519 {
-
520 return get_io_context();
-
521 }
-
-
522
- -
-
524 getIOLatency() override
-
525 {
-
526 return m_io_latency_sampler.get();
-
527 }
-
-
528
- -
- -
531 {
-
532 return *m_ledgerMaster;
-
533 }
-
-
534
- -
- -
537 {
-
538 return *ledgerCleaner_;
-
539 }
-
-
540
- -
- -
543 {
-
544 return *m_ledgerReplayer;
-
545 }
-
-
546
- -
- -
549 {
-
550 return *m_inboundLedgers;
-
551 }
-
-
552
- -
- -
555 {
-
556 return *m_inboundTransactions;
-
557 }
-
-
558
- -
- -
561 {
- -
563 }
-
-
564
-
565 void
-
-
566 gotTXSet(std::shared_ptr<SHAMap> const& set, bool fromAcquire)
-
567 {
-
568 if (set)
-
569 m_networkOPs->mapComplete(set, fromAcquire);
-
570 }
-
-
571
- -
- -
574 {
-
575 return m_txMaster;
-
576 }
-
-
577
- -
-
579 getPerfLog() override
-
580 {
-
581 return *perfLog_;
-
582 }
-
-
583
-
584 NodeCache&
-
- -
586 {
-
587 return m_tempNodeCache;
-
588 }
-
-
589
- -
-
591 getNodeStore() override
-
592 {
-
593 return *m_nodeStore;
-
594 }
-
-
595
- -
-
597 getMasterMutex() override
-
598 {
-
599 return m_masterMutex;
-
600 }
-
-
601
- -
-
603 getLoadManager() override
-
604 {
-
605 return *m_loadManager;
-
606 }
-
-
607
- -
- -
610 {
-
611 return *m_resourceManager;
-
612 }
-
-
613
- -
-
615 getOrderBookDB() override
-
616 {
-
617 return m_orderBookDB;
-
618 }
-
-
619
- -
- -
622 {
-
623 return *m_pathRequests;
-
624 }
-
-
625
- -
-
627 cachedSLEs() override
-
628 {
-
629 return cachedSLEs_;
-
630 }
-
-
631
- -
- -
634 {
-
635 return *m_amendmentTable;
-
636 }
-
-
637
- -
-
639 getFeeTrack() override
-
640 {
-
641 return *mFeeTrack;
-
642 }
-
-
643
- -
-
645 getHashRouter() override
-
646 {
-
647 return *hashRouter_;
-
648 }
-
-
649
- -
-
651 getValidations() override
-
652 {
-
653 return mValidations;
-
654 }
-
-
655
- -
-
657 validators() override
-
658 {
-
659 return *validators_;
-
660 }
-
-
661
- -
-
663 validatorSites() override
-
664 {
-
665 return *validatorSites_;
-
666 }
-
-
667
- -
- -
670 {
-
671 return *validatorManifests_;
-
672 }
-
-
673
- -
- -
676 {
-
677 return *publisherManifests_;
-
678 }
-
-
679
-
680 Cluster&
-
-
681 cluster() override
-
682 {
-
683 return *cluster_;
-
684 }
-
-
685
- -
- -
688 {
-
689 return *peerReservations_;
-
690 }
-
-
691
- -
-
693 getSHAMapStore() override
-
694 {
-
695 return *m_shaMapStore;
-
696 }
-
-
697
- -
-
699 pendingSaves() override
-
700 {
-
701 return pendingSaves_;
-
702 }
-
-
703
- -
-
705 openLedger() override
-
706 {
-
707 return *openLedger_;
-
708 }
-
-
709
-
710 OpenLedger const&
-
-
711 openLedger() const override
-
712 {
-
713 return *openLedger_;
-
714 }
-
-
715
-
716 Overlay&
-
-
717 overlay() override
-
718 {
-
719 XRPL_ASSERT(overlay_, "xrpl::ApplicationImp::overlay : non-null overlay");
-
720 return *overlay_;
-
721 }
-
-
722
-
723 TxQ&
-
-
724 getTxQ() override
-
725 {
-
726 XRPL_ASSERT(txQ_, "xrpl::ApplicationImp::getTxQ : non-null transaction queue");
-
727 return *txQ_;
-
728 }
-
-
729
- -
- -
732 {
-
733 XRPL_ASSERT(
- -
735 "xrpl::ApplicationImp::getRelationalDatabase : non-null "
-
736 "relational database");
-
737 return *mRelationalDatabase;
-
738 }
-
-
739
- -
-
741 getWalletDB() override
-
742 {
-
743 XRPL_ASSERT(mWalletDB, "xrpl::ApplicationImp::getWalletDB : non-null wallet database");
-
744 return *mWalletDB;
-
745 }
-
-
746
-
747 bool
-
748 serverOkay(std::string& reason) override;
-
749
- -
751 journal(std::string const& name) override;
-
752
-
753 //--------------------------------------------------------------------------
-
754
-
755 bool
-
- -
757 {
-
758 XRPL_ASSERT(
-
759 mWalletDB.get() == nullptr,
-
760 "xrpl::ApplicationImp::initRelationalDatabase : null wallet "
-
761 "database");
-
762
-
763 try
-
764 {
- -
766
-
767 // wallet database
- -
769 setup.useGlobalPragma = false;
-
770
- -
772 }
-
773 catch (std::exception const& e)
-
774 {
-
775 JLOG(m_journal.fatal()) << "Failed to initialize SQL databases: " << e.what();
-
776 return false;
-
777 }
-
778
-
779 return true;
-
780 }
-
-
781
-
782 bool
-
- -
784 {
-
785 if (config_->doImport)
-
786 {
-
787 auto j = logs_->journal("NodeObject");
-
788 NodeStore::DummyScheduler dummyScheduler;
- - -
791 dummyScheduler,
-
792 0,
- -
794 j);
-
795
-
796 JLOG(j.warn()) << "Starting node import from '" << source->getName() << "' to '" << m_nodeStore->getName()
-
797 << "'.";
-
798
-
799 using namespace std::chrono;
-
800 auto const start = steady_clock::now();
-
801
-
802 m_nodeStore->importDatabase(*source);
-
803
-
804 auto const elapsed = duration_cast<seconds>(steady_clock::now() - start);
-
805 JLOG(j.warn()) << "Node import from '" << source->getName() << "' took " << elapsed.count() << " seconds.";
-
806 }
-
807
-
808 return true;
-
809 }
-
-
810
-
811 //--------------------------------------------------------------------------
-
812 //
-
813 // PropertyStream
-
814 //
-
815
-
816 void
-
- -
818 {
-
819 }
-
-
820
-
821 //--------------------------------------------------------------------------
-
822
-
823 void
-
- -
825 {
-
826 // Only start the timer if waitHandlerCounter_ is not yet joined.
-
827 if (auto optionalCountedHandler = waitHandlerCounter_.wrap([this](boost::system::error_code const& e) {
-
828 if (e.value() == boost::system::errc::success)
-
829 {
-
830 m_jobQueue->addJob(jtSWEEP, "sweep", [this]() { doSweep(); });
-
831 }
-
832 // Recover as best we can if an unexpected error occurs.
-
833 if (e.value() != boost::system::errc::success && e.value() != boost::asio::error::operation_aborted)
-
834 {
-
835 // Try again later and hope for the best.
-
836 JLOG(m_journal.error()) << "Sweep timer got error '" << e.message() << "'. Restarting timer.";
-
837 setSweepTimer();
-
838 }
-
839 }))
-
840 {
-
841 using namespace std::chrono;
-
842 sweepTimer_.expires_after(
-
843 seconds{config_->SWEEP_INTERVAL.value_or(config_->getValueFor(SizedItem::sweepInterval))});
-
844 sweepTimer_.async_wait(std::move(*optionalCountedHandler));
-
845 }
-
846 }
-
-
847
-
848 void
-
- -
850 {
-
851 // Only start the timer if waitHandlerCounter_ is not yet joined.
-
852 if (auto optionalCountedHandler = waitHandlerCounter_.wrap([this](boost::system::error_code const& e) {
-
853 if (e.value() == boost::system::errc::success)
-
854 {
-
855 crypto_prng().mix_entropy();
-
856 setEntropyTimer();
-
857 }
-
858 // Recover as best we can if an unexpected error occurs.
-
859 if (e.value() != boost::system::errc::success && e.value() != boost::asio::error::operation_aborted)
-
860 {
-
861 // Try again later and hope for the best.
-
862 JLOG(m_journal.error()) << "Entropy timer got error '" << e.message() << "'. Restarting timer.";
-
863 setEntropyTimer();
-
864 }
-
865 }))
-
866 {
-
867 using namespace std::chrono_literals;
-
868 entropyTimer_.expires_after(5min);
-
869 entropyTimer_.async_wait(std::move(*optionalCountedHandler));
-
870 }
-
871 }
-
-
872
-
873 void
-
- -
875 {
-
876 if (!config_->standalone() && !getRelationalDatabase().transactionDbHasSpace(*config_))
-
877 {
-
878 signalStop("Out of transaction DB space");
-
879 }
-
880
-
881 // VFALCO NOTE Does the order of calls matter?
-
882 // VFALCO TODO fix the dependency inversion using an observer,
-
883 // have listeners register for "onSweep ()" notification.
-
884
-
885 {
-
886 std::shared_ptr<FullBelowCache const> const fullBelowCache = nodeFamily_.getFullBelowCache();
-
887
-
888 std::shared_ptr<TreeNodeCache const> const treeNodeCache = nodeFamily_.getTreeNodeCache();
-
889
-
890 std::size_t const oldFullBelowSize = fullBelowCache->size();
-
891 std::size_t const oldTreeNodeSize = treeNodeCache->size();
-
892
-
893 nodeFamily_.sweep();
-
894
-
895 JLOG(m_journal.debug()) << "NodeFamily::FullBelowCache sweep. Size before: " << oldFullBelowSize
-
896 << "; size after: " << fullBelowCache->size();
-
897
-
898 JLOG(m_journal.debug()) << "NodeFamily::TreeNodeCache sweep. Size before: " << oldTreeNodeSize
-
899 << "; size after: " << treeNodeCache->size();
-
900 }
-
901 {
-
902 TaggedCache<uint256, Transaction> const& masterTxCache = getMasterTransaction().getCache();
-
903
-
904 std::size_t const oldMasterTxSize = masterTxCache.size();
-
905
-
906 getMasterTransaction().sweep();
-
907
-
908 JLOG(m_journal.debug()) << "MasterTransaction sweep. Size before: " << oldMasterTxSize
-
909 << "; size after: " << masterTxCache.size();
-
910 }
-
911 {
-
912 std::size_t const oldLedgerMasterCacheSize = getLedgerMaster().getFetchPackCacheSize();
-
913
-
914 getLedgerMaster().sweep();
-
915
-
916 JLOG(m_journal.debug()) << "LedgerMaster sweep. Size before: " << oldLedgerMasterCacheSize
-
917 << "; size after: " << getLedgerMaster().getFetchPackCacheSize();
-
918 }
-
919 {
-
920 // NodeCache == TaggedCache<SHAMapHash, Blob>
-
921 std::size_t const oldTempNodeCacheSize = getTempNodeCache().size();
-
922
-
923 getTempNodeCache().sweep();
-
924
-
925 JLOG(m_journal.debug()) << "TempNodeCache sweep. Size before: " << oldTempNodeCacheSize
-
926 << "; size after: " << getTempNodeCache().size();
-
927 }
-
928 {
-
929 std::size_t const oldCurrentCacheSize = getValidations().sizeOfCurrentCache();
-
930 std::size_t const oldSizeSeqEnforcesSize = getValidations().sizeOfSeqEnforcersCache();
-
931 std::size_t const oldByLedgerSize = getValidations().sizeOfByLedgerCache();
-
932 std::size_t const oldBySequenceSize = getValidations().sizeOfBySequenceCache();
-
933
-
934 getValidations().expire(m_journal);
-
935
-
936 JLOG(m_journal.debug()) << "Validations Current expire. Size before: " << oldCurrentCacheSize
-
937 << "; size after: " << getValidations().sizeOfCurrentCache();
-
938
-
939 JLOG(m_journal.debug()) << "Validations SeqEnforcer expire. Size before: " << oldSizeSeqEnforcesSize
-
940 << "; size after: " << getValidations().sizeOfSeqEnforcersCache();
-
941
-
942 JLOG(m_journal.debug()) << "Validations ByLedger expire. Size before: " << oldByLedgerSize
-
943 << "; size after: " << getValidations().sizeOfByLedgerCache();
-
944
-
945 JLOG(m_journal.debug()) << "Validations BySequence expire. Size before: " << oldBySequenceSize
-
946 << "; size after: " << getValidations().sizeOfBySequenceCache();
-
947 }
-
948 {
-
949 std::size_t const oldInboundLedgersSize = getInboundLedgers().cacheSize();
-
950
-
951 getInboundLedgers().sweep();
-
952
-
953 JLOG(m_journal.debug()) << "InboundLedgers sweep. Size before: " << oldInboundLedgersSize
-
954 << "; size after: " << getInboundLedgers().cacheSize();
-
955 }
-
956 {
-
957 size_t const oldTasksSize = getLedgerReplayer().tasksSize();
-
958 size_t const oldDeltasSize = getLedgerReplayer().deltasSize();
-
959 size_t const oldSkipListsSize = getLedgerReplayer().skipListsSize();
-
960
-
961 getLedgerReplayer().sweep();
-
962
-
963 JLOG(m_journal.debug()) << "LedgerReplayer tasks sweep. Size before: " << oldTasksSize
-
964 << "; size after: " << getLedgerReplayer().tasksSize();
-
965
-
966 JLOG(m_journal.debug()) << "LedgerReplayer deltas sweep. Size before: " << oldDeltasSize
-
967 << "; size after: " << getLedgerReplayer().deltasSize();
-
968
-
969 JLOG(m_journal.debug()) << "LedgerReplayer skipLists sweep. Size before: " << oldSkipListsSize
-
970 << "; size after: " << getLedgerReplayer().skipListsSize();
-
971 }
-
972 {
-
973 std::size_t const oldAcceptedLedgerSize = m_acceptedLedgerCache.size();
-
974
-
975 m_acceptedLedgerCache.sweep();
-
976
-
977 JLOG(m_journal.debug()) << "AcceptedLedgerCache sweep. Size before: " << oldAcceptedLedgerSize
-
978 << "; size after: " << m_acceptedLedgerCache.size();
-
979 }
-
980 {
-
981 std::size_t const oldCachedSLEsSize = cachedSLEs_.size();
-
982
-
983 cachedSLEs_.sweep();
-
984
-
985 JLOG(m_journal.debug()) << "CachedSLEs sweep. Size before: " << oldCachedSLEsSize
-
986 << "; size after: " << cachedSLEs_.size();
-
987 }
-
988
-
989 // Set timer to do another sweep later.
-
990 setSweepTimer();
-
991 }
-
-
992
- -
- -
995 {
-
996 return maxDisallowedLedger_;
-
997 }
-
-
998
-
999 virtual std::optional<uint256> const&
-
-
1000 trapTxID() const override
-
1001 {
-
1002 return trapTxID_;
-
1003 }
-
-
1004
-
1005private:
-
1006 // For a newly-started validator, this is the greatest persisted ledger
-
1007 // and new validations must be greater than this.
-
1008 std::atomic<LedgerIndex> maxDisallowedLedger_{0};
-
1009
-
1010 void
-
1011 startGenesisLedger();
-
1012
- -
1014 getLastFullLedger();
-
1015
- -
1017 loadLedgerFromFile(std::string const& ledgerID);
-
1018
-
1019 bool
-
1020 loadOldLedger(std::string const& ledgerID, bool replay, bool isFilename, std::optional<uint256> trapTxID);
-
1021
-
1022 void
-
1023 setMaxDisallowedLedger();
-
1024};
-
-
1025
-
1026//------------------------------------------------------------------------------
-
1027
-
1028// TODO Break this up into smaller, more digestible initialization segments.
-
1029bool
-
-
1030ApplicationImp::setup(boost::program_options::variables_map const& cmdline)
-
1031{
-
1032 // We want to intercept CTRL-C and the standard termination signal SIGTERM
-
1033 // and terminate the process. This handler will NEVER be invoked twice.
-
1034 //
-
1035 // Note that async_wait is "one-shot": for each call, the handler will be
-
1036 // invoked exactly once, either when one of the registered signals in the
-
1037 // signal set occurs or the signal set is cancelled. Subsequent signals are
-
1038 // effectively ignored (technically, they are queued up, waiting for a call
-
1039 // to async_wait).
-
1040 m_signals.add(SIGINT);
-
1041 m_signals.add(SIGTERM);
-
1042 m_signals.async_wait([this](boost::system::error_code const& ec, int signum) {
-
1043 // Indicates the signal handler has been aborted; do nothing
-
1044 if (ec == boost::asio::error::operation_aborted)
-
1045 return;
-
1046
-
1047 JLOG(m_journal.info()) << "Received signal " << signum;
-
1048
-
1049 if (signum == SIGTERM || signum == SIGINT)
-
1050 signalStop("Signal: " + to_string(signum));
-
1051 });
-
1052
-
1053 auto debug_log = config_->getDebugLogFile();
-
1054
-
1055 if (!debug_log.empty())
-
1056 {
-
1057 // Let debug messages go to the file but only WARNING or higher to
-
1058 // regular output (unless verbose)
+
14#include <xrpld/app/main/GRPCServer.h>
+
15#include <xrpld/app/main/LoadManager.h>
+
16#include <xrpld/app/main/NodeIdentity.h>
+
17#include <xrpld/app/main/NodeStoreScheduler.h>
+
18#include <xrpld/app/misc/AmendmentTable.h>
+
19#include <xrpld/app/misc/HashRouter.h>
+
20#include <xrpld/app/misc/LoadFeeTrack.h>
+
21#include <xrpld/app/misc/NetworkOPs.h>
+
22#include <xrpld/app/misc/SHAMapStore.h>
+
23#include <xrpld/app/misc/TxQ.h>
+
24#include <xrpld/app/misc/ValidatorKeys.h>
+
25#include <xrpld/app/misc/ValidatorSite.h>
+
26#include <xrpld/app/paths/PathRequests.h>
+
27#include <xrpld/app/rdb/RelationalDatabase.h>
+
28#include <xrpld/app/tx/apply.h>
+
29#include <xrpld/overlay/Cluster.h>
+
30#include <xrpld/overlay/PeerSet.h>
+
31#include <xrpld/overlay/make_Overlay.h>
+
32#include <xrpld/shamap/NodeFamily.h>
+
33
+
34#include <xrpl/basics/ByteUtilities.h>
+
35#include <xrpl/basics/ResolverAsio.h>
+
36#include <xrpl/basics/random.h>
+
37#include <xrpl/beast/asio/io_latency_probe.h>
+
38#include <xrpl/beast/core/LexicalCast.h>
+
39#include <xrpl/core/PeerReservationTable.h>
+
40#include <xrpl/core/PerfLog.h>
+
41#include <xrpl/crypto/csprng.h>
+
42#include <xrpl/json/json_reader.h>
+
43#include <xrpl/nodestore/DummyScheduler.h>
+
44#include <xrpl/protocol/ApiVersion.h>
+
45#include <xrpl/protocol/BuildInfo.h>
+
46#include <xrpl/protocol/Feature.h>
+
47#include <xrpl/protocol/Protocol.h>
+
48#include <xrpl/protocol/STParsedJSON.h>
+
49#include <xrpl/rdb/DatabaseCon.h>
+
50#include <xrpl/resource/Fees.h>
+
51#include <xrpl/server/Wallet.h>
+
52
+
53#include <boost/algorithm/string/predicate.hpp>
+
54#include <boost/asio/steady_timer.hpp>
+
55#include <boost/system/error_code.hpp>
+
56
+
57#include <date/date.h>
+
58
+
59#include <chrono>
+
60#include <condition_variable>
+
61#include <cstring>
+
62#include <fstream>
+
63#include <limits>
+
64#include <mutex>
+
65#include <optional>
+
66#include <utility>
+
67
+
68namespace xrpl {
+
69
+
70static void
+
71fixConfigPorts(Config& config, Endpoints const& endpoints);
+
72
+
73// VFALCO TODO Move the function definitions into the class declaration
+
+
74class ApplicationImp : public Application, public BasicApp
+
75{
+
76private:
+
+ +
78 {
+
79 private:
+ + + + +
84
+
85 public:
+
+ + + + +
90 boost::asio::io_context& ios)
+
91 : m_event(ev), m_journal(journal), m_probe(interval, ios), lastSample_{}
+
92 {
+
93 }
+
+
94
+
95 void
+
+ +
97 {
+
98 m_probe.sample(std::ref(*this));
+
99 }
+
+
100
+
101 template <class Duration>
+
102 void
+
+
103 operator()(Duration const& elapsed)
+
104 {
+
105 using namespace std::chrono;
+
106 auto const lastSample = ceil<milliseconds>(elapsed);
+
107
+
108 lastSample_ = lastSample;
+
109
+
110 if (lastSample >= 10ms)
+
111 m_event.notify(lastSample);
+
112 if (lastSample >= 500ms)
+
113 {
+
114 JLOG(m_journal.warn()) << "io_context latency = " << lastSample.count();
+
115 }
+
116 }
+
+
117
+ +
+
119 get() const
+
120 {
+
121 return lastSample_.load();
+
122 }
+
+
123
+
124 void
+
+ +
126 {
+
127 m_probe.cancel();
+
128 }
+
+
129
+
130 void
+
+ +
132 {
+ +
134 }
+
+
135 };
+
+
136
+
137public:
+ + + +
141
+ +
143
+ + + +
147
+
148 // Required by the SHAMapStore
+ +
150
+ + + + + + +
157
+ + + + +
162
+ +
164
+ + +
167 // VFALCO TODO Make OrderBookDB abstract
+ + + + + + + + + + + + + + + + + + + + + + + +
191 boost::asio::steady_timer sweepTimer_;
+
192 boost::asio::steady_timer entropyTimer_;
+
193
+ + + + +
198
+
199 boost::asio::signal_set m_signals;
+
200
+ +
202
+ +
204
+ +
206
+ +
208
+ +
210
+
211 //--------------------------------------------------------------------------
+
212
+
213 static std::size_t
+
+ +
215 {
+
216#if XRPL_SINGLE_IO_SERVICE_THREAD
+
217 return 1;
+
218#else
+
219
+
220 if (config.IO_WORKERS > 0)
+
221 return config.IO_WORKERS;
+
222
+
223 auto const cores = std::thread::hardware_concurrency();
+
224
+
225 // Use a single thread when running on under-provisioned systems
+
226 // or if we are configured to use minimal resources.
+
227 if ((cores == 1) || ((config.NODE_SIZE == 0) && (cores == 2)))
+
228 return 1;
+
229
+
230 // Otherwise, prefer six threads.
+
231 return 6;
+
232#endif
+
233 }
+
+
234
+
235 //--------------------------------------------------------------------------
+
236
+
+ + +
239 , config_(std::move(config))
+
240 , logs_(std::move(logs))
+
241 , timeKeeper_(std::move(timeKeeper))
+ +
243 , m_journal(logs_->journal("Application"))
+
244
+
245 // PerfLog must be started before any other threads are launched.
+
246 , perfLog_(perf::make_PerfLog(
+
247 perf::setup_PerfLog(config_->section("perf"), config_->CONFIG_DIR),
+
248 *this,
+
249 logs_->journal("PerfLog"),
+
250 [this] { signalStop("PerfLog"); }))
+
251
+
252 , m_txMaster(*this)
+
253
+
254 , m_collectorManager(make_CollectorManager(config_->section(SECTION_INSIGHT), logs_->journal("Collector")))
+
255
+ + + +
259 return 1;
+
260
+
261 if (config->WORKERS)
+
262 return config->WORKERS;
+
263
+
264 auto count = static_cast<int>(std::thread::hardware_concurrency());
+
265
+
266 // Be more aggressive about the number of threads to use
+
267 // for the job queue if the server is configured as
+
268 // "large" or "huge" if there are enough cores.
+
269 if (config->NODE_SIZE >= 4 && count >= 16)
+
270 count = 6 + std::min(count, 8);
+
271 else if (config->NODE_SIZE >= 3 && count >= 8)
+
272 count = 4 + std::min(count, 6);
+
273 else
+
274 count = 2 + std::min(count, 4);
+
275
+
276 return count;
+
277 }(config_),
+
278 m_collectorManager->group("jobq"),
+
279 logs_->journal("JobQueue"),
+
280 *logs_,
+
281 *perfLog_))
+
282
+ +
284
+
285 , m_shaMapStore(make_SHAMapStore(*this, m_nodeStoreScheduler, logs_->journal("SHAMapStore")))
+
286
+
287 , m_tempNodeCache("NodeCache", 16384, std::chrono::seconds{90}, stopwatch(), logs_->journal("TaggedCache"))
+
288
+
289 , cachedSLEs_("Cached SLEs", 0, std::chrono::minutes(1), stopwatch(), logs_->journal("CachedSLEs"))
+
290
+ +
292
+
293 , m_resourceManager(Resource::make_Manager(m_collectorManager->collector(), logs_->journal("Resource")))
+
294
+
295 , m_nodeStore(m_shaMapStore->makeNodeStore(config_->PREFETCH_WORKERS > 0 ? config_->PREFETCH_WORKERS : 4))
+
296
+ +
298
+
299 , m_orderBookDB(*this)
+
300
+ +
302 std::make_unique<PathRequests>(*this, logs_->journal("PathRequest"), m_collectorManager->collector()))
+
303
+
304 , m_ledgerMaster(std::make_unique<LedgerMaster>(
+
305 *this,
+
306 stopwatch(),
+
307 m_collectorManager->collector(),
+
308 logs_->journal("LedgerMaster")))
+
309
+
310 , ledgerCleaner_(make_LedgerCleaner(*this, logs_->journal("LedgerCleaner")))
+
311
+
312 // VFALCO NOTE must come before NetworkOPs to prevent a crash due
+
313 // to dependencies in the destructor.
+
314 //
+ +
316
+ +
318 *this,
+
319 m_collectorManager->collector(),
+
320 [this](std::shared_ptr<SHAMap> const& set, bool fromAcquire) { gotTXSet(set, fromAcquire); }))
+
321
+ +
323
+ +
325 "AcceptedLedger",
+
326 4,
+ +
328 stopwatch(),
+
329 logs_->journal("TaggedCache"))
+
330
+ +
332 *this,
+
333 stopwatch(),
+
334 config_->standalone(),
+
335 config_->NETWORK_QUORUM,
+
336 config_->START_VALID,
+
337 *m_jobQueue,
+ + + +
341 logs_->journal("NetworkOPs"),
+
342 m_collectorManager->collector()))
+
343
+
344 , cluster_(std::make_unique<Cluster>(logs_->journal("Overlay")))
+
345
+
346 , peerReservations_(std::make_unique<PeerReservationTable>(logs_->journal("PeerReservationTable")))
+
347
+
348 , validatorManifests_(std::make_unique<ManifestCache>(logs_->journal("ManifestCache")))
+
349
+
350 , publisherManifests_(std::make_unique<ManifestCache>(logs_->journal("ManifestCache")))
+
351
+ + + + +
356 config_->legacy("database_path"),
+
357 logs_->journal("ValidatorList"),
+
358 config_->VALIDATION_QUORUM))
+
359
+ +
361
+ +
363 *this,
+ +
365 *m_jobQueue,
+ + + +
369
+
370 , mFeeTrack(std::make_unique<LoadFeeTrack>(logs_->journal("LoadManager")))
+
371
+ +
373
+
374 , mValidations(ValidationParms(), stopwatch(), *this, logs_->journal("Validations"))
+
375
+
376 , m_loadManager(make_LoadManager(*this, logs_->journal("LoadManager")))
+
377
+
378 , txQ_(std::make_unique<TxQ>(setup_TxQ(*config_), logs_->journal("TxQ")))
+
379
+ +
381
+ +
383
+ +
385
+
386 , checkSigs_(true)
+
387
+
388 , m_resolver(ResolverAsio::New(get_io_context(), logs_->journal("Resolver")))
+
389
+ +
391 m_collectorManager->collector()->make_event("ios_latency"),
+
392 logs_->journal("Application"),
+ + + +
396 {
+ +
398
+
399 add(m_resourceManager.get());
+
400
+
401 //
+
402 // VFALCO - READ THIS!
+
403 //
+
404 // Do not start threads, open sockets, or do any sort of "real work"
+
405 // inside the constructor. Put it in start instead. Or if you must,
+
406 // put it in setup (but everything in setup should be moved to start
+
407 // anyway.
+
408 //
+
409 // The reason is that the unit tests require an Application object to
+
410 // be created. But we don't actually start all the threads, sockets,
+
411 // and services when running the unit tests. Therefore anything which
+
412 // needs to be stopped will not get stopped correctly if it is
+
413 // started in this constructor.
+
414 //
+
415
+
416 add(ledgerCleaner_.get());
+
417 }
+
+
418
+
419 //--------------------------------------------------------------------------
+
420
+
421 bool
+
422 setup(boost::program_options::variables_map const& cmdline) override;
+
423 void
+
424 start(bool withTimers) override;
+
425 void
+
426 run() override;
+
427 void
+
428 signalStop(std::string msg) override;
+
429 bool
+
430 checkSigs() const override;
+
431 void
+
432 checkSigs(bool) override;
+
433 bool
+
434 isStopping() const override;
+
435 int
+
436 fdRequired() const override;
+
437
+
438 //--------------------------------------------------------------------------
+
439
+ +
+
441 instanceID() const override
+
442 {
+
443 return instanceCookie_;
+
444 }
+
+
445
+
446 Logs&
+
+
447 logs() override
+
448 {
+
449 return *logs_;
+
450 }
+
+
451
+
452 Config&
+
+
453 config() override
+
454 {
+
455 return *config_;
+
456 }
+
+
457
+ +
+ +
460 {
+
461 return *m_collectorManager;
+
462 }
+
+
463
+
464 Family&
+
+
465 getNodeFamily() override
+
466 {
+
467 return nodeFamily_;
+
468 }
+
+
469
+ +
+
471 timeKeeper() override
+
472 {
+
473 return *timeKeeper_;
+
474 }
+
+
475
+
476 JobQueue&
+
+
477 getJobQueue() override
+
478 {
+
479 return *m_jobQueue;
+
480 }
+
+
481
+ +
+
483 nodeIdentity() override
+
484 {
+
485 if (nodeIdentity_)
+
486 return *nodeIdentity_;
+
487
+
488 LogicError("Accessing Application::nodeIdentity() before it is initialized.");
+
489 }
+
+
490
+ +
+
492 getValidationPublicKey() const override
+
493 {
+
494 if (!validatorKeys_.keys)
+
495 return {};
+
496
+
497 return validatorKeys_.keys->publicKey;
+
498 }
+
+
499
+ +
+
501 getOPs() override
+
502 {
+
503 return *m_networkOPs;
+
504 }
+
+
505
+
506 virtual ServerHandler&
+
+ +
508 {
+
509 XRPL_ASSERT(
+ +
511 "xrpl::ApplicationImp::getServerHandler : non-null server "
+
512 "handle");
+
513 return *serverHandler_;
+
514 }
+
+
515
+
516 boost::asio::io_context&
+
+
517 getIOContext() override
+
518 {
+
519 return get_io_context();
+
520 }
+
+
521
+ +
+
523 getIOLatency() override
+
524 {
+
525 return m_io_latency_sampler.get();
+
526 }
+
+
527
+ +
+ +
530 {
+
531 return *m_ledgerMaster;
+
532 }
+
+
533
+ +
+ +
536 {
+
537 return *ledgerCleaner_;
+
538 }
+
+
539
+ +
+ +
542 {
+
543 return *m_ledgerReplayer;
+
544 }
+
+
545
+ +
+ +
548 {
+
549 return *m_inboundLedgers;
+
550 }
+
+
551
+ +
+ +
554 {
+
555 return *m_inboundTransactions;
+
556 }
+
+
557
+ +
+ +
560 {
+ +
562 }
+
+
563
+
564 void
+
+
565 gotTXSet(std::shared_ptr<SHAMap> const& set, bool fromAcquire)
+
566 {
+
567 if (set)
+
568 m_networkOPs->mapComplete(set, fromAcquire);
+
569 }
+
+
570
+ +
+ +
573 {
+
574 return m_txMaster;
+
575 }
+
+
576
+ +
+
578 getPerfLog() override
+
579 {
+
580 return *perfLog_;
+
581 }
+
+
582
+
583 NodeCache&
+
+ +
585 {
+
586 return m_tempNodeCache;
+
587 }
+
+
588
+ +
+
590 getNodeStore() override
+
591 {
+
592 return *m_nodeStore;
+
593 }
+
+
594
+ +
+
596 getMasterMutex() override
+
597 {
+
598 return m_masterMutex;
+
599 }
+
+
600
+ +
+
602 getLoadManager() override
+
603 {
+
604 return *m_loadManager;
+
605 }
+
+
606
+ +
+ +
609 {
+
610 return *m_resourceManager;
+
611 }
+
+
612
+ +
+
614 getOrderBookDB() override
+
615 {
+
616 return m_orderBookDB;
+
617 }
+
+
618
+ +
+ +
621 {
+
622 return *m_pathRequests;
+
623 }
+
+
624
+ +
+
626 cachedSLEs() override
+
627 {
+
628 return cachedSLEs_;
+
629 }
+
+
630
+ +
+ +
633 {
+
634 return *m_amendmentTable;
+
635 }
+
+
636
+ +
+
638 getFeeTrack() override
+
639 {
+
640 return *mFeeTrack;
+
641 }
+
+
642
+ +
+
644 getHashRouter() override
+
645 {
+
646 return *hashRouter_;
+
647 }
+
+
648
+ +
+
650 getValidations() override
+
651 {
+
652 return mValidations;
+
653 }
+
+
654
+ +
+
656 validators() override
+
657 {
+
658 return *validators_;
+
659 }
+
+
660
+ +
+
662 validatorSites() override
+
663 {
+
664 return *validatorSites_;
+
665 }
+
+
666
+ +
+ +
669 {
+
670 return *validatorManifests_;
+
671 }
+
+
672
+ +
+ +
675 {
+
676 return *publisherManifests_;
+
677 }
+
+
678
+
679 Cluster&
+
+
680 cluster() override
+
681 {
+
682 return *cluster_;
+
683 }
+
+
684
+ +
+ +
687 {
+
688 return *peerReservations_;
+
689 }
+
+
690
+ +
+
692 getSHAMapStore() override
+
693 {
+
694 return *m_shaMapStore;
+
695 }
+
+
696
+ +
+
698 pendingSaves() override
+
699 {
+
700 return pendingSaves_;
+
701 }
+
+
702
+ +
+
704 openLedger() override
+
705 {
+
706 return *openLedger_;
+
707 }
+
+
708
+
709 OpenLedger const&
+
+
710 openLedger() const override
+
711 {
+
712 return *openLedger_;
+
713 }
+
+
714
+
715 Overlay&
+
+
716 overlay() override
+
717 {
+
718 XRPL_ASSERT(overlay_, "xrpl::ApplicationImp::overlay : non-null overlay");
+
719 return *overlay_;
+
720 }
+
+
721
+
722 TxQ&
+
+
723 getTxQ() override
+
724 {
+
725 XRPL_ASSERT(txQ_, "xrpl::ApplicationImp::getTxQ : non-null transaction queue");
+
726 return *txQ_;
+
727 }
+
+
728
+ +
+ +
731 {
+
732 XRPL_ASSERT(
+ +
734 "xrpl::ApplicationImp::getRelationalDatabase : non-null "
+
735 "relational database");
+
736 return *mRelationalDatabase;
+
737 }
+
+
738
+ +
+
740 getWalletDB() override
+
741 {
+
742 XRPL_ASSERT(mWalletDB, "xrpl::ApplicationImp::getWalletDB : non-null wallet database");
+
743 return *mWalletDB;
+
744 }
+
+
745
+
746 bool
+
747 serverOkay(std::string& reason) override;
+
748
+ +
750 journal(std::string const& name) override;
+
751
+
752 //--------------------------------------------------------------------------
+
753
+
754 bool
+
+ +
756 {
+
757 XRPL_ASSERT(
+
758 mWalletDB.get() == nullptr,
+
759 "xrpl::ApplicationImp::initRelationalDatabase : null wallet "
+
760 "database");
+
761
+
762 try
+
763 {
+ +
765
+
766 // wallet database
+ +
768 setup.useGlobalPragma = false;
+
769
+ +
771 }
+
772 catch (std::exception const& e)
+
773 {
+
774 JLOG(m_journal.fatal()) << "Failed to initialize SQL databases: " << e.what();
+
775 return false;
+
776 }
+
777
+
778 return true;
+
779 }
+
+
780
+
781 bool
+
+ +
783 {
+
784 if (config_->doImport)
+
785 {
+
786 auto j = logs_->journal("NodeObject");
+
787 NodeStore::DummyScheduler dummyScheduler;
+ + +
790 dummyScheduler,
+
791 0,
+ +
793 j);
+
794
+
795 JLOG(j.warn()) << "Starting node import from '" << source->getName() << "' to '" << m_nodeStore->getName()
+
796 << "'.";
+
797
+
798 using namespace std::chrono;
+
799 auto const start = steady_clock::now();
+
800
+
801 m_nodeStore->importDatabase(*source);
+
802
+
803 auto const elapsed = duration_cast<seconds>(steady_clock::now() - start);
+
804 JLOG(j.warn()) << "Node import from '" << source->getName() << "' took " << elapsed.count() << " seconds.";
+
805 }
+
806
+
807 return true;
+
808 }
+
+
809
+
810 //--------------------------------------------------------------------------
+
811 //
+
812 // PropertyStream
+
813 //
+
814
+
815 void
+
+ +
817 {
+
818 }
+
+
819
+
820 //--------------------------------------------------------------------------
+
821
+
822 void
+
+ +
824 {
+
825 // Only start the timer if waitHandlerCounter_ is not yet joined.
+
826 if (auto optionalCountedHandler = waitHandlerCounter_.wrap([this](boost::system::error_code const& e) {
+
827 if (e.value() == boost::system::errc::success)
+
828 {
+
829 m_jobQueue->addJob(jtSWEEP, "sweep", [this]() { doSweep(); });
+
830 }
+
831 // Recover as best we can if an unexpected error occurs.
+
832 if (e.value() != boost::system::errc::success && e.value() != boost::asio::error::operation_aborted)
+
833 {
+
834 // Try again later and hope for the best.
+
835 JLOG(m_journal.error()) << "Sweep timer got error '" << e.message() << "'. Restarting timer.";
+
836 setSweepTimer();
+
837 }
+
838 }))
+
839 {
+
840 using namespace std::chrono;
+
841 sweepTimer_.expires_after(
+
842 seconds{config_->SWEEP_INTERVAL.value_or(config_->getValueFor(SizedItem::sweepInterval))});
+
843 sweepTimer_.async_wait(std::move(*optionalCountedHandler));
+
844 }
+
845 }
+
+
846
+
847 void
+
+ +
849 {
+
850 // Only start the timer if waitHandlerCounter_ is not yet joined.
+
851 if (auto optionalCountedHandler = waitHandlerCounter_.wrap([this](boost::system::error_code const& e) {
+
852 if (e.value() == boost::system::errc::success)
+
853 {
+
854 crypto_prng().mix_entropy();
+
855 setEntropyTimer();
+
856 }
+
857 // Recover as best we can if an unexpected error occurs.
+
858 if (e.value() != boost::system::errc::success && e.value() != boost::asio::error::operation_aborted)
+
859 {
+
860 // Try again later and hope for the best.
+
861 JLOG(m_journal.error()) << "Entropy timer got error '" << e.message() << "'. Restarting timer.";
+
862 setEntropyTimer();
+
863 }
+
864 }))
+
865 {
+
866 using namespace std::chrono_literals;
+
867 entropyTimer_.expires_after(5min);
+
868 entropyTimer_.async_wait(std::move(*optionalCountedHandler));
+
869 }
+
870 }
+
+
871
+
872 void
+
+ +
874 {
+
875 if (!config_->standalone() && !getRelationalDatabase().transactionDbHasSpace(*config_))
+
876 {
+
877 signalStop("Out of transaction DB space");
+
878 }
+
879
+
880 // VFALCO NOTE Does the order of calls matter?
+
881 // VFALCO TODO fix the dependency inversion using an observer,
+
882 // have listeners register for "onSweep ()" notification.
+
883
+
884 {
+
885 std::shared_ptr<FullBelowCache const> const fullBelowCache = nodeFamily_.getFullBelowCache();
+
886
+
887 std::shared_ptr<TreeNodeCache const> const treeNodeCache = nodeFamily_.getTreeNodeCache();
+
888
+
889 std::size_t const oldFullBelowSize = fullBelowCache->size();
+
890 std::size_t const oldTreeNodeSize = treeNodeCache->size();
+
891
+
892 nodeFamily_.sweep();
+
893
+
894 JLOG(m_journal.debug()) << "NodeFamily::FullBelowCache sweep. Size before: " << oldFullBelowSize
+
895 << "; size after: " << fullBelowCache->size();
+
896
+
897 JLOG(m_journal.debug()) << "NodeFamily::TreeNodeCache sweep. Size before: " << oldTreeNodeSize
+
898 << "; size after: " << treeNodeCache->size();
+
899 }
+
900 {
+
901 TaggedCache<uint256, Transaction> const& masterTxCache = getMasterTransaction().getCache();
+
902
+
903 std::size_t const oldMasterTxSize = masterTxCache.size();
+
904
+
905 getMasterTransaction().sweep();
+
906
+
907 JLOG(m_journal.debug()) << "MasterTransaction sweep. Size before: " << oldMasterTxSize
+
908 << "; size after: " << masterTxCache.size();
+
909 }
+
910 {
+
911 std::size_t const oldLedgerMasterCacheSize = getLedgerMaster().getFetchPackCacheSize();
+
912
+
913 getLedgerMaster().sweep();
+
914
+
915 JLOG(m_journal.debug()) << "LedgerMaster sweep. Size before: " << oldLedgerMasterCacheSize
+
916 << "; size after: " << getLedgerMaster().getFetchPackCacheSize();
+
917 }
+
918 {
+
919 // NodeCache == TaggedCache<SHAMapHash, Blob>
+
920 std::size_t const oldTempNodeCacheSize = getTempNodeCache().size();
+
921
+
922 getTempNodeCache().sweep();
+
923
+
924 JLOG(m_journal.debug()) << "TempNodeCache sweep. Size before: " << oldTempNodeCacheSize
+
925 << "; size after: " << getTempNodeCache().size();
+
926 }
+
927 {
+
928 std::size_t const oldCurrentCacheSize = getValidations().sizeOfCurrentCache();
+
929 std::size_t const oldSizeSeqEnforcesSize = getValidations().sizeOfSeqEnforcersCache();
+
930 std::size_t const oldByLedgerSize = getValidations().sizeOfByLedgerCache();
+
931 std::size_t const oldBySequenceSize = getValidations().sizeOfBySequenceCache();
+
932
+
933 getValidations().expire(m_journal);
+
934
+
935 JLOG(m_journal.debug()) << "Validations Current expire. Size before: " << oldCurrentCacheSize
+
936 << "; size after: " << getValidations().sizeOfCurrentCache();
+
937
+
938 JLOG(m_journal.debug()) << "Validations SeqEnforcer expire. Size before: " << oldSizeSeqEnforcesSize
+
939 << "; size after: " << getValidations().sizeOfSeqEnforcersCache();
+
940
+
941 JLOG(m_journal.debug()) << "Validations ByLedger expire. Size before: " << oldByLedgerSize
+
942 << "; size after: " << getValidations().sizeOfByLedgerCache();
+
943
+
944 JLOG(m_journal.debug()) << "Validations BySequence expire. Size before: " << oldBySequenceSize
+
945 << "; size after: " << getValidations().sizeOfBySequenceCache();
+
946 }
+
947 {
+
948 std::size_t const oldInboundLedgersSize = getInboundLedgers().cacheSize();
+
949
+
950 getInboundLedgers().sweep();
+
951
+
952 JLOG(m_journal.debug()) << "InboundLedgers sweep. Size before: " << oldInboundLedgersSize
+
953 << "; size after: " << getInboundLedgers().cacheSize();
+
954 }
+
955 {
+
956 size_t const oldTasksSize = getLedgerReplayer().tasksSize();
+
957 size_t const oldDeltasSize = getLedgerReplayer().deltasSize();
+
958 size_t const oldSkipListsSize = getLedgerReplayer().skipListsSize();
+
959
+
960 getLedgerReplayer().sweep();
+
961
+
962 JLOG(m_journal.debug()) << "LedgerReplayer tasks sweep. Size before: " << oldTasksSize
+
963 << "; size after: " << getLedgerReplayer().tasksSize();
+
964
+
965 JLOG(m_journal.debug()) << "LedgerReplayer deltas sweep. Size before: " << oldDeltasSize
+
966 << "; size after: " << getLedgerReplayer().deltasSize();
+
967
+
968 JLOG(m_journal.debug()) << "LedgerReplayer skipLists sweep. Size before: " << oldSkipListsSize
+
969 << "; size after: " << getLedgerReplayer().skipListsSize();
+
970 }
+
971 {
+
972 std::size_t const oldAcceptedLedgerSize = m_acceptedLedgerCache.size();
+
973
+
974 m_acceptedLedgerCache.sweep();
+
975
+
976 JLOG(m_journal.debug()) << "AcceptedLedgerCache sweep. Size before: " << oldAcceptedLedgerSize
+
977 << "; size after: " << m_acceptedLedgerCache.size();
+
978 }
+
979 {
+
980 std::size_t const oldCachedSLEsSize = cachedSLEs_.size();
+
981
+
982 cachedSLEs_.sweep();
+
983
+
984 JLOG(m_journal.debug()) << "CachedSLEs sweep. Size before: " << oldCachedSLEsSize
+
985 << "; size after: " << cachedSLEs_.size();
+
986 }
+
987
+
988 // Set timer to do another sweep later.
+
989 setSweepTimer();
+
990 }
+
+
991
+ +
+ +
994 {
+
995 return maxDisallowedLedger_;
+
996 }
+
+
997
+
998 virtual std::optional<uint256> const&
+
+
999 trapTxID() const override
+
1000 {
+
1001 return trapTxID_;
+
1002 }
+
+
1003
+
1004private:
+
1005 // For a newly-started validator, this is the greatest persisted ledger
+
1006 // and new validations must be greater than this.
+
1007 std::atomic<LedgerIndex> maxDisallowedLedger_{0};
+
1008
+
1009 void
+
1010 startGenesisLedger();
+
1011
+ +
1013 getLastFullLedger();
+
1014
+ +
1016 loadLedgerFromFile(std::string const& ledgerID);
+
1017
+
1018 bool
+
1019 loadOldLedger(std::string const& ledgerID, bool replay, bool isFilename, std::optional<uint256> trapTxID);
+
1020
+
1021 void
+
1022 setMaxDisallowedLedger();
+
1023
+ +
+
1025 app() override
+
1026 {
+
1027 return *this;
+
1028 }
+
+
1029};
+
+
1030
+
1031//------------------------------------------------------------------------------
+
1032
+
1033// TODO Break this up into smaller, more digestible initialization segments.
+
1034bool
+
+
1035ApplicationImp::setup(boost::program_options::variables_map const& cmdline)
+
1036{
+
1037 // We want to intercept CTRL-C and the standard termination signal SIGTERM
+
1038 // and terminate the process. This handler will NEVER be invoked twice.
+
1039 //
+
1040 // Note that async_wait is "one-shot": for each call, the handler will be
+
1041 // invoked exactly once, either when one of the registered signals in the
+
1042 // signal set occurs or the signal set is cancelled. Subsequent signals are
+
1043 // effectively ignored (technically, they are queued up, waiting for a call
+
1044 // to async_wait).
+
1045 m_signals.add(SIGINT);
+
1046 m_signals.add(SIGTERM);
+
1047 m_signals.async_wait([this](boost::system::error_code const& ec, int signum) {
+
1048 // Indicates the signal handler has been aborted; do nothing
+
1049 if (ec == boost::asio::error::operation_aborted)
+
1050 return;
+
1051
+
1052 JLOG(m_journal.info()) << "Received signal " << signum;
+
1053
+
1054 if (signum == SIGTERM || signum == SIGINT)
+
1055 signalStop("Signal: " + to_string(signum));
+
1056 });
+
1057
+
1058 auto debug_log = config_->getDebugLogFile();
1059
-
1060 if (!logs_->open(debug_log))
-
1061 std::cerr << "Can't open log file " << debug_log << '\n';
-
1062
-
1063 using namespace beast::severities;
-
1064 if (logs_->threshold() > kDebug)
-
1065 logs_->threshold(kDebug);
-
1066 }
+
1060 if (!debug_log.empty())
+
1061 {
+
1062 // Let debug messages go to the file but only WARNING or higher to
+
1063 // regular output (unless verbose)
+
1064
+
1065 if (!logs_->open(debug_log))
+
1066 std::cerr << "Can't open log file " << debug_log << '\n';
1067
-
1068 JLOG(m_journal.info()) << "Process starting: " << BuildInfo::getFullVersionString()
-
1069 << ", Instance Cookie: " << instanceCookie_;
-
1070
-
1071 if (numberOfThreads(*config_) < 2)
-
1072 {
-
1073 JLOG(m_journal.warn()) << "Limited to a single I/O service thread by "
-
1074 "system configuration.";
-
1075 }
-
1076
-
1077 // Optionally turn off logging to console.
-
1078 logs_->silent(config_->silent());
-
1079
-
1080 if (!initRelationalDatabase() || !initNodeStore())
-
1081 return false;
-
1082
-
1083 if (!peerReservations_->load(getWalletDB()))
-
1084 {
-
1085 JLOG(m_journal.fatal()) << "Cannot find peer reservations!";
+
1068 using namespace beast::severities;
+
1069 if (logs_->threshold() > kDebug)
+
1070 logs_->threshold(kDebug);
+
1071 }
+
1072
+
1073 JLOG(m_journal.info()) << "Process starting: " << BuildInfo::getFullVersionString()
+
1074 << ", Instance Cookie: " << instanceCookie_;
+
1075
+
1076 if (numberOfThreads(*config_) < 2)
+
1077 {
+
1078 JLOG(m_journal.warn()) << "Limited to a single I/O service thread by "
+
1079 "system configuration.";
+
1080 }
+
1081
+
1082 // Optionally turn off logging to console.
+
1083 logs_->silent(config_->silent());
+
1084
+
1085 if (!initRelationalDatabase() || !initNodeStore())
1086 return false;
-
1087 }
-
1088
-
1089 if (validatorKeys_.keys)
-
1090 setMaxDisallowedLedger();
-
1091
-
1092 // Configure the amendments the server supports
-
1093 {
-
1094 auto const supported = []() {
-
1095 auto const& amendments = detail::supportedAmendments();
- -
1097 supported.reserve(amendments.size());
-
1098 for (auto const& [a, vote] : amendments)
-
1099 {
-
1100 auto const f = xrpl::getRegisteredFeature(a);
-
1101 XRPL_ASSERT(f, "xrpl::ApplicationImp::setup : registered feature");
-
1102 if (f)
-
1103 supported.emplace_back(a, *f, vote);
-
1104 }
-
1105 return supported;
-
1106 }();
-
1107 Section const& downVoted = config_->section(SECTION_VETO_AMENDMENTS);
-
1108
-
1109 Section const& upVoted = config_->section(SECTION_AMENDMENTS);
-
1110
-
1111 m_amendmentTable = make_AmendmentTable(
-
1112 *this, config().AMENDMENT_MAJORITY_TIME, supported, upVoted, downVoted, logs_->journal("Amendments"));
-
1113 }
-
1114
-
1115 Pathfinder::initPathTable();
-
1116
-
1117 auto const startUp = config_->START_UP;
-
1118 JLOG(m_journal.debug()) << "startUp: " << startUp;
-
1119 if (startUp == Config::FRESH)
-
1120 {
-
1121 JLOG(m_journal.info()) << "Starting new Ledger";
-
1122
-
1123 startGenesisLedger();
-
1124 }
-
1125 else if (startUp == Config::LOAD || startUp == Config::LOAD_FILE || startUp == Config::REPLAY)
-
1126 {
-
1127 JLOG(m_journal.info()) << "Loading specified Ledger";
-
1128
-
1129 if (!loadOldLedger(
-
1130 config_->START_LEDGER, startUp == Config::REPLAY, startUp == Config::LOAD_FILE, config_->TRAP_TX_HASH))
-
1131 {
-
1132 JLOG(m_journal.error()) << "The specified ledger could not be loaded.";
-
1133 if (config_->FAST_LOAD)
-
1134 {
-
1135 // Fall back to syncing from the network, such as
-
1136 // when there's no existing data.
-
1137 startGenesisLedger();
-
1138 }
-
1139 else
-
1140 {
-
1141 return false;
-
1142 }
-
1143 }
-
1144 }
-
1145 else if (startUp == Config::NETWORK)
-
1146 {
-
1147 // This should probably become the default once we have a stable
-
1148 // network.
-
1149 if (!config_->standalone())
-
1150 m_networkOPs->setNeedNetworkLedger();
-
1151
-
1152 startGenesisLedger();
-
1153 }
-
1154 else
-
1155 {
-
1156 startGenesisLedger();
-
1157 }
-
1158
-
1159 if (auto const& forcedRange = config().FORCED_LEDGER_RANGE_PRESENT)
-
1160 {
-
1161 m_ledgerMaster->setLedgerRangePresent(forcedRange->first, forcedRange->second);
-
1162 }
-
1163
-
1164 m_orderBookDB.setup(getLedgerMaster().getCurrentLedger());
-
1165
-
1166 nodeIdentity_ = getNodeIdentity(*this, cmdline);
-
1167
-
1168 if (!cluster_->load(config().section(SECTION_CLUSTER_NODES)))
-
1169 {
-
1170 JLOG(m_journal.fatal()) << "Invalid entry in cluster configuration.";
-
1171 return false;
-
1172 }
+
1087
+
1088 if (!peerReservations_->load(getWalletDB()))
+
1089 {
+
1090 JLOG(m_journal.fatal()) << "Cannot find peer reservations!";
+
1091 return false;
+
1092 }
+
1093
+
1094 if (validatorKeys_.keys)
+
1095 setMaxDisallowedLedger();
+
1096
+
1097 // Configure the amendments the server supports
+
1098 {
+
1099 auto const supported = []() {
+
1100 auto const& amendments = detail::supportedAmendments();
+ +
1102 supported.reserve(amendments.size());
+
1103 for (auto const& [a, vote] : amendments)
+
1104 {
+
1105 auto const f = xrpl::getRegisteredFeature(a);
+
1106 XRPL_ASSERT(f, "xrpl::ApplicationImp::setup : registered feature");
+
1107 if (f)
+
1108 supported.emplace_back(a, *f, vote);
+
1109 }
+
1110 return supported;
+
1111 }();
+
1112 Section const& downVoted = config_->section(SECTION_VETO_AMENDMENTS);
+
1113
+
1114 Section const& upVoted = config_->section(SECTION_AMENDMENTS);
+
1115
+
1116 m_amendmentTable = make_AmendmentTable(
+
1117 *this, config().AMENDMENT_MAJORITY_TIME, supported, upVoted, downVoted, logs_->journal("Amendments"));
+
1118 }
+
1119
+
1120 Pathfinder::initPathTable();
+
1121
+
1122 auto const startUp = config_->START_UP;
+
1123 JLOG(m_journal.debug()) << "startUp: " << startUp;
+
1124 if (startUp == StartUpType::FRESH)
+
1125 {
+
1126 JLOG(m_journal.info()) << "Starting new Ledger";
+
1127
+
1128 startGenesisLedger();
+
1129 }
+
1130 else if (startUp == StartUpType::LOAD || startUp == StartUpType::LOAD_FILE || startUp == StartUpType::REPLAY)
+
1131 {
+
1132 JLOG(m_journal.info()) << "Loading specified Ledger";
+
1133
+
1134 if (!loadOldLedger(
+
1135 config_->START_LEDGER,
+
1136 startUp == StartUpType::REPLAY,
+
1137 startUp == StartUpType::LOAD_FILE,
+
1138 config_->TRAP_TX_HASH))
+
1139 {
+
1140 JLOG(m_journal.error()) << "The specified ledger could not be loaded.";
+
1141 if (config_->FAST_LOAD)
+
1142 {
+
1143 // Fall back to syncing from the network, such as
+
1144 // when there's no existing data.
+
1145 startGenesisLedger();
+
1146 }
+
1147 else
+
1148 {
+
1149 return false;
+
1150 }
+
1151 }
+
1152 }
+
1153 else if (startUp == StartUpType::NETWORK)
+
1154 {
+
1155 // This should probably become the default once we have a stable
+
1156 // network.
+
1157 if (!config_->standalone())
+
1158 m_networkOPs->setNeedNetworkLedger();
+
1159
+
1160 startGenesisLedger();
+
1161 }
+
1162 else
+
1163 {
+
1164 startGenesisLedger();
+
1165 }
+
1166
+
1167 if (auto const& forcedRange = config().FORCED_LEDGER_RANGE_PRESENT)
+
1168 {
+
1169 m_ledgerMaster->setLedgerRangePresent(forcedRange->first, forcedRange->second);
+
1170 }
+
1171
+
1172 m_orderBookDB.setup(getLedgerMaster().getCurrentLedger());
1173
-
1174 {
-
1175 if (validatorKeys_.configInvalid())
-
1176 return false;
-
1177
-
1178 if (!validatorManifests_->load(
-
1179 getWalletDB(),
-
1180 "ValidatorManifests",
-
1181 validatorKeys_.manifest,
-
1182 config().section(SECTION_VALIDATOR_KEY_REVOCATION).values()))
-
1183 {
-
1184 JLOG(m_journal.fatal()) << "Invalid configured validator manifest.";
-
1185 return false;
-
1186 }
-
1187
-
1188 publisherManifests_->load(getWalletDB(), "PublisherManifests");
-
1189
-
1190 // It is possible to have a valid ValidatorKeys object without
-
1191 // setting the signingKey or masterKey. This occurs if the
-
1192 // configuration file does not have either
-
1193 // SECTION_VALIDATOR_TOKEN or SECTION_VALIDATION_SEED section.
-
1194
-
1195 // masterKey for the configuration-file specified validator keys
-
1196 std::optional<PublicKey> localSigningKey;
-
1197 if (validatorKeys_.keys)
-
1198 localSigningKey = validatorKeys_.keys->publicKey;
-
1199
-
1200 // Setup trusted validators
-
1201 if (!validators_->load(
-
1202 localSigningKey,
-
1203 config().section(SECTION_VALIDATORS).values(),
-
1204 config().section(SECTION_VALIDATOR_LIST_KEYS).values(),
-
1205 config().VALIDATOR_LIST_THRESHOLD))
-
1206 {
-
1207 JLOG(m_journal.fatal()) << "Invalid entry in validator configuration.";
-
1208 return false;
-
1209 }
-
1210 }
-
1211
-
1212 if (!validatorSites_->load(config().section(SECTION_VALIDATOR_LIST_SITES).values()))
-
1213 {
-
1214 JLOG(m_journal.fatal()) << "Invalid entry in [" << SECTION_VALIDATOR_LIST_SITES << "]";
-
1215 return false;
-
1216 }
-
1217
-
1218 // Tell the AmendmentTable who the trusted validators are.
-
1219 m_amendmentTable->trustChanged(validators_->getQuorumKeys().second);
-
1220
-
1221 //----------------------------------------------------------------------
-
1222 //
-
1223 // Server
-
1224 //
-
1225 //----------------------------------------------------------------------
-
1226
-
1227 // VFALCO NOTE Unfortunately, in stand-alone mode some code still
-
1228 // foolishly calls overlay(). When this is fixed we can
-
1229 // move the instantiation inside a conditional:
+
1174 nodeIdentity_ = getNodeIdentity(*this, cmdline);
+
1175
+
1176 if (!cluster_->load(config().section(SECTION_CLUSTER_NODES)))
+
1177 {
+
1178 JLOG(m_journal.fatal()) << "Invalid entry in cluster configuration.";
+
1179 return false;
+
1180 }
+
1181
+
1182 {
+
1183 if (validatorKeys_.configInvalid())
+
1184 return false;
+
1185
+
1186 if (!validatorManifests_->load(
+
1187 getWalletDB(),
+
1188 "ValidatorManifests",
+
1189 validatorKeys_.manifest,
+
1190 config().section(SECTION_VALIDATOR_KEY_REVOCATION).values()))
+
1191 {
+
1192 JLOG(m_journal.fatal()) << "Invalid configured validator manifest.";
+
1193 return false;
+
1194 }
+
1195
+
1196 publisherManifests_->load(getWalletDB(), "PublisherManifests");
+
1197
+
1198 // It is possible to have a valid ValidatorKeys object without
+
1199 // setting the signingKey or masterKey. This occurs if the
+
1200 // configuration file does not have either
+
1201 // SECTION_VALIDATOR_TOKEN or SECTION_VALIDATION_SEED section.
+
1202
+
1203 // masterKey for the configuration-file specified validator keys
+
1204 std::optional<PublicKey> localSigningKey;
+
1205 if (validatorKeys_.keys)
+
1206 localSigningKey = validatorKeys_.keys->publicKey;
+
1207
+
1208 // Setup trusted validators
+
1209 if (!validators_->load(
+
1210 localSigningKey,
+
1211 config().section(SECTION_VALIDATORS).values(),
+
1212 config().section(SECTION_VALIDATOR_LIST_KEYS).values(),
+
1213 config().VALIDATOR_LIST_THRESHOLD))
+
1214 {
+
1215 JLOG(m_journal.fatal()) << "Invalid entry in validator configuration.";
+
1216 return false;
+
1217 }
+
1218 }
+
1219
+
1220 if (!validatorSites_->load(config().section(SECTION_VALIDATOR_LIST_SITES).values()))
+
1221 {
+
1222 JLOG(m_journal.fatal()) << "Invalid entry in [" << SECTION_VALIDATOR_LIST_SITES << "]";
+
1223 return false;
+
1224 }
+
1225
+
1226 // Tell the AmendmentTable who the trusted validators are.
+
1227 m_amendmentTable->trustChanged(validators_->getQuorumKeys().second);
+
1228
+
1229 //----------------------------------------------------------------------
1230 //
-
1231 // if (!config_.standalone())
-
1232 overlay_ = make_Overlay(
-
1233 *this,
-
1234 setup_Overlay(*config_),
-
1235 *serverHandler_,
-
1236 *m_resourceManager,
-
1237 *m_resolver,
-
1238 get_io_context(),
-
1239 *config_,
-
1240 m_collectorManager->collector());
-
1241 add(*overlay_); // add to PropertyStream
-
1242
-
1243 // start first consensus round
-
1244 if (!m_networkOPs->beginConsensus(m_ledgerMaster->getClosedLedger()->header().hash, {}))
-
1245 {
-
1246 JLOG(m_journal.fatal()) << "Unable to start consensus";
-
1247 return false;
-
1248 }
-
1249
-
1250 {
-
1251 try
-
1252 {
-
1253 auto setup = setup_ServerHandler(*config_, beast::logstream{m_journal.error()});
-
1254 setup.makeContexts();
-
1255 serverHandler_->setup(setup, m_journal);
-
1256 fixConfigPorts(*config_, serverHandler_->endpoints());
-
1257 }
-
1258 catch (std::exception const& e)
-
1259 {
-
1260 if (auto stream = m_journal.fatal())
-
1261 {
-
1262 stream << "Unable to setup server handler";
-
1263 if (std::strlen(e.what()) > 0)
-
1264 stream << ": " << e.what();
-
1265 }
-
1266 return false;
-
1267 }
-
1268 }
-
1269
-
1270 // Begin connecting to network.
-
1271 if (!config_->standalone())
-
1272 {
-
1273 // Should this message be here, conceptually? In theory this sort
-
1274 // of message, if displayed, should be displayed from PeerFinder.
-
1275 if (config_->PEER_PRIVATE && config_->IPS_FIXED.empty())
-
1276 {
-
1277 JLOG(m_journal.warn()) << "No outbound peer connections will be made";
-
1278 }
-
1279
-
1280 // VFALCO NOTE the state timer resets the deadlock detector.
-
1281 //
-
1282 m_networkOPs->setStateTimer();
-
1283 }
-
1284 else
-
1285 {
-
1286 JLOG(m_journal.warn()) << "Running in standalone mode";
+
1231 // Server
+
1232 //
+
1233 //----------------------------------------------------------------------
+
1234
+
1235 // VFALCO NOTE Unfortunately, in stand-alone mode some code still
+
1236 // foolishly calls overlay(). When this is fixed we can
+
1237 // move the instantiation inside a conditional:
+
1238 //
+
1239 // if (!config_.standalone())
+
1240 overlay_ = make_Overlay(
+
1241 *this,
+
1242 setup_Overlay(*config_),
+
1243 *serverHandler_,
+
1244 *m_resourceManager,
+
1245 *m_resolver,
+
1246 get_io_context(),
+
1247 *config_,
+
1248 m_collectorManager->collector());
+
1249 add(*overlay_); // add to PropertyStream
+
1250
+
1251 // start first consensus round
+
1252 if (!m_networkOPs->beginConsensus(m_ledgerMaster->getClosedLedger()->header().hash, {}))
+
1253 {
+
1254 JLOG(m_journal.fatal()) << "Unable to start consensus";
+
1255 return false;
+
1256 }
+
1257
+
1258 {
+
1259 try
+
1260 {
+
1261 auto setup = setup_ServerHandler(*config_, beast::logstream{m_journal.error()});
+
1262 setup.makeContexts();
+
1263 serverHandler_->setup(setup, m_journal);
+
1264 fixConfigPorts(*config_, serverHandler_->endpoints());
+
1265 }
+
1266 catch (std::exception const& e)
+
1267 {
+
1268 if (auto stream = m_journal.fatal())
+
1269 {
+
1270 stream << "Unable to setup server handler";
+
1271 if (std::strlen(e.what()) > 0)
+
1272 stream << ": " << e.what();
+
1273 }
+
1274 return false;
+
1275 }
+
1276 }
+
1277
+
1278 // Begin connecting to network.
+
1279 if (!config_->standalone())
+
1280 {
+
1281 // Should this message be here, conceptually? In theory this sort
+
1282 // of message, if displayed, should be displayed from PeerFinder.
+
1283 if (config_->PEER_PRIVATE && config_->IPS_FIXED.empty())
+
1284 {
+
1285 JLOG(m_journal.warn()) << "No outbound peer connections will be made";
+
1286 }
1287
-
1288 m_networkOPs->setStandAlone();
-
1289 }
-
1290
-
1291 if (config_->canSign())
-
1292 {
-
1293 JLOG(m_journal.warn()) << "*** The server is configured to allow the "
-
1294 "'sign' and 'sign_for'";
-
1295 JLOG(m_journal.warn()) << "*** commands. These commands have security "
-
1296 "implications and have";
-
1297 JLOG(m_journal.warn()) << "*** been deprecated. They will be removed "
-
1298 "in a future release of";
-
1299 JLOG(m_journal.warn()) << "*** rippled.";
-
1300 JLOG(m_journal.warn()) << "*** If you do not use them to sign "
-
1301 "transactions please edit your";
-
1302 JLOG(m_journal.warn()) << "*** configuration file and remove the [enable_signing] stanza.";
-
1303 JLOG(m_journal.warn()) << "*** If you do use them to sign transactions "
-
1304 "please migrate to a";
-
1305 JLOG(m_journal.warn()) << "*** standalone signing solution as soon as possible.";
-
1306 }
-
1307
-
1308 //
-
1309 // Execute start up rpc commands.
-
1310 //
-
1311 for (auto cmd : config_->section(SECTION_RPC_STARTUP).lines())
-
1312 {
-
1313 Json::Reader jrReader;
-
1314 Json::Value jvCommand;
+
1288 // VFALCO NOTE the state timer resets the deadlock detector.
+
1289 //
+
1290 m_networkOPs->setStateTimer();
+
1291 }
+
1292 else
+
1293 {
+
1294 JLOG(m_journal.warn()) << "Running in standalone mode";
+
1295
+
1296 m_networkOPs->setStandAlone();
+
1297 }
+
1298
+
1299 if (config_->canSign())
+
1300 {
+
1301 JLOG(m_journal.warn()) << "*** The server is configured to allow the "
+
1302 "'sign' and 'sign_for'";
+
1303 JLOG(m_journal.warn()) << "*** commands. These commands have security "
+
1304 "implications and have";
+
1305 JLOG(m_journal.warn()) << "*** been deprecated. They will be removed "
+
1306 "in a future release of";
+
1307 JLOG(m_journal.warn()) << "*** rippled.";
+
1308 JLOG(m_journal.warn()) << "*** If you do not use them to sign "
+
1309 "transactions please edit your";
+
1310 JLOG(m_journal.warn()) << "*** configuration file and remove the [enable_signing] stanza.";
+
1311 JLOG(m_journal.warn()) << "*** If you do use them to sign transactions "
+
1312 "please migrate to a";
+
1313 JLOG(m_journal.warn()) << "*** standalone signing solution as soon as possible.";
+
1314 }
1315
-
1316 if (!jrReader.parse(cmd, jvCommand))
-
1317 {
-
1318 JLOG(m_journal.fatal()) << "Couldn't parse entry in [" << SECTION_RPC_STARTUP << "]: '" << cmd;
-
1319 }
-
1320
-
1321 if (!config_->quiet())
-
1322 {
-
1323 JLOG(m_journal.fatal()) << "Startup RPC: " << jvCommand << std::endl;
-
1324 }
-
1325
-
1326 Resource::Charge loadType = Resource::feeReferenceRPC;
- -
1328 RPC::JsonContext context{
-
1329 {journal("RPCHandler"),
-
1330 *this,
-
1331 loadType,
-
1332 getOPs(),
-
1333 getLedgerMaster(),
-
1334 c,
-
1335 Role::ADMIN,
-
1336 {},
-
1337 {},
-
1338 RPC::apiMaximumSupportedVersion},
-
1339 jvCommand};
-
1340
-
1341 Json::Value jvResult;
-
1342 RPC::doCommand(context, jvResult);
-
1343
-
1344 if (!config_->quiet())
-
1345 {
-
1346 JLOG(m_journal.fatal()) << "Result: " << jvResult << std::endl;
-
1347 }
-
1348 }
-
1349
-
1350 validatorSites_->start();
+
1316 //
+
1317 // Execute start up rpc commands.
+
1318 //
+
1319 for (auto cmd : config_->section(SECTION_RPC_STARTUP).lines())
+
1320 {
+
1321 Json::Reader jrReader;
+
1322 Json::Value jvCommand;
+
1323
+
1324 if (!jrReader.parse(cmd, jvCommand))
+
1325 {
+
1326 JLOG(m_journal.fatal()) << "Couldn't parse entry in [" << SECTION_RPC_STARTUP << "]: '" << cmd;
+
1327 }
+
1328
+
1329 if (!config_->quiet())
+
1330 {
+
1331 JLOG(m_journal.fatal()) << "Startup RPC: " << jvCommand << std::endl;
+
1332 }
+
1333
+
1334 Resource::Charge loadType = Resource::feeReferenceRPC;
+ +
1336 RPC::JsonContext context{
+
1337 {journal("RPCHandler"),
+
1338 *this,
+
1339 loadType,
+
1340 getOPs(),
+
1341 getLedgerMaster(),
+
1342 c,
+
1343 Role::ADMIN,
+
1344 {},
+
1345 {},
+
1346 RPC::apiMaximumSupportedVersion},
+
1347 jvCommand};
+
1348
+
1349 Json::Value jvResult;
+
1350 RPC::doCommand(context, jvResult);
1351
-
1352 return true;
-
1353}
-
-
1354
-
1355void
-
-
1356ApplicationImp::start(bool withTimers)
-
1357{
-
1358 JLOG(m_journal.info()) << "Application starting. Version is " << BuildInfo::getVersionString();
+
1352 if (!config_->quiet())
+
1353 {
+
1354 JLOG(m_journal.fatal()) << "Result: " << jvResult << std::endl;
+
1355 }
+
1356 }
+
1357
+
1358 validatorSites_->start();
1359
-
1360 if (withTimers)
-
1361 {
-
1362 setSweepTimer();
-
1363 setEntropyTimer();
-
1364 }
-
1365
-
1366 m_io_latency_sampler.start();
-
1367 m_resolver->start();
-
1368 m_loadManager->start();
-
1369 m_shaMapStore->start();
-
1370 if (overlay_)
-
1371 overlay_->start();
-
1372
-
1373 if (grpcServer_->start())
-
1374 fixConfigPorts(*config_, {{SECTION_PORT_GRPC, grpcServer_->getEndpoint()}});
-
1375
-
1376 ledgerCleaner_->start();
-
1377 perfLog_->start();
-
1378}
+
1360 return true;
+
1361}
-
1379
-
1380void
-
-
1381ApplicationImp::run()
-
1382{
-
1383 if (!config_->standalone())
-
1384 {
-
1385 // VFALCO NOTE This seems unnecessary. If we properly refactor the load
-
1386 // manager then the stall detector can just always be
-
1387 // "armed"
-
1388 //
-
1389 getLoadManager().activateStallDetector();
-
1390 }
-
1391
-
1392 isTimeToStop.wait(false, std::memory_order_relaxed);
-
1393
-
1394 JLOG(m_journal.debug()) << "Application stopping";
-
1395
-
1396 m_io_latency_sampler.cancel_async();
-
1397
-
1398 // VFALCO Enormous hack, we have to force the probe to cancel
-
1399 // before we stop the io_context queue or else it never
-
1400 // unblocks in its destructor. The fix is to make all
-
1401 // io_objects gracefully handle exit so that we can
-
1402 // naturally return from io_context::run() instead of
-
1403 // forcing a call to io_context::stop()
-
1404 m_io_latency_sampler.cancel();
+
1362
+
1363void
+
+
1364ApplicationImp::start(bool withTimers)
+
1365{
+
1366 JLOG(m_journal.info()) << "Application starting. Version is " << BuildInfo::getVersionString();
+
1367
+
1368 if (withTimers)
+
1369 {
+
1370 setSweepTimer();
+
1371 setEntropyTimer();
+
1372 }
+
1373
+
1374 m_io_latency_sampler.start();
+
1375 m_resolver->start();
+
1376 m_loadManager->start();
+
1377 m_shaMapStore->start();
+
1378 if (overlay_)
+
1379 overlay_->start();
+
1380
+
1381 if (grpcServer_->start())
+
1382 fixConfigPorts(*config_, {{SECTION_PORT_GRPC, grpcServer_->getEndpoint()}});
+
1383
+
1384 ledgerCleaner_->start();
+
1385 perfLog_->start();
+
1386}
+
+
1387
+
1388void
+
+
1389ApplicationImp::run()
+
1390{
+
1391 if (!config_->standalone())
+
1392 {
+
1393 // VFALCO NOTE This seems unnecessary. If we properly refactor the load
+
1394 // manager then the stall detector can just always be
+
1395 // "armed"
+
1396 //
+
1397 getLoadManager().activateStallDetector();
+
1398 }
+
1399
+
1400 isTimeToStop.wait(false, std::memory_order_relaxed);
+
1401
+
1402 JLOG(m_journal.debug()) << "Application stopping";
+
1403
+
1404 m_io_latency_sampler.cancel_async();
1405
-
1406 m_resolver->stop_async();
-
1407
-
1408 // NIKB This is a hack - we need to wait for the resolver to
-
1409 // stop. before we stop the io_server_queue or weird
-
1410 // things will happen.
-
1411 m_resolver->stop();
-
1412
-
1413 {
-
1414 try
-
1415 {
-
1416 sweepTimer_.cancel();
-
1417 }
-
1418 catch (boost::system::system_error const& e)
-
1419 {
-
1420 JLOG(m_journal.error()) << "Application: sweepTimer cancel error: " << e.what();
-
1421 }
-
1422
-
1423 try
-
1424 {
-
1425 entropyTimer_.cancel();
-
1426 }
-
1427 catch (boost::system::system_error const& e)
-
1428 {
-
1429 JLOG(m_journal.error()) << "Application: entropyTimer cancel error: " << e.what();
-
1430 }
-
1431 }
-
1432
-
1433 // Make sure that any waitHandlers pending in our timers are done
-
1434 // before we declare ourselves stopped.
-
1435 using namespace std::chrono_literals;
-
1436
-
1437 waitHandlerCounter_.join("Application", 1s, m_journal);
-
1438
-
1439 mValidations.flush();
+
1406 // VFALCO Enormous hack, we have to force the probe to cancel
+
1407 // before we stop the io_context queue or else it never
+
1408 // unblocks in its destructor. The fix is to make all
+
1409 // io_objects gracefully handle exit so that we can
+
1410 // naturally return from io_context::run() instead of
+
1411 // forcing a call to io_context::stop()
+
1412 m_io_latency_sampler.cancel();
+
1413
+
1414 m_resolver->stop_async();
+
1415
+
1416 // NIKB This is a hack - we need to wait for the resolver to
+
1417 // stop. before we stop the io_server_queue or weird
+
1418 // things will happen.
+
1419 m_resolver->stop();
+
1420
+
1421 {
+
1422 try
+
1423 {
+
1424 sweepTimer_.cancel();
+
1425 }
+
1426 catch (boost::system::system_error const& e)
+
1427 {
+
1428 JLOG(m_journal.error()) << "Application: sweepTimer cancel error: " << e.what();
+
1429 }
+
1430
+
1431 try
+
1432 {
+
1433 entropyTimer_.cancel();
+
1434 }
+
1435 catch (boost::system::system_error const& e)
+
1436 {
+
1437 JLOG(m_journal.error()) << "Application: entropyTimer cancel error: " << e.what();
+
1438 }
+
1439 }
1440
-
1441 validatorSites_->stop();
-
1442
-
1443 // TODO Store manifests in manifests.sqlite instead of wallet.db
-
1444 validatorManifests_->save(
-
1445 getWalletDB(), "ValidatorManifests", [this](PublicKey const& pubKey) { return validators().listed(pubKey); });
+
1441 // Make sure that any waitHandlers pending in our timers are done
+
1442 // before we declare ourselves stopped.
+
1443 using namespace std::chrono_literals;
+
1444
+
1445 waitHandlerCounter_.join("Application", 1s, m_journal);
1446
-
1447 publisherManifests_->save(getWalletDB(), "PublisherManifests", [this](PublicKey const& pubKey) {
-
1448 return validators().trustedPublisher(pubKey);
-
1449 });
+
1447 mValidations.flush();
+
1448
+
1449 validatorSites_->stop();
1450
-
1451 // The order of these stop calls is delicate.
-
1452 // Re-ordering them risks undefined behavior.
-
1453 m_loadManager->stop();
-
1454 m_shaMapStore->stop();
-
1455 m_jobQueue->stop();
-
1456 if (overlay_)
-
1457 overlay_->stop();
-
1458 grpcServer_->stop();
-
1459 m_networkOPs->stop();
-
1460 serverHandler_->stop();
-
1461 m_ledgerReplayer->stop();
-
1462 m_inboundTransactions->stop();
-
1463 m_inboundLedgers->stop();
-
1464 ledgerCleaner_->stop();
-
1465 m_nodeStore->stop();
-
1466 perfLog_->stop();
-
1467
-
1468 JLOG(m_journal.info()) << "Done.";
-
1469}
+
1451 // TODO Store manifests in manifests.sqlite instead of wallet.db
+
1452 validatorManifests_->save(
+
1453 getWalletDB(), "ValidatorManifests", [this](PublicKey const& pubKey) { return validators().listed(pubKey); });
+
1454
+
1455 publisherManifests_->save(getWalletDB(), "PublisherManifests", [this](PublicKey const& pubKey) {
+
1456 return validators().trustedPublisher(pubKey);
+
1457 });
+
1458
+
1459 // The order of these stop calls is delicate.
+
1460 // Re-ordering them risks undefined behavior.
+
1461 m_loadManager->stop();
+
1462 m_shaMapStore->stop();
+
1463 m_jobQueue->stop();
+
1464 if (overlay_)
+
1465 overlay_->stop();
+
1466 grpcServer_->stop();
+
1467 m_networkOPs->stop();
+
1468 serverHandler_->stop();
+
1469 m_ledgerReplayer->stop();
+
1470 m_inboundTransactions->stop();
+
1471 m_inboundLedgers->stop();
+
1472 ledgerCleaner_->stop();
+
1473 m_nodeStore->stop();
+
1474 perfLog_->stop();
+
1475
+
1476 JLOG(m_journal.info()) << "Done.";
+
1477}
-
1470
-
1471void
-
-
1472ApplicationImp::signalStop(std::string msg)
-
1473{
-
1474 if (!isTimeToStop.test_and_set(std::memory_order_acquire))
-
1475 {
-
1476 if (msg.empty())
-
1477 JLOG(m_journal.warn()) << "Server stopping";
-
1478 else
-
1479 JLOG(m_journal.warn()) << "Server stopping: " << msg;
-
1480
-
1481 isTimeToStop.notify_all();
-
1482 }
-
1483}
+
1478
+
1479void
+
+
1480ApplicationImp::signalStop(std::string msg)
+
1481{
+
1482 if (!isTimeToStop.test_and_set(std::memory_order_acquire))
+
1483 {
+
1484 if (msg.empty())
+
1485 JLOG(m_journal.warn()) << "Server stopping";
+
1486 else
+
1487 JLOG(m_journal.warn()) << "Server stopping: " << msg;
+
1488
+
1489 isTimeToStop.notify_all();
+
1490 }
+
1491}
-
1484
-
1485bool
-
-
1486ApplicationImp::checkSigs() const
-
1487{
-
1488 return checkSigs_;
-
1489}
+
1492
+
1493bool
+
+
1494ApplicationImp::checkSigs() const
+
1495{
+
1496 return checkSigs_;
+
1497}
-
1490
-
1491void
-
-
1492ApplicationImp::checkSigs(bool check)
-
1493{
-
1494 checkSigs_ = check;
-
1495}
+
1498
+
1499void
+
+
1500ApplicationImp::checkSigs(bool check)
+
1501{
+
1502 checkSigs_ = check;
+
1503}
-
1496
-
1497bool
-
-
1498ApplicationImp::isStopping() const
-
1499{
-
1500 return isTimeToStop.test(std::memory_order_relaxed);
-
1501}
+
1504
+
1505bool
+
+
1506ApplicationImp::isStopping() const
+
1507{
+
1508 return isTimeToStop.test(std::memory_order_relaxed);
+
1509}
-
1502
-
1503int
-
-
1504ApplicationImp::fdRequired() const
-
1505{
-
1506 // Standard handles, config file, misc I/O etc:
-
1507 int needed = 128;
-
1508
-
1509 // 2x the configured peer limit for peer connections:
-
1510 if (overlay_)
-
1511 needed += 2 * overlay_->limit();
-
1512
-
1513 // the number of fds needed by the backend (internally
-
1514 // doubled if online delete is enabled).
-
1515 needed += std::max(5, m_shaMapStore->fdRequired());
+
1510
+
1511int
+
+
1512ApplicationImp::fdRequired() const
+
1513{
+
1514 // Standard handles, config file, misc I/O etc:
+
1515 int needed = 128;
1516
-
1517 // One fd per incoming connection a port can accept, or
-
1518 // if no limit is set, assume it'll handle 256 clients.
-
1519 for (auto const& p : serverHandler_->setup().ports)
-
1520 needed += std::max(256, p.limit);
-
1521
-
1522 // The minimum number of file descriptors we need is 1024:
-
1523 return std::max(1024, needed);
-
1524}
+
1517 // 2x the configured peer limit for peer connections:
+
1518 if (overlay_)
+
1519 needed += 2 * overlay_->limit();
+
1520
+
1521 // the number of fds needed by the backend (internally
+
1522 // doubled if online delete is enabled).
+
1523 needed += std::max(5, m_shaMapStore->fdRequired());
+
1524
+
1525 // One fd per incoming connection a port can accept, or
+
1526 // if no limit is set, assume it'll handle 256 clients.
+
1527 for (auto const& p : serverHandler_->setup().ports)
+
1528 needed += std::max(256, p.limit);
+
1529
+
1530 // The minimum number of file descriptors we need is 1024:
+
1531 return std::max(1024, needed);
+
1532}
-
1525
-
1526//------------------------------------------------------------------------------
-
1527
-
1528void
-
-
1529ApplicationImp::startGenesisLedger()
-
1530{
-
1531 std::vector<uint256> const initialAmendments =
-
1532 (config_->START_UP == Config::FRESH) ? m_amendmentTable->getDesired() : std::vector<uint256>{};
1533
-
1534 std::shared_ptr<Ledger> const genesis =
-
1535 std::make_shared<Ledger>(create_genesis, *config_, initialAmendments, nodeFamily_);
-
1536 m_ledgerMaster->storeLedger(genesis);
-
1537
-
1538 auto const next = std::make_shared<Ledger>(*genesis, timeKeeper().closeTime());
-
1539 next->updateSkipList();
-
1540 XRPL_ASSERT(
-
1541 next->header().seq < XRP_LEDGER_EARLIEST_FEES || next->read(keylet::fees()),
-
1542 "xrpl::ApplicationImp::startGenesisLedger : valid ledger fees");
-
1543 next->setImmutable();
-
1544 openLedger_.emplace(next, cachedSLEs_, logs_->journal("OpenLedger"));
-
1545 m_ledgerMaster->storeLedger(next);
-
1546 m_ledgerMaster->switchLCL(next);
-
1547}
+
1534//------------------------------------------------------------------------------
+
1535
+
1536void
+
+
1537ApplicationImp::startGenesisLedger()
+
1538{
+
1539 std::vector<uint256> const initialAmendments =
+
1540 (config_->START_UP == StartUpType::FRESH) ? m_amendmentTable->getDesired() : std::vector<uint256>{};
+
1541
+
1542 std::shared_ptr<Ledger> const genesis =
+
1543 std::make_shared<Ledger>(create_genesis, *config_, initialAmendments, nodeFamily_);
+
1544 m_ledgerMaster->storeLedger(genesis);
+
1545
+
1546 auto const next = std::make_shared<Ledger>(*genesis, timeKeeper().closeTime());
+
1547 next->updateSkipList();
+
1548 XRPL_ASSERT(
+
1549 next->header().seq < XRP_LEDGER_EARLIEST_FEES || next->read(keylet::fees()),
+
1550 "xrpl::ApplicationImp::startGenesisLedger : valid ledger fees");
+
1551 next->setImmutable();
+
1552 openLedger_.emplace(next, cachedSLEs_, logs_->journal("OpenLedger"));
+
1553 m_ledgerMaster->storeLedger(next);
+
1554 m_ledgerMaster->switchLCL(next);
+
1555}
-
1548
- -
-
1550ApplicationImp::getLastFullLedger()
-
1551{
-
1552 auto j = journal("Ledger");
-
1553
-
1554 try
-
1555 {
-
1556 auto const [ledger, seq, hash] = getLatestLedger(*this);
-
1557
-
1558 if (!ledger)
-
1559 return ledger;
-
1560
-
1561 XRPL_ASSERT(
-
1562 ledger->header().seq < XRP_LEDGER_EARLIEST_FEES || ledger->read(keylet::fees()),
-
1563 "xrpl::ApplicationImp::getLastFullLedger : valid ledger fees");
-
1564 ledger->setImmutable();
+
1556
+ +
+
1558ApplicationImp::getLastFullLedger()
+
1559{
+
1560 auto j = journal("Ledger");
+
1561
+
1562 try
+
1563 {
+
1564 auto const [ledger, seq, hash] = getLatestLedger(*this);
1565
-
1566 if (getLedgerMaster().haveLedger(seq))
-
1567 ledger->setValidated();
+
1566 if (!ledger)
+
1567 return ledger;
1568
-
1569 if (ledger->header().hash == hash)
-
1570 {
-
1571 JLOG(j.trace()) << "Loaded ledger: " << hash;
-
1572 return ledger;
-
1573 }
-
1574
-
1575 if (auto stream = j.error())
-
1576 {
-
1577 stream << "Failed on ledger";
-
1578 Json::Value p;
-
1579 addJson(p, {*ledger, nullptr, LedgerFill::full});
-
1580 stream << p;
+
1569 XRPL_ASSERT(
+
1570 ledger->header().seq < XRP_LEDGER_EARLIEST_FEES || ledger->read(keylet::fees()),
+
1571 "xrpl::ApplicationImp::getLastFullLedger : valid ledger fees");
+
1572 ledger->setImmutable();
+
1573
+
1574 if (getLedgerMaster().haveLedger(seq))
+
1575 ledger->setValidated();
+
1576
+
1577 if (ledger->header().hash == hash)
+
1578 {
+
1579 JLOG(j.trace()) << "Loaded ledger: " << hash;
+
1580 return ledger;
1581 }
1582
-
1583 return {};
-
1584 }
-
1585 catch (SHAMapMissingNode const& mn)
-
1586 {
-
1587 JLOG(j.warn()) << "Ledger in database: " << mn.what();
-
1588 return {};
-
1589 }
-
1590}
+
1583 if (auto stream = j.error())
+
1584 {
+
1585 stream << "Failed on ledger";
+
1586 Json::Value p;
+
1587 addJson(p, {*ledger, nullptr, LedgerFill::full});
+
1588 stream << p;
+
1589 }
+
1590
+
1591 return {};
+
1592 }
+
1593 catch (SHAMapMissingNode const& mn)
+
1594 {
+
1595 JLOG(j.warn()) << "Ledger in database: " << mn.what();
+
1596 return {};
+
1597 }
+
1598}
-
1591
- -
-
1593ApplicationImp::loadLedgerFromFile(std::string const& name)
-
1594{
-
1595 try
-
1596 {
-
1597 std::ifstream ledgerFile(name, std::ios::in);
-
1598
-
1599 if (!ledgerFile)
-
1600 {
-
1601 JLOG(m_journal.fatal()) << "Unable to open file '" << name << "'";
-
1602 return nullptr;
-
1603 }
-
1604
-
1605 Json::Reader reader;
-
1606 Json::Value jLedger;
-
1607
-
1608 if (!reader.parse(ledgerFile, jLedger))
-
1609 {
-
1610 JLOG(m_journal.fatal()) << "Unable to parse ledger JSON";
-
1611 return nullptr;
-
1612 }
-
1613
- +
1599
+ +
+
1601ApplicationImp::loadLedgerFromFile(std::string const& name)
+
1602{
+
1603 try
+
1604 {
+
1605 std::ifstream ledgerFile(name, std::ios::in);
+
1606
+
1607 if (!ledgerFile)
+
1608 {
+
1609 JLOG(m_journal.fatal()) << "Unable to open file '" << name << "'";
+
1610 return nullptr;
+
1611 }
+
1612
+
1613 Json::Reader reader;
+
1614 Json::Value jLedger;
1615
-
1616 // accept a wrapped ledger
-
1617 if (ledger.get().isMember("result"))
-
1618 ledger = ledger.get()["result"];
-
1619
-
1620 if (ledger.get().isMember("ledger"))
-
1621 ledger = ledger.get()["ledger"];
-
1622
-
1623 std::uint32_t seq = 1;
-
1624 auto closeTime = timeKeeper().closeTime();
-
1625 using namespace std::chrono_literals;
-
1626 auto closeTimeResolution = 30s;
-
1627 bool closeTimeEstimated = false;
-
1628 std::uint64_t totalDrops = 0;
-
1629
-
1630 if (ledger.get().isMember("accountState"))
-
1631 {
-
1632 if (ledger.get().isMember(jss::ledger_index))
-
1633 {
-
1634 seq = ledger.get()[jss::ledger_index].asUInt();
-
1635 }
-
1636
-
1637 if (ledger.get().isMember("close_time"))
-
1638 {
-
1639 using tp = NetClock::time_point;
-
1640 using d = tp::duration;
-
1641 closeTime = tp{d{ledger.get()["close_time"].asUInt()}};
-
1642 }
-
1643 if (ledger.get().isMember("close_time_resolution"))
-
1644 {
-
1645 using namespace std::chrono;
-
1646 closeTimeResolution = seconds{ledger.get()["close_time_resolution"].asUInt()};
-
1647 }
-
1648 if (ledger.get().isMember("close_time_estimated"))
-
1649 {
-
1650 closeTimeEstimated = ledger.get()["close_time_estimated"].asBool();
-
1651 }
-
1652 if (ledger.get().isMember("total_coins"))
-
1653 {
-
1654 totalDrops = beast::lexicalCastThrow<std::uint64_t>(ledger.get()["total_coins"].asString());
+
1616 if (!reader.parse(ledgerFile, jLedger))
+
1617 {
+
1618 JLOG(m_journal.fatal()) << "Unable to parse ledger JSON";
+
1619 return nullptr;
+
1620 }
+
1621
+ +
1623
+
1624 // accept a wrapped ledger
+
1625 if (ledger.get().isMember("result"))
+
1626 ledger = ledger.get()["result"];
+
1627
+
1628 if (ledger.get().isMember("ledger"))
+
1629 ledger = ledger.get()["ledger"];
+
1630
+
1631 std::uint32_t seq = 1;
+
1632 auto closeTime = timeKeeper().closeTime();
+
1633 using namespace std::chrono_literals;
+
1634 auto closeTimeResolution = 30s;
+
1635 bool closeTimeEstimated = false;
+
1636 std::uint64_t totalDrops = 0;
+
1637
+
1638 if (ledger.get().isMember("accountState"))
+
1639 {
+
1640 if (ledger.get().isMember(jss::ledger_index))
+
1641 {
+
1642 seq = ledger.get()[jss::ledger_index].asUInt();
+
1643 }
+
1644
+
1645 if (ledger.get().isMember("close_time"))
+
1646 {
+
1647 using tp = NetClock::time_point;
+
1648 using d = tp::duration;
+
1649 closeTime = tp{d{ledger.get()["close_time"].asUInt()}};
+
1650 }
+
1651 if (ledger.get().isMember("close_time_resolution"))
+
1652 {
+
1653 using namespace std::chrono;
+
1654 closeTimeResolution = seconds{ledger.get()["close_time_resolution"].asUInt()};
1655 }
-
1656
-
1657 ledger = ledger.get()["accountState"];
-
1658 }
-
1659
-
1660 if (!ledger.get().isArrayOrNull())
-
1661 {
-
1662 JLOG(m_journal.fatal()) << "State nodes must be an array";
-
1663 return nullptr;
-
1664 }
-
1665
-
1666 auto loadLedger = std::make_shared<Ledger>(seq, closeTime, *config_, nodeFamily_);
-
1667 loadLedger->setTotalDrops(totalDrops);
-
1668
-
1669 for (Json::UInt index = 0; index < ledger.get().size(); ++index)
-
1670 {
-
1671 Json::Value& entry = ledger.get()[index];
-
1672
-
1673 if (!entry.isObjectOrNull())
-
1674 {
-
1675 JLOG(m_journal.fatal()) << "Invalid entry in ledger";
-
1676 return nullptr;
-
1677 }
-
1678
-
1679 uint256 uIndex;
+
1656 if (ledger.get().isMember("close_time_estimated"))
+
1657 {
+
1658 closeTimeEstimated = ledger.get()["close_time_estimated"].asBool();
+
1659 }
+
1660 if (ledger.get().isMember("total_coins"))
+
1661 {
+
1662 totalDrops = beast::lexicalCastThrow<std::uint64_t>(ledger.get()["total_coins"].asString());
+
1663 }
+
1664
+
1665 ledger = ledger.get()["accountState"];
+
1666 }
+
1667
+
1668 if (!ledger.get().isArrayOrNull())
+
1669 {
+
1670 JLOG(m_journal.fatal()) << "State nodes must be an array";
+
1671 return nullptr;
+
1672 }
+
1673
+
1674 auto loadLedger = std::make_shared<Ledger>(seq, closeTime, *config_, nodeFamily_);
+
1675 loadLedger->setTotalDrops(totalDrops);
+
1676
+
1677 for (Json::UInt index = 0; index < ledger.get().size(); ++index)
+
1678 {
+
1679 Json::Value& entry = ledger.get()[index];
1680
-
1681 if (!uIndex.parseHex(entry[jss::index].asString()))
+
1681 if (!entry.isObjectOrNull())
1682 {
1683 JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1684 return nullptr;
1685 }
1686
-
1687 entry.removeMember(jss::index);
+
1687 uint256 uIndex;
1688
-
1689 STParsedJSONObject stp("sle", ledger.get()[index]);
-
1690
-
1691 if (!stp.object || uIndex.isZero())
-
1692 {
-
1693 JLOG(m_journal.fatal()) << "Invalid entry in ledger";
-
1694 return nullptr;
-
1695 }
+
1689 if (!uIndex.parseHex(entry[jss::index].asString()))
+
1690 {
+
1691 JLOG(m_journal.fatal()) << "Invalid entry in ledger";
+
1692 return nullptr;
+
1693 }
+
1694
+
1695 entry.removeMember(jss::index);
1696
-
1697 // VFALCO TODO This is the only place that
-
1698 // constructor is used, try to remove it
-
1699 STLedgerEntry sle(*stp.object, uIndex);
-
1700
-
1701 if (!loadLedger->addSLE(sle))
-
1702 {
-
1703 JLOG(m_journal.fatal()) << "Couldn't add serialized ledger: " << uIndex;
-
1704 return nullptr;
-
1705 }
-
1706 }
-
1707
-
1708 loadLedger->stateMap().flushDirty(hotACCOUNT_NODE);
-
1709
-
1710 XRPL_ASSERT(
-
1711 loadLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || loadLedger->read(keylet::fees()),
-
1712 "xrpl::ApplicationImp::loadLedgerFromFile : valid ledger fees");
-
1713 loadLedger->setAccepted(closeTime, closeTimeResolution, !closeTimeEstimated);
-
1714
-
1715 return loadLedger;
-
1716 }
-
1717 catch (std::exception const& x)
-
1718 {
-
1719 JLOG(m_journal.fatal()) << "Ledger contains invalid data: " << x.what();
-
1720 return nullptr;
-
1721 }
-
1722}
+
1697 STParsedJSONObject stp("sle", ledger.get()[index]);
+
1698
+
1699 if (!stp.object || uIndex.isZero())
+
1700 {
+
1701 JLOG(m_journal.fatal()) << "Invalid entry in ledger";
+
1702 return nullptr;
+
1703 }
+
1704
+
1705 // VFALCO TODO This is the only place that
+
1706 // constructor is used, try to remove it
+
1707 STLedgerEntry sle(*stp.object, uIndex);
+
1708
+
1709 if (!loadLedger->addSLE(sle))
+
1710 {
+
1711 JLOG(m_journal.fatal()) << "Couldn't add serialized ledger: " << uIndex;
+
1712 return nullptr;
+
1713 }
+
1714 }
+
1715
+
1716 loadLedger->stateMap().flushDirty(hotACCOUNT_NODE);
+
1717
+
1718 XRPL_ASSERT(
+
1719 loadLedger->header().seq < XRP_LEDGER_EARLIEST_FEES || loadLedger->read(keylet::fees()),
+
1720 "xrpl::ApplicationImp::loadLedgerFromFile : valid ledger fees");
+
1721 loadLedger->setAccepted(closeTime, closeTimeResolution, !closeTimeEstimated);
+
1722
+
1723 return loadLedger;
+
1724 }
+
1725 catch (std::exception const& x)
+
1726 {
+
1727 JLOG(m_journal.fatal()) << "Ledger contains invalid data: " << x.what();
+
1728 return nullptr;
+
1729 }
+
1730}
-
1723
-
1724bool
-
-
1725ApplicationImp::loadOldLedger(
-
1726 std::string const& ledgerID,
-
1727 bool replay,
-
1728 bool isFileName,
-
1729 std::optional<uint256> trapTxID)
-
1730{
-
1731 try
-
1732 {
-
1733 std::shared_ptr<Ledger const> loadLedger, replayLedger;
-
1734
-
1735 if (isFileName)
-
1736 {
-
1737 if (!ledgerID.empty())
-
1738 loadLedger = loadLedgerFromFile(ledgerID);
-
1739 }
-
1740 else if (ledgerID.length() == 64)
-
1741 {
-
1742 uint256 hash;
-
1743
-
1744 if (hash.parseHex(ledgerID))
-
1745 {
-
1746 loadLedger = loadByHash(hash, *this);
-
1747
-
1748 if (!loadLedger)
-
1749 {
-
1750 // Try to build the ledger from the back end
- -
1752 *this, hash, 0, InboundLedger::Reason::GENERIC, stopwatch(), make_DummyPeerSet(*this));
-
1753 if (il->checkLocal())
-
1754 loadLedger = il->getLedger();
-
1755 }
-
1756 }
-
1757 }
-
1758 else if (ledgerID.empty() || boost::iequals(ledgerID, "latest"))
-
1759 {
-
1760 loadLedger = getLastFullLedger();
-
1761 }
-
1762 else
-
1763 {
-
1764 // assume by sequence
-
1765 std::uint32_t index;
-
1766
-
1767 if (beast::lexicalCastChecked(index, ledgerID))
-
1768 loadLedger = loadByIndex(index, *this);
+
1731
+
1732bool
+
+
1733ApplicationImp::loadOldLedger(
+
1734 std::string const& ledgerID,
+
1735 bool replay,
+
1736 bool isFileName,
+
1737 std::optional<uint256> trapTxID)
+
1738{
+
1739 try
+
1740 {
+
1741 std::shared_ptr<Ledger const> loadLedger, replayLedger;
+
1742
+
1743 if (isFileName)
+
1744 {
+
1745 if (!ledgerID.empty())
+
1746 loadLedger = loadLedgerFromFile(ledgerID);
+
1747 }
+
1748 else if (ledgerID.length() == 64)
+
1749 {
+
1750 uint256 hash;
+
1751
+
1752 if (hash.parseHex(ledgerID))
+
1753 {
+
1754 loadLedger = loadByHash(hash, *this);
+
1755
+
1756 if (!loadLedger)
+
1757 {
+
1758 // Try to build the ledger from the back end
+ +
1760 *this, hash, 0, InboundLedger::Reason::GENERIC, stopwatch(), make_DummyPeerSet(*this));
+
1761 if (il->checkLocal())
+
1762 loadLedger = il->getLedger();
+
1763 }
+
1764 }
+
1765 }
+
1766 else if (ledgerID.empty() || boost::iequals(ledgerID, "latest"))
+
1767 {
+
1768 loadLedger = getLastFullLedger();
1769 }
-
1770
-
1771 if (!loadLedger)
-
1772 return false;
-
1773
-
1774 if (replay)
-
1775 {
-
1776 // Replay a ledger close with same prior ledger and transactions
-
1777
-
1778 // this ledger holds the transactions we want to replay
-
1779 replayLedger = loadLedger;
-
1780
-
1781 JLOG(m_journal.info()) << "Loading parent ledger";
-
1782
-
1783 loadLedger = loadByHash(replayLedger->header().parentHash, *this);
-
1784 if (!loadLedger)
-
1785 {
-
1786 JLOG(m_journal.info()) << "Loading parent ledger from node store";
-
1787
-
1788 // Try to build the ledger from the back end
- -
1790 *this,
-
1791 replayLedger->header().parentHash,
-
1792 0,
-
1793 InboundLedger::Reason::GENERIC,
-
1794 stopwatch(),
-
1795 make_DummyPeerSet(*this));
-
1796
-
1797 if (il->checkLocal())
-
1798 loadLedger = il->getLedger();
-
1799
-
1800 if (!loadLedger)
-
1801 {
-
1802 // LCOV_EXCL_START
-
1803 JLOG(m_journal.fatal()) << "Replay ledger missing/damaged";
-
1804 UNREACHABLE(
-
1805 "xrpl::ApplicationImp::loadOldLedger : replay ledger "
-
1806 "missing/damaged");
-
1807 return false;
-
1808 // LCOV_EXCL_STOP
-
1809 }
-
1810 }
-
1811 }
-
1812 using namespace std::chrono_literals;
-
1813 using namespace date;
-
1814 static constexpr NetClock::time_point ledgerWarnTimePoint{
-
1815 sys_days{January / 1 / 2018} - sys_days{January / 1 / 2000}};
-
1816 if (loadLedger->header().closeTime < ledgerWarnTimePoint)
-
1817 {
-
1818 JLOG(m_journal.fatal()) << "\n\n*** WARNING ***\n"
-
1819 "You are replaying a ledger from before "
-
1820 << to_string(ledgerWarnTimePoint)
-
1821 << " UTC.\n"
-
1822 "This replay will not handle your ledger as it was "
-
1823 "originally "
-
1824 "handled.\nConsider running an earlier version of rippled "
-
1825 "to "
-
1826 "get the older rules.\n*** CONTINUING ***\n";
-
1827 }
-
1828
-
1829 JLOG(m_journal.info()) << "Loading ledger " << loadLedger->header().hash << " seq:" << loadLedger->header().seq;
-
1830
-
1831 if (loadLedger->header().accountHash.isZero())
-
1832 {
-
1833 // LCOV_EXCL_START
-
1834 JLOG(m_journal.fatal()) << "Ledger is empty.";
-
1835 UNREACHABLE("xrpl::ApplicationImp::loadOldLedger : ledger is empty");
-
1836 return false;
-
1837 // LCOV_EXCL_STOP
-
1838 }
-
1839
-
1840 if (!loadLedger->walkLedger(journal("Ledger"), true))
-
1841 {
-
1842 // LCOV_EXCL_START
-
1843 JLOG(m_journal.fatal()) << "Ledger is missing nodes.";
-
1844 UNREACHABLE(
-
1845 "xrpl::ApplicationImp::loadOldLedger : ledger is missing "
-
1846 "nodes");
-
1847 return false;
-
1848 // LCOV_EXCL_STOP
-
1849 }
-
1850
-
1851 if (!loadLedger->assertSensible(journal("Ledger")))
-
1852 {
-
1853 // LCOV_EXCL_START
-
1854 JLOG(m_journal.fatal()) << "Ledger is not sensible.";
-
1855 UNREACHABLE(
-
1856 "xrpl::ApplicationImp::loadOldLedger : ledger is not "
-
1857 "sensible");
-
1858 return false;
-
1859 // LCOV_EXCL_STOP
-
1860 }
-
1861
-
1862 m_ledgerMaster->setLedgerRangePresent(loadLedger->header().seq, loadLedger->header().seq);
-
1863
-
1864 m_ledgerMaster->switchLCL(loadLedger);
-
1865 loadLedger->setValidated();
-
1866 m_ledgerMaster->setFullLedger(loadLedger, true, false);
-
1867 openLedger_.emplace(loadLedger, cachedSLEs_, logs_->journal("OpenLedger"));
-
1868
-
1869 if (replay)
-
1870 {
-
1871 // inject transaction(s) from the replayLedger into our open ledger
-
1872 // and build replay structure
-
1873 auto replayData = std::make_unique<LedgerReplay>(loadLedger, replayLedger);
-
1874
-
1875 for (auto const& [_, tx] : replayData->orderedTxns())
-
1876 {
-
1877 (void)_;
-
1878 auto txID = tx->getTransactionID();
-
1879 if (trapTxID == txID)
-
1880 {
-
1881 trapTxID_ = txID;
-
1882 JLOG(m_journal.debug()) << "Trap transaction set: " << txID;
-
1883 }
-
1884
- -
1886 tx->add(*s);
-
1887
-
1888 forceValidity(getHashRouter(), txID, Validity::SigGoodOnly);
-
1889
-
1890 openLedger_->modify([&txID, &s](OpenView& view, beast::Journal j) {
-
1891 view.rawTxInsert(txID, std::move(s), nullptr);
-
1892 return true;
-
1893 });
-
1894 }
+
1770 else
+
1771 {
+
1772 // assume by sequence
+
1773 std::uint32_t index;
+
1774
+
1775 if (beast::lexicalCastChecked(index, ledgerID))
+
1776 loadLedger = loadByIndex(index, *this);
+
1777 }
+
1778
+
1779 if (!loadLedger)
+
1780 return false;
+
1781
+
1782 if (replay)
+
1783 {
+
1784 // Replay a ledger close with same prior ledger and transactions
+
1785
+
1786 // this ledger holds the transactions we want to replay
+
1787 replayLedger = loadLedger;
+
1788
+
1789 JLOG(m_journal.info()) << "Loading parent ledger";
+
1790
+
1791 loadLedger = loadByHash(replayLedger->header().parentHash, *this);
+
1792 if (!loadLedger)
+
1793 {
+
1794 JLOG(m_journal.info()) << "Loading parent ledger from node store";
+
1795
+
1796 // Try to build the ledger from the back end
+ +
1798 *this,
+
1799 replayLedger->header().parentHash,
+
1800 0,
+
1801 InboundLedger::Reason::GENERIC,
+
1802 stopwatch(),
+
1803 make_DummyPeerSet(*this));
+
1804
+
1805 if (il->checkLocal())
+
1806 loadLedger = il->getLedger();
+
1807
+
1808 if (!loadLedger)
+
1809 {
+
1810 // LCOV_EXCL_START
+
1811 JLOG(m_journal.fatal()) << "Replay ledger missing/damaged";
+
1812 UNREACHABLE(
+
1813 "xrpl::ApplicationImp::loadOldLedger : replay ledger "
+
1814 "missing/damaged");
+
1815 return false;
+
1816 // LCOV_EXCL_STOP
+
1817 }
+
1818 }
+
1819 }
+
1820 using namespace std::chrono_literals;
+
1821 using namespace date;
+
1822 static constexpr NetClock::time_point ledgerWarnTimePoint{
+
1823 sys_days{January / 1 / 2018} - sys_days{January / 1 / 2000}};
+
1824 if (loadLedger->header().closeTime < ledgerWarnTimePoint)
+
1825 {
+
1826 JLOG(m_journal.fatal()) << "\n\n*** WARNING ***\n"
+
1827 "You are replaying a ledger from before "
+
1828 << to_string(ledgerWarnTimePoint)
+
1829 << " UTC.\n"
+
1830 "This replay will not handle your ledger as it was "
+
1831 "originally "
+
1832 "handled.\nConsider running an earlier version of rippled "
+
1833 "to "
+
1834 "get the older rules.\n*** CONTINUING ***\n";
+
1835 }
+
1836
+
1837 JLOG(m_journal.info()) << "Loading ledger " << loadLedger->header().hash << " seq:" << loadLedger->header().seq;
+
1838
+
1839 if (loadLedger->header().accountHash.isZero())
+
1840 {
+
1841 // LCOV_EXCL_START
+
1842 JLOG(m_journal.fatal()) << "Ledger is empty.";
+
1843 UNREACHABLE("xrpl::ApplicationImp::loadOldLedger : ledger is empty");
+
1844 return false;
+
1845 // LCOV_EXCL_STOP
+
1846 }
+
1847
+
1848 if (!loadLedger->walkLedger(journal("Ledger"), true))
+
1849 {
+
1850 // LCOV_EXCL_START
+
1851 JLOG(m_journal.fatal()) << "Ledger is missing nodes.";
+
1852 UNREACHABLE(
+
1853 "xrpl::ApplicationImp::loadOldLedger : ledger is missing "
+
1854 "nodes");
+
1855 return false;
+
1856 // LCOV_EXCL_STOP
+
1857 }
+
1858
+
1859 if (!loadLedger->assertSensible(journal("Ledger")))
+
1860 {
+
1861 // LCOV_EXCL_START
+
1862 JLOG(m_journal.fatal()) << "Ledger is not sensible.";
+
1863 UNREACHABLE(
+
1864 "xrpl::ApplicationImp::loadOldLedger : ledger is not "
+
1865 "sensible");
+
1866 return false;
+
1867 // LCOV_EXCL_STOP
+
1868 }
+
1869
+
1870 m_ledgerMaster->setLedgerRangePresent(loadLedger->header().seq, loadLedger->header().seq);
+
1871
+
1872 m_ledgerMaster->switchLCL(loadLedger);
+
1873 loadLedger->setValidated();
+
1874 m_ledgerMaster->setFullLedger(loadLedger, true, false);
+
1875 openLedger_.emplace(loadLedger, cachedSLEs_, logs_->journal("OpenLedger"));
+
1876
+
1877 if (replay)
+
1878 {
+
1879 // inject transaction(s) from the replayLedger into our open ledger
+
1880 // and build replay structure
+
1881 auto replayData = std::make_unique<LedgerReplay>(loadLedger, replayLedger);
+
1882
+
1883 for (auto const& [_, tx] : replayData->orderedTxns())
+
1884 {
+
1885 (void)_;
+
1886 auto txID = tx->getTransactionID();
+
1887 if (trapTxID == txID)
+
1888 {
+
1889 trapTxID_ = txID;
+
1890 JLOG(m_journal.debug()) << "Trap transaction set: " << txID;
+
1891 }
+
1892
+ +
1894 tx->add(*s);
1895
-
1896 m_ledgerMaster->takeReplay(std::move(replayData));
+
1896 forceValidity(getHashRouter(), txID, Validity::SigGoodOnly);
1897
-
1898 if (trapTxID && !trapTxID_)
-
1899 {
-
1900 JLOG(m_journal.fatal()) << "Ledger " << replayLedger->header().seq
-
1901 << " does not contain the transaction hash " << *trapTxID;
-
1902 return false;
-
1903 }
-
1904 }
-
1905 }
-
1906 catch (SHAMapMissingNode const& mn)
-
1907 {
-
1908 JLOG(m_journal.fatal()) << "While loading specified ledger: " << mn.what();
-
1909 return false;
-
1910 }
-
1911 catch (boost::bad_lexical_cast&)
-
1912 {
-
1913 JLOG(m_journal.fatal()) << "Ledger specified '" << ledgerID << "' is not valid";
-
1914 return false;
-
1915 }
-
1916
-
1917 return true;
-
1918}
+
1898 openLedger_->modify([&txID, &s](OpenView& view, beast::Journal j) {
+
1899 view.rawTxInsert(txID, std::move(s), nullptr);
+
1900 return true;
+
1901 });
+
1902 }
+
1903
+
1904 m_ledgerMaster->takeReplay(std::move(replayData));
+
1905
+
1906 if (trapTxID && !trapTxID_)
+
1907 {
+
1908 JLOG(m_journal.fatal()) << "Ledger " << replayLedger->header().seq
+
1909 << " does not contain the transaction hash " << *trapTxID;
+
1910 return false;
+
1911 }
+
1912 }
+
1913 }
+
1914 catch (SHAMapMissingNode const& mn)
+
1915 {
+
1916 JLOG(m_journal.fatal()) << "While loading specified ledger: " << mn.what();
+
1917 return false;
+
1918 }
+
1919 catch (boost::bad_lexical_cast&)
+
1920 {
+
1921 JLOG(m_journal.fatal()) << "Ledger specified '" << ledgerID << "' is not valid";
+
1922 return false;
+
1923 }
+
1924
+
1925 return true;
+
1926}
-
1919
-
1920bool
-
-
1921ApplicationImp::serverOkay(std::string& reason)
-
1922{
-
1923 if (!config().ELB_SUPPORT)
-
1924 return true;
-
1925
-
1926 if (isStopping())
-
1927 {
-
1928 reason = "Server is shutting down";
-
1929 return false;
-
1930 }
-
1931
-
1932 if (getOPs().isNeedNetworkLedger())
-
1933 {
-
1934 reason = "Not synchronized with network yet";
-
1935 return false;
-
1936 }
-
1937
-
1938 if (getOPs().isAmendmentBlocked())
-
1939 {
-
1940 reason = "Server version too old";
-
1941 return false;
-
1942 }
-
1943
-
1944 if (getOPs().isUNLBlocked())
-
1945 {
-
1946 reason = "No valid validator list available";
-
1947 return false;
-
1948 }
-
1949
-
1950 if (getOPs().getOperatingMode() < OperatingMode::SYNCING)
-
1951 {
-
1952 reason = "Not synchronized with network";
-
1953 return false;
-
1954 }
-
1955
-
1956 if (!getLedgerMaster().isCaughtUp(reason))
-
1957 return false;
-
1958
-
1959 if (getFeeTrack().isLoadedLocal())
-
1960 {
-
1961 reason = "Too much load";
-
1962 return false;
-
1963 }
-
1964
-
1965 return true;
-
1966}
+
1927
+
1928bool
+
+
1929ApplicationImp::serverOkay(std::string& reason)
+
1930{
+
1931 if (!config().ELB_SUPPORT)
+
1932 return true;
+
1933
+
1934 if (isStopping())
+
1935 {
+
1936 reason = "Server is shutting down";
+
1937 return false;
+
1938 }
+
1939
+
1940 if (getOPs().isNeedNetworkLedger())
+
1941 {
+
1942 reason = "Not synchronized with network yet";
+
1943 return false;
+
1944 }
+
1945
+
1946 if (getOPs().isAmendmentBlocked())
+
1947 {
+
1948 reason = "Server version too old";
+
1949 return false;
+
1950 }
+
1951
+
1952 if (getOPs().isUNLBlocked())
+
1953 {
+
1954 reason = "No valid validator list available";
+
1955 return false;
+
1956 }
+
1957
+
1958 if (getOPs().getOperatingMode() < OperatingMode::SYNCING)
+
1959 {
+
1960 reason = "Not synchronized with network";
+
1961 return false;
+
1962 }
+
1963
+
1964 if (!getLedgerMaster().isCaughtUp(reason))
+
1965 return false;
+
1966
+
1967 if (getFeeTrack().isLoadedLocal())
+
1968 {
+
1969 reason = "Too much load";
+
1970 return false;
+
1971 }
+
1972
+
1973 return true;
+
1974}
-
1967
- -
-
1969ApplicationImp::journal(std::string const& name)
-
1970{
-
1971 return logs_->journal(name);
-
1972}
+
1975
+ +
+
1977ApplicationImp::journal(std::string const& name)
+
1978{
+
1979 return logs_->journal(name);
+
1980}
-
1973
-
1974void
-
-
1975ApplicationImp::setMaxDisallowedLedger()
-
1976{
-
1977 auto seq = getRelationalDatabase().getMaxLedgerSeq();
-
1978 if (seq)
-
1979 maxDisallowedLedger_ = *seq;
-
1980
-
1981 JLOG(m_journal.trace()) << "Max persisted ledger is " << maxDisallowedLedger_;
-
1982}
+
1981
+
1982void
+
+
1983ApplicationImp::setMaxDisallowedLedger()
+
1984{
+
1985 auto seq = getRelationalDatabase().getMaxLedgerSeq();
+
1986 if (seq)
+
1987 maxDisallowedLedger_ = *seq;
+
1988
+
1989 JLOG(m_journal.trace()) << "Max persisted ledger is " << maxDisallowedLedger_;
+
1990}
-
1983
-
1984//------------------------------------------------------------------------------
-
1985
-
-
1986Application::Application() : beast::PropertyStream::Source("app")
-
1987{
-
1988}
-
-
1989
-
1990//------------------------------------------------------------------------------
1991
- -
- -
1994{
-
1995 return std::make_unique<ApplicationImp>(std::move(config), std::move(logs), std::move(timeKeeper));
+
1992//------------------------------------------------------------------------------
+
1993
+
+
1994Application::Application() : beast::PropertyStream::Source("app")
+
1995{
1996}
1997
-
1998void
-
-
1999fixConfigPorts(Config& config, Endpoints const& endpoints)
-
2000{
-
2001 for (auto const& [name, ep] : endpoints)
-
2002 {
-
2003 if (!config.exists(name))
-
2004 continue;
-
2005
-
2006 auto& section = config[name];
-
2007 auto const optPort = section.get("port");
-
2008 if (optPort)
-
2009 {
-
2010 std::uint16_t const port = beast::lexicalCast<std::uint16_t>(*optPort);
-
2011 if (!port)
-
2012 section.set("port", std::to_string(ep.port()));
-
2013 }
-
2014 }
-
2015}
+
1998//------------------------------------------------------------------------------
+
1999
+ +
+ +
2002{
+
2003 return std::make_unique<ApplicationImp>(std::move(config), std::move(logs), std::move(timeKeeper));
+
2004}
-
2016
-
2017} // namespace xrpl
+
2005
+
2006void
+
+
2007fixConfigPorts(Config& config, Endpoints const& endpoints)
+
2008{
+
2009 for (auto const& [name, ep] : endpoints)
+
2010 {
+
2011 if (!config.exists(name))
+
2012 continue;
+
2013
+
2014 auto& section = config[name];
+
2015 auto const optPort = section.get("port");
+
2016 if (optPort)
+
2017 {
+
2018 std::uint16_t const port = beast::lexicalCast<std::uint16_t>(*optPort);
+
2019 if (!port)
+
2020 section.set("port", std::to_string(ep.port()));
+
2021 }
+
2022 }
+
2023}
+
+
2024
+
2025} // namespace xrpl
@@ -2295,153 +2305,154 @@ $(document).ready(function() { init_codefold(0); });
void cancel()
Cancel all pending i/o.
The amendment table stores the list of enabled and potential amendments.
- - - -
beast::io_latency_probe< std::chrono::steady_clock > m_probe
-
void operator()(Duration const &elapsed)
-
std::atomic< std::chrono::milliseconds > lastSample_
-
io_latency_sampler(beast::insight::Event ev, beast::Journal journal, std::chrono::milliseconds interval, boost::asio::io_context &ios)
-
std::chrono::milliseconds get() const
- - - - -
LedgerReplayer & getLedgerReplayer() override
-
Application::MutexType & getMasterMutex() override
-
std::optional< std::pair< PublicKey, SecretKey > > nodeIdentity_
-
InboundLedgers & getInboundLedgers() override
- -
std::unique_ptr< LedgerCleaner > ledgerCleaner_
-
std::unique_ptr< LoadManager > m_loadManager
-
void start(bool withTimers) override
-
LoadFeeTrack & getFeeTrack() override
-
Cluster & cluster() override
-
std::unique_ptr< perf::PerfLog > perfLog_
-
std::unique_ptr< HashRouter > hashRouter_
-
std::optional< OpenLedger > openLedger_
-
RCLValidations & getValidations() override
-
void run() override
-
OpenLedger & openLedger() override
-
Resource::Manager & getResourceManager() override
-
NodeStoreScheduler m_nodeStoreScheduler
-
ClosureCounter< void, boost::system::error_code const & > waitHandlerCounter_
-
beast::Journal m_journal
-
RelationalDatabase & getRelationalDatabase() override
-
TransactionMaster & getMasterTransaction() override
-
std::chrono::milliseconds getIOLatency() override
-
std::unique_ptr< CollectorManager > m_collectorManager
-
boost::asio::io_context & getIOContext() override
-
std::optional< PublicKey const > getValidationPublicKey() const override
-
HashRouter & getHashRouter() override
-
LoadManager & getLoadManager() override
- -
PendingSaves pendingSaves_
-
std::unique_ptr< RelationalDatabase > mRelationalDatabase
-
std::atomic< bool > checkSigs_
-
bool checkSigs() const override
-
bool serverOkay(std::string &reason) override
-
std::unique_ptr< SHAMapStore > m_shaMapStore
-
Application::MutexType m_masterMutex
-
InboundTransactions & getInboundTransactions() override
-
io_latency_sampler m_io_latency_sampler
-
std::unique_ptr< AmendmentTable > m_amendmentTable
-
std::unique_ptr< InboundTransactions > m_inboundTransactions
-
SHAMapStore & getSHAMapStore() override
-
boost::asio::steady_timer sweepTimer_
-
std::unique_ptr< NodeStore::Database > m_nodeStore
-
std::unique_ptr< LoadFeeTrack > mFeeTrack
-
boost::asio::steady_timer entropyTimer_
-
std::unique_ptr< Overlay > overlay_
-
bool setup(boost::program_options::variables_map const &cmdline) override
- -
Overlay & overlay() override
-
std::unique_ptr< Config > config_
-
ManifestCache & publisherManifests() override
-
std::unique_ptr< ManifestCache > validatorManifests_
-
CollectorManager & getCollectorManager() override
-
std::optional< uint256 > trapTxID_
-
std::unique_ptr< ResolverAsio > m_resolver
-
NetworkOPs & getOPs() override
-
TimeKeeper & timeKeeper() override
-
std::unique_ptr< ValidatorList > validators_
-
std::unique_ptr< TxQ > txQ_
- -
static std::size_t numberOfThreads(Config const &config)
-
OpenLedger const & openLedger() const override
- - -
std::unique_ptr< ManifestCache > publisherManifests_
-
LedgerIndex getMaxDisallowedLedger() override
Ensure that a newly-started validator does not sign proposals older than the last ledger it persisted...
-
NodeCache & getTempNodeCache() override
-
Logs & logs() override
-
OrderBookDB m_orderBookDB
-
ValidatorList & validators() override
-
PeerReservationTable & peerReservations() override
-
ApplicationImp(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
-
std::unique_ptr< PeerReservationTable > peerReservations_
-
std::unique_ptr< Resource::Manager > m_resourceManager
-
std::pair< PublicKey, SecretKey > const & nodeIdentity() override
-
std::unique_ptr< Logs > logs_
-
std::unique_ptr< DatabaseCon > mWalletDB
-
CachedSLEs & cachedSLEs() override
-
ValidatorSite & validatorSites() override
-
virtual std::optional< uint256 > const & trapTxID() const override
-
std::atomic_flag isTimeToStop
-
std::unique_ptr< LedgerMaster > m_ledgerMaster
-
std::unique_ptr< GRPCServer > grpcServer_
-
std::unique_ptr< ServerHandler > serverHandler_
-
ValidatorKeys const validatorKeys_
-
std::uint64_t instanceID() const override
Returns a 64-bit instance identifier, generated at startup.
-
OrderBookDB & getOrderBookDB() override
-
Family & getNodeFamily() override
-
void gotTXSet(std::shared_ptr< SHAMap > const &set, bool fromAcquire)
-
Config & config() override
- -
DatabaseCon & getWalletDB() override
Retrieve the "wallet database".
-
PathRequests & getPathRequests() override
-
bool isStopping() const override
-
std::unique_ptr< TimeKeeper > timeKeeper_
-
beast::Journal journal(std::string const &name) override
-
std::unique_ptr< ValidatorSite > validatorSites_
-
RCLValidations mValidations
-
void signalStop(std::string msg) override
-
std::uint64_t const instanceCookie_
-
LedgerCleaner & getLedgerCleaner() override
-
ManifestCache & validatorManifests() override
-
AmendmentTable & getAmendmentTable() override
-
int fdRequired() const override
-
TaggedCache< uint256, AcceptedLedger > m_acceptedLedgerCache
-
std::unique_ptr< PathRequests > m_pathRequests
-
std::unique_ptr< JobQueue > m_jobQueue
-
LedgerMaster & getLedgerMaster() override
-
NodeStore::Database & getNodeStore() override
- -
TransactionMaster m_txMaster
-
std::unique_ptr< Cluster > cluster_
-
std::unique_ptr< NetworkOPs > m_networkOPs
-
virtual ServerHandler & getServerHandler() override
-
JobQueue & getJobQueue() override
-
PendingSaves & pendingSaves() override
-
void onWrite(beast::PropertyStream::Map &stream) override
Subclass override.
-
std::unique_ptr< InboundLedgers > m_inboundLedgers
-
TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache() override
-
perf::PerfLog & getPerfLog() override
-
TxQ & getTxQ() override
-
boost::asio::signal_set m_signals
-
std::unique_ptr< LedgerReplayer > m_ledgerReplayer
+ + + +
beast::io_latency_probe< std::chrono::steady_clock > m_probe
+
void operator()(Duration const &elapsed)
+
std::atomic< std::chrono::milliseconds > lastSample_
+
io_latency_sampler(beast::insight::Event ev, beast::Journal journal, std::chrono::milliseconds interval, boost::asio::io_context &ios)
+
std::chrono::milliseconds get() const
+ + + + +
LedgerReplayer & getLedgerReplayer() override
+
Application::MutexType & getMasterMutex() override
+
std::optional< std::pair< PublicKey, SecretKey > > nodeIdentity_
+
InboundLedgers & getInboundLedgers() override
+ +
std::unique_ptr< LedgerCleaner > ledgerCleaner_
+
std::unique_ptr< LoadManager > m_loadManager
+
void start(bool withTimers) override
+
LoadFeeTrack & getFeeTrack() override
+
Cluster & cluster() override
+
std::unique_ptr< perf::PerfLog > perfLog_
+
std::unique_ptr< HashRouter > hashRouter_
+
std::optional< OpenLedger > openLedger_
+
RCLValidations & getValidations() override
+
void run() override
+
OpenLedger & openLedger() override
+
Resource::Manager & getResourceManager() override
+
NodeStoreScheduler m_nodeStoreScheduler
+
ClosureCounter< void, boost::system::error_code const & > waitHandlerCounter_
+
beast::Journal m_journal
+
RelationalDatabase & getRelationalDatabase() override
+
TransactionMaster & getMasterTransaction() override
+
std::chrono::milliseconds getIOLatency() override
+
std::unique_ptr< CollectorManager > m_collectorManager
+
boost::asio::io_context & getIOContext() override
+
std::optional< PublicKey const > getValidationPublicKey() const override
+
HashRouter & getHashRouter() override
+
LoadManager & getLoadManager() override
+ +
PendingSaves pendingSaves_
+
std::unique_ptr< RelationalDatabase > mRelationalDatabase
+
std::atomic< bool > checkSigs_
+
bool checkSigs() const override
+
bool serverOkay(std::string &reason) override
+
std::unique_ptr< SHAMapStore > m_shaMapStore
+
Application::MutexType m_masterMutex
+
InboundTransactions & getInboundTransactions() override
+
io_latency_sampler m_io_latency_sampler
+
std::unique_ptr< AmendmentTable > m_amendmentTable
+
std::unique_ptr< InboundTransactions > m_inboundTransactions
+
SHAMapStore & getSHAMapStore() override
+
boost::asio::steady_timer sweepTimer_
+
std::unique_ptr< NodeStore::Database > m_nodeStore
+
std::unique_ptr< LoadFeeTrack > mFeeTrack
+
boost::asio::steady_timer entropyTimer_
+
std::unique_ptr< Overlay > overlay_
+
bool setup(boost::program_options::variables_map const &cmdline) override
+ +
Overlay & overlay() override
+
std::unique_ptr< Config > config_
+
ManifestCache & publisherManifests() override
+
std::unique_ptr< ManifestCache > validatorManifests_
+
CollectorManager & getCollectorManager() override
+
std::optional< uint256 > trapTxID_
+
std::unique_ptr< ResolverAsio > m_resolver
+
NetworkOPs & getOPs() override
+
TimeKeeper & timeKeeper() override
+
std::unique_ptr< ValidatorList > validators_
+
std::unique_ptr< TxQ > txQ_
+ +
static std::size_t numberOfThreads(Config const &config)
+
OpenLedger const & openLedger() const override
+ + +
std::unique_ptr< ManifestCache > publisherManifests_
+
LedgerIndex getMaxDisallowedLedger() override
Ensure that a newly-started validator does not sign proposals older than the last ledger it persisted...
+
NodeCache & getTempNodeCache() override
+
Application & app() override
+
Logs & logs() override
+
OrderBookDB m_orderBookDB
+
ValidatorList & validators() override
+
PeerReservationTable & peerReservations() override
+
ApplicationImp(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
+
std::unique_ptr< PeerReservationTable > peerReservations_
+
std::unique_ptr< Resource::Manager > m_resourceManager
+
std::pair< PublicKey, SecretKey > const & nodeIdentity() override
+
std::unique_ptr< Logs > logs_
+
std::unique_ptr< DatabaseCon > mWalletDB
+
CachedSLEs & cachedSLEs() override
+
ValidatorSite & validatorSites() override
+
virtual std::optional< uint256 > const & trapTxID() const override
+
std::atomic_flag isTimeToStop
+
std::unique_ptr< LedgerMaster > m_ledgerMaster
+
std::unique_ptr< GRPCServer > grpcServer_
+
std::unique_ptr< ServerHandler > serverHandler_
+
ValidatorKeys const validatorKeys_
+
std::uint64_t instanceID() const override
Returns a 64-bit instance identifier, generated at startup.
+
OrderBookDB & getOrderBookDB() override
+
Family & getNodeFamily() override
+
void gotTXSet(std::shared_ptr< SHAMap > const &set, bool fromAcquire)
+
Config & config() override
+ +
DatabaseCon & getWalletDB() override
Retrieve the "wallet database".
+
PathRequests & getPathRequests() override
+
bool isStopping() const override
+
std::unique_ptr< TimeKeeper > timeKeeper_
+
beast::Journal journal(std::string const &name) override
+
std::unique_ptr< ValidatorSite > validatorSites_
+
RCLValidations mValidations
+
void signalStop(std::string msg) override
+
std::uint64_t const instanceCookie_
+
LedgerCleaner & getLedgerCleaner() override
+
ManifestCache & validatorManifests() override
+
AmendmentTable & getAmendmentTable() override
+
int fdRequired() const override
+
TaggedCache< uint256, AcceptedLedger > m_acceptedLedgerCache
+
std::unique_ptr< PathRequests > m_pathRequests
+
std::unique_ptr< JobQueue > m_jobQueue
+
LedgerMaster & getLedgerMaster() override
+
NodeStore::Database & getNodeStore() override
+ +
TransactionMaster m_txMaster
+
std::unique_ptr< Cluster > cluster_
+
std::unique_ptr< NetworkOPs > m_networkOPs
+
virtual ServerHandler & getServerHandler() override
+
JobQueue & getJobQueue() override
+
PendingSaves & pendingSaves() override
+
void onWrite(beast::PropertyStream::Map &stream) override
Subclass override.
+
std::unique_ptr< InboundLedgers > m_inboundLedgers
+
TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache() override
+
perf::PerfLog & getPerfLog() override
+
TxQ & getTxQ() override
+
boost::asio::signal_set m_signals
+
std::unique_ptr< LedgerReplayer > m_ledgerReplayer
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
The role of a ClosureCounter is to assist in shutdown by letting callers wait for the completion of c...
Provides the beast::insight::Collector service.
- -
bool standalone() const
Definition Config.h:311
-
bool FORCE_MULTI_THREAD
Definition Config.h:219
-
std::size_t NODE_SIZE
Definition Config.h:193
-
int IO_WORKERS
Definition Config.h:215
-
int WORKERS
Definition Config.h:214
- + +
bool standalone() const
Definition Config.h:312
+
bool FORCE_MULTI_THREAD
Definition Config.h:220
+
std::size_t NODE_SIZE
Definition Config.h:194
+
int IO_WORKERS
Definition Config.h:216
+
int WORKERS
Definition Config.h:215
+
Routing table for objects identified by hash.
Definition HashRouter.h:77
Manages the lifetime of inbound ledgers.
@@ -2471,7 +2482,7 @@ $(document).ready(function() { init_codefold(0); });
Keeps track of which ledgers haven't been fully saved.
A public key.
Definition PublicKey.h:42
-
static std::unique_ptr< RelationalDatabase > init(Application &app, Config const &config, JobQueue &jobQueue)
init Creates and returns an appropriate RelationalDatabase instance based on configuration.
+
static std::unique_ptr< RelationalDatabase > init(ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
init Creates and returns an appropriate RelationalDatabase instance based on configuration.
static std::unique_ptr< ResolverAsio > New(boost::asio::io_context &, beast::Journal)
A consumption charge.
Definition Charge.h:10
An endpoint that consumes resources.
Definition Consumer.h:16
@@ -2523,16 +2534,16 @@ $(document).ready(function() { init_codefold(0); });
STL namespace.
std::unique_ptr< Manager > make_Manager(beast::insight::Collector::ptr const &collector, beast::Journal journal)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition Ledger.cpp:1038
-
std::pair< PublicKey, SecretKey > getNodeIdentity(Application &app, boost::program_options::variables_map const &cmdline)
The cryptographic credentials identifying this server instance.
+
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition Ledger.cpp:1037
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
csprng_engine & crypto_prng()
The default cryptographically secure PRNG.
std::unique_ptr< LedgerCleaner > make_LedgerCleaner(Application &app, beast::Journal journal)
std::unique_ptr< LoadManager > make_LoadManager(Application &app, beast::Journal journal)
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Definition chrono.h:93
TxQ::Setup setup_TxQ(Config const &config)
Build a TxQ::Setup object from application configuration.
Definition TxQ.cpp:1733
-
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Application &app)
Definition Ledger.cpp:1017
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
+
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Application &app)
Definition Ledger.cpp:1016
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
+
std::pair< PublicKey, SecretKey > getNodeIdentity(soci::session &session)
Returns a stable public and private key for this node.
Definition Wallet.cpp:102
std::unique_ptr< NetworkOPs > make_NetworkOPs(Application &app, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool startvalid, JobQueue &job_queue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_context &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
std::enable_if_t< std::is_integral< Integral >::value, Integral > rand_int()
std::unique_ptr< SHAMapStore > make_SHAMapStore(Application &app, NodeStore::Scheduler &scheduler, beast::Journal journal)
@@ -2542,16 +2553,16 @@ $(document).ready(function() { init_codefold(0); }); -
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
+
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
ServerHandler::Setup setup_ServerHandler(Config const &config, std::ostream &&log)
-
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1026
+
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1025
std::unique_ptr< CollectorManager > make_CollectorManager(Section const &params, beast::Journal journal)
-
std::unique_ptr< DatabaseCon > makeWalletDB(DatabaseCon::Setup const &setup, beast::Journal j)
makeWalletDB Opens the wallet database and returns it.
Definition Wallet.cpp:8
std::unique_ptr< InboundLedgers > make_InboundLedgers(Application &app, InboundLedgers::clock_type &clock, beast::insight::Collector::ptr const &collector)
std::unique_ptr< ServerHandler > make_ServerHandler(Application &app, boost::asio::io_context &io_context, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
constexpr auto megabytes(T value) noexcept
-
static void fixConfigPorts(Config &config, Endpoints const &endpoints)
-
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
+
static void fixConfigPorts(Config &config, Endpoints const &endpoints)
+
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition Config.cpp:1043
+
std::unique_ptr< DatabaseCon > makeWalletDB(DatabaseCon::Setup const &setup, beast::Journal j)
makeWalletDB Opens the wallet database and returns it.
Definition Wallet.cpp:9
void initAccountIdCache(std::size_t count)
Initialize the global cache used to map AccountID to base58 conversions.
Definition AccountID.cpp:85
std::unique_ptr< InboundTransactions > make_InboundTransactions(Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
void addJson(Json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a Json::Value with a description of the ledger.
diff --git a/Application_8h_source.html b/Application_8h_source.html index a4b9006b21..622ddb5720 100644 --- a/Application_8h_source.html +++ b/Application_8h_source.html @@ -84,10 +84,10 @@ $(document).ready(function() { init_codefold(0); });
1#pragma once
2
3#include <xrpld/core/Config.h>
-
4#include <xrpld/overlay/PeerReservationTable.h>
-
5
-
6#include <xrpl/basics/TaggedCache.h>
-
7#include <xrpl/beast/utility/PropertyStream.h>
+
4
+
5#include <xrpl/basics/TaggedCache.h>
+
6#include <xrpl/beast/utility/PropertyStream.h>
+
7#include <xrpl/core/PeerReservationTable.h>
8#include <xrpl/core/ServiceRegistry.h>
9#include <xrpl/protocol/Protocol.h>
10#include <xrpl/shamap/TreeNodeCache.h>
@@ -198,77 +198,63 @@ $(document).ready(function() { init_codefold(0); });
112public:
113 Application();
114
-
115 virtual ~Application() = default;
-
116
-
117 virtual bool
-
118 setup(boost::program_options::variables_map const& options) = 0;
-
119
+
115 virtual bool
+
116 setup(boost::program_options::variables_map const& options) = 0;
+
117
+
118 virtual void
+
119 start(bool withTimers) = 0;
120 virtual void
-
121 start(bool withTimers) = 0;
+
121 run() = 0;
122 virtual void
-
123 run() = 0;
-
124 virtual void
- -
126 virtual bool
-
127 checkSigs() const = 0;
-
128 virtual void
-
129 checkSigs(bool) = 0;
-
130 virtual bool
-
131 isStopping() const = 0;
+ +
124 virtual bool
+
125 checkSigs() const = 0;
+
126 virtual void
+
127 checkSigs(bool) = 0;
+
128
+
129 //
+
130 // ---
+
131 //
132
-
133 //
-
134 // ---
-
135 //
+
134 virtual std::uint64_t
+
135 instanceID() const = 0;
136
-
138 virtual std::uint64_t
-
139 instanceID() const = 0;
-
140
-
141 virtual Logs&
-
142 logs() = 0;
-
143 virtual Config&
-
144 config() = 0;
+
137 virtual Config&
+
138 config() = 0;
+
139
+ + +
142
+ +
145
-
146 virtual boost::asio::io_context&
- + +
148
- - +
149 virtual bool
+
151
- - -
154
- - -
157
-
158 virtual bool
- -
160
-
161 virtual beast::Journal
- -
163
-
164 /* Returns the number of file descriptors the application needs */
-
165 virtual int
-
166 fdRequired() const = 0;
-
167
-
169 virtual DatabaseCon&
- -
171
-
174 virtual LedgerIndex
- -
176
-
177 virtual std::optional<uint256> const&
-
178 trapTxID() const = 0;
-
179};
+
152 /* Returns the number of file descriptors the application needs */
+
153 virtual int
+
154 fdRequired() const = 0;
+
155
+
157 virtual DatabaseCon&
+ +
159
+
162 virtual LedgerIndex
+ +
164
+
165 virtual std::optional<uint256> const&
+
166 trapTxID() const = 0;
+
167};
-
180
- - -
183
-
184} // namespace xrpl
+
168
+ + +
171
+
172} // namespace xrpl
-
A generic endpoint for log messages.
Definition Journal.h:40
Subclasses can be called to write to a stream and have children.
-
std::string const & name() const
Returns the name of this source.
virtual bool setup(boost::program_options::variables_map const &options)=0
virtual std::chrono::milliseconds getIOLatency()=0
@@ -278,35 +264,29 @@ $(document).ready(function() { init_codefold(0); });
virtual bool checkSigs() const =0
virtual int fdRequired() const =0
virtual LedgerIndex getMaxDisallowedLedger()=0
Ensure that a newly-started validator does not sign proposals older than the last ledger it persisted...
-
virtual beast::Journal journal(std::string const &name)=0
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
virtual void run()=0
virtual std::optional< uint256 > const & trapTxID() const =0
- +
virtual std::optional< PublicKey const > getValidationPublicKey() const =0
-
virtual boost::asio::io_context & getIOContext()=0
-
virtual ~Application()=default
virtual bool serverOkay(std::string &reason)=0
-
virtual Logs & logs()=0
virtual void checkSigs(bool)=0
virtual MutexType & getMasterMutex()=0
virtual void start(bool withTimers)=0
virtual std::pair< PublicKey, SecretKey > const & nodeIdentity()=0
-
virtual bool isStopping() const =0
- - -
Manages partitions for logging.
Definition Log.h:32
-
Service registry for dependency injection.
+ + +
Service registry for dependency injection.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
TaggedCache< uint256, SLE const > CachedSLEs
Definition CachedSLEs.h:8
-
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
+
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
STLedgerEntry SLE
-
TaggedCache< SHAMapHash, Blob > NodeCache
-
Validations< RCLValidationsAdaptor > RCLValidations
Alias for RCL-specific instantiation of generic Validations.
+
TaggedCache< SHAMapHash, Blob > NodeCache
+
Validations< RCLValidationsAdaptor > RCLValidations
Alias for RCL-specific instantiation of generic Validations.
diff --git a/BaseWSPeer_8h_source.html b/BaseWSPeer_8h_source.html index c9670c8f5e..8ce41dddc0 100644 --- a/BaseWSPeer_8h_source.html +++ b/BaseWSPeer_8h_source.html @@ -310,7 +310,7 @@ $(document).ready(function() { init_codefold(0); });
198 {
199 cr_.code = safe_cast<decltype(cr_.code)>(boost::beast::websocket::close_code::policy_error);
200 cr_.reason = "Policy error: client is too slow.";
-
201 JLOG(this->j_.info()) << cr_.reason;
+
201 JLOG(this->j_.info()) << cr_.reason;
202 wq_.erase(std::next(wq_.begin()), wq_.end());
203 close(cr_);
204 return;
@@ -537,11 +537,11 @@ $(document).ready(function() { init_codefold(0); });
397 if (payload == p)
398 {
399 close_on_timer_ = false;
-
400 JLOG(this->j_.trace()) << "got matching pong";
+
400 JLOG(this->j_.trace()) << "got matching pong";
401 }
402 else
403 {
-
404 JLOG(this->j_.trace()) << "got pong";
+
404 JLOG(this->j_.trace()) << "got pong";
405 }
406 }
407}
@@ -567,7 +567,7 @@ $(document).ready(function() { init_codefold(0); });
425 payload_,
426 bind_executor(
427 strand_, std::bind(&BaseWSPeer::on_ping, impl().shared_from_this(), std::placeholders::_1)));
-
428 JLOG(this->j_.trace()) << "sent ping";
+
428 JLOG(this->j_.trace()) << "sent ping";
429 return;
430 }
431 ec = boost::system::errc::make_error_code(boost::system::errc::timed_out);
@@ -587,7 +587,7 @@ $(document).ready(function() { init_codefold(0); });
444 if (!ec_ && ec != boost::asio::error::operation_aborted)
445 {
446 ec_ = ec;
-
447 JLOG(this->j_.trace()) << what << ": " << ec.message();
+
447 JLOG(this->j_.trace()) << what << ": " << ec.message();
448 xrpl::get_lowest_layer(impl().ws_).socket().close(ec);
449 }
450}
@@ -616,6 +616,8 @@ $(document).ready(function() { init_codefold(0); });
T back_inserter(T... args)
T bind(T... args)
A generic endpoint for log messages.
Definition Journal.h:40
+
Stream info() const
Definition Journal.h:306
+
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
boost::asio::strand< boost::asio::executor > strand_
Definition BasePeer.h:34
Port const & port_
Definition BasePeer.h:27
diff --git a/BookStep_8cpp_source.html b/BookStep_8cpp_source.html index 30646f84da..3517801809 100644 --- a/BookStep_8cpp_source.html +++ b/BookStep_8cpp_source.html @@ -1145,7 +1145,7 @@ $(document).ready(function() { init_codefold(0); });
966 case -1: {
967 // something went very wrong
968 // LCOV_EXCL_START
-
969 JLOG(j_.error()) << "BookStep remainingOut < 0 " << to_string(remainingOut);
+
969 JLOG(j_.error()) << "BookStep remainingOut < 0 " << to_string(remainingOut);
970 UNREACHABLE("xrpl::BookStep::revImp : remaining less than zero");
971 cache_.emplace(beast::zero, beast::zero);
972 return {beast::zero, beast::zero};
@@ -1296,7 +1296,7 @@ $(document).ready(function() { init_codefold(0); });
1115 case -1: {
1116 // LCOV_EXCL_START
1117 // something went very wrong
-
1118 JLOG(j_.error()) << "BookStep remainingIn < 0 " << to_string(remainingIn);
+
1118 JLOG(j_.error()) << "BookStep remainingIn < 0 " << to_string(remainingIn);
1119 UNREACHABLE("xrpl::BookStep::fwdImp : remaining less than zero");
1120 cache_.emplace(beast::zero, beast::zero);
1121 return {beast::zero, beast::zero};
@@ -1321,7 +1321,7 @@ $(document).ready(function() { init_codefold(0); });
1138{
1139 if (!cache_)
1140 {
-
1141 JLOG(j_.trace()) << "Expected valid cache in validFwd";
+
1141 JLOG(j_.trace()) << "Expected valid cache in validFwd";
1142 return {false, EitherAmount(TOut(beast::zero))};
1143 }
1144
@@ -1339,7 +1339,7 @@ $(document).ready(function() { init_codefold(0); });
1156
1157 if (!(checkNear(savCache.in, cache_->in) && checkNear(savCache.out, cache_->out)))
1158 {
-
1159 JLOG(j_.warn()) << "Strand re-execute check failed."
+
1159 JLOG(j_.warn()) << "Strand re-execute check failed."
1160 << " ExpectedIn: " << to_string(savCache.in) << " CachedIn: " << to_string(cache_->in)
1161 << " ExpectedOut: " << to_string(savCache.out) << " CachedOut: " << to_string(cache_->out);
1162 return {false, EitherAmount(cache_->out)};
@@ -1355,12 +1355,12 @@ $(document).ready(function() { init_codefold(0); });
1170{
1171 if (book_.in == book_.out)
1172 {
-
1173 JLOG(j_.debug()) << "BookStep: Book with same in and out issuer " << *this;
+
1173 JLOG(j_.debug()) << "BookStep: Book with same in and out issuer " << *this;
1174 return temBAD_PATH;
1175 }
1176 if (!isConsistent(book_.in) || !isConsistent(book_.out))
1177 {
-
1178 JLOG(j_.debug()) << "Book: currency is inconsistent with issuer." << *this;
+
1178 JLOG(j_.debug()) << "Book: currency is inconsistent with issuer." << *this;
1179 return temBAD_PATH;
1180 }
1181
@@ -1368,13 +1368,13 @@ $(document).ready(function() { init_codefold(0); });
1183 // one step to unfund offers in another step.
1184 if (!ctx.seenBookOuts.insert(book_.out).second || ctx.seenDirectIssues[0].count(book_.out))
1185 {
-
1186 JLOG(j_.debug()) << "BookStep: loop detected: " << *this;
+
1186 JLOG(j_.debug()) << "BookStep: loop detected: " << *this;
1187 return temBAD_PATH_LOOP;
1188 }
1189
1190 if (ctx.seenDirectIssues[1].count(book_.out))
1191 {
-
1192 JLOG(j_.debug()) << "BookStep: loop detected: " << *this;
+
1192 JLOG(j_.debug()) << "BookStep: loop detected: " << *this;
1193 return temBAD_PATH_LOOP;
1194 }
1195
@@ -1384,7 +1384,7 @@ $(document).ready(function() { init_codefold(0); });
1199
1200 if (!issuerExists(ctx.view, book_.in) || !issuerExists(ctx.view, book_.out))
1201 {
-
1202 JLOG(j_.debug()) << "BookStep: deleted issuer detected: " << *this;
+
1202 JLOG(j_.debug()) << "BookStep: deleted issuer detected: " << *this;
1203 return tecNO_ISSUER;
1204 }
1205
@@ -1518,6 +1518,10 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
+
Stream error() const
Definition Journal.h:318
+
Stream debug() const
Definition Journal.h:300
+
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
+
Stream warn() const
Definition Journal.h:312
AccountID account() const
Definition AMMContext.h:81
Represents synthetic AMM offer in BookStep.
Definition AMMOffer.h:20
Quality quality() const noexcept
Definition AMMOffer.h:49
diff --git a/CancelCheck_8cpp_source.html b/CancelCheck_8cpp_source.html index b70caef2b0..67b1d748c8 100644 --- a/CancelCheck_8cpp_source.html +++ b/CancelCheck_8cpp_source.html @@ -144,7 +144,7 @@ $(document).ready(function() { init_codefold(0); });
56 if (!sleCheck)
57 {
58 // Error should have been caught in preclaim.
-
59 JLOG(j_.warn()) << "Check does not exist.";
+
59 JLOG(j_.warn()) << "Check does not exist.";
60 return tecNO_ENTRY;
61 }
62
@@ -160,7 +160,7 @@ $(document).ready(function() { init_codefold(0); });
72 if (!view().dirRemove(keylet::ownerDir(dstId), page, sleCheck->key(), true))
73 {
74 // LCOV_EXCL_START
-
75 JLOG(j_.fatal()) << "Unable to delete check from destination.";
+
75 JLOG(j_.fatal()) << "Unable to delete check from destination.";
76 return tefBAD_LEDGER;
77 // LCOV_EXCL_STOP
78 }
@@ -170,7 +170,7 @@ $(document).ready(function() { init_codefold(0); });
82 if (!view().dirRemove(keylet::ownerDir(srcId), page, sleCheck->key(), true))
83 {
84 // LCOV_EXCL_START
-
85 JLOG(j_.fatal()) << "Unable to delete check from owner.";
+
85 JLOG(j_.fatal()) << "Unable to delete check from owner.";
86 return tefBAD_LEDGER;
87 // LCOV_EXCL_STOP
88 }
@@ -187,6 +187,7 @@ $(document).ready(function() { init_codefold(0); });
99
100} // namespace xrpl
+
Stream fatal() const
Definition Journal.h:324
Stream warn() const
Definition Journal.h:312
static NotTEC preflight(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
diff --git a/CancelOffer_8cpp_source.html b/CancelOffer_8cpp_source.html index 639d45f522..61347478e9 100644 --- a/CancelOffer_8cpp_source.html +++ b/CancelOffer_8cpp_source.html @@ -142,7 +142,7 @@ $(document).ready(function() { init_codefold(0); });
54 if (auto sleOffer = view().peek(keylet::offer(account_, offerSequence)))
55 {
56 JLOG(j_.debug()) << "Trying to cancel offer #" << offerSequence;
-
57 return offerDelete(view(), sleOffer, ctx_.app.journal("View"));
+
57 return offerDelete(view(), sleOffer, ctx_.app.journal("View"));
58 }
59
60 JLOG(j_.debug()) << "Offer #" << offerSequence << " can't be found.";
@@ -153,13 +153,13 @@ $(document).ready(function() { init_codefold(0); });
64} // namespace xrpl
Stream debug() const
Definition Journal.h:300
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
-
virtual beast::Journal journal(std::string const &name)=0
STTx const & tx
Application & app
static TER preclaim(PreclaimContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
TER doApply() override
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
+
virtual beast::Journal journal(std::string const &name)=0
AccountID const account_
Definition Transactor.h:112
beast::Journal const j_
Definition Transactor.h:110
diff --git a/CashCheck_8cpp_source.html b/CashCheck_8cpp_source.html index 831ced49bd..6ed2190cb8 100644 --- a/CashCheck_8cpp_source.html +++ b/CashCheck_8cpp_source.html @@ -316,7 +316,7 @@ $(document).ready(function() { init_codefold(0); });
228 //
229 // If it is not a check to self (as should be the case), then there's
230 // work to do...
-
231 auto viewJ = ctx_.app.journal("View");
+
231 auto viewJ = ctx_.app.journal("View");
232 auto const optDeliverMin = ctx_.tx[~sfDeliverMin];
233
234 if (srcId != account_)
@@ -533,7 +533,6 @@ $(document).ready(function() { init_codefold(0); });
Stream error() const
Definition Journal.h:318
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
Stream warn() const
Definition Journal.h:312
-
virtual beast::Journal journal(std::string const &name)=0
STTx const & tx
void deliver(STAmount const &amount)
Sets the DeliveredAmount field in the metadata.
beast::Journal const journal
@@ -559,6 +558,7 @@ $(document).ready(function() { init_codefold(0); });
STAmount const & getFieldAmount(SField const &field) const
Definition STObject.cpp:632
+
virtual beast::Journal journal(std::string const &name)=0
AccountID const account_
Definition Transactor.h:112
beast::Journal const j_
Definition Transactor.h:110
diff --git a/Change_8cpp_source.html b/Change_8cpp_source.html index 02f14c59cc..3ee6757999 100644 --- a/Change_8cpp_source.html +++ b/Change_8cpp_source.html @@ -533,7 +533,7 @@ $(document).ready(function() { init_codefold(0); });
Keylet const & fees() noexcept
The (fixed) index of the object containing the ledger fees.
Definition Indexes.cpp:194
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
-
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition Ledger.cpp:891
+
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition Ledger.cpp:890
std::string strHex(FwdIt begin, FwdIt end)
Definition strHex.h:10
constexpr std::uint32_t tfChangeMask
Definition TxFlags.h:110
@ tefALREADY
Definition TER.h:147
diff --git a/ClosureCounter__test_8cpp_source.html b/ClosureCounter__test_8cpp_source.html index c1016756f1..3241de1b43 100644 --- a/ClosureCounter__test_8cpp_source.html +++ b/ClosureCounter__test_8cpp_source.html @@ -101,7 +101,7 @@ $(document).ready(function() { init_codefold(0); });
17 // We're only using Env for its Journal. That Journal gives better
18 // coverage in unit tests.
-
20 beast::Journal j{env_.app().journal("ClosureCounter_test")};
+
20 beast::Journal j{env_.app().journal("ClosureCounter_test")};
21
22 void
@@ -425,12 +425,12 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
A testsuite class.
Definition suite.h:51
-
virtual beast::Journal journal(std::string const &name)=0
The role of a ClosureCounter is to assist in shutdown by letting callers wait for the completion of c...
bool joined() const
Returns true if this has been joined.
std::optional< Substitute< Closure > > wrap(Closure &&closure)
Wrap the passed closure with a reference counter.
int count() const
Current number of Closures outstanding.
void join(char const *name, std::chrono::milliseconds wait, beast::Journal j)
Returns once all counted in-flight closures are destroyed.
+
virtual beast::Journal journal(std::string const &name)=0
friend TrackedString operator+(TrackedString const &s, char const *rhs)
diff --git a/Config_8cpp_source.html b/Config_8cpp_source.html index 74e6faafc1..76df50a890 100644 --- a/Config_8cpp_source.html +++ b/Config_8cpp_source.html @@ -1146,7 +1146,155 @@ $(document).ready(function() { init_codefold(0); });
1040}
1041
-
1042} // namespace xrpl
+
1042DatabaseCon::Setup
+
+ +
1044{
+
1045 DatabaseCon::Setup setup;
+
1046
+
1047 setup.startUp = c.START_UP;
+
1048 setup.standAlone = c.standalone();
+
1049 setup.dataDir = c.legacy("database_path");
+
1050 if (!setup.standAlone && setup.dataDir.empty())
+
1051 {
+
1052 Throw<std::runtime_error>("database_path must be set.");
+
1053 }
+
1054
+
1055 if (!setup.globalPragma)
+
1056 {
+
1057 auto const& sqlite = c.section("sqlite");
+ +
1059 result->reserve(3);
+
1060
+
1061 // defaults
+
1062 std::string safety_level;
+
1063 std::string journal_mode = "wal";
+
1064 std::string synchronous = "normal";
+
1065 std::string temp_store = "file";
+
1066 bool showRiskWarning = false;
+
1067
+
1068 if (set(safety_level, "safety_level", sqlite))
+
1069 {
+
1070 if (boost::iequals(safety_level, "low"))
+
1071 {
+
1072 // low safety defaults
+
1073 journal_mode = "memory";
+
1074 synchronous = "off";
+
1075 temp_store = "memory";
+
1076 showRiskWarning = true;
+
1077 }
+
1078 else if (!boost::iequals(safety_level, "high"))
+
1079 {
+
1080 Throw<std::runtime_error>("Invalid safety_level value: " + safety_level);
+
1081 }
+
1082 }
+
1083
+
1084 {
+
1085 // #journal_mode Valid values : delete, truncate, persist,
+
1086 // memory, wal, off
+
1087 if (set(journal_mode, "journal_mode", sqlite) && !safety_level.empty())
+
1088 {
+
1089 Throw<std::runtime_error>(
+
1090 "Configuration file may not define both "
+
1091 "\"safety_level\" and \"journal_mode\"");
+
1092 }
+
1093 bool higherRisk = boost::iequals(journal_mode, "memory") || boost::iequals(journal_mode, "off");
+
1094 showRiskWarning = showRiskWarning || higherRisk;
+
1095 if (higherRisk || boost::iequals(journal_mode, "delete") || boost::iequals(journal_mode, "truncate") ||
+
1096 boost::iequals(journal_mode, "persist") || boost::iequals(journal_mode, "wal"))
+
1097 {
+
1098 result->emplace_back(boost::str(boost::format(CommonDBPragmaJournal) % journal_mode));
+
1099 }
+
1100 else
+
1101 {
+
1102 Throw<std::runtime_error>("Invalid journal_mode value: " + journal_mode);
+
1103 }
+
1104 }
+
1105
+
1106 {
+
1107 // #synchronous Valid values : off, normal, full, extra
+
1108 if (set(synchronous, "synchronous", sqlite) && !safety_level.empty())
+
1109 {
+
1110 Throw<std::runtime_error>(
+
1111 "Configuration file may not define both "
+
1112 "\"safety_level\" and \"synchronous\"");
+
1113 }
+
1114 bool higherRisk = boost::iequals(synchronous, "off");
+
1115 showRiskWarning = showRiskWarning || higherRisk;
+
1116 if (higherRisk || boost::iequals(synchronous, "normal") || boost::iequals(synchronous, "full") ||
+
1117 boost::iequals(synchronous, "extra"))
+
1118 {
+
1119 result->emplace_back(boost::str(boost::format(CommonDBPragmaSync) % synchronous));
+
1120 }
+
1121 else
+
1122 {
+
1123 Throw<std::runtime_error>("Invalid synchronous value: " + synchronous);
+
1124 }
+
1125 }
+
1126
+
1127 {
+
1128 // #temp_store Valid values : default, file, memory
+
1129 if (set(temp_store, "temp_store", sqlite) && !safety_level.empty())
+
1130 {
+
1131 Throw<std::runtime_error>(
+
1132 "Configuration file may not define both "
+
1133 "\"safety_level\" and \"temp_store\"");
+
1134 }
+
1135 bool higherRisk = boost::iequals(temp_store, "memory");
+
1136 showRiskWarning = showRiskWarning || higherRisk;
+
1137 if (higherRisk || boost::iequals(temp_store, "default") || boost::iequals(temp_store, "file"))
+
1138 {
+
1139 result->emplace_back(boost::str(boost::format(CommonDBPragmaTemp) % temp_store));
+
1140 }
+
1141 else
+
1142 {
+
1143 Throw<std::runtime_error>("Invalid temp_store value: " + temp_store);
+
1144 }
+
1145 }
+
1146
+
1147 if (showRiskWarning && j && c.LEDGER_HISTORY > SQLITE_TUNING_CUTOFF)
+
1148 {
+
1149 JLOG(j->warn()) << "reducing the data integrity guarantees from the "
+
1150 "default [sqlite] behavior is not recommended for "
+
1151 "nodes storing large amounts of history, because of the "
+
1152 "difficulty inherent in rebuilding corrupted data.";
+
1153 }
+
1154 XRPL_ASSERT(result->size() == 3, "xrpl::setup_DatabaseCon::globalPragma : result size is 3");
+
1155 setup.globalPragma = std::move(result);
+
1156 }
+
1157 setup.useGlobalPragma = true;
+
1158
+
1159 auto setPragma = [](std::string& pragma, std::string const& key, int64_t value) {
+
1160 pragma = "PRAGMA " + key + "=" + std::to_string(value) + ";";
+
1161 };
+
1162
+
1163 // Lgr Pragma
+
1164 setPragma(setup.lgrPragma[0], "journal_size_limit", 1582080);
+
1165
+
1166 // TX Pragma
+
1167 int64_t page_size = 4096;
+
1168 int64_t journal_size_limit = 1582080;
+
1169 if (c.exists("sqlite"))
+
1170 {
+
1171 auto& s = c.section("sqlite");
+
1172 set(journal_size_limit, "journal_size_limit", s);
+
1173 set(page_size, "page_size", s);
+
1174 if (page_size < 512 || page_size > 65536)
+
1175 Throw<std::runtime_error>("Invalid page_size. Must be between 512 and 65536.");
+
1176
+
1177 if (page_size & (page_size - 1))
+
1178 Throw<std::runtime_error>("Invalid page_size. Must be a power of 2.");
+
1179 }
+
1180
+
1181 setPragma(setup.txPragma[0], "page_size", page_size);
+
1182 setPragma(setup.txPragma[1], "journal_size_limit", journal_size_limit);
+
1183 setPragma(setup.txPragma[2], "max_page_count", 4294967294);
+
1184 setPragma(setup.txPragma[3], "mmap_size", 17179869184);
+
1185
+
1186 return setup;
+
1187}
+
+
1188} // namespace xrpl
@@ -1160,71 +1308,73 @@ $(document).ready(function() { init_codefold(0); });
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
Section & section(std::string const &name)
Returns the section with the given name.
- -
uint32_t NETWORK_ID
Definition Config.h:137
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:256
-
bool ELB_SUPPORT
Definition Config.h:119
-
bool COMPRESSION
Definition Config.h:200
-
static char const *const configLegacyName
Definition Config.h:70
-
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:85
+ +
uint32_t NETWORK_ID
Definition Config.h:138
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
+
bool ELB_SUPPORT
Definition Config.h:121
+
bool COMPRESSION
Definition Config.h:201
+
static char const *const configLegacyName
Definition Config.h:72
+
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:87
void load()
Definition Config.cpp:418
-
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:279
-
boost::filesystem::path CONFIG_FILE
Definition Config.h:79
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:238
-
static char const *const configFileName
Definition Config.h:69
-
int MAX_TRANSACTIONS
Definition Config.h:206
-
std::size_t PEERS_IN_MAX
Definition Config.h:162
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
int PATH_SEARCH_OLD
Definition Config.h:176
-
bool BETA_RPC_API
Definition Config.h:267
-
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:264
-
beast::Journal const j_
Definition Config.h:89
-
std::vector< std::string > IPS
Definition Config.h:122
-
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition Config.h:102
-
int PATH_SEARCH_FAST
Definition Config.h:178
-
std::string SSL_VERIFY_FILE
Definition Config.h:196
-
std::size_t PEERS_OUT_MAX
Definition Config.h:161
-
std::string SERVER_DOMAIN
Definition Config.h:258
-
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:150
-
bool SILENT
Definition Config.h:92
-
std::string SSL_VERIFY_DIR
Definition Config.h:197
+
StartUpType START_UP
Definition Config.h:129
+
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:280
+
boost::filesystem::path CONFIG_FILE
Definition Config.h:81
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
+
static char const *const configFileName
Definition Config.h:71
+
int MAX_TRANSACTIONS
Definition Config.h:207
+
std::size_t PEERS_IN_MAX
Definition Config.h:163
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
int PATH_SEARCH_OLD
Definition Config.h:177
+
bool BETA_RPC_API
Definition Config.h:268
+
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:265
+
beast::Journal const j_
Definition Config.h:91
+
std::vector< std::string > IPS
Definition Config.h:124
+
bool standalone() const
Definition Config.h:312
+
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition Config.h:104
+
int PATH_SEARCH_FAST
Definition Config.h:179
+
std::string SSL_VERIFY_FILE
Definition Config.h:197
+
std::size_t PEERS_OUT_MAX
Definition Config.h:162
+
std::string SERVER_DOMAIN
Definition Config.h:259
+
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:151
+
bool SILENT
Definition Config.h:94
+
std::string SSL_VERIFY_DIR
Definition Config.h:198
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:278
-
bool USE_TX_TABLES
Definition Config.h:104
-
static constexpr int MAX_JOB_QUEUE_TX
Definition Config.h:207
-
int PREFETCH_WORKERS
Definition Config.h:216
-
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:251
+
bool USE_TX_TABLES
Definition Config.h:106
+
static constexpr int MAX_JOB_QUEUE_TX
Definition Config.h:208
+
int PREFETCH_WORKERS
Definition Config.h:217
+
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:252
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
-
bool SSL_VERIFY
Definition Config.h:195
+
bool SSL_VERIFY
Definition Config.h:196
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition Config.cpp:982
-
bool QUIET
Definition Config.h:91
-
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:245
-
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:261
-
static constexpr int MIN_JOB_QUEUE_TX
Definition Config.h:208
-
bool PEER_PRIVATE
Definition Config.h:154
-
static char const *const validatorsFileName
Definition Config.h:72
-
std::uint32_t LEDGER_HISTORY
Definition Config.h:187
-
std::size_t NODE_SIZE
Definition Config.h:193
-
bool FAST_LOAD
Definition Config.h:270
-
std::size_t PEERS_MAX
Definition Config.h:160
-
std::uint32_t FETCH_DEPTH
Definition Config.h:188
-
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition Config.h:112
-
int PATH_SEARCH
Definition Config.h:177
-
std::optional< int > SWEEP_INTERVAL
Definition Config.h:223
+
bool QUIET
Definition Config.h:93
+
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
+
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:262
+
static constexpr int MIN_JOB_QUEUE_TX
Definition Config.h:209
+
bool PEER_PRIVATE
Definition Config.h:155
+
static char const *const validatorsFileName
Definition Config.h:74
+
std::uint32_t LEDGER_HISTORY
Definition Config.h:188
+
std::size_t NODE_SIZE
Definition Config.h:194
+
bool FAST_LOAD
Definition Config.h:271
+
std::size_t PEERS_MAX
Definition Config.h:161
+
std::uint32_t FETCH_DEPTH
Definition Config.h:189
+
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition Config.h:114
+
int PATH_SEARCH
Definition Config.h:178
+
std::optional< int > SWEEP_INTERVAL
Definition Config.h:224
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:244
-
std::size_t NETWORK_QUORUM
Definition Config.h:145
-
FeeSetup FEES
Definition Config.h:184
+
std::size_t NETWORK_QUORUM
Definition Config.h:146
+
FeeSetup FEES
Definition Config.h:185
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1015
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:228
-
int IO_WORKERS
Definition Config.h:215
-
std::vector< std::string > IPS_FIXED
Definition Config.h:125
-
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition Config.h:211
-
int RELAY_UNTRUSTED_PROPOSALS
Definition Config.h:151
-
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:234
-
int WORKERS
Definition Config.h:214
-
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:248
-
boost::filesystem::path CONFIG_DIR
Definition Config.h:82
-
bool LEDGER_REPLAY
Definition Config.h:203
-
static char const *const databaseDirName
Definition Config.h:71
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
+
int IO_WORKERS
Definition Config.h:216
+
std::vector< std::string > IPS_FIXED
Definition Config.h:127
+
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition Config.h:212
+
int RELAY_UNTRUSTED_PROPOSALS
Definition Config.h:152
+
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:235
+
int WORKERS
Definition Config.h:215
+
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:249
+
boost::filesystem::path CONFIG_DIR
Definition Config.h:84
+
bool LEDGER_REPLAY
Definition Config.h:204
+
static char const *const databaseDirName
Definition Config.h:73
static void initializeSSLContext(std::string const &sslVerifyDir, std::string const &sslVerifyFile, bool sslVerify, beast::Journal j)
Holds a collection of configuration values.
Definition BasicConfig.h:24
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition BasicConfig.h:58
@@ -1256,7 +1406,7 @@ $(document).ready(function() { init_codefold(0); });
IniFileSections parseIniFile(std::string const &strInput, bool const bTrim)
Definition Config.cpp:142
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1024
std::chrono::duration< int, std::ratio_multiply< days::period, std::ratio< 7 > > > weeks
Definition chrono.h:20
-
SizedItem
Definition Config.h:24
+
SizedItem
Definition Config.h:26
@@ -1272,11 +1422,16 @@ $(document).ready(function() { init_codefold(0); });
constexpr std::array< std::pair< SizedItem, std::array< int, 5 > >, 13 > sizedItems
Definition Config.cpp:95
std::unordered_map< std::string, std::vector< std::string > > IniFileSections
Definition BasicConfig.h:16
+
constexpr char const * CommonDBPragmaTemp
Definition DBInit.h:14
+
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition Config.cpp:1043
+
constexpr std::uint32_t SQLITE_TUNING_CUTOFF
Definition DBInit.h:20
static std::string const & systemName()
std::chrono::duration< int, std::ratio_multiply< std::chrono::hours::period, std::ratio< 24 > > > days
Definition chrono.h:18
bool get_if_exists(Section const &section, std::string const &name, T &v)
static void checkZeroPorts(Config const &config)
Definition Config.cpp:392
+
constexpr char const * CommonDBPragmaSync
Definition DBInit.h:13
std::optional< uint256 > getRegisteredFeature(std::string const &name)
Definition Feature.cpp:336
+
constexpr char const * CommonDBPragmaJournal
Definition DBInit.h:12
@@ -1286,10 +1441,18 @@ $(document).ready(function() { init_codefold(0); });
T str(T... args)
static std::string nodeDatabase()
-
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:46
-
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:48
-
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:51
-
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:54
+ +
std::array< std::string, 4 > txPragma
Definition DatabaseCon.h:88
+
static std::unique_ptr< std::vector< std::string > const > globalPragma
Definition DatabaseCon.h:87
+
boost::filesystem::path dataDir
Definition DatabaseCon.h:72
+ + + +
std::array< std::string, 1 > lgrPragma
Definition DatabaseCon.h:89
+
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:48
+
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:50
+
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:53
+
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:56
T substr(T... args)
T to_string(T... args)
diff --git a/Config_8h_source.html b/Config_8h_source.html index a1ecc7b76d..b0358f7838 100644 --- a/Config_8h_source.html +++ b/Config_8h_source.html @@ -87,421 +87,418 @@ $(document).ready(function() { init_codefold(0); });
4#include <xrpl/basics/base_uint.h>
5#include <xrpl/beast/net/IPEndpoint.h>
6#include <xrpl/beast/utility/Journal.h>
-
7#include <xrpl/protocol/SystemParameters.h> // VFALCO Breaks levelization
-
8
-
9#include <boost/filesystem.hpp> // VFALCO FIX: This include should not be here
+
7#include <xrpl/core/StartUpType.h>
+
8#include <xrpl/protocol/SystemParameters.h> // VFALCO Breaks levelization
+
9#include <xrpl/rdb/DatabaseCon.h>
10
-
11#include <cstdint>
-
12#include <optional>
-
13#include <string>
-
14#include <unordered_set>
-
15#include <utility>
-
16#include <vector>
-
17
-
18namespace xrpl {
+
11#include <boost/filesystem.hpp> // VFALCO FIX: This include should not be here
+
12
+
13#include <cstdint>
+
14#include <optional>
+
15#include <string>
+
16#include <unordered_set>
+
17#include <utility>
+
18#include <vector>
19
-
20class Rules;
+
20namespace xrpl {
21
-
22//------------------------------------------------------------------------------
+
22class Rules;
23
-
-
24enum class SizedItem : std::size_t {
-
25 sweepInterval = 0,
- - - - - - - - - - - - -
38};
+
24//------------------------------------------------------------------------------
+
25
+
+
26enum class SizedItem : std::size_t {
+
27 sweepInterval = 0,
+ + + + + + + + + + + + +
40};
-
39
-
- -
46{
- -
49
- -
52
- -
55
-
56 /* (Remember to update the example cfg files when changing any of these
-
57 * values.) */
-
58};
+
41
+
+ +
48{
+ +
51
+ +
54
+ +
57
+
58 /* (Remember to update the example cfg files when changing any of these
+
59 * values.) */
+
60};
-
59
-
60// This entire derived class is deprecated.
-
61// For new config information use the style implied
-
62// in the base class. For existing config information
-
63// try to refactor code to use the new style.
-
64//
-
-
65class Config : public BasicConfig
-
66{
-
67public:
-
68 // Settings related to the configuration file location and directories
-
69 static char const* const configFileName;
-
70 static char const* const configLegacyName;
-
71 static char const* const databaseDirName;
-
72 static char const* const validatorsFileName;
-
73
-
75 boost::filesystem::path
-
76 getDebugLogFile() const;
-
77
-
78private:
-
79 boost::filesystem::path CONFIG_FILE;
-
80
-
81public:
-
82 boost::filesystem::path CONFIG_DIR;
-
83
-
84private:
-
85 boost::filesystem::path DEBUG_LOGFILE;
-
86
-
87 void
-
88 load();
- -
90
-
91 bool QUIET = false; // Minimize logging verbosity.
-
92 bool SILENT = false; // No output to console after startup.
-
102 bool RUN_STANDALONE = false;
-
103
-
104 bool USE_TX_TABLES = true;
+
61
+
62// This entire derived class is deprecated.
+
63// For new config information use the style implied
+
64// in the base class. For existing config information
+
65// try to refactor code to use the new style.
+
66//
+
+
67class Config : public BasicConfig
+
68{
+
69public:
+
70 // Settings related to the configuration file location and directories
+
71 static char const* const configFileName;
+
72 static char const* const configLegacyName;
+
73 static char const* const databaseDirName;
+
74 static char const* const validatorsFileName;
+
75
+
77 boost::filesystem::path
+
78 getDebugLogFile() const;
+
79
+
80private:
+
81 boost::filesystem::path CONFIG_FILE;
+
82
+
83public:
+
84 boost::filesystem::path CONFIG_DIR;
+
85
+
86private:
+
87 boost::filesystem::path DEBUG_LOGFILE;
+
88
+
89 void
+
90 load();
+ +
92
+
93 bool QUIET = false; // Minimize logging verbosity.
+
94 bool SILENT = false; // No output to console after startup.
+
104 bool RUN_STANDALONE = false;
105
-
112 bool signingEnabled_ = false;
-
113
-
114 // The amount of RAM, in bytes, that we detected on this system.
- -
116
-
117public:
-
118 bool doImport = false;
-
119 bool ELB_SUPPORT = false;
-
120
-
121 // Entries from [ips] config stanza
- -
123
-
124 // Entries from [ips_fixed] config stanza
- -
126
- - -
129
-
130 bool START_VALID = false;
-
131
- -
133
- -
135
-
136 // Network parameters
-
137 uint32_t NETWORK_ID = 0;
-
138
-
139 // DEPRECATED - Fee units for a reference transaction.
-
140 // Only provided for backwards compatibility in a couple of places
-
141 static constexpr std::uint32_t FEE_UNITS_DEPRECATED = 10;
-
142
-
143 // Note: The following parameters do not relate to the UNL or trust at all
-
144 // Minimum number of nodes to consider the network present
- -
146
-
147 // Peer networking parameters
-
148 // 1 = relay, 0 = do not relay (but process), -1 = drop completely (do NOT
-
149 // process)
- - -
152
-
153 // True to ask peers not to relay current IP.
-
154 bool PEER_PRIVATE = false;
-
155 // peers_max is a legacy configuration, which is going to be replaced
-
156 // with individual inbound peers peers_in_max and outbound peers
-
157 // peers_out_max configuration. for now we support both the legacy and
-
158 // the new configuration. if peers_max is configured then peers_in_max and
-
159 // peers_out_max are ignored.
- - - -
163
-
164 // Path searching: these were reasonable default values at some point but
-
165 // further research is needed to decide if they still are
-
166 // and whether all of them are needed.
-
167 //
-
168 // The performance and resource consumption of a server can
-
169 // be dramatically impacted by changing these configuration
-
170 // options; higher values result in exponentially higher
-
171 // resource usage.
-
172 //
-
173 // Servers operating as validators disable path finding by
-
174 // default by setting the `PATH_SEARCH_MAX` option to 0
-
175 // unless it is explicitly set in the configuration file.
- -
177 int PATH_SEARCH = 2;
- - -
180
-
181 // Validation
-
182 std::optional<std::size_t> VALIDATION_QUORUM; // validations to consider ledger authoritative
-
183
- -
185
-
186 // Node storage configuration
- - -
189
-
190 // Tunable that adjusts various parameters, typically associated
-
191 // with hardware parameters (RAM size and CPU cores). The default
-
192 // is 'tiny'.
- -
194
-
195 bool SSL_VERIFY = true;
- - -
198
-
199 // Compression
-
200 bool COMPRESSION = false;
-
201
-
202 // Enable the experimental Ledger Replay functionality
-
203 bool LEDGER_REPLAY = false;
-
204
-
205 // Work queue limits
- -
207 static constexpr int MAX_JOB_QUEUE_TX = 1000;
-
208 static constexpr int MIN_JOB_QUEUE_TX = 100;
-
209
-
210 // Amendment majority time
- -
212
-
213 // Thread pool configuration (0 = choose for me)
-
214 int WORKERS = 0; // jobqueue thread count. default: upto 6
-
215 int IO_WORKERS = 0; // io svc thread count. default: 2
-
216 int PREFETCH_WORKERS = 0; // prefetch thread count. default: 4
-
217
-
218 // Can only be set in code, specifically unit tests
-
219 bool FORCE_MULTI_THREAD = false;
-
220
-
221 // Normally the sweep timer is automatically deduced based on the node
-
222 // size, but we allow admins to explicitly set it in the config.
- -
224
-
225 // Reduce-relay - Experimental parameters to control p2p routing algorithms
-
226
-
227 // Enable base squelching of duplicate validation/proposal messages
- -
229
-
231 // Temporary squelching config for the peers selected as a source of //
-
232 // validator messages. The config must be removed once squelching is //
-
233 // made the default routing algorithm //
- -
236
-
237 // Transaction reduce-relay feature
- -
239 // If tx reduce-relay feature is disabled
-
240 // and this flag is enabled then some
-
241 // tx-related metrics is collected. It
-
242 // is ignored if tx reduce-relay feature is
-
243 // enabled. It is used in debugging to compare
-
244 // metrics with the feature disabled/enabled.
- -
246 // Minimum peers a server should have before
-
247 // selecting random peers
- -
249 // Percentage of peers with the tx reduce-relay feature enabled
-
250 // to relay to out of total active peers
- -
252
-
253 // These override the command line client settings
- -
255
- -
257
- -
259
-
260 // How long can a peer remain in the "unknown" state
- -
262
-
263 // How long can a peer remain in the "diverged" state
- -
265
-
266 // Enable the beta API version
-
267 bool BETA_RPC_API = false;
-
268
-
269 // First, attempt to load the latest ledger directly from disk.
-
270 bool FAST_LOAD = false;
-
271 // When starting rippled with existing database it do not know it has those
-
272 // ledgers locally until the server naturally tries to backfill. This makes
-
273 // is difficult to test some functionality (in particular performance
-
274 // testing sidechains). With this variable the user is able to force rippled
-
275 // to consider the ledger range to be present. It should be used for testing
-
276 // only.
- -
278
- -
280
-
281public:
-
282 Config();
-
283
-
284 /* Be very careful to make sure these bool params
-
285 are in the right order. */
-
286 void
-
287 setup(std::string const& strConf, bool bQuiet, bool bSilent, bool bStandalone);
-
288
-
289 void
-
290 setupControl(bool bQuiet, bool bSilent, bool bStandalone);
-
291
-
297 void
-
298 loadFromString(std::string const& fileContents);
-
299
-
300 bool
-
-
301 quiet() const
-
302 {
-
303 return QUIET;
-
304 }
+
106 bool USE_TX_TABLES = true;
+
107
+
114 bool signingEnabled_ = false;
+
115
+
116 // The amount of RAM, in bytes, that we detected on this system.
+ +
118
+
119public:
+
120 bool doImport = false;
+
121 bool ELB_SUPPORT = false;
+
122
+
123 // Entries from [ips] config stanza
+ +
125
+
126 // Entries from [ips_fixed] config stanza
+ +
128
+ +
130
+
131 bool START_VALID = false;
+
132
+ +
134
+ +
136
+
137 // Network parameters
+
138 uint32_t NETWORK_ID = 0;
+
139
+
140 // DEPRECATED - Fee units for a reference transaction.
+
141 // Only provided for backwards compatibility in a couple of places
+
142 static constexpr std::uint32_t FEE_UNITS_DEPRECATED = 10;
+
143
+
144 // Note: The following parameters do not relate to the UNL or trust at all
+
145 // Minimum number of nodes to consider the network present
+ +
147
+
148 // Peer networking parameters
+
149 // 1 = relay, 0 = do not relay (but process), -1 = drop completely (do NOT
+
150 // process)
+ + +
153
+
154 // True to ask peers not to relay current IP.
+
155 bool PEER_PRIVATE = false;
+
156 // peers_max is a legacy configuration, which is going to be replaced
+
157 // with individual inbound peers peers_in_max and outbound peers
+
158 // peers_out_max configuration. for now we support both the legacy and
+
159 // the new configuration. if peers_max is configured then peers_in_max and
+
160 // peers_out_max are ignored.
+ + + +
164
+
165 // Path searching: these were reasonable default values at some point but
+
166 // further research is needed to decide if they still are
+
167 // and whether all of them are needed.
+
168 //
+
169 // The performance and resource consumption of a server can
+
170 // be dramatically impacted by changing these configuration
+
171 // options; higher values result in exponentially higher
+
172 // resource usage.
+
173 //
+
174 // Servers operating as validators disable path finding by
+
175 // default by setting the `PATH_SEARCH_MAX` option to 0
+
176 // unless it is explicitly set in the configuration file.
+ +
178 int PATH_SEARCH = 2;
+ + +
181
+
182 // Validation
+
183 std::optional<std::size_t> VALIDATION_QUORUM; // validations to consider ledger authoritative
+
184
+ +
186
+
187 // Node storage configuration
+ + +
190
+
191 // Tunable that adjusts various parameters, typically associated
+
192 // with hardware parameters (RAM size and CPU cores). The default
+
193 // is 'tiny'.
+ +
195
+
196 bool SSL_VERIFY = true;
+ + +
199
+
200 // Compression
+
201 bool COMPRESSION = false;
+
202
+
203 // Enable the experimental Ledger Replay functionality
+
204 bool LEDGER_REPLAY = false;
+
205
+
206 // Work queue limits
+ +
208 static constexpr int MAX_JOB_QUEUE_TX = 1000;
+
209 static constexpr int MIN_JOB_QUEUE_TX = 100;
+
210
+
211 // Amendment majority time
+ +
213
+
214 // Thread pool configuration (0 = choose for me)
+
215 int WORKERS = 0; // jobqueue thread count. default: upto 6
+
216 int IO_WORKERS = 0; // io svc thread count. default: 2
+
217 int PREFETCH_WORKERS = 0; // prefetch thread count. default: 4
+
218
+
219 // Can only be set in code, specifically unit tests
+
220 bool FORCE_MULTI_THREAD = false;
+
221
+
222 // Normally the sweep timer is automatically deduced based on the node
+
223 // size, but we allow admins to explicitly set it in the config.
+ +
225
+
226 // Reduce-relay - Experimental parameters to control p2p routing algorithms
+
227
+
228 // Enable base squelching of duplicate validation/proposal messages
+ +
230
+
232 // Temporary squelching config for the peers selected as a source of //
+
233 // validator messages. The config must be removed once squelching is //
+
234 // made the default routing algorithm //
+ +
237
+
238 // Transaction reduce-relay feature
+ +
240 // If tx reduce-relay feature is disabled
+
241 // and this flag is enabled then some
+
242 // tx-related metrics is collected. It
+
243 // is ignored if tx reduce-relay feature is
+
244 // enabled. It is used in debugging to compare
+
245 // metrics with the feature disabled/enabled.
+ +
247 // Minimum peers a server should have before
+
248 // selecting random peers
+ +
250 // Percentage of peers with the tx reduce-relay feature enabled
+
251 // to relay to out of total active peers
+ +
253
+
254 // These override the command line client settings
+ +
256
+ +
258
+ +
260
+
261 // How long can a peer remain in the "unknown" state
+ +
263
+
264 // How long can a peer remain in the "diverged" state
+ +
266
+
267 // Enable the beta API version
+
268 bool BETA_RPC_API = false;
+
269
+
270 // First, attempt to load the latest ledger directly from disk.
+
271 bool FAST_LOAD = false;
+
272 // When starting rippled with existing database it do not know it has those
+
273 // ledgers locally until the server naturally tries to backfill. This makes
+
274 // is difficult to test some functionality (in particular performance
+
275 // testing sidechains). With this variable the user is able to force rippled
+
276 // to consider the ledger range to be present. It should be used for testing
+
277 // only.
+ +
279
+ +
281
+
282public:
+
283 Config();
+
284
+
285 /* Be very careful to make sure these bool params
+
286 are in the right order. */
+
287 void
+
288 setup(std::string const& strConf, bool bQuiet, bool bSilent, bool bStandalone);
+
289
+
290 void
+
291 setupControl(bool bQuiet, bool bSilent, bool bStandalone);
+
292
+
298 void
+
299 loadFromString(std::string const& fileContents);
+
300
+
301 bool
+
+
302 quiet() const
+
303 {
+
304 return QUIET;
+
305 }
-
305 bool
-
-
306 silent() const
-
307 {
-
308 return SILENT;
-
309 }
+
306 bool
+
+
307 silent() const
+
308 {
+
309 return SILENT;
+
310 }
-
310 bool
-
- -
312 {
-
313 return RUN_STANDALONE;
-
314 }
+
311 bool
+
+ +
313 {
+
314 return RUN_STANDALONE;
+
315 }
-
315
-
316 bool
-
- -
318 {
-
319 return USE_TX_TABLES;
-
320 }
+
316
+
317 bool
+
+ +
319 {
+
320 return USE_TX_TABLES;
+
321 }
-
321
-
322 bool
-
-
323 canSign() const
-
324 {
-
325 return signingEnabled_;
-
326 }
+
322
+
323 bool
+
+
324 canSign() const
+
325 {
+
326 return signingEnabled_;
+
327 }
-
327
-
345 int
- -
347
- -
-
349 journal() const
-
350 {
-
351 return j_;
-
352 }
+
328
+
346 int
+ +
348
+ +
+
350 journal() const
+
351 {
+
352 return j_;
+
353 }
-
353};
+
354};
-
354
-
355FeeSetup
-
356setup_FeeVote(Section const& section);
-
357
-
358} // namespace xrpl
+
355
+
356FeeSetup
+
357setup_FeeVote(Section const& section);
+
358
+
359DatabaseCon::Setup
+ +
361
+
362} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
Holds unparsed configuration information.
- -
uint32_t NETWORK_ID
Definition Config.h:137
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:256
-
bool ELB_SUPPORT
Definition Config.h:119
-
bool COMPRESSION
Definition Config.h:200
-
static char const *const configLegacyName
Definition Config.h:70
-
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:85
+ +
uint32_t NETWORK_ID
Definition Config.h:138
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
+
bool ELB_SUPPORT
Definition Config.h:121
+
bool COMPRESSION
Definition Config.h:201
+
static char const *const configLegacyName
Definition Config.h:72
+
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:87
void load()
Definition Config.cpp:418
-
bool doImport
Definition Config.h:118
-
StartUpType START_UP
Definition Config.h:128
-
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:279
-
boost::filesystem::path CONFIG_FILE
Definition Config.h:79
-
bool silent() const
Definition Config.h:306
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:238
-
static char const *const configFileName
Definition Config.h:69
-
int MAX_TRANSACTIONS
Definition Config.h:206
-
bool quiet() const
Definition Config.h:301
-
std::size_t PEERS_IN_MAX
Definition Config.h:162
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
int PATH_SEARCH_OLD
Definition Config.h:176
-
std::optional< beast::IP::Endpoint > rpc_ip
Definition Config.h:254
-
bool BETA_RPC_API
Definition Config.h:267
-
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:264
-
beast::Journal const j_
Definition Config.h:89
-
std::vector< std::string > IPS
Definition Config.h:122
-
bool standalone() const
Definition Config.h:311
-
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition Config.h:102
-
int PATH_SEARCH_FAST
Definition Config.h:178
-
std::string SSL_VERIFY_FILE
Definition Config.h:196
-
std::size_t PEERS_OUT_MAX
Definition Config.h:161
-
std::string SERVER_DOMAIN
Definition Config.h:258
-
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:150
-
bool SILENT
Definition Config.h:92
-
std::string SSL_VERIFY_DIR
Definition Config.h:197
+
bool doImport
Definition Config.h:120
+
StartUpType START_UP
Definition Config.h:129
+
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:280
+
boost::filesystem::path CONFIG_FILE
Definition Config.h:81
+
bool silent() const
Definition Config.h:307
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
+
static char const *const configFileName
Definition Config.h:71
+
int MAX_TRANSACTIONS
Definition Config.h:207
+
bool quiet() const
Definition Config.h:302
+
std::size_t PEERS_IN_MAX
Definition Config.h:163
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
int PATH_SEARCH_OLD
Definition Config.h:177
+
std::optional< beast::IP::Endpoint > rpc_ip
Definition Config.h:255
+
bool BETA_RPC_API
Definition Config.h:268
+
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:265
+
beast::Journal const j_
Definition Config.h:91
+
std::vector< std::string > IPS
Definition Config.h:124
+
bool standalone() const
Definition Config.h:312
+
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition Config.h:104
+
int PATH_SEARCH_FAST
Definition Config.h:179
+
std::string SSL_VERIFY_FILE
Definition Config.h:197
+
std::size_t PEERS_OUT_MAX
Definition Config.h:162
+
std::string SERVER_DOMAIN
Definition Config.h:259
+
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:151
+
bool SILENT
Definition Config.h:94
+
std::string SSL_VERIFY_DIR
Definition Config.h:198
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:278
-
std::string START_LEDGER
Definition Config.h:132
-
bool USE_TX_TABLES
Definition Config.h:104
-
beast::Journal journal() const
Definition Config.h:349
-
std::optional< std::size_t > VALIDATION_QUORUM
Definition Config.h:182
-
static constexpr int MAX_JOB_QUEUE_TX
Definition Config.h:207
-
std::uint64_t const ramSize_
Definition Config.h:115
-
int PREFETCH_WORKERS
Definition Config.h:216
-
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:251
+
std::string START_LEDGER
Definition Config.h:133
+
bool USE_TX_TABLES
Definition Config.h:106
+
beast::Journal journal() const
Definition Config.h:350
+
std::optional< std::size_t > VALIDATION_QUORUM
Definition Config.h:183
+
static constexpr int MAX_JOB_QUEUE_TX
Definition Config.h:208
+
std::uint64_t const ramSize_
Definition Config.h:117
+
int PREFETCH_WORKERS
Definition Config.h:217
+
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:252
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
-
std::optional< std::pair< std::uint32_t, std::uint32_t > > FORCED_LEDGER_RANGE_PRESENT
Definition Config.h:277
-
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:141
-
bool FORCE_MULTI_THREAD
Definition Config.h:219
-
bool SSL_VERIFY
Definition Config.h:195
+
std::optional< std::pair< std::uint32_t, std::uint32_t > > FORCED_LEDGER_RANGE_PRESENT
Definition Config.h:278
+
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
+
bool FORCE_MULTI_THREAD
Definition Config.h:220
+
bool SSL_VERIFY
Definition Config.h:196
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition Config.cpp:982
-
bool QUIET
Definition Config.h:91
-
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:245
-
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:261
-
static constexpr int MIN_JOB_QUEUE_TX
Definition Config.h:208
-
bool PEER_PRIVATE
Definition Config.h:154
-
static char const *const validatorsFileName
Definition Config.h:72
-
std::uint32_t LEDGER_HISTORY
Definition Config.h:187
+
bool QUIET
Definition Config.h:93
+
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
+
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:262
+
static constexpr int MIN_JOB_QUEUE_TX
Definition Config.h:209
+
bool PEER_PRIVATE
Definition Config.h:155
+
static char const *const validatorsFileName
Definition Config.h:74
+
std::uint32_t LEDGER_HISTORY
Definition Config.h:188
-
std::size_t NODE_SIZE
Definition Config.h:193
-
bool useTxTables() const
Definition Config.h:317
-
bool FAST_LOAD
Definition Config.h:270
- - - - - - - -
std::size_t PEERS_MAX
Definition Config.h:160
-
std::uint32_t FETCH_DEPTH
Definition Config.h:188
-
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition Config.h:112
-
int PATH_SEARCH
Definition Config.h:177
-
std::optional< int > SWEEP_INTERVAL
Definition Config.h:223
+
std::size_t NODE_SIZE
Definition Config.h:194
+
bool useTxTables() const
Definition Config.h:318
+
bool FAST_LOAD
Definition Config.h:271
+
std::size_t PEERS_MAX
Definition Config.h:161
+
std::uint32_t FETCH_DEPTH
Definition Config.h:189
+
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition Config.h:114
+
int PATH_SEARCH
Definition Config.h:178
+
std::optional< int > SWEEP_INTERVAL
Definition Config.h:224
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:244
-
std::size_t NETWORK_QUORUM
Definition Config.h:145
-
FeeSetup FEES
Definition Config.h:184
-
std::optional< uint256 > TRAP_TX_HASH
Definition Config.h:134
+
std::size_t NETWORK_QUORUM
Definition Config.h:146
+
FeeSetup FEES
Definition Config.h:185
+
std::optional< uint256 > TRAP_TX_HASH
Definition Config.h:135
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1015
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:228
-
int IO_WORKERS
Definition Config.h:215
-
std::vector< std::string > IPS_FIXED
Definition Config.h:125
-
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition Config.h:211
-
int RELAY_UNTRUSTED_PROPOSALS
Definition Config.h:151
-
bool canSign() const
Definition Config.h:323
-
bool START_VALID
Definition Config.h:130
-
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:234
-
int WORKERS
Definition Config.h:214
-
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:248
-
boost::filesystem::path CONFIG_DIR
Definition Config.h:82
-
bool LEDGER_REPLAY
Definition Config.h:203
-
static char const *const databaseDirName
Definition Config.h:71
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
+
int IO_WORKERS
Definition Config.h:216
+
std::vector< std::string > IPS_FIXED
Definition Config.h:127
+
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition Config.h:212
+
int RELAY_UNTRUSTED_PROPOSALS
Definition Config.h:152
+
bool canSign() const
Definition Config.h:324
+
bool START_VALID
Definition Config.h:131
+
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:235
+
int WORKERS
Definition Config.h:215
+
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:249
+
boost::filesystem::path CONFIG_DIR
Definition Config.h:84
+
bool LEDGER_REPLAY
Definition Config.h:204
+
static char const *const databaseDirName
Definition Config.h:73
@@ -510,7 +507,7 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
constexpr std::chrono::seconds const defaultAmendmentMajorityTime
The minimum amount of time an amendment must hold a majority.
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1024
-
SizedItem
Definition Config.h:24
+
SizedItem
Definition Config.h:26
@@ -524,14 +521,17 @@ $(document).ready(function() { init_codefold(0); }); +
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition Config.cpp:1043
constexpr XRPAmount DROPS_PER_XRP
Number of drops per 1 XRP.
Definition XRPAmount.h:237
+
StartUpType
Definition StartUpType.h:8
+ -
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:46
-
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:48
-
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:51
-
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:54
+
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:48
+
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:50
+
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:53
+
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:56
diff --git a/Config__test_8cpp_source.html b/Config__test_8cpp_source.html index 4a8cf4c2ca..18f786a17e 100644 --- a/Config__test_8cpp_source.html +++ b/Config__test_8cpp_source.html @@ -1701,21 +1701,21 @@ $(document).ready(function() { init_codefold(0); });
boost::filesystem::path path
- -
uint32_t NETWORK_ID
Definition Config.h:137
-
static char const *const configLegacyName
Definition Config.h:70
-
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:279
-
bool silent() const
Definition Config.h:306
-
static char const *const configFileName
Definition Config.h:69
-
bool quiet() const
Definition Config.h:301
-
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:264
-
std::vector< std::string > IPS
Definition Config.h:122
-
bool standalone() const
Definition Config.h:311
+ +
uint32_t NETWORK_ID
Definition Config.h:138
+
static char const *const configLegacyName
Definition Config.h:72
+
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:280
+
bool silent() const
Definition Config.h:307
+
static char const *const configFileName
Definition Config.h:71
+
bool quiet() const
Definition Config.h:302
+
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:265
+
std::vector< std::string > IPS
Definition Config.h:124
+
bool standalone() const
Definition Config.h:312
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:278
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
-
std::uint32_t LEDGER_HISTORY
Definition Config.h:187
-
std::vector< std::string > IPS_FIXED
Definition Config.h:125
-
static char const *const databaseDirName
Definition Config.h:71
+
std::uint32_t LEDGER_HISTORY
Definition Config.h:188
+
std::vector< std::string > IPS_FIXED
Definition Config.h:127
+
static char const *const databaseDirName
Definition Config.h:73
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition BasicConfig.h:58
std::vector< std::string > const & lines() const
Returns all the lines in the section.
Definition BasicConfig.h:49
diff --git a/ConnectAttempt_8cpp_source.html b/ConnectAttempt_8cpp_source.html index ade7efbe66..eadbf6c322 100644 --- a/ConnectAttempt_8cpp_source.html +++ b/ConnectAttempt_8cpp_source.html @@ -698,10 +698,10 @@ $(document).ready(function() { init_codefold(0); });
virtual Config & config()=0
std::optional< std::string > member(PublicKey const &node) const
Determines whether a node belongs in the cluster.
Definition Cluster.cpp:19
-
bool COMPRESSION
Definition Config.h:200
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:238
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:228
-
bool LEDGER_REPLAY
Definition Config.h:203
+
bool COMPRESSION
Definition Config.h:201
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
+
bool LEDGER_REPLAY
Definition Config.h:204
boost::system::error_code error_code
boost::beast::ssl_stream< middle_type > stream_type
void fail(std::string const &reason)
diff --git a/Connect_8cpp_source.html b/Connect_8cpp_source.html index 809b3e3bca..f6ef6ef9dc 100644 --- a/Connect_8cpp_source.html +++ b/Connect_8cpp_source.html @@ -141,7 +141,7 @@ $(document).ready(function() { init_codefold(0); });
bool isConvertibleTo(ValueType other) const
static Endpoint from_string(std::string const &s)
virtual Config & config()=0
-
bool standalone() const
Definition Config.h:311
+
bool standalone() const
Definition Config.h:312
virtual void connect(beast::IP::Endpoint const &address)=0
Establish a peer connection to the specified endpoint.
virtual Overlay & overlay()=0
@ intValue
signed integer value
Definition json_value.h:20
diff --git a/Consensus_8h_source.html b/Consensus_8h_source.html index 29002068ff..1b199e324d 100644 --- a/Consensus_8h_source.html +++ b/Consensus_8h_source.html @@ -425,8 +425,8 @@ $(document).ready(function() { init_codefold(0); });
644 else // Unable to acquire the correct ledger
645 {
646 startMode = ConsensusMode::wrongLedger;
-
647 JLOG(j_.info()) << "Entering consensus with: " << previousLedger_.id();
-
648 JLOG(j_.info()) << "Correct LCL is: " << prevLedgerID;
+
647 JLOG(j_.info()) << "Entering consensus with: " << previousLedger_.id();
+
648 JLOG(j_.info()) << "Correct LCL is: " << prevLedgerID;
649 }
650 }
651
@@ -444,7 +444,7 @@ $(document).ready(function() { init_codefold(0); });
662{
663 phase_ = ConsensusPhase::open;
-
664 JLOG(j_.debug()) << "transitioned to ConsensusPhase::open ";
+
664 JLOG(j_.debug()) << "transitioned to ConsensusPhase::open ";
665 CLOG(clog) << "startRoundInternal transitioned to ConsensusPhase::open, "
666 "previous ledgerID: "
667 << prevLedgerID << ", seq: " << prevLedger.seq() << ". ";
@@ -486,7 +486,7 @@ $(document).ready(function() { init_codefold(0); });
703{
-
704 JLOG(j_.debug()) << "PROPOSAL " << newPeerPos.render();
+
704 JLOG(j_.debug()) << "PROPOSAL " << newPeerPos.render();
705 auto const& peerID = newPeerPos.proposal().nodeID();
706
707 // Always need to store recent positions
@@ -517,7 +517,7 @@ $(document).ready(function() { init_codefold(0); });
730
731 if (newPeerProp.prevLedger() != prevLedgerID_)
732 {
-
733 JLOG(j_.debug()) << "Got proposal for " << newPeerProp.prevLedger() << " but we are on " << prevLedgerID_;
+
733 JLOG(j_.debug()) << "Got proposal for " << newPeerProp.prevLedger() << " but we are on " << prevLedgerID_;
734 return false;
735 }
736
@@ -525,7 +525,7 @@ $(document).ready(function() { init_codefold(0); });
738
739 if (deadNodes_.find(peerID) != deadNodes_.end())
740 {
-
741 JLOG(j_.info()) << "Position from dead node: " << peerID;
+
741 JLOG(j_.info()) << "Position from dead node: " << peerID;
742 return false;
743 }
744
@@ -543,7 +543,7 @@ $(document).ready(function() { init_codefold(0); });
756
757 if (newPeerProp.isBowOut())
758 {
-
759 JLOG(j_.info()) << "Peer " << peerID << " bows out";
+
759 JLOG(j_.info()) << "Peer " << peerID << " bows out";
760 if (result_)
761 {
762 for (auto& it : result_->disputes)
@@ -565,11 +565,11 @@ $(document).ready(function() { init_codefold(0); });
778 if (newPeerProp.isInitial())
779 {
780 // Record the close time estimate
-
781 JLOG(j_.trace()) << "Peer reports close time as " << newPeerProp.closeTime().time_since_epoch().count();
+
781 JLOG(j_.trace()) << "Peer reports close time as " << newPeerProp.closeTime().time_since_epoch().count();
782 ++rawCloseTimes_.peers[newPeerProp.closeTime()];
783 }
784
-
785 JLOG(j_.trace()) << "Processing peer proposal " << newPeerProp.proposeSeq() << "/" << newPeerProp.position();
+
785 JLOG(j_.trace()) << "Processing peer proposal " << newPeerProp.proposeSeq() << "/" << newPeerProp.position();
786
787 {
788 auto const ait = acquired_.find(newPeerProp.position());
@@ -581,7 +581,7 @@ $(document).ready(function() { init_codefold(0); });
794 if (auto set = adaptor_.acquireTxSet(newPeerProp.position()))
795 gotTxSet(now_, *set);
796 else
-
797 JLOG(j_.debug()) << "Don't have tx set for peer";
+
797 JLOG(j_.debug()) << "Don't have tx set for peer";
798 }
799 else if (result_)
800 {
@@ -646,7 +646,7 @@ $(document).ready(function() { init_codefold(0); });
855
856 if (!result_)
857 {
-
858 JLOG(j_.debug()) << "Not creating disputes: no position yet.";
+
858 JLOG(j_.debug()) << "Not creating disputes: no position yet.";
859 }
860 else
861 {
@@ -665,7 +665,7 @@ $(document).ready(function() { init_codefold(0); });
874
875 if (!any)
876 {
-
877 JLOG(j_.warn()) << "By the time we got " << id << " no peers were proposing it";
+
877 JLOG(j_.warn()) << "By the time we got " << id << " no peers were proposing it";
878 }
879 }
880}
@@ -677,7 +677,7 @@ $(document).ready(function() { init_codefold(0); });
885{
886 using namespace std::chrono_literals;
-
887 JLOG(j_.info()) << "Simulating consensus";
+
887 JLOG(j_.info()) << "Simulating consensus";
888 now_ = now;
889 closeLedger({});
890 result_->roundTime.tick(consensusDelay.value_or(100ms));
@@ -685,7 +685,7 @@ $(document).ready(function() { init_codefold(0); });
892 prevRoundTime_ = result_->roundTime.read();
894 adaptor_.onForceAccept(*result_, previousLedger_, closeResolution_, rawCloseTimes_, mode_.get(), getJson(true));
-
895 JLOG(j_.info()) << "Simulation complete";
+
895 JLOG(j_.info()) << "Simulation complete";
896}
897
@@ -830,7 +830,7 @@ $(document).ready(function() { init_codefold(0); });
1033 // we need to switch the ledger we're working from
1034 if (auto newLedger = adaptor_.acquireLedger(prevLedgerID_))
1035 {
-
1036 JLOG(j_.info()) << "Have the consensus ledger " << prevLedgerID_;
+
1036 JLOG(j_.info()) << "Have the consensus ledger " << prevLedgerID_;
1037 CLOG(clog) << "Have the consensus ledger " << prevLedgerID_ << ". ";
1038 startRoundInternal(now_, lgrId, *newLedger, ConsensusMode::switchedLedger, clog);
1039 }
@@ -858,7 +858,7 @@ $(document).ready(function() { init_codefold(0); });
1060 ss << "View of consensus changed during " << to_string(phase_) << " mode=" << to_string(mode_.get()) << ", "
1061 << prevLedgerID_ << " to " << netLgr << ", " << Json::Compact{previousLedger_.getJson()} << ". ";
-
1062 JLOG(j_.warn()) << ss.str();
+
1062 JLOG(j_.warn()) << ss.str();
1063 CLOG(clog) << ss.str();
1064 CLOG(clog) << "State on consensus change " << Json::Compact{getJson(true)} << ". ";
1065 handleWrongLedger(netLgr, clog);
@@ -988,7 +988,7 @@ $(document).ready(function() { init_codefold(0); });
1183 if (!ahead || !laggards || !totalValidators || !adaptor_.validator() || !adaptor_.haveValidated() ||
1184 result_->roundTime.read() > parms.ledgerMAX_CONSENSUS)
1185 {
-
1186 j_.debug() << "not pausing (early)" << vars.str();
+
1186 j_.debug() << "not pausing (early)" << vars.str();
1187 CLOG(clog) << "Not pausing (early). ";
1188 return false;
1189 }
@@ -1034,12 +1034,12 @@ $(document).ready(function() { init_codefold(0); });
1261
1262 if (willPause)
1263 {
-
1264 j_.warn() << "pausing" << vars.str();
+
1264 j_.warn() << "pausing" << vars.str();
1265 CLOG(clog) << "pausing " << vars.str() << ". ";
1266 }
1267 else
1268 {
-
1269 j_.debug() << "not pausing" << vars.str();
+
1269 j_.debug() << "not pausing" << vars.str();
1270 CLOG(clog) << "not pausing. ";
1271 }
1272 return willPause;
@@ -1086,19 +1086,19 @@ $(document).ready(function() { init_codefold(0); });
1311
1312 if (!haveCloseTimeConsensus_)
1313 {
-
1314 JLOG(j_.info()) << "We have TX consensus but not CT consensus";
+
1314 JLOG(j_.info()) << "We have TX consensus but not CT consensus";
1315 CLOG(clog) << "We have TX consensus but not CT consensus. ";
1316 return;
1317 }
1318
-
1319 JLOG(j_.info()) << "Converge cutoff (" << currPeerPositions_.size() << " participants)";
+
1319 JLOG(j_.info()) << "Converge cutoff (" << currPeerPositions_.size() << " participants)";
1320 CLOG(clog) << "Converge cutoff (" << currPeerPositions_.size()
1321 << " participants). Transitioned to ConsensusPhase::accepted. ";
1322 adaptor_.updateOperatingMode(currPeerPositions_.size());
1323 prevProposers_ = currPeerPositions_.size();
1324 prevRoundTime_ = result_->roundTime.read();
1325 phase_ = ConsensusPhase::accepted;
-
1326 JLOG(j_.debug()) << "transitioned to ConsensusPhase::accepted";
+
1326 JLOG(j_.debug()) << "transitioned to ConsensusPhase::accepted";
1327 adaptor_.onAccept(
1328 *result_, previousLedger_, closeResolution_, rawCloseTimes_, mode_.get(), getJson(true), adaptor_.validating());
1329}
@@ -1113,7 +1113,7 @@ $(document).ready(function() { init_codefold(0); });
1336 XRPL_ASSERT(!result_, "xrpl::Consensus::closeLedger : result is not set");
1337
-
1339 JLOG(j_.debug()) << "transitioned to ConsensusPhase::establish";
+
1339 JLOG(j_.debug()) << "transitioned to ConsensusPhase::establish";
1340 rawCloseTimes_.self = now_;
1341 peerUnchangedCounter_ = 0;
1342 establishCounter_ = 0;
@@ -1178,7 +1178,7 @@ $(document).ready(function() { init_codefold(0); });
1409 {
1410 // peer's proposal is stale, so remove it
1411 NodeID_t const& peerID = peerProp.nodeID();
-
1412 JLOG(j_.warn()) << "Removing stale proposal from " << peerID;
+
1412 JLOG(j_.warn()) << "Removing stale proposal from " << peerID;
1413 for (auto& dt : result_->disputes)
1414 dt.second.unVote(peerID);
1415 it = currPeerPositions_.erase(it);
@@ -1257,12 +1257,12 @@ $(document).ready(function() { init_codefold(0); });
1489 ss << "Proposers:" << currPeerPositions_.size() << " nw:" << neededWeight << " thrV:" << threshVote
1490 << " thrC:" << threshConsensus;
-
1491 JLOG(j_.info()) << ss.str();
+
1491 JLOG(j_.info()) << ss.str();
1492 CLOG(clog) << ss.str();
1493
1494 for (auto const& [t, v] : closeTimeVotes)
1495 {
-
1496 JLOG(j_.debug()) << "CCTime: seq " << static_cast<std::uint32_t>(previousLedger_.seq()) + 1 << ": "
+
1496 JLOG(j_.debug()) << "CCTime: seq " << static_cast<std::uint32_t>(previousLedger_.seq()) + 1 << ": "
1497 << t.time_since_epoch().count() << " has " << v << ", " << threshVote << " required";
1498
1499 if (v >= threshVote)
@@ -1278,7 +1278,7 @@ $(document).ready(function() { init_codefold(0); });
1509
1510 if (!haveCloseTimeConsensus_)
1511 {
-
1512 JLOG(j_.debug()) << "No CT consensus:"
+
1512 JLOG(j_.debug()) << "No CT consensus:"
1513 << " Proposers:" << currPeerPositions_.size() << " Mode:" << to_string(mode_.get())
1514 << " Thresh:" << threshConsensus
1515 << " Pos:" << consensusCloseTime.time_since_epoch().count();
@@ -1301,7 +1301,7 @@ $(document).ready(function() { init_codefold(0); });
1532
1534 ss << "Position change: CTime " << consensusCloseTime.time_since_epoch().count() << ", tx " << newID;
-
1535 JLOG(j_.info()) << ss.str();
+
1535 JLOG(j_.info()) << ss.str();
1536 CLOG(clog) << ss.str();
1537
1538 result_->position.changePosition(newID, consensusCloseTime, now_);
@@ -1351,13 +1351,13 @@ $(document).ready(function() { init_codefold(0); });
1580 }
1581 else
1582 {
-
1583 JLOG(j_.debug()) << "Proposal disagreement: Peer " << nodeId << " has " << peerProp.position();
+
1583 JLOG(j_.debug()) << "Proposal disagreement: Peer " << nodeId << " has " << peerProp.position();
1584 ++disagree;
1585 }
1586 }
1587 auto currentFinished = adaptor_.proposersFinished(previousLedger_, prevLedgerID_);
1588
-
1589 JLOG(j_.debug()) << "Checking for TX consensus: agree=" << agree << ", disagree=" << disagree;
+
1589 JLOG(j_.debug()) << "Checking for TX consensus: agree=" << agree << ", disagree=" << disagree;
1590
1591 ConsensusParms const& parms = adaptor_.parms();
1592 // Stalling is BAD. It means that we have a consensus on the close time, so
@@ -1373,7 +1373,7 @@ $(document).ready(function() { init_codefold(0); });
1603 ss << "Consensus detects as stalled with " << (agree + disagree) << "/" << prevProposers_ << " proposers, and "
1604 << result_->disputes.size() << " stalled disputed transactions.";
-
1605 JLOG(j_.error()) << ss.str();
+
1605 JLOG(j_.error()) << ss.str();
1606 CLOG(clog) << ss.str();
1607 }
1608
@@ -1413,12 +1413,12 @@ $(document).ready(function() { init_codefold(0); });
1642
1643 ss << "Consensus time has expired in round " << establishCounter_ << "; continue until round "
1644 << minimumCounter << ". " << Json::Compact{getJson(false)};
-
1645 JLOG(j_.error()) << ss.str();
+
1645 JLOG(j_.error()) << ss.str();
1646 CLOG(clog) << ss.str() << ". ";
1647 return false;
1648 }
1649 ss << "Consensus expired. " << Json::Compact{getJson(true)};
-
1650 JLOG(j_.error()) << ss.str();
+
1650 JLOG(j_.error()) << ss.str();
1651 CLOG(clog) << ss.str() << ". ";
1652 leaveConsensus(clog);
1653 }
@@ -1426,8 +1426,8 @@ $(document).ready(function() { init_codefold(0); });
1655 // without us.
1656 if (result_->state == ConsensusState::MovedOn)
1657 {
-
1658 JLOG(j_.error()) << "Unable to reach consensus";
-
1659 JLOG(j_.error()) << Json::Compact{getJson(true)};
+
1658 JLOG(j_.error()) << "Unable to reach consensus";
+
1659 JLOG(j_.error()) << Json::Compact{getJson(true)};
1660 CLOG(clog) << "Unable to reach consensus " << Json::Compact{getJson(true)} << ". ";
1661 }
1662
@@ -1450,7 +1450,7 @@ $(document).ready(function() { init_codefold(0); });
1677 }
1678
1679 mode_.set(ConsensusMode::observing, adaptor_);
-
1680 JLOG(j_.info()) << "Bowing out of consensus";
+
1680 JLOG(j_.info()) << "Bowing out of consensus";
1681 CLOG(clog) << "Bowing out of consensus. ";
1682 }
1683}
@@ -1478,7 +1478,7 @@ $(document).ready(function() { init_codefold(0); });
1703 }
1704
1705 CLOG(clog) << "comparing existing with new set: " << result_->txns.id() << ',' << o.id() << ". ";
-
1706 JLOG(j_.debug()) << "createDisputes " << result_->txns.id() << " to " << o.id();
+
1706 JLOG(j_.debug()) << "createDisputes " << result_->txns.id() << " to " << o.id();
1707
1708 auto differences = result_->txns.compare(o);
1709
@@ -1499,7 +1499,7 @@ $(document).ready(function() { init_codefold(0); });
1724 if (result_->disputes.find(txID) != result_->disputes.end())
1725 continue;
1726
-
1727 JLOG(j_.debug()) << "Transaction " << txID << " is disputed";
+
1727 JLOG(j_.debug()) << "Transaction " << txID << " is disputed";
1728
1729 typename Result::Dispute_t dtx{
1730 tx, result_->txns.exists(txID), std::max(prevProposers_, currPeerPositions_.size()), j_};
@@ -1516,7 +1516,7 @@ $(document).ready(function() { init_codefold(0); });
1741
1742 result_->disputes.emplace(txID, std::move(dtx));
1743 }
-
1744 JLOG(j_.debug()) << dc << " differences found";
+
1744 JLOG(j_.debug()) << dc << " differences found";
1745 CLOG(clog) << "disputes: " << dc << ". ";
1746}
@@ -1586,7 +1586,11 @@ $(document).ready(function() { init_codefold(0); });
Value & append(Value const &value)
Append value to array at the end.
Json::Int Int
Definition json_value.h:138
A generic endpoint for log messages.
Definition Journal.h:40
+
Stream error() const
Definition Journal.h:318
Stream debug() const
Definition Journal.h:300
+
Stream info() const
Definition Journal.h:306
+
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
+
Stream warn() const
Definition Journal.h:312
NetClock::time_point const & closeTime() const
The current position on the consensus close time.
diff --git a/CreateCheck_8cpp_source.html b/CreateCheck_8cpp_source.html index c172fd8cb0..20142bd7fd 100644 --- a/CreateCheck_8cpp_source.html +++ b/CreateCheck_8cpp_source.html @@ -252,7 +252,7 @@ $(document).ready(function() { init_codefold(0); });
164
165 view().insert(sleCheck);
166
-
167 auto viewJ = ctx_.app.journal("View");
+
167 auto viewJ = ctx_.app.journal("View");
168 // If it's not a self-send (and it shouldn't be), add Check to the
169 // destination's owner directory.
170 if (dstAccountId != account_)
@@ -288,7 +288,6 @@ $(document).ready(function() { init_codefold(0); });
199} // namespace xrpl
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
Stream warn() const
Definition Journal.h:312
-
virtual beast::Journal journal(std::string const &name)=0
STTx const & tx
Application & app
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
@@ -305,6 +304,7 @@ $(document).ready(function() { init_codefold(0); });
AccountID getAccountID(SField const &field) const
Definition STObject.cpp:618
STAmount const & getFieldAmount(SField const &field) const
Definition STObject.cpp:632
std::uint32_t getSeqValue() const
Returns the first non-zero value of (Sequence, TicketSequence).
Definition STTx.cpp:208
+
virtual beast::Journal journal(std::string const &name)=0
AccountID const account_
Definition Transactor.h:112
beast::Journal const j_
Definition Transactor.h:110
diff --git a/CreateOffer_8cpp_source.html b/CreateOffer_8cpp_source.html index 46aed4263f..50ca67bec6 100644 --- a/CreateOffer_8cpp_source.html +++ b/CreateOffer_8cpp_source.html @@ -236,7 +236,7 @@ $(document).ready(function() { init_codefold(0); });
144
145 std::uint32_t const uAccountSequence = sleCreator->getFieldU32(sfSequence);
146
-
147 auto viewJ = ctx.app.journal("View");
+
147 auto viewJ = ctx.app.journal("View");
148
149 if (isGlobalFrozen(ctx.view, uPaysIssuerID) || isGlobalFrozen(ctx.view, uGetsIssuerID))
150 {
@@ -625,7 +625,7 @@ $(document).ready(function() { init_codefold(0); });
523 // end up on the books.
524 auto uRate = getRate(saTakerGets, saTakerPays);
525
-
526 auto viewJ = ctx_.app.journal("View");
+
526 auto viewJ = ctx_.app.journal("View");
527
528 TER result = tesSUCCESS;
529
@@ -964,7 +964,6 @@ $(document).ready(function() { init_codefold(0); });
Stream error() const
Definition Journal.h:318
Stream debug() const
Definition Journal.h:300
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
-
virtual beast::Journal journal(std::string const &name)=0
STTx const & tx
RawView & rawView()
ApplyView & view()
@@ -1015,6 +1014,7 @@ $(document).ready(function() { init_codefold(0); });
Discardable, editable view to a ledger.
Definition Sandbox.h:15
void apply(RawView &to)
Definition Sandbox.h:35
virtual OrderBookDB & getOrderBookDB()=0
+
virtual beast::Journal journal(std::string const &name)=0
AccountID const account_
Definition Transactor.h:112
beast::Journal const j_
Definition Transactor.h:110
diff --git a/CreateTicket_8cpp_source.html b/CreateTicket_8cpp_source.html index 73c07c8a76..8da74cdc95 100644 --- a/CreateTicket_8cpp_source.html +++ b/CreateTicket_8cpp_source.html @@ -157,7 +157,7 @@ $(document).ready(function() { init_codefold(0); });
68 }
69
-
70 beast::Journal viewJ{ctx_.app.journal("View")};
+
70 beast::Journal viewJ{ctx_.app.journal("View")};
71
72 // The starting ticket sequence is the same as the current account
73 // root sequence. Before we got here to doApply(), the transaction
@@ -209,7 +209,6 @@ $(document).ready(function() { init_codefold(0); });
118} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
-
virtual beast::Journal journal(std::string const &name)=0
STTx const & tx
Application & app
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
@@ -225,6 +224,7 @@ $(document).ready(function() { init_codefold(0); });
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
SeqProxy getSeqProxy() const
Definition STTx.cpp:193
constexpr bool isTicket() const
Definition SeqProxy.h:74
+
virtual beast::Journal journal(std::string const &name)=0
AccountID const account_
Definition Transactor.h:112
beast::Journal const j_
Definition Transactor.h:110
diff --git a/DBInit_8h_source.html b/DBInit_8h_source.html index 7b34217de4..c5b49d01ba 100644 --- a/DBInit_8h_source.html +++ b/DBInit_8h_source.html @@ -74,7 +74,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/DNS__test_8cpp_source.html b/DNS__test_8cpp_source.html index e9432b586a..1b0068b015 100644 --- a/DNS__test_8cpp_source.html +++ b/DNS__test_8cpp_source.html @@ -130,7 +130,7 @@ $(document).ready(function() { init_codefold(0); });
44 pUrl_.path,
45 port_,
- +
48 env_.app().config(),
49 lastEndpoint,
@@ -149,7 +149,7 @@ $(document).ready(function() { init_codefold(0); });
61 {
62 using boost::asio::ip::tcp;
-
63 tcp::resolver resolver(env_.app().getIOContext());
+
63 tcp::resolver resolver(env_.app().getIOContext());
64 std::string port = pUrl_.port ? std::to_string(*pUrl_.port) : "443";
65 auto results = resolver.resolve(pUrl_.domain, port);
66 auto it = results.begin();
@@ -212,7 +212,7 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:51
std::string const & arg() const
Return the argument associated with the runner.
Definition suite.h:276
virtual Config & config()=0
-
virtual boost::asio::io_context & getIOContext()=0
+
virtual boost::asio::io_context & getIOContext()=0
virtual void run()=0
std::condition_variable cv_
Definition DNS_test.cpp:24
diff --git a/DatabaseCon_8cpp_source.html b/DatabaseCon_8cpp_source.html index b6160c6f8e..4deb4afeca 100644 --- a/DatabaseCon_8cpp_source.html +++ b/DatabaseCon_8cpp_source.html @@ -74,321 +74,144 @@ $(document).ready(function() { init_codefold(0); });
DatabaseCon.cpp
-
1#include <xrpld/core/DatabaseCon.h>
-
2#include <xrpld/core/SociDB.h>
-
3
-
4#include <xrpl/basics/Log.h>
-
5#include <xrpl/basics/contract.h>
-
6
-
7#include <boost/algorithm/string.hpp>
-
8#include <boost/format.hpp>
-
9
-
10#include <memory>
-
11#include <unordered_map>
-
12
-
13namespace xrpl {
-
14
-
- -
16{
- -
18 // Mutex protects the CheckpointersCollection
- -
20 // Each checkpointer is given a unique id. All the checkpointers that are
-
21 // part of a DatabaseCon are part of this collection. When the DatabaseCon
-
22 // is destroyed, its checkpointer is removed from the collection
- -
24
-
25public:
- -
- -
28 {
- -
30 auto it = checkpointers_.find(id);
-
31 if (it != checkpointers_.end())
-
32 return it->second;
-
33 return {};
-
34 }
+
1#include <xrpl/basics/Log.h>
+
2#include <xrpl/basics/contract.h>
+
3#include <xrpl/rdb/DatabaseCon.h>
+
4#include <xrpl/rdb/SociDB.h>
+
5
+
6#include <boost/algorithm/string.hpp>
+
7#include <boost/format.hpp>
+
8
+
9#include <memory>
+
10#include <unordered_map>
+
11
+
12namespace xrpl {
+
13
+
+ +
15{
+ +
17 // Mutex protects the CheckpointersCollection
+ +
19 // Each checkpointer is given a unique id. All the checkpointers that are
+
20 // part of a DatabaseCon are part of this collection. When the DatabaseCon
+
21 // is destroyed, its checkpointer is removed from the collection
+ +
23
+
24public:
+ +
+ +
27 {
+ +
29 auto it = checkpointers_.find(id);
+
30 if (it != checkpointers_.end())
+
31 return it->second;
+
32 return {};
+
33 }
-
35
-
36 void
-
- -
38 {
- -
40 checkpointers_.erase(id);
-
41 }
+
34
+
35 void
+
+ +
37 {
+ +
39 checkpointers_.erase(id);
+
40 }
-
42
- -
-
44 create(std::shared_ptr<soci::session> const& session, JobQueue& jobQueue, Logs& logs)
-
45 {
- -
47 auto const id = nextId_++;
-
48 auto const r = makeCheckpointer(id, session, jobQueue, logs);
-
49 checkpointers_[id] = r;
-
50 return r;
-
51 }
+
41
+ +
+
43 create(std::shared_ptr<soci::session> const& session, JobQueue& jobQueue, Logs& logs)
+
44 {
+ +
46 auto const id = nextId_++;
+
47 auto const r = makeCheckpointer(id, session, jobQueue, logs);
+
48 checkpointers_[id] = r;
+
49 return r;
+
50 }
-
52};
+
51};
-
53
- -
55
- -
- -
58{
-
59 return checkpointers.fromId(id);
-
60}
+
52
+ +
54
+ +
+ +
57{
+
58 return checkpointers.fromId(id);
+
59}
-
61
-
- -
63{
-
64 if (checkpointer_)
-
65 {
- -
67
- -
69 checkpointer_.reset();
-
70
-
71 // The references to our Checkpointer held by 'checkpointer_' and
-
72 // 'checkpointers' have been removed, so if the use count is nonzero, a
-
73 // checkpoint is currently in progress. Wait for it to end, otherwise
-
74 // creating a new DatabaseCon to the same database may fail due to the
-
75 // database being locked by our (now old) Checkpointer.
-
76 while (wk.use_count())
-
77 {
- -
79 }
-
80 }
-
81}
+
60
+
+ +
62{
+
63 if (checkpointer_)
+
64 {
+ +
66
+ +
68 checkpointer_.reset();
+
69
+
70 // The references to our Checkpointer held by 'checkpointer_' and
+
71 // 'checkpointers' have been removed, so if the use count is nonzero, a
+
72 // checkpoint is currently in progress. Wait for it to end, otherwise
+
73 // creating a new DatabaseCon to the same database may fail due to the
+
74 // database being locked by our (now old) Checkpointer.
+
75 while (wk.use_count())
+
76 {
+ +
78 }
+
79 }
+
80}
-
82
- -
- -
85{
- -
87
-
88 setup.startUp = c.START_UP;
-
89 setup.standAlone = c.standalone();
-
90 setup.dataDir = c.legacy("database_path");
-
91 if (!setup.standAlone && setup.dataDir.empty())
-
92 {
-
93 Throw<std::runtime_error>("database_path must be set.");
-
94 }
-
95
-
96 if (!setup.globalPragma)
-
97 {
-
98 setup.globalPragma = [&c, &j]() {
-
99 auto const& sqlite = c.section("sqlite");
- -
101 result->reserve(3);
-
102
-
103 // defaults
-
104 std::string safety_level;
-
105 std::string journal_mode = "wal";
-
106 std::string synchronous = "normal";
-
107 std::string temp_store = "file";
-
108 bool showRiskWarning = false;
-
109
-
110 if (set(safety_level, "safety_level", sqlite))
-
111 {
-
112 if (boost::iequals(safety_level, "low"))
-
113 {
-
114 // low safety defaults
-
115 journal_mode = "memory";
-
116 synchronous = "off";
-
117 temp_store = "memory";
-
118 showRiskWarning = true;
-
119 }
-
120 else if (!boost::iequals(safety_level, "high"))
-
121 {
-
122 Throw<std::runtime_error>("Invalid safety_level value: " + safety_level);
-
123 }
-
124 }
-
125
-
126 {
-
127 // #journal_mode Valid values : delete, truncate, persist,
-
128 // memory, wal, off
-
129 if (set(journal_mode, "journal_mode", sqlite) && !safety_level.empty())
-
130 {
-
131 Throw<std::runtime_error>(
-
132 "Configuration file may not define both "
-
133 "\"safety_level\" and \"journal_mode\"");
-
134 }
-
135 bool higherRisk = boost::iequals(journal_mode, "memory") || boost::iequals(journal_mode, "off");
-
136 showRiskWarning = showRiskWarning || higherRisk;
-
137 if (higherRisk || boost::iequals(journal_mode, "delete") || boost::iequals(journal_mode, "truncate") ||
-
138 boost::iequals(journal_mode, "persist") || boost::iequals(journal_mode, "wal"))
-
139 {
-
140 result->emplace_back(boost::str(boost::format(CommonDBPragmaJournal) % journal_mode));
-
141 }
-
142 else
-
143 {
-
144 Throw<std::runtime_error>("Invalid journal_mode value: " + journal_mode);
-
145 }
-
146 }
-
147
-
148 {
-
149 // #synchronous Valid values : off, normal, full, extra
-
150 if (set(synchronous, "synchronous", sqlite) && !safety_level.empty())
-
151 {
-
152 Throw<std::runtime_error>(
-
153 "Configuration file may not define both "
-
154 "\"safety_level\" and \"synchronous\"");
-
155 }
-
156 bool higherRisk = boost::iequals(synchronous, "off");
-
157 showRiskWarning = showRiskWarning || higherRisk;
-
158 if (higherRisk || boost::iequals(synchronous, "normal") || boost::iequals(synchronous, "full") ||
-
159 boost::iequals(synchronous, "extra"))
-
160 {
-
161 result->emplace_back(boost::str(boost::format(CommonDBPragmaSync) % synchronous));
-
162 }
-
163 else
-
164 {
-
165 Throw<std::runtime_error>("Invalid synchronous value: " + synchronous);
-
166 }
-
167 }
-
168
-
169 {
-
170 // #temp_store Valid values : default, file, memory
-
171 if (set(temp_store, "temp_store", sqlite) && !safety_level.empty())
-
172 {
-
173 Throw<std::runtime_error>(
-
174 "Configuration file may not define both "
-
175 "\"safety_level\" and \"temp_store\"");
-
176 }
-
177 bool higherRisk = boost::iequals(temp_store, "memory");
-
178 showRiskWarning = showRiskWarning || higherRisk;
-
179 if (higherRisk || boost::iequals(temp_store, "default") || boost::iequals(temp_store, "file"))
-
180 {
-
181 result->emplace_back(boost::str(boost::format(CommonDBPragmaTemp) % temp_store));
-
182 }
-
183 else
-
184 {
-
185 Throw<std::runtime_error>("Invalid temp_store value: " + temp_store);
-
186 }
-
187 }
-
188
-
189 if (showRiskWarning && j && c.LEDGER_HISTORY > SQLITE_TUNING_CUTOFF)
-
190 {
-
191 JLOG(j->warn()) << "reducing the data integrity guarantees from the "
-
192 "default [sqlite] behavior is not recommended for "
-
193 "nodes storing large amounts of history, because of the "
-
194 "difficulty inherent in rebuilding corrupted data.";
-
195 }
-
196 XRPL_ASSERT(result->size() == 3, "xrpl::setup_DatabaseCon::globalPragma : result size is 3");
-
197 return result;
-
198 }();
-
199 }
-
200 setup.useGlobalPragma = true;
-
201
-
202 auto setPragma = [](std::string& pragma, std::string const& key, int64_t value) {
-
203 pragma = "PRAGMA " + key + "=" + std::to_string(value) + ";";
-
204 };
-
205
-
206 // Lgr Pragma
-
207 setPragma(setup.lgrPragma[0], "journal_size_limit", 1582080);
-
208
-
209 // TX Pragma
-
210 int64_t page_size = 4096;
-
211 int64_t journal_size_limit = 1582080;
-
212 if (c.exists("sqlite"))
-
213 {
-
214 auto& s = c.section("sqlite");
-
215 set(journal_size_limit, "journal_size_limit", s);
-
216 set(page_size, "page_size", s);
-
217 if (page_size < 512 || page_size > 65536)
-
218 Throw<std::runtime_error>("Invalid page_size. Must be between 512 and 65536.");
-
219
-
220 if (page_size & (page_size - 1))
-
221 Throw<std::runtime_error>("Invalid page_size. Must be a power of 2.");
-
222 }
-
223
-
224 setPragma(setup.txPragma[0], "page_size", page_size);
-
225 setPragma(setup.txPragma[1], "journal_size_limit", journal_size_limit);
-
226 setPragma(setup.txPragma[2], "max_page_count", 4294967294);
-
227 setPragma(setup.txPragma[3], "mmap_size", 17179869184);
-
228
-
229 return setup;
-
230}
+
81
+ +
83
+
84void
+
+ +
86{
+
87 if (!q)
+
88 Throw<std::logic_error>("No JobQueue");
+ +
90}
-
231
- -
233
-
234void
-
- -
236{
-
237 if (!q)
-
238 Throw<std::logic_error>("No JobQueue");
- -
240}
-
-
241
-
242} // namespace xrpl
- -
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
-
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
-
Section & section(std::string const &name)
Returns the section with the given name.
- - - -
void erase(std::uintptr_t id)
-
std::shared_ptr< Checkpointer > create(std::shared_ptr< soci::session > const &session, JobQueue &jobQueue, Logs &logs)
-
std::shared_ptr< Checkpointer > fromId(std::uintptr_t id)
-
std::unordered_map< std::uintptr_t, std::shared_ptr< Checkpointer > > checkpointers_
- -
StartUpType START_UP
Definition Config.h:128
-
bool standalone() const
Definition Config.h:311
-
std::uint32_t LEDGER_HISTORY
Definition Config.h:187
-
std::shared_ptr< soci::session > const session_
-
void setupCheckpointing(JobQueue *, Logs &)
-
std::shared_ptr< Checkpointer > checkpointer_
- +
91
+
92} // namespace xrpl
+ + + +
void erase(std::uintptr_t id)
+
std::shared_ptr< Checkpointer > create(std::shared_ptr< soci::session > const &session, JobQueue &jobQueue, Logs &logs)
+
std::shared_ptr< Checkpointer > fromId(std::uintptr_t id)
+
std::unordered_map< std::uintptr_t, std::shared_ptr< Checkpointer > > checkpointers_
+
std::shared_ptr< soci::session > const session_
+
void setupCheckpointing(JobQueue *, Logs &)
+
std::shared_ptr< Checkpointer > checkpointer_
+
A pool of threads to perform work.
Definition JobQueue.h:37
Manages partitions for logging.
Definition Log.h:32
-
T empty(T... args)
-
T is_same_v
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
-
CheckpointersCollection checkpointers
-
constexpr char const * CommonDBPragmaTemp
Definition DBInit.h:14
-
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
-
constexpr std::uint32_t SQLITE_TUNING_CUTOFF
Definition DBInit.h:20
-
std::shared_ptr< Checkpointer > makeCheckpointer(std::uintptr_t id, std::weak_ptr< soci::session > session, JobQueue &queue, Logs &logs)
Returns a new checkpointer which makes checkpoints of a soci database every checkpointPageCount pages...
Definition SociDB.cpp:290
-
constexpr char const * CommonDBPragmaSync
Definition DBInit.h:13
-
std::shared_ptr< Checkpointer > checkpointerFromId(std::uintptr_t id)
-
constexpr char const * CommonDBPragmaJournal
Definition DBInit.h:12
- +
CheckpointersCollection checkpointers
+
std::shared_ptr< Checkpointer > makeCheckpointer(std::uintptr_t id, std::weak_ptr< soci::session >, JobQueue &, Logs &)
Returns a new checkpointer which makes checkpoints of a soci database every checkpointPageCount pages...
Definition SociDB.cpp:288
+
std::shared_ptr< Checkpointer > checkpointerFromId(std::uintptr_t id)
T sleep_for(T... args)
- -
std::array< std::string, 4 > txPragma
Definition DatabaseCon.h:89
-
Config::StartUpType startUp
Definition DatabaseCon.h:71
-
static std::unique_ptr< std::vector< std::string > const > globalPragma
Definition DatabaseCon.h:88
-
boost::filesystem::path dataDir
Definition DatabaseCon.h:73
- - -
std::array< std::string, 1 > lgrPragma
Definition DatabaseCon.h:90
-
T to_string(T... args)
+
static std::unique_ptr< std::vector< std::string > const > globalPragma
Definition DatabaseCon.h:87
T use_count(T... args)
diff --git a/DatabaseCon_8h_source.html b/DatabaseCon_8h_source.html index f41d389553..31bd78da89 100644 --- a/DatabaseCon_8h_source.html +++ b/DatabaseCon_8h_source.html @@ -74,7 +74,7 @@ $(document).ready(function() { init_codefold(0); });
@@ -83,338 +83,334 @@ $(document).ready(function() { init_codefold(0); });
1#pragma once
2
-
3#include <xrpld/app/main/DBInit.h>
-
4#include <xrpld/core/Config.h>
-
5#include <xrpld/core/SociDB.h>
-
6
-
7#include <xrpl/core/PerfLog.h>
-
8
-
9#include <boost/filesystem/path.hpp>
-
10
-
11#include <mutex>
-
12#include <optional>
-
13#include <string>
-
14
-
-
15namespace soci {
-
16class session;
-
17}
+
3#include <xrpl/core/PerfLog.h>
+
4#include <xrpl/core/StartUpType.h>
+
5#include <xrpl/rdb/DBInit.h>
+
6#include <xrpl/rdb/SociDB.h>
+
7
+
8#include <boost/filesystem/path.hpp>
+
9
+
10#include <mutex>
+
11#include <optional>
+
12#include <string>
+
13
+
+
14namespace soci {
+
15class session;
+
16}
-
18
-
19namespace xrpl {
-
20
-
- -
22{
-
23public:
- -
25
-
26private:
- - -
29
-
30public:
-
- -
32 {
-
33 }
+
17
+
18namespace xrpl {
+
19
+
+ +
21{
+
22public:
+ +
24
+
25private:
+ + +
28
+
29public:
+
+ +
31 {
+
32 }
-
-
34 LockedSociSession(LockedSociSession&& rhs) noexcept : session_(std::move(rhs.session_)), lock_(std::move(rhs.lock_))
-
35 {
-
36 }
+
+
33 LockedSociSession(LockedSociSession&& rhs) noexcept : session_(std::move(rhs.session_)), lock_(std::move(rhs.lock_))
+
34 {
+
35 }
- - - -
40 operator=(LockedSociSession const& rhs) = delete;
-
41
-
42 soci::session*
-
- -
44 {
-
45 return session_.get();
-
46 }
+ + + +
39 operator=(LockedSociSession const& rhs) = delete;
+
40
+
41 soci::session*
+
+ +
43 {
+
44 return session_.get();
+
45 }
-
47 soci::session&
-
- -
49 {
-
50 return *session_;
-
51 }
+
46 soci::session&
+
+ +
48 {
+
49 return *session_;
+
50 }
-
52 soci::session*
-
- -
54 {
-
55 return session_.get();
-
56 }
+
51 soci::session*
+
+ +
53 {
+
54 return session_.get();
+
55 }
-
57 explicit
-
-
58 operator bool() const
-
59 {
-
60 return bool(session_);
-
61 }
+
56 explicit
+
+
57 operator bool() const
+
58 {
+
59 return bool(session_);
+
60 }
-
62};
+
61};
-
63
-
- -
65{
-
66public:
-
-
67 struct Setup
-
68 {
-
69 explicit Setup() = default;
-
70
- -
72 bool standAlone = false;
-
73 boost::filesystem::path dataDir;
-
74 // Indicates whether or not to return the `globalPragma`
-
75 // from commonPragma()
-
76 bool useGlobalPragma = false;
-
77
- -
- -
80 {
-
81 XRPL_ASSERT(
- -
83 "xrpl::DatabaseCon::Setup::commonPragma : consistent global "
-
84 "pragma");
-
85 return useGlobalPragma && globalPragma ? globalPragma.get() : nullptr;
-
86 }
+
62
+
+ +
64{
+
65public:
+
+
66 struct Setup
+
67 {
+
68 explicit Setup() = default;
+
69
+ +
71 bool standAlone = false;
+
72 boost::filesystem::path dataDir;
+
73 // Indicates whether or not to return the `globalPragma`
+
74 // from commonPragma()
+
75 bool useGlobalPragma = false;
+
76
+ +
+ +
79 {
+
80 XRPL_ASSERT(
+ +
82 "xrpl::DatabaseCon::Setup::commonPragma : consistent global "
+
83 "pragma");
+
84 return useGlobalPragma && globalPragma ? globalPragma.get() : nullptr;
+
85 }
-
87
- - - -
91 };
+
86
+ + + +
90 };
-
92
-
- -
94 {
- - -
97 };
+
91
+
+ +
93 {
+ + +
96 };
-
98
-
99 template <std::size_t N, std::size_t M>
-
- -
101 Setup const& setup,
-
102 std::string const& dbName,
-
103 std::array<std::string, N> const& pragma,
-
104 std::array<char const*, M> const& initSQL,
-
105 beast::Journal journal)
-
106 // Use temporary files or regular DB files?
-
107 : DatabaseCon(
-
108 setup.standAlone && setup.startUp != Config::LOAD && setup.startUp != Config::LOAD_FILE &&
-
109 setup.startUp != Config::REPLAY
-
110 ? ""
-
111 : (setup.dataDir / dbName),
-
112 setup.commonPragma(),
-
113 pragma,
-
114 initSQL,
-
115 journal)
-
116 {
-
117 }
+
97
+
98 template <std::size_t N, std::size_t M>
+
+ +
100 Setup const& setup,
+
101 std::string const& dbName,
+
102 std::array<std::string, N> const& pragma,
+
103 std::array<char const*, M> const& initSQL,
+
104 beast::Journal journal)
+
105 // Use temporary files or regular DB files?
+
106 : DatabaseCon(
+
107 setup.standAlone && setup.startUp != StartUpType::LOAD && setup.startUp != StartUpType::LOAD_FILE &&
+
108 setup.startUp != StartUpType::REPLAY
+
109 ? ""
+
110 : (setup.dataDir / dbName),
+
111 setup.commonPragma(),
+
112 pragma,
+
113 initSQL,
+
114 journal)
+
115 {
+
116 }
-
118
-
119 // Use this constructor to setup checkpointing
-
120 template <std::size_t N, std::size_t M>
-
- -
122 Setup const& setup,
-
123 std::string const& dbName,
-
124 std::array<std::string, N> const& pragma,
-
125 std::array<char const*, M> const& initSQL,
-
126 CheckpointerSetup const& checkpointerSetup,
-
127 beast::Journal journal)
-
128 : DatabaseCon(setup, dbName, pragma, initSQL, journal)
-
129 {
-
130 setupCheckpointing(checkpointerSetup.jobQueue, *checkpointerSetup.logs);
-
131 }
+
117
+
118 // Use this constructor to setup checkpointing
+
119 template <std::size_t N, std::size_t M>
+
+ +
121 Setup const& setup,
+
122 std::string const& dbName,
+
123 std::array<std::string, N> const& pragma,
+
124 std::array<char const*, M> const& initSQL,
+
125 CheckpointerSetup const& checkpointerSetup,
+
126 beast::Journal journal)
+
127 : DatabaseCon(setup, dbName, pragma, initSQL, journal)
+
128 {
+
129 setupCheckpointing(checkpointerSetup.jobQueue, *checkpointerSetup.logs);
+
130 }
-
132
-
133 template <std::size_t N, std::size_t M>
-
- -
135 boost::filesystem::path const& dataDir,
-
136 std::string const& dbName,
-
137 std::array<std::string, N> const& pragma,
-
138 std::array<char const*, M> const& initSQL,
-
139 beast::Journal journal)
-
140 : DatabaseCon(dataDir / dbName, nullptr, pragma, initSQL, journal)
-
141 {
-
142 }
+
131
+
132 template <std::size_t N, std::size_t M>
+
+ +
134 boost::filesystem::path const& dataDir,
+
135 std::string const& dbName,
+
136 std::array<std::string, N> const& pragma,
+
137 std::array<char const*, M> const& initSQL,
+
138 beast::Journal journal)
+
139 : DatabaseCon(dataDir / dbName, nullptr, pragma, initSQL, journal)
+
140 {
+
141 }
-
143
-
144 // Use this constructor to setup checkpointing
-
145 template <std::size_t N, std::size_t M>
-
- -
147 boost::filesystem::path const& dataDir,
-
148 std::string const& dbName,
-
149 std::array<std::string, N> const& pragma,
-
150 std::array<char const*, M> const& initSQL,
-
151 CheckpointerSetup const& checkpointerSetup,
-
152 beast::Journal journal)
-
153 : DatabaseCon(dataDir, dbName, pragma, initSQL, journal)
-
154 {
-
155 setupCheckpointing(checkpointerSetup.jobQueue, *checkpointerSetup.logs);
-
156 }
+
142
+
143 // Use this constructor to setup checkpointing
+
144 template <std::size_t N, std::size_t M>
+
+ +
146 boost::filesystem::path const& dataDir,
+
147 std::string const& dbName,
+
148 std::array<std::string, N> const& pragma,
+
149 std::array<char const*, M> const& initSQL,
+
150 CheckpointerSetup const& checkpointerSetup,
+
151 beast::Journal journal)
+
152 : DatabaseCon(dataDir, dbName, pragma, initSQL, journal)
+
153 {
+
154 setupCheckpointing(checkpointerSetup.jobQueue, *checkpointerSetup.logs);
+
155 }
-
157
-
158 ~DatabaseCon();
-
159
-
160 soci::session&
-
- -
162 {
-
163 return *session_;
-
164 }
+
156
+
157 ~DatabaseCon();
+
158
+
159 soci::session&
+
+ +
161 {
+
162 return *session_;
+
163 }
-
165
- -
- -
168 {
-
169 using namespace std::chrono_literals;
-
170 LockedSociSession session =
-
171 perf::measureDurationAndLog([&]() { return LockedSociSession(session_, lock_); }, "checkoutDb", 10ms, j_);
-
172
-
173 return session;
-
174 }
+
164
+ +
+ +
167 {
+
168 using namespace std::chrono_literals;
+
169 LockedSociSession session =
+
170 perf::measureDurationAndLog([&]() { return LockedSociSession(session_, lock_); }, "checkoutDb", 10ms, j_);
+
171
+
172 return session;
+
173 }
-
175
-
176private:
-
177 void
- -
179
-
180 template <std::size_t N, std::size_t M>
-
- -
182 boost::filesystem::path const& pPath,
-
183 std::vector<std::string> const* commonPragma,
-
184 std::array<std::string, N> const& pragma,
-
185 std::array<char const*, M> const& initSQL,
-
186 beast::Journal journal)
-
187 : session_(std::make_shared<soci::session>()), j_(journal)
-
188 {
-
189 open(*session_, "sqlite", pPath.string());
-
190
-
191 for (auto const& p : pragma)
-
192 {
-
193 soci::statement st = session_->prepare << p;
-
194 st.execute(true);
-
195 }
-
196
-
197 if (commonPragma)
-
198 {
-
199 for (auto const& p : *commonPragma)
-
200 {
-
201 soci::statement st = session_->prepare << p;
-
202 st.execute(true);
-
203 }
-
204 }
-
205
-
206 for (auto const& sql : initSQL)
-
207 {
-
208 soci::statement st = session_->prepare << sql;
-
209 st.execute(true);
-
210 }
-
211 }
+
174
+
175private:
+
176 void
+ +
178
+
179 template <std::size_t N, std::size_t M>
+
+ +
181 boost::filesystem::path const& pPath,
+
182 std::vector<std::string> const* commonPragma,
+
183 std::array<std::string, N> const& pragma,
+
184 std::array<char const*, M> const& initSQL,
+
185 beast::Journal journal)
+
186 : session_(std::make_shared<soci::session>()), j_(journal)
+
187 {
+
188 open(*session_, "sqlite", pPath.string());
+
189
+
190 for (auto const& p : pragma)
+
191 {
+
192 soci::statement st = session_->prepare << p;
+
193 st.execute(true);
+
194 }
+
195
+
196 if (commonPragma)
+
197 {
+
198 for (auto const& p : *commonPragma)
+
199 {
+
200 soci::statement st = session_->prepare << p;
+
201 st.execute(true);
+
202 }
+
203 }
+
204
+
205 for (auto const& sql : initSQL)
+
206 {
+
207 soci::statement st = session_->prepare << sql;
+
208 st.execute(true);
+
209 }
+
210 }
-
212
- -
214
-
215 // checkpointer may outlive the DatabaseCon when the checkpointer jobQueue
-
216 // callback locks a weak pointer and the DatabaseCon is then destroyed. In
-
217 // this case, the checkpointer needs to make sure it doesn't use an already
-
218 // destroyed session. Thus this class keeps a shared_ptr to the session (so
-
219 // the checkpointer can keep a weak_ptr) and the checkpointer is a
-
220 // shared_ptr in this class. session_ will never be null.
- - -
223
- -
225};
+
211
+ +
213
+
214 // checkpointer may outlive the DatabaseCon when the checkpointer jobQueue
+
215 // callback locks a weak pointer and the DatabaseCon is then destroyed. In
+
216 // this case, the checkpointer needs to make sure it doesn't use an already
+
217 // destroyed session. Thus this class keeps a shared_ptr to the session (so
+
218 // the checkpointer can keep a weak_ptr) and the checkpointer is a
+
219 // shared_ptr in this class. session_ will never be null.
+ + +
222
+ +
224};
-
226
-
227// Return the checkpointer from its id. If the checkpointer no longer exists, an
-
228// nullptr is returned
- - -
231
- - -
234
-
235} // namespace xrpl
+
225
+
226// Return the checkpointer from its id. If the checkpointer no longer exists, an
+
227// nullptr is returned
+ + +
230
+
231} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
- - - - -
DatabaseCon(boost::filesystem::path const &dataDir, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, beast::Journal journal)
-
DatabaseCon(boost::filesystem::path const &dataDir, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, CheckpointerSetup const &checkpointerSetup, beast::Journal journal)
-
std::shared_ptr< soci::session > const session_
-
beast::Journal const j_
-
void setupCheckpointing(JobQueue *, Logs &)
-
std::shared_ptr< Checkpointer > checkpointer_
-
soci::session & getSession()
-
DatabaseCon(Setup const &setup, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, CheckpointerSetup const &checkpointerSetup, beast::Journal journal)
-
LockedSociSession checkoutDb()
-
DatabaseCon(Setup const &setup, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, beast::Journal journal)
-
DatabaseCon(boost::filesystem::path const &pPath, std::vector< std::string > const *commonPragma, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, beast::Journal journal)
-
LockedSociSession::mutex lock_
- + +
DatabaseCon(boost::filesystem::path const &dataDir, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, beast::Journal journal)
+
DatabaseCon(boost::filesystem::path const &dataDir, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, CheckpointerSetup const &checkpointerSetup, beast::Journal journal)
+
std::shared_ptr< soci::session > const session_
+
beast::Journal const j_
+
void setupCheckpointing(JobQueue *, Logs &)
+
std::shared_ptr< Checkpointer > checkpointer_
+
soci::session & getSession()
+
DatabaseCon(Setup const &setup, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, CheckpointerSetup const &checkpointerSetup, beast::Journal journal)
+
LockedSociSession checkoutDb()
+
DatabaseCon(Setup const &setup, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, beast::Journal journal)
Definition DatabaseCon.h:99
+
DatabaseCon(boost::filesystem::path const &pPath, std::vector< std::string > const *commonPragma, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, beast::Journal journal)
+
LockedSociSession::mutex lock_
+
A pool of threads to perform work.
Definition JobQueue.h:37
- -
soci::session * get()
Definition DatabaseCon.h:43
-
std::shared_ptr< soci::session > session_
Definition DatabaseCon.h:27
-
LockedSociSession(std::shared_ptr< soci::session > it, mutex &m)
Definition DatabaseCon.h:31
-
soci::session * operator->()
Definition DatabaseCon.h:53
+ +
soci::session * get()
Definition DatabaseCon.h:42
+
std::shared_ptr< soci::session > session_
Definition DatabaseCon.h:26
+
LockedSociSession(std::shared_ptr< soci::session > it, mutex &m)
Definition DatabaseCon.h:30
+
soci::session * operator->()
Definition DatabaseCon.h:52
LockedSociSession(LockedSociSession const &rhs)=delete
-
std::unique_lock< mutex > lock_
Definition DatabaseCon.h:28
+
std::unique_lock< mutex > lock_
Definition DatabaseCon.h:27
LockedSociSession & operator=(LockedSociSession const &rhs)=delete
-
LockedSociSession(LockedSociSession &&rhs) noexcept
Definition DatabaseCon.h:34
+
LockedSociSession(LockedSociSession &&rhs) noexcept
Definition DatabaseCon.h:33
-
soci::session & operator*()
Definition DatabaseCon.h:48
+
soci::session & operator*()
Definition DatabaseCon.h:47
Manages partitions for logging.
Definition Log.h:32
T get(T... args)
-
T is_same_v
- +
STL namespace.
auto measureDurationAndLog(Func &&func, std::string const &actionDescription, std::chrono::duration< Rep, Period > maxDelay, beast::Journal const &journal)
Definition PerfLog.h:158
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
@ open
We haven't closed our ledger yet, but others might have.
-
std::shared_ptr< Checkpointer > checkpointerFromId(std::uintptr_t id)
+
StartUpType
Definition StartUpType.h:8
+ + + + +
std::shared_ptr< Checkpointer > checkpointerFromId(std::uintptr_t id)
- - - - -
std::array< std::string, 4 > txPragma
Definition DatabaseCon.h:89
-
Config::StartUpType startUp
Definition DatabaseCon.h:71
-
static std::unique_ptr< std::vector< std::string > const > globalPragma
Definition DatabaseCon.h:88
+ + + + +
std::array< std::string, 4 > txPragma
Definition DatabaseCon.h:88
+
static std::unique_ptr< std::vector< std::string > const > globalPragma
Definition DatabaseCon.h:87
-
boost::filesystem::path dataDir
Definition DatabaseCon.h:73
- - -
std::array< std::string, 1 > lgrPragma
Definition DatabaseCon.h:90
-
std::vector< std::string > const * commonPragma() const
Definition DatabaseCon.h:79
+
boost::filesystem::path dataDir
Definition DatabaseCon.h:72
+ + + +
std::array< std::string, 1 > lgrPragma
Definition DatabaseCon.h:89
+
std::vector< std::string > const * commonPragma() const
Definition DatabaseCon.h:78
diff --git a/Database__test_8cpp_source.html b/Database__test_8cpp_source.html index 002cd8af56..b8ed0aa978 100644 --- a/Database__test_8cpp_source.html +++ b/Database__test_8cpp_source.html @@ -87,723 +87,722 @@ $(document).ready(function() { init_codefold(0); });
4#include <test/nodestore/TestBase.h>
5#include <test/unit_test/SuiteJournal.h>
6
-
7#include <xrpld/core/DatabaseCon.h>
-
8
-
9#include <xrpl/beast/utility/temp_dir.h>
-
10#include <xrpl/nodestore/DummyScheduler.h>
-
11#include <xrpl/nodestore/Manager.h>
-
12
-
13namespace xrpl {
-
14
-
15namespace NodeStore {
-
16
-
-
17class Database_test : public TestBase
-
18{
- -
20
-
21public:
-
-
22 Database_test() : journal_("Database_test", *this)
-
23 {
-
24 }
+
7#include <xrpl/beast/utility/temp_dir.h>
+
8#include <xrpl/nodestore/DummyScheduler.h>
+
9#include <xrpl/nodestore/Manager.h>
+
10#include <xrpl/rdb/DatabaseCon.h>
+
11
+
12namespace xrpl {
+
13
+
14namespace NodeStore {
+
15
+
+
16class Database_test : public TestBase
+
17{
+ +
19
+
20public:
+
+
21 Database_test() : journal_("Database_test", *this)
+
22 {
+
23 }
-
25
-
26 void
-
- -
28 {
-
29 testcase("Config");
-
30
-
31 using namespace xrpl::test;
-
32 using namespace xrpl::test::jtx;
-
33
-
34 auto const integrityWarning =
-
35 "reducing the data integrity guarantees from the "
-
36 "default [sqlite] behavior is not recommended for "
-
37 "nodes storing large amounts of history, because of the "
-
38 "difficulty inherent in rebuilding corrupted data.";
-
39 {
-
40 // defaults
-
41 Env env(*this);
-
42
-
43 auto const s = setup_DatabaseCon(env.app().config());
-
44
-
45 if (BEAST_EXPECT(s.globalPragma->size() == 3))
-
46 {
-
47 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=wal;");
-
48 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=normal;");
-
49 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=file;");
-
50 }
-
51 }
-
52 {
-
53 // High safety level
- -
55
-
56 bool found = false;
-
57 Env env = [&]() {
-
58 auto p = test::jtx::envconfig();
-
59 {
-
60 auto& section = p->section("sqlite");
-
61 section.set("safety_level", "high");
-
62 }
-
63 p->LEDGER_HISTORY = 100'000'000;
-
64
-
65 return Env(
-
66 *this,
-
67 std::move(p),
-
68 std::make_unique<CheckMessageLogs>(integrityWarning, &found),
- -
70 }();
-
71
-
72 BEAST_EXPECT(!found);
-
73 auto const s = setup_DatabaseCon(env.app().config());
-
74 if (BEAST_EXPECT(s.globalPragma->size() == 3))
-
75 {
-
76 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=wal;");
-
77 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=normal;");
-
78 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=file;");
-
79 }
-
80 }
-
81 {
-
82 // Low safety level
- -
84
-
85 bool found = false;
-
86 Env env = [&]() {
-
87 auto p = test::jtx::envconfig();
-
88 {
-
89 auto& section = p->section("sqlite");
-
90 section.set("safety_level", "low");
-
91 }
-
92 p->LEDGER_HISTORY = 100'000'000;
-
93
-
94 return Env(
-
95 *this,
-
96 std::move(p),
-
97 std::make_unique<CheckMessageLogs>(integrityWarning, &found),
- -
99 }();
-
100
-
101 BEAST_EXPECT(found);
-
102 auto const s = setup_DatabaseCon(env.app().config());
-
103 if (BEAST_EXPECT(s.globalPragma->size() == 3))
-
104 {
-
105 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=memory;");
-
106 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=off;");
-
107 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=memory;");
-
108 }
-
109 }
-
110 {
-
111 // Override individual settings
- -
113
-
114 bool found = false;
-
115 Env env = [&]() {
-
116 auto p = test::jtx::envconfig();
-
117 {
-
118 auto& section = p->section("sqlite");
-
119 section.set("journal_mode", "off");
-
120 section.set("synchronous", "extra");
-
121 section.set("temp_store", "default");
-
122 }
-
123
-
124 return Env(
-
125 *this,
-
126 std::move(p),
-
127 std::make_unique<CheckMessageLogs>(integrityWarning, &found),
- -
129 }();
-
130
-
131 // No warning, even though higher risk settings were used because
-
132 // LEDGER_HISTORY is small
-
133 BEAST_EXPECT(!found);
-
134 auto const s = setup_DatabaseCon(env.app().config());
-
135 if (BEAST_EXPECT(s.globalPragma->size() == 3))
-
136 {
-
137 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=off;");
-
138 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=extra;");
-
139 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=default;");
-
140 }
-
141 }
-
142 {
-
143 // Override individual settings with large history
- -
145
-
146 bool found = false;
-
147 Env env = [&]() {
-
148 auto p = test::jtx::envconfig();
-
149 {
-
150 auto& section = p->section("sqlite");
-
151 section.set("journal_mode", "off");
-
152 section.set("synchronous", "extra");
-
153 section.set("temp_store", "default");
-
154 }
-
155 p->LEDGER_HISTORY = 50'000'000;
-
156
-
157 return Env(
-
158 *this,
-
159 std::move(p),
-
160 std::make_unique<CheckMessageLogs>(integrityWarning, &found),
- -
162 }();
-
163
-
164 // No warning, even though higher risk settings were used because
-
165 // LEDGER_HISTORY is small
-
166 BEAST_EXPECT(found);
-
167 auto const s = setup_DatabaseCon(env.app().config());
-
168 if (BEAST_EXPECT(s.globalPragma->size() == 3))
-
169 {
-
170 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=off;");
-
171 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=extra;");
-
172 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=default;");
-
173 }
-
174 }
-
175 {
-
176 // Error: Mix safety_level and individual settings
- -
178 auto const expected =
-
179 "Failed to initialize SQL databases: "
-
180 "Configuration file may not define both \"safety_level\" and "
-
181 "\"journal_mode\"";
-
182 bool found = false;
-
183
-
184 auto p = test::jtx::envconfig();
-
185 {
-
186 auto& section = p->section("sqlite");
-
187 section.set("safety_level", "low");
-
188 section.set("journal_mode", "off");
-
189 section.set("synchronous", "extra");
-
190 section.set("temp_store", "default");
-
191 }
-
192
-
193 try
-
194 {
-
195 Env env(
-
196 *this,
-
197 std::move(p),
-
198 std::make_unique<CheckMessageLogs>(expected, &found),
- -
200 fail();
-
201 }
-
202 catch (...)
-
203 {
-
204 BEAST_EXPECT(found);
-
205 }
-
206 }
-
207 {
-
208 // Error: Mix safety_level and one setting (gotta catch 'em all)
- -
210 auto const expected =
-
211 "Failed to initialize SQL databases: Configuration file may "
-
212 "not define both \"safety_level\" and \"journal_mode\"";
-
213 bool found = false;
-
214
-
215 auto p = test::jtx::envconfig();
-
216 {
-
217 auto& section = p->section("sqlite");
-
218 section.set("safety_level", "high");
-
219 section.set("journal_mode", "off");
-
220 }
-
221
-
222 try
-
223 {
-
224 Env env(
-
225 *this,
-
226 std::move(p),
-
227 std::make_unique<CheckMessageLogs>(expected, &found),
- -
229 fail();
-
230 }
-
231 catch (...)
-
232 {
-
233 BEAST_EXPECT(found);
-
234 }
-
235 }
-
236 {
-
237 // Error: Mix safety_level and one setting (gotta catch 'em all)
- -
239 auto const expected =
-
240 "Failed to initialize SQL databases: Configuration file may "
-
241 "not define both \"safety_level\" and \"synchronous\"";
-
242 bool found = false;
-
243
-
244 auto p = test::jtx::envconfig();
-
245 {
-
246 auto& section = p->section("sqlite");
-
247 section.set("safety_level", "low");
-
248 section.set("synchronous", "extra");
-
249 }
-
250
-
251 try
-
252 {
-
253 Env env(
-
254 *this,
-
255 std::move(p),
-
256 std::make_unique<CheckMessageLogs>(expected, &found),
- -
258 fail();
-
259 }
-
260 catch (...)
-
261 {
-
262 BEAST_EXPECT(found);
-
263 }
-
264 }
-
265 {
-
266 // Error: Mix safety_level and one setting (gotta catch 'em all)
- -
268 auto const expected =
-
269 "Failed to initialize SQL databases: Configuration file may "
-
270 "not define both \"safety_level\" and \"temp_store\"";
-
271 bool found = false;
-
272
-
273 auto p = test::jtx::envconfig();
-
274 {
-
275 auto& section = p->section("sqlite");
-
276 section.set("safety_level", "high");
-
277 section.set("temp_store", "default");
-
278 }
-
279
-
280 try
-
281 {
-
282 Env env(
-
283 *this,
-
284 std::move(p),
-
285 std::make_unique<CheckMessageLogs>(expected, &found),
- -
287 fail();
-
288 }
-
289 catch (...)
-
290 {
-
291 BEAST_EXPECT(found);
-
292 }
-
293 }
-
294 {
-
295 // Error: Invalid value
- -
297 auto const expected =
-
298 "Failed to initialize SQL databases: Invalid safety_level "
-
299 "value: slow";
-
300 bool found = false;
-
301
-
302 auto p = test::jtx::envconfig();
-
303 {
-
304 auto& section = p->section("sqlite");
-
305 section.set("safety_level", "slow");
-
306 }
-
307
-
308 try
-
309 {
-
310 Env env(
-
311 *this,
-
312 std::move(p),
-
313 std::make_unique<CheckMessageLogs>(expected, &found),
- -
315 fail();
-
316 }
-
317 catch (...)
-
318 {
-
319 BEAST_EXPECT(found);
-
320 }
-
321 }
-
322 {
-
323 // Error: Invalid value
- -
325 auto const expected =
-
326 "Failed to initialize SQL databases: Invalid journal_mode "
-
327 "value: fast";
-
328 bool found = false;
-
329
-
330 auto p = test::jtx::envconfig();
-
331 {
-
332 auto& section = p->section("sqlite");
-
333 section.set("journal_mode", "fast");
-
334 }
-
335
-
336 try
-
337 {
-
338 Env env(
-
339 *this,
-
340 std::move(p),
-
341 std::make_unique<CheckMessageLogs>(expected, &found),
- -
343 fail();
-
344 }
-
345 catch (...)
-
346 {
-
347 BEAST_EXPECT(found);
-
348 }
-
349 }
-
350 {
-
351 // Error: Invalid value
- -
353 auto const expected =
-
354 "Failed to initialize SQL databases: Invalid synchronous "
-
355 "value: instant";
-
356 bool found = false;
-
357
-
358 auto p = test::jtx::envconfig();
-
359 {
-
360 auto& section = p->section("sqlite");
-
361 section.set("synchronous", "instant");
-
362 }
-
363
-
364 try
-
365 {
-
366 Env env(
-
367 *this,
-
368 std::move(p),
-
369 std::make_unique<CheckMessageLogs>(expected, &found),
- -
371 fail();
-
372 }
-
373 catch (...)
-
374 {
-
375 BEAST_EXPECT(found);
-
376 }
-
377 }
-
378 {
-
379 // Error: Invalid value
- -
381 auto const expected =
-
382 "Failed to initialize SQL databases: Invalid temp_store "
-
383 "value: network";
-
384 bool found = false;
-
385
-
386 auto p = test::jtx::envconfig();
-
387 {
-
388 auto& section = p->section("sqlite");
-
389 section.set("temp_store", "network");
-
390 }
-
391
-
392 try
-
393 {
-
394 Env env(
-
395 *this,
-
396 std::move(p),
-
397 std::make_unique<CheckMessageLogs>(expected, &found),
- -
399 fail();
-
400 }
-
401 catch (...)
-
402 {
-
403 BEAST_EXPECT(found);
-
404 }
-
405 }
-
406 {
-
407 // N/A: Default values
-
408 Env env(*this);
-
409 auto const s = setup_DatabaseCon(env.app().config());
-
410 if (BEAST_EXPECT(s.txPragma.size() == 4))
-
411 {
-
412 BEAST_EXPECT(s.txPragma.at(0) == "PRAGMA page_size=4096;");
-
413 BEAST_EXPECT(s.txPragma.at(1) == "PRAGMA journal_size_limit=1582080;");
-
414 BEAST_EXPECT(s.txPragma.at(2) == "PRAGMA max_page_count=4294967294;");
-
415 BEAST_EXPECT(s.txPragma.at(3) == "PRAGMA mmap_size=17179869184;");
-
416 }
-
417 }
-
418 {
-
419 // Success: Valid values
-
420 Env env = [&]() {
-
421 auto p = test::jtx::envconfig();
-
422 {
-
423 auto& section = p->section("sqlite");
-
424 section.set("page_size", "512");
-
425 section.set("journal_size_limit", "2582080");
-
426 }
-
427 return Env(*this, std::move(p));
-
428 }();
-
429 auto const s = setup_DatabaseCon(env.app().config());
-
430 if (BEAST_EXPECT(s.txPragma.size() == 4))
-
431 {
-
432 BEAST_EXPECT(s.txPragma.at(0) == "PRAGMA page_size=512;");
-
433 BEAST_EXPECT(s.txPragma.at(1) == "PRAGMA journal_size_limit=2582080;");
-
434 BEAST_EXPECT(s.txPragma.at(2) == "PRAGMA max_page_count=4294967294;");
-
435 BEAST_EXPECT(s.txPragma.at(3) == "PRAGMA mmap_size=17179869184;");
-
436 }
-
437 }
-
438 {
-
439 // Error: Invalid values
-
440 auto const expected = "Invalid page_size. Must be between 512 and 65536.";
-
441 bool found = false;
-
442 auto p = test::jtx::envconfig();
-
443 {
-
444 auto& section = p->section("sqlite");
-
445 section.set("page_size", "256");
-
446 }
-
447 try
-
448 {
-
449 Env env(
-
450 *this,
-
451 std::move(p),
-
452 std::make_unique<CheckMessageLogs>(expected, &found),
- -
454 fail();
-
455 }
-
456 catch (...)
-
457 {
-
458 BEAST_EXPECT(found);
-
459 }
-
460 }
-
461 {
-
462 // Error: Invalid values
-
463 auto const expected = "Invalid page_size. Must be between 512 and 65536.";
-
464 bool found = false;
-
465 auto p = test::jtx::envconfig();
-
466 {
-
467 auto& section = p->section("sqlite");
-
468 section.set("page_size", "131072");
-
469 }
-
470 try
-
471 {
-
472 Env env(
-
473 *this,
-
474 std::move(p),
-
475 std::make_unique<CheckMessageLogs>(expected, &found),
- -
477 fail();
-
478 }
-
479 catch (...)
-
480 {
-
481 BEAST_EXPECT(found);
-
482 }
-
483 }
-
484 {
-
485 // Error: Invalid values
-
486 auto const expected = "Invalid page_size. Must be a power of 2.";
-
487 bool found = false;
-
488 auto p = test::jtx::envconfig();
-
489 {
-
490 auto& section = p->section("sqlite");
-
491 section.set("page_size", "513");
-
492 }
-
493 try
-
494 {
-
495 Env env(
-
496 *this,
-
497 std::move(p),
-
498 std::make_unique<CheckMessageLogs>(expected, &found),
- -
500 fail();
-
501 }
-
502 catch (...)
-
503 {
-
504 BEAST_EXPECT(found);
-
505 }
-
506 }
-
507 }
+
24
+
25 void
+
+ +
27 {
+
28 testcase("Config");
+
29
+
30 using namespace xrpl::test;
+
31 using namespace xrpl::test::jtx;
+
32
+
33 auto const integrityWarning =
+
34 "reducing the data integrity guarantees from the "
+
35 "default [sqlite] behavior is not recommended for "
+
36 "nodes storing large amounts of history, because of the "
+
37 "difficulty inherent in rebuilding corrupted data.";
+
38 {
+
39 // defaults
+
40 Env env(*this);
+
41
+
42 auto const s = setup_DatabaseCon(env.app().config());
+
43
+
44 if (BEAST_EXPECT(s.globalPragma->size() == 3))
+
45 {
+
46 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=wal;");
+
47 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=normal;");
+
48 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=file;");
+
49 }
+
50 }
+
51 {
+
52 // High safety level
+ +
54
+
55 bool found = false;
+
56 Env env = [&]() {
+
57 auto p = test::jtx::envconfig();
+
58 {
+
59 auto& section = p->section("sqlite");
+
60 section.set("safety_level", "high");
+
61 }
+
62 p->LEDGER_HISTORY = 100'000'000;
+
63
+
64 return Env(
+
65 *this,
+
66 std::move(p),
+
67 std::make_unique<CheckMessageLogs>(integrityWarning, &found),
+ +
69 }();
+
70
+
71 BEAST_EXPECT(!found);
+
72 auto const s = setup_DatabaseCon(env.app().config());
+
73 if (BEAST_EXPECT(s.globalPragma->size() == 3))
+
74 {
+
75 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=wal;");
+
76 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=normal;");
+
77 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=file;");
+
78 }
+
79 }
+
80 {
+
81 // Low safety level
+ +
83
+
84 bool found = false;
+
85 Env env = [&]() {
+
86 auto p = test::jtx::envconfig();
+
87 {
+
88 auto& section = p->section("sqlite");
+
89 section.set("safety_level", "low");
+
90 }
+
91 p->LEDGER_HISTORY = 100'000'000;
+
92
+
93 return Env(
+
94 *this,
+
95 std::move(p),
+
96 std::make_unique<CheckMessageLogs>(integrityWarning, &found),
+ +
98 }();
+
99
+
100 BEAST_EXPECT(found);
+
101 auto const s = setup_DatabaseCon(env.app().config());
+
102 if (BEAST_EXPECT(s.globalPragma->size() == 3))
+
103 {
+
104 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=memory;");
+
105 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=off;");
+
106 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=memory;");
+
107 }
+
108 }
+
109 {
+
110 // Override individual settings
+ +
112
+
113 bool found = false;
+
114 Env env = [&]() {
+
115 auto p = test::jtx::envconfig();
+
116 {
+
117 auto& section = p->section("sqlite");
+
118 section.set("journal_mode", "off");
+
119 section.set("synchronous", "extra");
+
120 section.set("temp_store", "default");
+
121 }
+
122
+
123 return Env(
+
124 *this,
+
125 std::move(p),
+
126 std::make_unique<CheckMessageLogs>(integrityWarning, &found),
+ +
128 }();
+
129
+
130 // No warning, even though higher risk settings were used because
+
131 // LEDGER_HISTORY is small
+
132 BEAST_EXPECT(!found);
+
133 auto const s = setup_DatabaseCon(env.app().config());
+
134 if (BEAST_EXPECT(s.globalPragma->size() == 3))
+
135 {
+
136 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=off;");
+
137 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=extra;");
+
138 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=default;");
+
139 }
+
140 }
+
141 {
+
142 // Override individual settings with large history
+ +
144
+
145 bool found = false;
+
146 Env env = [&]() {
+
147 auto p = test::jtx::envconfig();
+
148 {
+
149 auto& section = p->section("sqlite");
+
150 section.set("journal_mode", "off");
+
151 section.set("synchronous", "extra");
+
152 section.set("temp_store", "default");
+
153 }
+
154 p->LEDGER_HISTORY = 50'000'000;
+
155
+
156 return Env(
+
157 *this,
+
158 std::move(p),
+
159 std::make_unique<CheckMessageLogs>(integrityWarning, &found),
+ +
161 }();
+
162
+
163 // No warning, even though higher risk settings were used because
+
164 // LEDGER_HISTORY is small
+
165 BEAST_EXPECT(found);
+
166 auto const s = setup_DatabaseCon(env.app().config());
+
167 if (BEAST_EXPECT(s.globalPragma->size() == 3))
+
168 {
+
169 BEAST_EXPECT(s.globalPragma->at(0) == "PRAGMA journal_mode=off;");
+
170 BEAST_EXPECT(s.globalPragma->at(1) == "PRAGMA synchronous=extra;");
+
171 BEAST_EXPECT(s.globalPragma->at(2) == "PRAGMA temp_store=default;");
+
172 }
+
173 }
+
174 {
+
175 // Error: Mix safety_level and individual settings
+ +
177 auto const expected =
+
178 "Failed to initialize SQL databases: "
+
179 "Configuration file may not define both \"safety_level\" and "
+
180 "\"journal_mode\"";
+
181 bool found = false;
+
182
+
183 auto p = test::jtx::envconfig();
+
184 {
+
185 auto& section = p->section("sqlite");
+
186 section.set("safety_level", "low");
+
187 section.set("journal_mode", "off");
+
188 section.set("synchronous", "extra");
+
189 section.set("temp_store", "default");
+
190 }
+
191
+
192 try
+
193 {
+
194 Env env(
+
195 *this,
+
196 std::move(p),
+
197 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
199 fail();
+
200 }
+
201 catch (...)
+
202 {
+
203 BEAST_EXPECT(found);
+
204 }
+
205 }
+
206 {
+
207 // Error: Mix safety_level and one setting (gotta catch 'em all)
+ +
209 auto const expected =
+
210 "Failed to initialize SQL databases: Configuration file may "
+
211 "not define both \"safety_level\" and \"journal_mode\"";
+
212 bool found = false;
+
213
+
214 auto p = test::jtx::envconfig();
+
215 {
+
216 auto& section = p->section("sqlite");
+
217 section.set("safety_level", "high");
+
218 section.set("journal_mode", "off");
+
219 }
+
220
+
221 try
+
222 {
+
223 Env env(
+
224 *this,
+
225 std::move(p),
+
226 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
228 fail();
+
229 }
+
230 catch (...)
+
231 {
+
232 BEAST_EXPECT(found);
+
233 }
+
234 }
+
235 {
+
236 // Error: Mix safety_level and one setting (gotta catch 'em all)
+ +
238 auto const expected =
+
239 "Failed to initialize SQL databases: Configuration file may "
+
240 "not define both \"safety_level\" and \"synchronous\"";
+
241 bool found = false;
+
242
+
243 auto p = test::jtx::envconfig();
+
244 {
+
245 auto& section = p->section("sqlite");
+
246 section.set("safety_level", "low");
+
247 section.set("synchronous", "extra");
+
248 }
+
249
+
250 try
+
251 {
+
252 Env env(
+
253 *this,
+
254 std::move(p),
+
255 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
257 fail();
+
258 }
+
259 catch (...)
+
260 {
+
261 BEAST_EXPECT(found);
+
262 }
+
263 }
+
264 {
+
265 // Error: Mix safety_level and one setting (gotta catch 'em all)
+ +
267 auto const expected =
+
268 "Failed to initialize SQL databases: Configuration file may "
+
269 "not define both \"safety_level\" and \"temp_store\"";
+
270 bool found = false;
+
271
+
272 auto p = test::jtx::envconfig();
+
273 {
+
274 auto& section = p->section("sqlite");
+
275 section.set("safety_level", "high");
+
276 section.set("temp_store", "default");
+
277 }
+
278
+
279 try
+
280 {
+
281 Env env(
+
282 *this,
+
283 std::move(p),
+
284 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
286 fail();
+
287 }
+
288 catch (...)
+
289 {
+
290 BEAST_EXPECT(found);
+
291 }
+
292 }
+
293 {
+
294 // Error: Invalid value
+ +
296 auto const expected =
+
297 "Failed to initialize SQL databases: Invalid safety_level "
+
298 "value: slow";
+
299 bool found = false;
+
300
+
301 auto p = test::jtx::envconfig();
+
302 {
+
303 auto& section = p->section("sqlite");
+
304 section.set("safety_level", "slow");
+
305 }
+
306
+
307 try
+
308 {
+
309 Env env(
+
310 *this,
+
311 std::move(p),
+
312 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
314 fail();
+
315 }
+
316 catch (...)
+
317 {
+
318 BEAST_EXPECT(found);
+
319 }
+
320 }
+
321 {
+
322 // Error: Invalid value
+ +
324 auto const expected =
+
325 "Failed to initialize SQL databases: Invalid journal_mode "
+
326 "value: fast";
+
327 bool found = false;
+
328
+
329 auto p = test::jtx::envconfig();
+
330 {
+
331 auto& section = p->section("sqlite");
+
332 section.set("journal_mode", "fast");
+
333 }
+
334
+
335 try
+
336 {
+
337 Env env(
+
338 *this,
+
339 std::move(p),
+
340 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
342 fail();
+
343 }
+
344 catch (...)
+
345 {
+
346 BEAST_EXPECT(found);
+
347 }
+
348 }
+
349 {
+
350 // Error: Invalid value
+ +
352 auto const expected =
+
353 "Failed to initialize SQL databases: Invalid synchronous "
+
354 "value: instant";
+
355 bool found = false;
+
356
+
357 auto p = test::jtx::envconfig();
+
358 {
+
359 auto& section = p->section("sqlite");
+
360 section.set("synchronous", "instant");
+
361 }
+
362
+
363 try
+
364 {
+
365 Env env(
+
366 *this,
+
367 std::move(p),
+
368 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
370 fail();
+
371 }
+
372 catch (...)
+
373 {
+
374 BEAST_EXPECT(found);
+
375 }
+
376 }
+
377 {
+
378 // Error: Invalid value
+ +
380 auto const expected =
+
381 "Failed to initialize SQL databases: Invalid temp_store "
+
382 "value: network";
+
383 bool found = false;
+
384
+
385 auto p = test::jtx::envconfig();
+
386 {
+
387 auto& section = p->section("sqlite");
+
388 section.set("temp_store", "network");
+
389 }
+
390
+
391 try
+
392 {
+
393 Env env(
+
394 *this,
+
395 std::move(p),
+
396 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
398 fail();
+
399 }
+
400 catch (...)
+
401 {
+
402 BEAST_EXPECT(found);
+
403 }
+
404 }
+
405 {
+
406 // N/A: Default values
+
407 Env env(*this);
+
408 auto const s = setup_DatabaseCon(env.app().config());
+
409 if (BEAST_EXPECT(s.txPragma.size() == 4))
+
410 {
+
411 BEAST_EXPECT(s.txPragma.at(0) == "PRAGMA page_size=4096;");
+
412 BEAST_EXPECT(s.txPragma.at(1) == "PRAGMA journal_size_limit=1582080;");
+
413 BEAST_EXPECT(s.txPragma.at(2) == "PRAGMA max_page_count=4294967294;");
+
414 BEAST_EXPECT(s.txPragma.at(3) == "PRAGMA mmap_size=17179869184;");
+
415 }
+
416 }
+
417 {
+
418 // Success: Valid values
+
419 Env env = [&]() {
+
420 auto p = test::jtx::envconfig();
+
421 {
+
422 auto& section = p->section("sqlite");
+
423 section.set("page_size", "512");
+
424 section.set("journal_size_limit", "2582080");
+
425 }
+
426 return Env(*this, std::move(p));
+
427 }();
+
428 auto const s = setup_DatabaseCon(env.app().config());
+
429 if (BEAST_EXPECT(s.txPragma.size() == 4))
+
430 {
+
431 BEAST_EXPECT(s.txPragma.at(0) == "PRAGMA page_size=512;");
+
432 BEAST_EXPECT(s.txPragma.at(1) == "PRAGMA journal_size_limit=2582080;");
+
433 BEAST_EXPECT(s.txPragma.at(2) == "PRAGMA max_page_count=4294967294;");
+
434 BEAST_EXPECT(s.txPragma.at(3) == "PRAGMA mmap_size=17179869184;");
+
435 }
+
436 }
+
437 {
+
438 // Error: Invalid values
+
439 auto const expected = "Invalid page_size. Must be between 512 and 65536.";
+
440 bool found = false;
+
441 auto p = test::jtx::envconfig();
+
442 {
+
443 auto& section = p->section("sqlite");
+
444 section.set("page_size", "256");
+
445 }
+
446 try
+
447 {
+
448 Env env(
+
449 *this,
+
450 std::move(p),
+
451 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
453 fail();
+
454 }
+
455 catch (...)
+
456 {
+
457 BEAST_EXPECT(found);
+
458 }
+
459 }
+
460 {
+
461 // Error: Invalid values
+
462 auto const expected = "Invalid page_size. Must be between 512 and 65536.";
+
463 bool found = false;
+
464 auto p = test::jtx::envconfig();
+
465 {
+
466 auto& section = p->section("sqlite");
+
467 section.set("page_size", "131072");
+
468 }
+
469 try
+
470 {
+
471 Env env(
+
472 *this,
+
473 std::move(p),
+
474 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
476 fail();
+
477 }
+
478 catch (...)
+
479 {
+
480 BEAST_EXPECT(found);
+
481 }
+
482 }
+
483 {
+
484 // Error: Invalid values
+
485 auto const expected = "Invalid page_size. Must be a power of 2.";
+
486 bool found = false;
+
487 auto p = test::jtx::envconfig();
+
488 {
+
489 auto& section = p->section("sqlite");
+
490 section.set("page_size", "513");
+
491 }
+
492 try
+
493 {
+
494 Env env(
+
495 *this,
+
496 std::move(p),
+
497 std::make_unique<CheckMessageLogs>(expected, &found),
+ +
499 fail();
+
500 }
+
501 catch (...)
+
502 {
+
503 BEAST_EXPECT(found);
+
504 }
+
505 }
+
506 }
-
508
-
509 //--------------------------------------------------------------------------
-
510
-
511 void
-
-
512 testImport(std::string const& destBackendType, std::string const& srcBackendType, std::int64_t seedValue)
-
513 {
-
514 DummyScheduler scheduler;
-
515
-
516 beast::temp_dir node_db;
-
517 Section srcParams;
-
518 srcParams.set("type", srcBackendType);
-
519 srcParams.set("path", node_db.path());
-
520
-
521 // Create a batch
- -
523
-
524 // Write to source db
-
525 {
- -
527 Manager::instance().make_Database(megabytes(4), scheduler, 2, srcParams, journal_);
-
528 storeBatch(*src, batch);
-
529 }
-
530
-
531 Batch copy;
-
532
-
533 {
-
534 // Re-open the db
- -
536 Manager::instance().make_Database(megabytes(4), scheduler, 2, srcParams, journal_);
-
537
-
538 // Set up the destination database
-
539 beast::temp_dir dest_db;
-
540 Section destParams;
-
541 destParams.set("type", destBackendType);
-
542 destParams.set("path", dest_db.path());
-
543
- -
545 Manager::instance().make_Database(megabytes(4), scheduler, 2, destParams, journal_);
-
546
-
547 testcase("import into '" + destBackendType + "' from '" + srcBackendType + "'");
-
548
-
549 // Do the import
-
550 dest->importDatabase(*src);
-
551
-
552 // Get the results of the import
-
553 fetchCopyOfBatch(*dest, &copy, batch);
-
554 }
-
555
-
556 // Canonicalize the source and destination batches
-
557 std::sort(batch.begin(), batch.end(), LessThan{});
-
558 std::sort(copy.begin(), copy.end(), LessThan{});
-
559 BEAST_EXPECT(areBatchesEqual(batch, copy));
-
560 }
+
507
+
508 //--------------------------------------------------------------------------
+
509
+
510 void
+
+
511 testImport(std::string const& destBackendType, std::string const& srcBackendType, std::int64_t seedValue)
+
512 {
+
513 DummyScheduler scheduler;
+
514
+
515 beast::temp_dir node_db;
+
516 Section srcParams;
+
517 srcParams.set("type", srcBackendType);
+
518 srcParams.set("path", node_db.path());
+
519
+
520 // Create a batch
+ +
522
+
523 // Write to source db
+
524 {
+ +
526 Manager::instance().make_Database(megabytes(4), scheduler, 2, srcParams, journal_);
+
527 storeBatch(*src, batch);
+
528 }
+
529
+
530 Batch copy;
+
531
+
532 {
+
533 // Re-open the db
+ +
535 Manager::instance().make_Database(megabytes(4), scheduler, 2, srcParams, journal_);
+
536
+
537 // Set up the destination database
+
538 beast::temp_dir dest_db;
+
539 Section destParams;
+
540 destParams.set("type", destBackendType);
+
541 destParams.set("path", dest_db.path());
+
542
+ +
544 Manager::instance().make_Database(megabytes(4), scheduler, 2, destParams, journal_);
+
545
+
546 testcase("import into '" + destBackendType + "' from '" + srcBackendType + "'");
+
547
+
548 // Do the import
+
549 dest->importDatabase(*src);
+
550
+
551 // Get the results of the import
+
552 fetchCopyOfBatch(*dest, &copy, batch);
+
553 }
+
554
+
555 // Canonicalize the source and destination batches
+
556 std::sort(batch.begin(), batch.end(), LessThan{});
+
557 std::sort(copy.begin(), copy.end(), LessThan{});
+
558 BEAST_EXPECT(areBatchesEqual(batch, copy));
+
559 }
-
561
-
562 //--------------------------------------------------------------------------
-
563
-
564 void
-
- -
566 std::string const& type,
-
567 bool const testPersistence,
-
568 std::int64_t const seedValue,
-
569 int numObjsToTest = 2000)
-
570 {
-
571 DummyScheduler scheduler;
-
572
-
573 std::string s = "NodeStore backend '" + type + "'";
-
574
-
575 testcase(s);
-
576
-
577 beast::temp_dir node_db;
-
578 Section nodeParams;
-
579 nodeParams.set("type", type);
-
580 nodeParams.set("path", node_db.path());
-
581
-
582 beast::xor_shift_engine rng(seedValue);
-
583
-
584 // Create a batch
-
585 auto batch = createPredictableBatch(numObjsToTest, rng());
-
586
-
587 {
-
588 // Open the database
- -
590 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
-
591
-
592 // Write the batch
-
593 storeBatch(*db, batch);
-
594
-
595 {
-
596 // Read it back in
-
597 Batch copy;
-
598 fetchCopyOfBatch(*db, &copy, batch);
-
599 BEAST_EXPECT(areBatchesEqual(batch, copy));
-
600 }
-
601
-
602 {
-
603 // Reorder and read the copy again
-
604 std::shuffle(batch.begin(), batch.end(), rng);
-
605 Batch copy;
-
606 fetchCopyOfBatch(*db, &copy, batch);
-
607 BEAST_EXPECT(areBatchesEqual(batch, copy));
-
608 }
-
609 }
-
610
-
611 if (testPersistence)
-
612 {
-
613 // Re-open the database without the ephemeral DB
- -
615 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
-
616
-
617 // Read it back in
-
618 Batch copy;
-
619 fetchCopyOfBatch(*db, &copy, batch);
-
620
-
621 // Canonicalize the source and destination batches
-
622 std::sort(batch.begin(), batch.end(), LessThan{});
-
623 std::sort(copy.begin(), copy.end(), LessThan{});
-
624 BEAST_EXPECT(areBatchesEqual(batch, copy));
-
625 }
-
626
-
627 if (type == "memory")
-
628 {
-
629 // Verify default earliest ledger sequence
-
630 {
- -
632 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
-
633 BEAST_EXPECT(db->earliestLedgerSeq() == XRP_LEDGER_EARLIEST_SEQ);
-
634 }
-
635
-
636 // Set an invalid earliest ledger sequence
-
637 try
-
638 {
-
639 nodeParams.set("earliest_seq", "0");
- -
641 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
-
642 }
-
643 catch (std::runtime_error const& e)
-
644 {
-
645 BEAST_EXPECT(std::strcmp(e.what(), "Invalid earliest_seq") == 0);
-
646 }
-
647
-
648 {
-
649 // Set a valid earliest ledger sequence
-
650 nodeParams.set("earliest_seq", "1");
- -
652 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
-
653
-
654 // Verify database uses the earliest ledger sequence setting
-
655 BEAST_EXPECT(db->earliestLedgerSeq() == 1);
-
656 }
-
657
-
658 // Create another database that attempts to set the value again
-
659 try
-
660 {
-
661 // Set to default earliest ledger sequence
-
662 nodeParams.set("earliest_seq", std::to_string(XRP_LEDGER_EARLIEST_SEQ));
- -
664 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
-
665 }
-
666 catch (std::runtime_error const& e)
-
667 {
-
668 BEAST_EXPECT(std::strcmp(e.what(), "earliest_seq set more than once") == 0);
-
669 }
-
670 }
-
671 }
+
560
+
561 //--------------------------------------------------------------------------
+
562
+
563 void
+
+ +
565 std::string const& type,
+
566 bool const testPersistence,
+
567 std::int64_t const seedValue,
+
568 int numObjsToTest = 2000)
+
569 {
+
570 DummyScheduler scheduler;
+
571
+
572 std::string s = "NodeStore backend '" + type + "'";
+
573
+
574 testcase(s);
+
575
+
576 beast::temp_dir node_db;
+
577 Section nodeParams;
+
578 nodeParams.set("type", type);
+
579 nodeParams.set("path", node_db.path());
+
580
+
581 beast::xor_shift_engine rng(seedValue);
+
582
+
583 // Create a batch
+
584 auto batch = createPredictableBatch(numObjsToTest, rng());
+
585
+
586 {
+
587 // Open the database
+ +
589 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
+
590
+
591 // Write the batch
+
592 storeBatch(*db, batch);
+
593
+
594 {
+
595 // Read it back in
+
596 Batch copy;
+
597 fetchCopyOfBatch(*db, &copy, batch);
+
598 BEAST_EXPECT(areBatchesEqual(batch, copy));
+
599 }
+
600
+
601 {
+
602 // Reorder and read the copy again
+
603 std::shuffle(batch.begin(), batch.end(), rng);
+
604 Batch copy;
+
605 fetchCopyOfBatch(*db, &copy, batch);
+
606 BEAST_EXPECT(areBatchesEqual(batch, copy));
+
607 }
+
608 }
+
609
+
610 if (testPersistence)
+
611 {
+
612 // Re-open the database without the ephemeral DB
+ +
614 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
+
615
+
616 // Read it back in
+
617 Batch copy;
+
618 fetchCopyOfBatch(*db, &copy, batch);
+
619
+
620 // Canonicalize the source and destination batches
+
621 std::sort(batch.begin(), batch.end(), LessThan{});
+
622 std::sort(copy.begin(), copy.end(), LessThan{});
+
623 BEAST_EXPECT(areBatchesEqual(batch, copy));
+
624 }
+
625
+
626 if (type == "memory")
+
627 {
+
628 // Verify default earliest ledger sequence
+
629 {
+ +
631 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
+
632 BEAST_EXPECT(db->earliestLedgerSeq() == XRP_LEDGER_EARLIEST_SEQ);
+
633 }
+
634
+
635 // Set an invalid earliest ledger sequence
+
636 try
+
637 {
+
638 nodeParams.set("earliest_seq", "0");
+ +
640 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
+
641 }
+
642 catch (std::runtime_error const& e)
+
643 {
+
644 BEAST_EXPECT(std::strcmp(e.what(), "Invalid earliest_seq") == 0);
+
645 }
+
646
+
647 {
+
648 // Set a valid earliest ledger sequence
+
649 nodeParams.set("earliest_seq", "1");
+ +
651 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
+
652
+
653 // Verify database uses the earliest ledger sequence setting
+
654 BEAST_EXPECT(db->earliestLedgerSeq() == 1);
+
655 }
+
656
+
657 // Create another database that attempts to set the value again
+
658 try
+
659 {
+
660 // Set to default earliest ledger sequence
+
661 nodeParams.set("earliest_seq", std::to_string(XRP_LEDGER_EARLIEST_SEQ));
+ +
663 Manager::instance().make_Database(megabytes(4), scheduler, 2, nodeParams, journal_);
+
664 }
+
665 catch (std::runtime_error const& e)
+
666 {
+
667 BEAST_EXPECT(std::strcmp(e.what(), "earliest_seq set more than once") == 0);
+
668 }
+
669 }
+
670 }
-
672
-
673 //--------------------------------------------------------------------------
-
674
-
675 void
-
-
676 run() override
-
677 {
-
678 std::int64_t const seedValue = 50;
-
679
-
680 testConfig();
-
681
-
682 testNodeStore("memory", false, seedValue);
-
683
-
684 // Persistent backend tests
-
685 {
-
686 testNodeStore("nudb", true, seedValue);
-
687
-
688#if XRPL_ROCKSDB_AVAILABLE
-
689 testNodeStore("rocksdb", true, seedValue);
-
690#endif
-
691 }
-
692
-
693 // Import tests
-
694 {
-
695 testImport("nudb", "nudb", seedValue);
-
696
-
697#if XRPL_ROCKSDB_AVAILABLE
-
698 testImport("rocksdb", "rocksdb", seedValue);
-
699#endif
-
700
-
701#if XRPL_ENABLE_SQLITE_BACKEND_TESTS
-
702 testImport("sqlite", "sqlite", seedValue);
-
703#endif
-
704 }
-
705 }
+
671
+
672 //--------------------------------------------------------------------------
+
673
+
674 void
+
+
675 run() override
+
676 {
+
677 std::int64_t const seedValue = 50;
+
678
+
679 testConfig();
+
680
+
681 testNodeStore("memory", false, seedValue);
+
682
+
683 // Persistent backend tests
+
684 {
+
685 testNodeStore("nudb", true, seedValue);
+
686
+
687#if XRPL_ROCKSDB_AVAILABLE
+
688 testNodeStore("rocksdb", true, seedValue);
+
689#endif
+
690 }
+
691
+
692 // Import tests
+
693 {
+
694 testImport("nudb", "nudb", seedValue);
+
695
+
696#if XRPL_ROCKSDB_AVAILABLE
+
697 testImport("rocksdb", "rocksdb", seedValue);
+
698#endif
+
699
+
700#if XRPL_ENABLE_SQLITE_BACKEND_TESTS
+
701 testImport("sqlite", "sqlite", seedValue);
+
702#endif
+
703 }
+
704 }
-
706};
+
705};
-
707
-
708BEAST_DEFINE_TESTSUITE(Database, nodestore, xrpl);
-
709
-
710} // namespace NodeStore
-
711} // namespace xrpl
+
706
+
707BEAST_DEFINE_TESTSUITE(Database, nodestore, xrpl);
+
708
+
709} // namespace NodeStore
+
710} // namespace xrpl
RAII temporary directory.
Definition temp_dir.h:15
@@ -811,13 +810,13 @@ $(document).ready(function() { init_codefold(0); });
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:516
virtual Config & config()=0
- -
void run() override
Runs the suite.
-
void testImport(std::string const &destBackendType, std::string const &srcBackendType, std::int64_t seedValue)
- -
void testNodeStore(std::string const &type, bool const testPersistence, std::int64_t const seedValue, int numObjsToTest=2000)
- - + +
void run() override
Runs the suite.
+
void testImport(std::string const &destBackendType, std::string const &srcBackendType, std::int64_t seedValue)
+ +
void testNodeStore(std::string const &type, bool const testPersistence, std::int64_t const seedValue, int numObjsToTest=2000)
+ +
Persistency layer for NodeObject.
Definition Database.h:31
Simple NodeStore Scheduler that just performs the tasks synchronously.
static Manager & instance()
Returns the instance of the manager singleton.
@@ -841,14 +840,14 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
constexpr auto megabytes(T value) noexcept
-
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
+
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition Config.cpp:1043
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ
The XRP ledger network's earliest allowed sequence.
T shuffle(T... args)
T sort(T... args)
T strcmp(T... args)
-
static std::unique_ptr< std::vector< std::string > const > globalPragma
Definition DatabaseCon.h:88
+
static std::unique_ptr< std::vector< std::string > const > globalPragma
Definition DatabaseCon.h:87
Binary function that satisfies the strict-weak-ordering requirement.
Definition TestBase.h:27
T to_string(T... args)
diff --git a/DirectStep_8cpp_source.html b/DirectStep_8cpp_source.html index 14bfe9d894..e6ce6abdc2 100644 --- a/DirectStep_8cpp_source.html +++ b/DirectStep_8cpp_source.html @@ -614,13 +614,13 @@ $(document).ready(function() { init_codefold(0); });
457
458 Issue const srcToDstIss(currency_, redeems(srcDebtDir) ? dst_ : src_);
459
-
460 JLOG(j_.trace()) << "DirectStepI::rev"
+
460 JLOG(j_.trace()) << "DirectStepI::rev"
461 << " srcRedeems: " << redeems(srcDebtDir) << " outReq: " << to_string(out)
462 << " maxSrcToDst: " << to_string(maxSrcToDst) << " srcQOut: " << srcQOut << " dstQIn: " << dstQIn;
463
464 if (maxSrcToDst.signum() <= 0)
465 {
-
466 JLOG(j_.trace()) << "DirectStepI::rev: dry";
+
466 JLOG(j_.trace()) << "DirectStepI::rev: dry";
467 cache_.emplace(IOUAmount(beast::zero), IOUAmount(beast::zero), IOUAmount(beast::zero), srcDebtDir);
468 return {beast::zero, beast::zero};
469 }
@@ -638,7 +638,7 @@ $(document).ready(function() { init_codefold(0); });
481 toSTAmount(srcToDst, srcToDstIss),
482 /*checkIssuer*/ true,
483 j_);
-
484 JLOG(j_.trace()) << "DirectStepI::rev: Non-limiting"
+
484 JLOG(j_.trace()) << "DirectStepI::rev: Non-limiting"
485 << " srcRedeems: " << redeems(srcDebtDir) << " in: " << to_string(in)
486 << " srcToDst: " << to_string(srcToDst) << " out: " << to_string(out);
487 return {in, out};
@@ -655,7 +655,7 @@ $(document).ready(function() { init_codefold(0); });
498 toSTAmount(maxSrcToDst, srcToDstIss),
499 /*checkIssuer*/ true,
500 j_);
-
501 JLOG(j_.trace()) << "DirectStepI::rev: Limiting"
+
501 JLOG(j_.trace()) << "DirectStepI::rev: Limiting"
502 << " srcRedeems: " << redeems(srcDebtDir) << " in: " << to_string(in)
503 << " srcToDst: " << to_string(maxSrcToDst) << " out: " << to_string(out);
504 return {in, actualOut};
@@ -686,7 +686,7 @@ $(document).ready(function() { init_codefold(0); });
527 {
528 // Detect large diffs on forward pass so they may be
529 // investigated
-
530 JLOG(j_.warn()) << "DirectStepI::fwd: setCacheLimiting"
+
530 JLOG(j_.warn()) << "DirectStepI::fwd: setCacheLimiting"
531 << " fwdIn: " << to_string(fwdIn) << " cacheIn: " << to_string(cache_->in)
532 << " fwdSrcToDst: " << to_string(fwdSrcToDst)
533 << " cacheSrcToDst: " << to_string(cache_->srcToDst) << " fwdOut: " << to_string(fwdOut)
@@ -723,13 +723,13 @@ $(document).ready(function() { init_codefold(0); });
561
562 Issue const srcToDstIss(currency_, redeems(srcDebtDir) ? dst_ : src_);
563
-
564 JLOG(j_.trace()) << "DirectStepI::fwd"
+
564 JLOG(j_.trace()) << "DirectStepI::fwd"
565 << " srcRedeems: " << redeems(srcDebtDir) << " inReq: " << to_string(in)
566 << " maxSrcToDst: " << to_string(maxSrcToDst) << " srcQOut: " << srcQOut << " dstQIn: " << dstQIn;
567
568 if (maxSrcToDst.signum() <= 0)
569 {
-
570 JLOG(j_.trace()) << "DirectStepI::fwd: dry";
+
570 JLOG(j_.trace()) << "DirectStepI::fwd: dry";
571 cache_.emplace(IOUAmount(beast::zero), IOUAmount(beast::zero), IOUAmount(beast::zero), srcDebtDir);
572 return {beast::zero, beast::zero};
573 }
@@ -747,7 +747,7 @@ $(document).ready(function() { init_codefold(0); });
585 toSTAmount(cache_->srcToDst, srcToDstIss),
586 /*checkIssuer*/ true,
587 j_);
-
588 JLOG(j_.trace()) << "DirectStepI::fwd: Non-limiting"
+
588 JLOG(j_.trace()) << "DirectStepI::fwd: Non-limiting"
589 << " srcRedeems: " << redeems(srcDebtDir) << " in: " << to_string(in)
590 << " srcToDst: " << to_string(srcToDst) << " out: " << to_string(out);
591 }
@@ -764,7 +764,7 @@ $(document).ready(function() { init_codefold(0); });
602 toSTAmount(cache_->srcToDst, srcToDstIss),
603 /*checkIssuer*/ true,
604 j_);
-
605 JLOG(j_.trace()) << "DirectStepI::rev: Limiting"
+
605 JLOG(j_.trace()) << "DirectStepI::rev: Limiting"
606 << " srcRedeems: " << redeems(srcDebtDir) << " in: " << to_string(actualIn)
607 << " srcToDst: " << to_string(srcToDst) << " out: " << to_string(out);
608 }
@@ -779,7 +779,7 @@ $(document).ready(function() { init_codefold(0); });
615{
616 if (!cache_)
617 {
-
618 JLOG(j_.trace()) << "Expected valid cache in validFwd";
+
618 JLOG(j_.trace()) << "Expected valid cache in validFwd";
619 return {false, EitherAmount(IOUAmount(beast::zero))};
620 }
621
@@ -802,7 +802,7 @@ $(document).ready(function() { init_codefold(0); });
638
639 if (maxSrcToDst < cache_->srcToDst)
640 {
-
641 JLOG(j_.warn()) << "DirectStepI: Strand re-execute check failed."
+
641 JLOG(j_.warn()) << "DirectStepI: Strand re-execute check failed."
642 << " Exceeded max src->dst limit"
643 << " max src->dst: " << to_string(maxSrcToDst)
644 << " actual src->dst: " << to_string(cache_->srcToDst);
@@ -811,7 +811,7 @@ $(document).ready(function() { init_codefold(0); });
647
648 if (!(checkNear(savCache.in, cache_->in) && checkNear(savCache.out, cache_->out)))
649 {
-
650 JLOG(j_.warn()) << "DirectStepI: Strand re-execute check failed."
+
650 JLOG(j_.warn()) << "DirectStepI: Strand re-execute check failed."
651 << " ExpectedIn: " << to_string(savCache.in) << " CachedIn: " << to_string(cache_->in)
652 << " ExpectedOut: " << to_string(savCache.out) << " CachedOut: " << to_string(cache_->out);
653 return {false, EitherAmount(cache_->out)};
@@ -920,20 +920,20 @@ $(document).ready(function() { init_codefold(0); });
744 // The following checks apply for both payments and offer crossing.
745 if (!src_ || !dst_)
746 {
-
747 JLOG(j_.debug()) << "DirectStepI: specified bad account.";
+
747 JLOG(j_.debug()) << "DirectStepI: specified bad account.";
748 return temBAD_PATH;
749 }
750
751 if (src_ == dst_)
752 {
-
753 JLOG(j_.debug()) << "DirectStepI: same src and dst.";
+
753 JLOG(j_.debug()) << "DirectStepI: same src and dst.";
754 return temBAD_PATH;
755 }
756
757 auto const sleSrc = ctx.view.read(keylet::account(src_));
758 if (!sleSrc)
759 {
-
760 JLOG(j_.warn()) << "DirectStepI: can't receive IOUs from non-existent issuer: " << src_;
+
760 JLOG(j_.warn()) << "DirectStepI: can't receive IOUs from non-existent issuer: " << src_;
761 return terNO_ACCOUNT;
762 }
763
@@ -983,7 +983,7 @@ $(document).ready(function() { init_codefold(0); });
807
808 if (!ctx.seenDirectIssues[0].insert(srcIssue).second || !ctx.seenDirectIssues[1].insert(dstIssue).second)
809 {
-
810 JLOG(j_.debug()) << "DirectStepI: loop detected: Index: " << ctx.strandSize << ' ' << *this;
+
810 JLOG(j_.debug()) << "DirectStepI: loop detected: Index: " << ctx.strandSize << ' ' << *this;
811 return temBAD_PATH_LOOP;
812 }
813 }
@@ -1054,6 +1054,7 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
Stream debug() const
Definition Journal.h:300
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
+
Stream warn() const
Definition Journal.h:312
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:114
std::uint32_t quality(ReadView const &sb, QualityDirection qDir) const
diff --git a/DisputedTx_8h_source.html b/DisputedTx_8h_source.html index 73d1d120fb..60b5d7c8b5 100644 --- a/DisputedTx_8h_source.html +++ b/DisputedTx_8h_source.html @@ -240,12 +240,12 @@ $(document).ready(function() { init_codefold(0); });
196 {
197 if (votesYes)
198 {
-
199 JLOG(j_.debug()) << "Peer " << peer << " votes YES on " << tx_.id();
+
199 JLOG(j_.debug()) << "Peer " << peer << " votes YES on " << tx_.id();
200 ++yays_;
201 }
202 else
203 {
-
204 JLOG(j_.debug()) << "Peer " << peer << " votes NO on " << tx_.id();
+
204 JLOG(j_.debug()) << "Peer " << peer << " votes NO on " << tx_.id();
205 ++nays_;
206 }
207 return true;
@@ -253,7 +253,7 @@ $(document).ready(function() { init_codefold(0); });
209 // changes vote to yes
210 else if (votesYes && !it->second)
211 {
-
212 JLOG(j_.debug()) << "Peer " << peer << " now votes YES on " << tx_.id();
+
212 JLOG(j_.debug()) << "Peer " << peer << " now votes YES on " << tx_.id();
213 --nays_;
214 ++yays_;
215 it->second = true;
@@ -262,7 +262,7 @@ $(document).ready(function() { init_codefold(0); });
218 // changes vote to no
219 else if (!votesYes && it->second)
220 {
-
221 JLOG(j_.debug()) << "Peer " << peer << " now votes NO on " << tx_.id();
+
221 JLOG(j_.debug()) << "Peer " << peer << " now votes NO on " << tx_.id();
222 ++nays_;
223 --yays_;
224 it->second = false;
@@ -337,16 +337,16 @@ $(document).ready(function() { init_codefold(0); });
289 if (newPosition == ourVote_)
290 {
291 ++currentVoteCounter_;
-
292 JLOG(j_.info()) << "No change (" << (ourVote_ ? "YES" : "NO") << ") on " << tx_.id() << " : weight " << weight
+
292 JLOG(j_.info()) << "No change (" << (ourVote_ ? "YES" : "NO") << ") on " << tx_.id() << " : weight " << weight
293 << ", percent " << percentTime << ", round(s) with this vote: " << currentVoteCounter_;
-
294 JLOG(j_.debug()) << Json::Compact{getJson()};
+
294 JLOG(j_.debug()) << Json::Compact{getJson()};
295 return false;
296 }
297
298 currentVoteCounter_ = 0;
299 ourVote_ = newPosition;
-
300 JLOG(j_.debug()) << "We now vote " << (ourVote_ ? "YES" : "NO") << " on " << tx_.id();
-
301 JLOG(j_.debug()) << Json::Compact{getJson()};
+
300 JLOG(j_.debug()) << "We now vote " << (ourVote_ ? "YES" : "NO") << " on " << tx_.id();
+
301 JLOG(j_.debug()) << Json::Compact{getJson()};
302 return true;
303}
@@ -382,6 +382,8 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:130
A generic endpoint for log messages.
Definition Journal.h:40
Stream error() const
Definition Journal.h:318
+
Stream debug() const
Definition Journal.h:300
+
Stream info() const
Definition Journal.h:306
A transaction discovered to be in dispute during consensus.
Definition DisputedTx.h:29
std::size_t currentVoteCounter_
The number of rounds we've gone without changing our vote.
Definition DisputedTx.h:179
beast::Journal const j_
Definition DisputedTx.h:184
diff --git a/DoManifest_8cpp_source.html b/DoManifest_8cpp_source.html index 24be25423a..b9d7df256c 100644 --- a/DoManifest_8cpp_source.html +++ b/DoManifest_8cpp_source.html @@ -143,11 +143,11 @@ $(document).ready(function() { init_codefold(0); });
59} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
-
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
Definition Manifest.cpp:273
-
std::optional< std::string > getDomain(PublicKey const &pk) const
Returns domain claimed by a given public key.
Definition Manifest.cpp:308
-
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:285
-
std::optional< std::string > getManifest(PublicKey const &pk) const
Returns manifest corresponding to a given public key.
Definition Manifest.cpp:320
-
std::optional< std::uint32_t > getSequence(PublicKey const &pk) const
Returns master key's current manifest sequence.
Definition Manifest.cpp:296
+
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
Definition Manifest.cpp:272
+
std::optional< std::string > getDomain(PublicKey const &pk) const
Returns domain claimed by a given public key.
Definition Manifest.cpp:307
+
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:284
+
std::optional< std::string > getManifest(PublicKey const &pk) const
Returns manifest corresponding to a given public key.
Definition Manifest.cpp:319
+
std::optional< std::uint32_t > getSequence(PublicKey const &pk) const
Returns master key's current manifest sequence.
Definition Manifest.cpp:295
virtual ManifestCache & validatorManifests()=0
Json::Value missing_field_error(std::string const &name)
Definition ErrorCodes.h:226
void inject_error(error_code_i code, Json::Value &json)
Add or update the json update to reflect the error code.
diff --git a/Door_8h_source.html b/Door_8h_source.html index 1ff9e53d78..8ee91dcc36 100644 --- a/Door_8h_source.html +++ b/Door_8h_source.html @@ -426,7 +426,7 @@ $(document).ready(function() { init_codefold(0); });
323 boost::system::error_code tec;
324 backoff_timer_.async_wait(do_yield[tec]);
325 accept_delay_ = std::min(accept_delay_ * 2, MAX_ACCEPT_DELAY);
-
326 JLOG(j_.warn()) << "Throttling do_accept for " << accept_delay_.count() << "ms.";
+
326 JLOG(j_.warn()) << "Throttling do_accept for " << accept_delay_.count() << "ms.";
327 continue;
328 }
329
@@ -442,7 +442,7 @@ $(document).ready(function() { init_codefold(0); });
339
340 if (ec == boost::asio::error::no_descriptors || ec == boost::asio::error::no_buffer_space)
341 {
-
342 JLOG(j_.warn()) << "accept: Too many open files. Pausing for " << accept_delay_.count() << "ms.";
+
342 JLOG(j_.warn()) << "accept: Too many open files. Pausing for " << accept_delay_.count() << "ms.";
343
344 backoff_timer_.expires_after(accept_delay_);
345 boost::system::error_code tec;
@@ -452,7 +452,7 @@ $(document).ready(function() { init_codefold(0); });
349 }
350 else
351 {
-
352 JLOG(j_.error()) << "accept error: " << ec.message();
+
352 JLOG(j_.error()) << "accept error: " << ec.message();
353 }
354 continue;
355 }
@@ -539,6 +539,7 @@ $(document).ready(function() { init_codefold(0); });
Stream error() const
Definition Journal.h:318
Stream info() const
Definition Journal.h:306
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
+
Stream warn() const
Definition Journal.h:312
Handler & handler_
Definition Door.h:59
stream_type stream_
Definition Door.h:61
diff --git a/Env_8cpp_source.html b/Env_8cpp_source.html index ecc106fab5..da70ca74af 100644 --- a/Env_8cpp_source.html +++ b/Env_8cpp_source.html @@ -143,7 +143,7 @@ $(document).ready(function() { init_codefold(0); });
59 HTTPClient::initializeSSLContext(config->SSL_VERIFY_DIR, config->SSL_VERIFY_FILE, config->SSL_VERIFY, debugLog());
60 owned = make_Application(std::move(config), std::move(logs), std::move(timeKeeper_));
61 app = owned.get();
-
62 app->logs().threshold(thresh);
+
62 app->logs().threshold(thresh);
63 if (!app->setup({}))
64 Throw<std::runtime_error>("Env::AppBundle: setup failed");
65 timeKeeper->set(app->getLedgerMaster().getClosedLedger()->header().closeTime);
@@ -794,12 +794,11 @@ $(document).ready(function() { init_codefold(0); });
virtual Config & config()=0
virtual void signalStop(std::string msg)=0
virtual void run()=0
-
virtual Logs & logs()=0
virtual void start(bool withTimers)=0
constexpr value_type const & value() const
Definition Asset.h:154
-
uint32_t NETWORK_ID
Definition Config.h:137
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:256
+
uint32_t NETWORK_ID
Definition Config.h:138
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
static void initializeSSLContext(std::string const &sslVerifyDir, std::string const &sslVerifyFile, bool sslVerify, beast::Journal j)
A currency issued by an account.
Definition Issue.h:13
Currency currency
Definition Issue.h:15
@@ -815,6 +814,7 @@ $(document).ready(function() { init_codefold(0); });
Slice slice() const noexcept
Definition Serializer.h:44
+
virtual Logs & logs()=0
virtual JobQueue & getJobQueue()=0
virtual NetworkOPs & getOPs()=0
virtual LedgerMaster & getLedgerMaster()=0
@@ -914,7 +914,7 @@ $(document).ready(function() { init_codefold(0); });
std::string transHuman(TER code)
Definition TER.cpp:252
std::pair< int, Json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition RPCCall.cpp:1437
std::string transToken(TER code)
Definition TER.cpp:243
-
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
+
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
constexpr std::uint32_t asfDefaultRipple
Definition TxFlags.h:64
@ temMALFORMED
Definition TER.h:67
diff --git a/Env__test_8cpp_source.html b/Env__test_8cpp_source.html index 764dd8965f..b5c52e5364 100644 --- a/Env__test_8cpp_source.html +++ b/Env__test_8cpp_source.html @@ -990,7 +990,7 @@ $(document).ready(function() { init_codefold(0); });
bool except(F &&f, String const &reason)
Definition suite.h:431
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:516
virtual Config & config()=0
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:256
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
FeatureBitset & set(uint256 const &f, bool value=true)
Definition Feature.h:214
virtual std::size_t getLocalTxCount()=0
diff --git a/FeeVoteImpl_8cpp_source.html b/FeeVoteImpl_8cpp_source.html index d4ce162778..d6424542a2 100644 --- a/FeeVoteImpl_8cpp_source.html +++ b/FeeVoteImpl_8cpp_source.html @@ -382,7 +382,7 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
Stream info() const
Definition Journal.h:306
Stream warn() const
Definition Journal.h:312
-
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:141
+
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
void doValidation(Fees const &lastFees, Rules const &rules, STValidation &val) override
Add local fee preference to validation.
FeeVoteImpl(FeeSetup const &setup, beast::Journal journal)
@@ -419,7 +419,7 @@ $(document).ready(function() { init_codefold(0); });
std::unique_ptr< FeeVote > make_FeeVote(FeeSetup const &setup, beast::Journal journal)
Create an instance of the FeeVote logic.
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
-
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition Ledger.cpp:891
+
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition Ledger.cpp:890
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
Definition SHAMapItem.h:137
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:28
@ current
This was a new validation and was added.
@@ -427,10 +427,10 @@ $(document).ready(function() { init_codefold(0); }); -
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:46
-
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:48
-
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:51
-
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:54
+
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:48
+
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:50
+
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:53
+
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:56
Reflects the fee settings for a particular ledger.
XRPAmount reserve
XRPAmount increment
diff --git a/FeeVote_8h_source.html b/FeeVote_8h_source.html index 41fd612111..a8e012a11c 100644 --- a/FeeVote_8h_source.html +++ b/FeeVote_8h_source.html @@ -121,7 +121,7 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::unique_ptr< FeeVote > make_FeeVote(FeeSetup const &setup, beast::Journal journal)
Create an instance of the FeeVote logic.
-
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:46
+
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:48
Reflects the fee settings for a particular ledger.
diff --git a/FeeVote__test_8cpp_source.html b/FeeVote__test_8cpp_source.html index 510448af62..054144ed88 100644 --- a/FeeVote__test_8cpp_source.html +++ b/FeeVote__test_8cpp_source.html @@ -619,7 +619,7 @@ $(document).ready(function() { init_codefold(0); });
506 // Test with XRPFees enabled
507 {
508 Env env(*this, testable_amendments() | featureXRPFees);
-
509 auto feeVote = make_FeeVote(setup, env.app().journal("FeeVote"));
+
509 auto feeVote = make_FeeVote(setup, env.app().journal("FeeVote"));
510
511 auto ledger = std::make_shared<Ledger>(
@@ -645,7 +645,7 @@ $(document).ready(function() { init_codefold(0); });
532 // Test with XRPFees disabled (legacy format)
533 {
534 Env env(*this, testable_amendments() - featureXRPFees);
-
535 auto feeVote = make_FeeVote(setup, env.app().journal("FeeVote"));
+
535 auto feeVote = make_FeeVote(setup, env.app().journal("FeeVote"));
536
537 auto ledger = std::make_shared<Ledger>(
@@ -689,7 +689,7 @@ $(document).ready(function() { init_codefold(0); });
574 BEAST_EXPECT(env.current()->fees().reserve == XRPAmount{200'000'000});
575 BEAST_EXPECT(env.current()->fees().increment == XRPAmount{50'000'000});
576
-
577 auto feeVote = make_FeeVote(setup, env.app().journal("FeeVote"));
+
577 auto feeVote = make_FeeVote(setup, env.app().journal("FeeVote"));
578 auto ledger = std::make_shared<Ledger>(
580
@@ -779,7 +779,6 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:51
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
Manager to process fee votes.
Definition FeeVote.h:11
Writable ledger view that accumulates state and tx changes.
Definition OpenView.h:45
void apply(TxsRawView &to) const
Apply changes.
Definition OpenView.cpp:101
@@ -794,6 +793,7 @@ $(document).ready(function() { init_codefold(0); });
virtual Family & getNodeFamily()=0
virtual TimeKeeper & timeKeeper()=0
+
virtual beast::Journal journal(std::string const &name)=0
time_point now() const override
Returns the current time, using the server's clock.
Definition TimeKeeper.h:43
time_point closeTime() const
Returns the predicted close time, in network time.
Definition TimeKeeper.h:55
@@ -829,7 +829,7 @@ $(document).ready(function() { init_codefold(0); });
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
ApplyResult apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition apply.cpp:117
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1024
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:28
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
@@ -841,10 +841,10 @@ $(document).ready(function() { init_codefold(0); });
T push_back(T... args)
-
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:46
-
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:48
-
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:51
-
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:54
+
Fee schedule for startup / standalone, and to vote for.
Definition Config.h:48
+
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:50
+
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:53
+
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:56
std::optional< std::uint64_t > baseFee
std::optional< XRPAmount > reserveIncrementDrops
diff --git a/Flow__test_8cpp_source.html b/Flow__test_8cpp_source.html index 28e98f389f..9debc31e6a 100644 --- a/Flow__test_8cpp_source.html +++ b/Flow__test_8cpp_source.html @@ -502,7 +502,7 @@ $(document).ready(function() { init_codefold(0); });
411 BEAST_EXPECT(isOffer(env, bob, BTC(60), EUR(50)));
412 BEAST_EXPECT(isOffer(env, carol, BTC(1000), EUR(1)));
413
-
414 auto flowJournal = env.app().logs().journal("Flow");
+
414 auto flowJournal = env.app().logs().journal("Flow");
415 auto const flowResult = [&] {
416 STAmount deliver(USD(51));
417 STAmount smax(BTC(61));
@@ -1387,7 +1387,6 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:51
void pass()
Record a successful test condition.
Definition suite.h:494
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
-
virtual Logs & logs()=0
A currency issued by an account.
Definition Issue.h:13
beast::Journal journal(std::string const &name)
Definition Log.cpp:134
@@ -1403,6 +1402,7 @@ $(document).ready(function() { init_codefold(0); });
Discardable, editable view to a ledger.
Definition Sandbox.h:15
void apply(RawView &to)
Definition Sandbox.h:35
+
virtual Logs & logs()=0
virtual OpenLedger & openLedger()=0
diff --git a/GRPCServer_8cpp_source.html b/GRPCServer_8cpp_source.html index 4102c20781..09e015cc97 100644 --- a/GRPCServer_8cpp_source.html +++ b/GRPCServer_8cpp_source.html @@ -201,7 +201,7 @@ $(document).ready(function() { init_codefold(0); });
111 {
112 auto usage = getUsage();
113 bool isUnlimited = clientIsUnlimited();
-
114 if (!isUnlimited && usage.disconnect(app_.journal("gRPCServer")))
+
114 if (!isUnlimited && usage.disconnect(app_.journal("gRPCServer")))
115 {
116 grpc::Status status{grpc::StatusCode::RESOURCE_EXHAUSTED, "usage balance exceeds threshold"};
117 responder_.FinishWithError(status, this);
@@ -225,11 +225,11 @@ $(document).ready(function() { init_codefold(0); });
135 toLog << user.value();
136 toLog << " isUnlimited = " << isUnlimited;
137
-
138 JLOG(app_.journal("GRPCServer::Calldata").debug()) << toLog.str();
+
138 JLOG(app_.journal("GRPCServer::Calldata").debug()) << toLog.str();
139 }
140
-
142 {app_.journal("gRPCServer"),
+
142 {app_.journal("gRPCServer"),
143 app_,
144 loadType,
145 app_.getOPs(),
@@ -700,7 +700,6 @@ $(document).ready(function() { init_codefold(0); });
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
Section & section(std::string const &name)
Returns the section with the given name.
@@ -744,7 +743,7 @@ $(document).ready(function() { init_codefold(0); });
GRPCServerImpl impl_
Definition GRPCServer.h:297
-
std::shared_ptr< InfoSub > pointer
Definition InfoSub.h:34
+
std::shared_ptr< InfoSub > pointer
Definition InfoSub.h:33
std::shared_ptr< Coro > postCoro(JobType t, std::string const &name, F &&f)
Creates a coroutine and adds a job to the queue which will run it.
Definition JobQueue.h:386
A consumption charge.
Definition Charge.h:10
@@ -756,6 +755,7 @@ $(document).ready(function() { init_codefold(0); });
virtual NetworkOPs & getOPs()=0
virtual Resource::Manager & getResourceManager()=0
virtual LedgerMaster & getLedgerMaster()=0
+
virtual beast::Journal journal(std::string const &name)=0
T emplace_back(T... args)
T empty(T... args)
T end(T... args)
diff --git a/GetCounts_8cpp_source.html b/GetCounts_8cpp_source.html index 09ef2b253a..164e0c13af 100644 --- a/GetCounts_8cpp_source.html +++ b/GetCounts_8cpp_source.html @@ -213,7 +213,7 @@ $(document).ready(function() { init_codefold(0); });
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
-
bool useTxTables() const
Definition Config.h:317
+
bool useTxTables() const
Definition Config.h:318
List getCounts(int minimumThreshold) const
static CountedObjects & getInstance() noexcept
virtual std::shared_ptr< TreeNodeCache > getTreeNodeCache()=0
Return a pointer to the Family Tree Node Cache.
diff --git a/Handshake_8cpp_source.html b/Handshake_8cpp_source.html index 993793d5d9..7bbd27dd55 100644 --- a/Handshake_8cpp_source.html +++ b/Handshake_8cpp_source.html @@ -481,11 +481,11 @@ $(document).ready(function() { init_codefold(0); });
virtual Config & config()=0
virtual std::uint64_t instanceID() const =0
Returns a 64-bit instance identifier, generated at startup.
virtual std::pair< PublicKey, SecretKey > const & nodeIdentity()=0
-
bool COMPRESSION
Definition Config.h:200
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:238
-
std::string SERVER_DOMAIN
Definition Config.h:258
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:228
-
bool LEDGER_REPLAY
Definition Config.h:203
+
bool COMPRESSION
Definition Config.h:201
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
+
std::string SERVER_DOMAIN
Definition Config.h:259
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
+
bool LEDGER_REPLAY
Definition Config.h:204
std::shared_ptr< Ledger const > getClosedLedger()
A public key.
Definition PublicKey.h:42
virtual LedgerMaster & getLedgerMaster()=0
diff --git a/HashRouter_8cpp_source.html b/HashRouter_8cpp_source.html index f6577b9979..00470fe834 100644 --- a/HashRouter_8cpp_source.html +++ b/HashRouter_8cpp_source.html @@ -247,7 +247,7 @@ $(document).ready(function() { init_codefold(0); });
144
145} // namespace xrpl
Section & section(std::string const &name)
Returns the section with the given name.
- +
An entry in the routing table.
Definition HashRouter.h:110
std::optional< std::set< PeerShortID > > shouldRelay(uint256 const &key)
Determines whether the hashed item should be relayed.
HashRouterFlags getFlags(uint256 const &key)
diff --git a/HashRouter_8h_source.html b/HashRouter_8h_source.html index 95a49e66dd..f5fb848695 100644 --- a/HashRouter_8h_source.html +++ b/HashRouter_8h_source.html @@ -327,7 +327,7 @@ $(document).ready(function() { init_codefold(0); });
Associative container where each element is also indexed by time.
- +
Tracks the number of instances of an object.
An entry in the routing table.
Definition HashRouter.h:110
bool shouldProcess(Stopwatch::time_point now, std::chrono::seconds interval)
Definition HashRouter.h:165
diff --git a/HashRouter__test_8cpp_source.html b/HashRouter__test_8cpp_source.html index f48e3b7c28..591c05642a 100644 --- a/HashRouter__test_8cpp_source.html +++ b/HashRouter__test_8cpp_source.html @@ -517,7 +517,7 @@ $(document).ready(function() { init_codefold(0); });
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:516
Section & section(std::string const &name)
Returns the section with the given name.
- +
Routing table for objects identified by hash.
Definition HashRouter.h:77
std::optional< std::set< PeerShortID > > shouldRelay(uint256 const &key)
Determines whether the hashed item should be relayed.
HashRouterFlags getFlags(uint256 const &key)
diff --git a/InfoSub_8cpp_source.html b/InfoSub_8cpp_source.html index d12a99503d..2e4c96b5eb 100644 --- a/InfoSub_8cpp_source.html +++ b/InfoSub_8cpp_source.html @@ -242,7 +242,7 @@ $(document).ready(function() { init_codefold(0); });
130
131} // namespace xrpl
-
Abstracts the source of subscription data.
Definition InfoSub.h:48
+
Abstracts the source of subscription data.
Definition InfoSub.h:47
virtual void unsubAccountHistoryInternal(std::uint64_t uListener, AccountID const &account, bool historyOnly)=0
virtual bool unsubRTTransactions(std::uint64_t uListener)=0
virtual bool unsubConsensus(std::uint64_t uListener)=0
@@ -253,7 +253,7 @@ $(document).ready(function() { init_codefold(0); });
virtual bool unsubPeerStatus(std::uint64_t uListener)=0
virtual bool unsubManifests(std::uint64_t uListener)=0
virtual bool unsubValidations(std::uint64_t uListener)=0
-
Source & m_source
Definition InfoSub.h:208
+
Source & m_source
Definition InfoSub.h:207
void setRequest(std::shared_ptr< InfoSubRequest > const &req)
Definition InfoSub.cpp:107
InfoSub(Source &source)
Definition InfoSub.cpp:16
void clearRequest()
Definition InfoSub.cpp:101
@@ -262,20 +262,20 @@ $(document).ready(function() { init_codefold(0); });
void setApiVersion(unsigned int apiVersion)
Definition InfoSub.cpp:119
virtual ~InfoSub()
Definition InfoSub.cpp:24
void insertSubAccountInfo(AccountID const &account, bool rt)
Definition InfoSub.cpp:65
-
hash_set< AccountID > accountHistorySubscriptions_
Definition InfoSub.h:213
-
hash_set< AccountID > normalSubscriptions_
Definition InfoSub.h:210
-
std::uint64_t mSeq
Definition InfoSub.h:212
-
hash_set< AccountID > realTimeSubscriptions_
Definition InfoSub.h:209
-
std::mutex mLock
Definition InfoSub.h:204
+
hash_set< AccountID > accountHistorySubscriptions_
Definition InfoSub.h:212
+
hash_set< AccountID > normalSubscriptions_
Definition InfoSub.h:209
+
std::uint64_t mSeq
Definition InfoSub.h:211
+
hash_set< AccountID > realTimeSubscriptions_
Definition InfoSub.h:208
+
std::mutex mLock
Definition InfoSub.h:203
void deleteSubAccountInfo(AccountID const &account, bool rt)
Definition InfoSub.cpp:76
void deleteSubAccountHistory(AccountID const &account)
Definition InfoSub.cpp:94
unsigned int getApiVersion() const noexcept
Definition InfoSub.cpp:125
-
Consumer m_consumer
Definition InfoSub.h:207
-
unsigned int apiVersion_
Definition InfoSub.h:214
+
Consumer m_consumer
Definition InfoSub.h:206
+
unsigned int apiVersion_
Definition InfoSub.h:213
void onSendEmpty()
Definition InfoSub.cpp:60
std::uint64_t getSeq()
Definition InfoSub.cpp:54
std::shared_ptr< InfoSubRequest > const & getRequest()
Definition InfoSub.cpp:113
-
std::shared_ptr< InfoSubRequest > request_
Definition InfoSub.h:211
+
std::shared_ptr< InfoSubRequest > request_
Definition InfoSub.h:210
An endpoint that consumes resources.
Definition Consumer.h:16
diff --git a/InfoSub_8h_source.html b/InfoSub_8h_source.html index 1de0e46c7c..615b75bd35 100644 --- a/InfoSub_8h_source.html +++ b/InfoSub_8h_source.html @@ -83,229 +83,228 @@ $(document).ready(function() { init_codefold(0); });
1#pragma once
2
-
3#include <xrpld/app/misc/Manifest.h>
-
4
-
5#include <xrpl/basics/CountedObject.h>
-
6#include <xrpl/json/json_value.h>
-
7#include <xrpl/protocol/Book.h>
-
8#include <xrpl/protocol/ErrorCodes.h>
-
9#include <xrpl/resource/Consumer.h>
-
10
-
11namespace xrpl {
-
12
-
13// Operations that clients may wish to perform against the network
-
14// Master operational handler, server sequencer, network tracker
-
15
-
-
16class InfoSubRequest : public CountedObject<InfoSubRequest>
-
17{
-
18public:
- -
20
-
21 virtual ~InfoSubRequest() = default;
-
22
-
23 virtual Json::Value
-
24 doClose() = 0;
-
25 virtual Json::Value
-
26 doStatus(Json::Value const&) = 0;
-
27};
+
3#include <xrpl/basics/CountedObject.h>
+
4#include <xrpl/json/json_value.h>
+
5#include <xrpl/protocol/Book.h>
+
6#include <xrpl/protocol/ErrorCodes.h>
+
7#include <xrpl/resource/Consumer.h>
+
8#include <xrpl/server/Manifest.h>
+
9
+
10namespace xrpl {
+
11
+
12// Operations that clients may wish to perform against the network
+
13// Master operational handler, server sequencer, network tracker
+
14
+
+
15class InfoSubRequest : public CountedObject<InfoSubRequest>
+
16{
+
17public:
+ +
19
+
20 virtual ~InfoSubRequest() = default;
+
21
+
22 virtual Json::Value
+
23 doClose() = 0;
+
24 virtual Json::Value
+
25 doStatus(Json::Value const&) = 0;
+
26};
-
28
-
-
31class InfoSub : public CountedObject<InfoSub>
-
32{
-
33public:
- -
35
-
36 // VFALCO TODO Standardize on the names of weak / strong pointer type
-
37 // aliases.
- -
39
- -
41
- -
43
-
44public:
-
-
47 class Source
-
48 {
-
49 public:
-
50 virtual ~Source() = default;
-
51
-
52 // For some reason, these were originally called "rt"
-
53 // for "real time". They actually refer to whether
-
54 // you get transactions as they occur or once their
-
55 // results are confirmed
-
56 virtual void
-
57 subAccount(ref ispListener, hash_set<AccountID> const& vnaAccountIDs, bool realTime) = 0;
-
58
-
59 // for normal use, removes from InfoSub and server
-
60 virtual void
-
61 unsubAccount(ref isplistener, hash_set<AccountID> const& vnaAccountIDs, bool realTime) = 0;
-
62
-
63 // for use during InfoSub destruction
-
64 // Removes only from the server
-
65 virtual void
-
66 unsubAccountInternal(std::uint64_t uListener, hash_set<AccountID> const& vnaAccountIDs, bool realTime) = 0;
-
67
-
73 virtual error_code_i
-
74 subAccountHistory(ref ispListener, AccountID const& account) = 0;
-
75
-
84 virtual void
-
85 unsubAccountHistory(ref ispListener, AccountID const& account, bool historyOnly) = 0;
-
86
-
87 virtual void
-
88 unsubAccountHistoryInternal(std::uint64_t uListener, AccountID const& account, bool historyOnly) = 0;
-
89
-
90 // VFALCO TODO Document the bool return value
-
91 virtual bool
-
92 subLedger(ref ispListener, Json::Value& jvResult) = 0;
-
93 virtual bool
-
94 unsubLedger(std::uint64_t uListener) = 0;
-
95
-
96 virtual bool
-
97 subBookChanges(ref ispListener) = 0;
-
98 virtual bool
- -
100
-
101 virtual bool
-
102 subManifests(ref ispListener) = 0;
-
103 virtual bool
- -
105 virtual void
- -
107
-
108 virtual bool
-
109 subServer(ref ispListener, Json::Value& jvResult, bool admin) = 0;
-
110 virtual bool
- -
112
-
113 virtual bool
-
114 subBook(ref ispListener, Book const&) = 0;
-
115 virtual bool
-
116 unsubBook(std::uint64_t uListener, Book const&) = 0;
-
117
-
118 virtual bool
-
119 subTransactions(ref ispListener) = 0;
-
120 virtual bool
- -
122
-
123 virtual bool
-
124 subRTTransactions(ref ispListener) = 0;
-
125 virtual bool
- -
127
-
128 virtual bool
-
129 subValidations(ref ispListener) = 0;
-
130 virtual bool
- -
132
-
133 virtual bool
-
134 subPeerStatus(ref ispListener) = 0;
-
135 virtual bool
- -
137 virtual void
- -
139
-
140 virtual bool
-
141 subConsensus(ref ispListener) = 0;
-
142 virtual bool
- -
144
-
145 // VFALCO TODO Remove
-
146 // This was added for one particular partner, it
-
147 // "pushes" subscription data to a particular URL.
-
148 //
-
149 virtual pointer
-
150 findRpcSub(std::string const& strUrl) = 0;
-
151 virtual pointer
-
152 addRpcSub(std::string const& strUrl, ref rspEntry) = 0;
-
153 virtual bool
-
154 tryRemoveRpcSub(std::string const& strUrl) = 0;
-
155 };
+
27
+
+
30class InfoSub : public CountedObject<InfoSub>
+
31{
+
32public:
+ +
34
+
35 // VFALCO TODO Standardize on the names of weak / strong pointer type
+
36 // aliases.
+ +
38
+ +
40
+ +
42
+
43public:
+
+
46 class Source
+
47 {
+
48 public:
+
49 virtual ~Source() = default;
+
50
+
51 // For some reason, these were originally called "rt"
+
52 // for "real time". They actually refer to whether
+
53 // you get transactions as they occur or once their
+
54 // results are confirmed
+
55 virtual void
+
56 subAccount(ref ispListener, hash_set<AccountID> const& vnaAccountIDs, bool realTime) = 0;
+
57
+
58 // for normal use, removes from InfoSub and server
+
59 virtual void
+
60 unsubAccount(ref isplistener, hash_set<AccountID> const& vnaAccountIDs, bool realTime) = 0;
+
61
+
62 // for use during InfoSub destruction
+
63 // Removes only from the server
+
64 virtual void
+
65 unsubAccountInternal(std::uint64_t uListener, hash_set<AccountID> const& vnaAccountIDs, bool realTime) = 0;
+
66
+
72 virtual error_code_i
+
73 subAccountHistory(ref ispListener, AccountID const& account) = 0;
+
74
+
83 virtual void
+
84 unsubAccountHistory(ref ispListener, AccountID const& account, bool historyOnly) = 0;
+
85
+
86 virtual void
+
87 unsubAccountHistoryInternal(std::uint64_t uListener, AccountID const& account, bool historyOnly) = 0;
+
88
+
89 // VFALCO TODO Document the bool return value
+
90 virtual bool
+
91 subLedger(ref ispListener, Json::Value& jvResult) = 0;
+
92 virtual bool
+
93 unsubLedger(std::uint64_t uListener) = 0;
+
94
+
95 virtual bool
+
96 subBookChanges(ref ispListener) = 0;
+
97 virtual bool
+ +
99
+
100 virtual bool
+
101 subManifests(ref ispListener) = 0;
+
102 virtual bool
+ +
104 virtual void
+ +
106
+
107 virtual bool
+
108 subServer(ref ispListener, Json::Value& jvResult, bool admin) = 0;
+
109 virtual bool
+ +
111
+
112 virtual bool
+
113 subBook(ref ispListener, Book const&) = 0;
+
114 virtual bool
+
115 unsubBook(std::uint64_t uListener, Book const&) = 0;
+
116
+
117 virtual bool
+
118 subTransactions(ref ispListener) = 0;
+
119 virtual bool
+ +
121
+
122 virtual bool
+
123 subRTTransactions(ref ispListener) = 0;
+
124 virtual bool
+ +
126
+
127 virtual bool
+
128 subValidations(ref ispListener) = 0;
+
129 virtual bool
+ +
131
+
132 virtual bool
+
133 subPeerStatus(ref ispListener) = 0;
+
134 virtual bool
+ +
136 virtual void
+ +
138
+
139 virtual bool
+
140 subConsensus(ref ispListener) = 0;
+
141 virtual bool
+ +
143
+
144 // VFALCO TODO Remove
+
145 // This was added for one particular partner, it
+
146 // "pushes" subscription data to a particular URL.
+
147 //
+
148 virtual pointer
+
149 findRpcSub(std::string const& strUrl) = 0;
+
150 virtual pointer
+
151 addRpcSub(std::string const& strUrl, ref rspEntry) = 0;
+
152 virtual bool
+
153 tryRemoveRpcSub(std::string const& strUrl) = 0;
+
154 };
-
156
-
157public:
-
158 InfoSub(Source& source);
-
159 InfoSub(Source& source, Consumer consumer);
-
160
-
161 virtual ~InfoSub();
-
162
-
163 Consumer&
-
164 getConsumer();
-
165
-
166 virtual void
-
167 send(Json::Value const& jvObj, bool broadcast) = 0;
-
168
- -
170 getSeq();
-
171
-
172 void
-
173 onSendEmpty();
-
174
-
175 void
-
176 insertSubAccountInfo(AccountID const& account, bool rt);
-
177
-
178 void
-
179 deleteSubAccountInfo(AccountID const& account, bool rt);
-
180
-
181 // return false if already subscribed to this account
-
182 bool
-
183 insertSubAccountHistory(AccountID const& account);
-
184
-
185 void
-
186 deleteSubAccountHistory(AccountID const& account);
-
187
-
188 void
-
189 clearRequest();
-
190
-
191 void
- -
193
- -
195 getRequest();
-
196
-
197 void
-
198 setApiVersion(unsigned int apiVersion);
-
199
-
200 unsigned int
-
201 getApiVersion() const noexcept;
-
202
-
203protected:
-
204 std::mutex mLock;
-
205
-
206private:
- - - - - -
212 std::uint64_t mSeq;
- -
214 unsigned int apiVersion_ = 0;
-
215
-
216 static int
-
- -
218 {
-
219 static std::atomic<std::uint64_t> id(0);
-
220 return ++id;
-
221 }
+
155
+
156public:
+
157 InfoSub(Source& source);
+
158 InfoSub(Source& source, Consumer consumer);
+
159
+
160 virtual ~InfoSub();
+
161
+
162 Consumer&
+
163 getConsumer();
+
164
+
165 virtual void
+
166 send(Json::Value const& jvObj, bool broadcast) = 0;
+
167
+ +
169 getSeq();
+
170
+
171 void
+
172 onSendEmpty();
+
173
+
174 void
+
175 insertSubAccountInfo(AccountID const& account, bool rt);
+
176
+
177 void
+
178 deleteSubAccountInfo(AccountID const& account, bool rt);
+
179
+
180 // return false if already subscribed to this account
+
181 bool
+
182 insertSubAccountHistory(AccountID const& account);
+
183
+
184 void
+
185 deleteSubAccountHistory(AccountID const& account);
+
186
+
187 void
+
188 clearRequest();
+
189
+
190 void
+ +
192
+ +
194 getRequest();
+
195
+
196 void
+
197 setApiVersion(unsigned int apiVersion);
+
198
+
199 unsigned int
+
200 getApiVersion() const noexcept;
+
201
+
202protected:
+
203 std::mutex mLock;
+
204
+
205private:
+ + + + + +
211 std::uint64_t mSeq;
+ +
213 unsigned int apiVersion_ = 0;
+
214
+
215 static int
+
+ +
217 {
+
218 static std::atomic<std::uint64_t> id(0);
+
219 return ++id;
+
220 }
-
222};
+
221};
-
223
-
224} // namespace xrpl
+
222
+
223} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
Specifies an order book.
Definition Book.h:16
Tracks the number of instances of an object.
- +
virtual Json::Value doClose()=0
virtual Json::Value doStatus(Json::Value const &)=0
virtual ~InfoSubRequest()=default
-
Abstracts the source of subscription data.
Definition InfoSub.h:48
+
Abstracts the source of subscription data.
Definition InfoSub.h:47
virtual void unsubAccountHistoryInternal(std::uint64_t uListener, AccountID const &account, bool historyOnly)=0
virtual bool unsubRTTransactions(std::uint64_t uListener)=0
virtual bool subTransactions(ref ispListener)=0
@@ -338,31 +337,31 @@ $(document).ready(function() { init_codefold(0); });
virtual bool subLedger(ref ispListener, Json::Value &jvResult)=0
virtual pointer findRpcSub(std::string const &strUrl)=0
virtual void unsubAccount(ref isplistener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0
-
Manages a client's subscription to data feeds.
Definition InfoSub.h:32
-
Source & m_source
Definition InfoSub.h:208
+
Manages a client's subscription to data feeds.
Definition InfoSub.h:31
+
Source & m_source
Definition InfoSub.h:207
void setRequest(std::shared_ptr< InfoSubRequest > const &req)
Definition InfoSub.cpp:107
void clearRequest()
Definition InfoSub.cpp:101
bool insertSubAccountHistory(AccountID const &account)
Definition InfoSub.cpp:87
-
static int assign_id()
Definition InfoSub.h:217
+
static int assign_id()
Definition InfoSub.h:216
Consumer & getConsumer()
Definition InfoSub.cpp:48
void setApiVersion(unsigned int apiVersion)
Definition InfoSub.cpp:119
virtual ~InfoSub()
Definition InfoSub.cpp:24
void insertSubAccountInfo(AccountID const &account, bool rt)
Definition InfoSub.cpp:65
-
hash_set< AccountID > accountHistorySubscriptions_
Definition InfoSub.h:213
-
hash_set< AccountID > normalSubscriptions_
Definition InfoSub.h:210
-
std::uint64_t mSeq
Definition InfoSub.h:212
-
hash_set< AccountID > realTimeSubscriptions_
Definition InfoSub.h:209
-
std::mutex mLock
Definition InfoSub.h:204
+
hash_set< AccountID > accountHistorySubscriptions_
Definition InfoSub.h:212
+
hash_set< AccountID > normalSubscriptions_
Definition InfoSub.h:209
+
std::uint64_t mSeq
Definition InfoSub.h:211
+
hash_set< AccountID > realTimeSubscriptions_
Definition InfoSub.h:208
+
std::mutex mLock
Definition InfoSub.h:203
void deleteSubAccountInfo(AccountID const &account, bool rt)
Definition InfoSub.cpp:76
void deleteSubAccountHistory(AccountID const &account)
Definition InfoSub.cpp:94
unsigned int getApiVersion() const noexcept
Definition InfoSub.cpp:125
-
Consumer m_consumer
Definition InfoSub.h:207
-
unsigned int apiVersion_
Definition InfoSub.h:214
+
Consumer m_consumer
Definition InfoSub.h:206
+
unsigned int apiVersion_
Definition InfoSub.h:213
virtual void send(Json::Value const &jvObj, bool broadcast)=0
void onSendEmpty()
Definition InfoSub.cpp:60
std::uint64_t getSeq()
Definition InfoSub.cpp:54
std::shared_ptr< InfoSubRequest > const & getRequest()
Definition InfoSub.cpp:113
-
std::shared_ptr< InfoSubRequest > request_
Definition InfoSub.h:211
+
std::shared_ptr< InfoSubRequest > request_
Definition InfoSub.h:210
An endpoint that consumes resources.
Definition Consumer.h:16
diff --git a/JSONRPCClient_8cpp_source.html b/JSONRPCClient_8cpp_source.html index daeca16f42..c11ff52b54 100644 --- a/JSONRPCClient_8cpp_source.html +++ b/JSONRPCClient_8cpp_source.html @@ -256,7 +256,7 @@ $(document).ready(function() { init_codefold(0); });
Holds unparsed configuration information.
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
Section & section(std::string const &name)
Returns the section with the given name.
- +
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition BasicConfig.h:58
diff --git a/LedgerAccept_8cpp_source.html b/LedgerAccept_8cpp_source.html index 5d59215c22..50e0ce9310 100644 --- a/LedgerAccept_8cpp_source.html +++ b/LedgerAccept_8cpp_source.html @@ -119,7 +119,7 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:130
virtual Config & config()=0
virtual MutexType & getMasterMutex()=0
-
bool standalone() const
Definition Config.h:311
+
bool standalone() const
Definition Config.h:312
LedgerIndex getCurrentLedgerIndex()
virtual std::uint32_t acceptLedger(std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)=0
Accepts the current transaction tree, return the new ledger's sequence.
diff --git a/LedgerCleaner_8cpp_source.html b/LedgerCleaner_8cpp_source.html index 14bc4a923b..caeb983c70 100644 --- a/LedgerCleaner_8cpp_source.html +++ b/LedgerCleaner_8cpp_source.html @@ -362,7 +362,7 @@ $(document).ready(function() { init_codefold(0); });
268 doTxns = true;
269 }
270
-
271 if (doNodes && !nodeLedger->walkLedger(app_.journal("Ledger")))
+
271 if (doNodes && !nodeLedger->walkLedger(app_.journal("Ledger")))
272 {
273 JLOG(j_.debug()) << "Ledger " << ledgerIndex << " is missing nodes";
274 app_.getLedgerMaster().clearLedger(ledgerIndex);
@@ -526,7 +526,6 @@ $(document).ready(function() { init_codefold(0); });
Stream warn() const
Definition Journal.h:312
-
virtual beast::Journal journal(std::string const &name)=0
virtual std::shared_ptr< Ledger const > acquire(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason)=0
@@ -566,6 +565,7 @@ $(document).ready(function() { init_codefold(0); });
virtual LoadFeeTrack & getFeeTrack()=0
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
+
virtual beast::Journal journal(std::string const &name)=0
bool isZero() const
Definition base_uint.h:508
bool isNonZero() const
Definition base_uint.h:513
@@ -581,9 +581,9 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
std::unique_ptr< LedgerCleaner > make_LedgerCleaner(Application &app, beast::Journal journal)
-
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:924
+
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:923
LedgerIndex getCandidateLedger(LedgerIndex requested)
Find a ledger index from which we could easily get the requested ledger.
Definition View.h:399
-
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1026
+
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1025
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition View.cpp:878
diff --git a/LedgerEntry__test_8cpp_source.html b/LedgerEntry__test_8cpp_source.html index 91ebe61471..fa88b7f1bf 100644 --- a/LedgerEntry__test_8cpp_source.html +++ b/LedgerEntry__test_8cpp_source.html @@ -2210,7 +2210,7 @@ $(document).ready(function() { init_codefold(0); });
2050 Account const bob{"bob"};
2051
2052 Env env{*this, envconfig([](auto cfg) {
-
2053 cfg->START_UP = Config::FRESH;
+
2053 cfg->START_UP = StartUpType::FRESH;
2054 return cfg;
2055 })};
2056
@@ -2383,7 +2383,7 @@ $(document).ready(function() { init_codefold(0); });
2241 Account const bob{"bob"};
2242
2243 Env env{*this, envconfig([](auto cfg) {
-
2244 cfg->START_UP = Config::FRESH;
+
2244 cfg->START_UP = StartUpType::FRESH;
2245 return cfg;
2246 })};
2247
@@ -2926,7 +2926,6 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:51
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:516
-
bool modify(modify_type const &f)
Modify the open ledger.
Writable ledger view that accumulates state and tx changes.
Definition OpenView.h:45
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
Definition OpenView.cpp:207
@@ -3090,6 +3089,7 @@ $(document).ready(function() { init_codefold(0); });
void forAllApiVersions(Fn const &fn, Args &&... args)
Definition ApiVersion.h:144
constexpr std::uint32_t const tfSellNFToken
Definition TxFlags.h:210
constexpr std::uint32_t const tfMPTCanEscrow
Definition TxFlags.h:130
+
T push_back(T... args)
T reserve(T... args)
diff --git a/LedgerHistory_8cpp_source.html b/LedgerHistory_8cpp_source.html index 4859a0b701..a6ec9b3d9e 100644 --- a/LedgerHistory_8cpp_source.html +++ b/LedgerHistory_8cpp_source.html @@ -607,17 +607,17 @@ $(document).ready(function() { init_codefold(0); });
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::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition Ledger.cpp:1038
+
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition Ledger.cpp:1037
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Definition chrono.h:93
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
static void log_metadata_difference(ReadView const &builtLedger, ReadView const &validLedger, uint256 const &tx, beast::Journal j)
-
SizedItem
Definition Config.h:24
+
SizedItem
Definition Config.h:26
static void log_one(ReadView const &ledger, uint256 const &tx, char const *msg, beast::Journal &j)
-
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1026
+
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1025
static std::vector< SHAMapItem const * > leaves(SHAMap const &sm)
diff --git a/LedgerHistory__test_8cpp_source.html b/LedgerHistory__test_8cpp_source.html index e8674027e3..7966d476fd 100644 --- a/LedgerHistory__test_8cpp_source.html +++ b/LedgerHistory__test_8cpp_source.html @@ -275,7 +275,7 @@ $(document).ready(function() { init_codefold(0); });
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition envconfig.h:34
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
ApplyTransactionResult applyTransaction(Application &app, OpenView &view, STTx const &tx, bool retryAssured, ApplyFlags flags, beast::Journal journal)
Transaction application helper.
Definition apply.cpp:190
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
@ hotTRANSACTION_NODE
Definition NodeObject.h:16
@ hotACCOUNT_NODE
Definition NodeObject.h:15
@ tapNONE
Definition ApplyView.h:11
diff --git a/LedgerLoad__test_8cpp_source.html b/LedgerLoad__test_8cpp_source.html index 57def60615..6d7b8b3bcd 100644 --- a/LedgerLoad__test_8cpp_source.html +++ b/LedgerLoad__test_8cpp_source.html @@ -102,11 +102,11 @@ $(document).ready(function() { init_codefold(0); });
19{
-
20 auto static ledgerConfig(
+
20 auto static ledgerConfig(
22 std::string const& dbPath,
23 std::string const& ledger,
- +
24 StartUpType type,
25 std::optional<uint256> trapTxHash)
26 {
27 cfg->START_LEDGER = ledger;
@@ -196,7 +196,7 @@ $(document).ready(function() { init_codefold(0); });
105 // create a new env with the ledger file specified for startup
106 Env env(
107 *this,
- +
109 nullptr,
111 auto jrb = env.rpc("ledger", "current", "full")[jss::result];
@@ -216,7 +216,7 @@ $(document).ready(function() { init_codefold(0); });
123 except([&] {
124 Env env(
125 *this,
- +
127 nullptr,
129 });
@@ -225,7 +225,7 @@ $(document).ready(function() { init_codefold(0); });
132 except([&] {
133 Env env(
134 *this,
-
135 envconfig(ledgerConfig, sd.dbPath, "badfile.json", Config::LOAD_FILE, std::nullopt),
+
135 envconfig(ledgerConfig, sd.dbPath, "badfile.json", StartUpType::LOAD_FILE, std::nullopt),
136 nullptr,
138 });
@@ -246,7 +246,7 @@ $(document).ready(function() { init_codefold(0); });
153 except([&] {
154 Env env(
155 *this,
-
156 envconfig(ledgerConfig, sd.dbPath, ledgerFileCorrupt.string(), Config::LOAD_FILE, std::nullopt),
+
156 envconfig(ledgerConfig, sd.dbPath, ledgerFileCorrupt.string(), StartUpType::LOAD_FILE, std::nullopt),
157 nullptr,
159 });
@@ -265,7 +265,7 @@ $(document).ready(function() { init_codefold(0); });
170 boost::erase_all(ledgerHash, "\"");
171 Env env(
172 *this,
-
173 envconfig(ledgerConfig, sd.dbPath, ledgerHash, Config::LOAD, std::nullopt),
+
173 envconfig(ledgerConfig, sd.dbPath, ledgerHash, StartUpType::LOAD, std::nullopt),
174 nullptr,
176 auto jrb = env.rpc("ledger", "current", "full")[jss::result];
@@ -286,7 +286,7 @@ $(document).ready(function() { init_codefold(0); });
189 boost::erase_all(ledgerHash, "\"");
190 Env env(
191 *this,
-
192 envconfig(ledgerConfig, sd.dbPath, ledgerHash, Config::REPLAY, std::nullopt),
+
192 envconfig(ledgerConfig, sd.dbPath, ledgerHash, StartUpType::REPLAY, std::nullopt),
193 nullptr,
195 auto const jrb = env.rpc("ledger", "current", "full")[jss::result];
@@ -312,7 +312,7 @@ $(document).ready(function() { init_codefold(0); });
213 boost::erase_all(ledgerHash, "\"");
214 Env env(
215 *this,
-
216 envconfig(ledgerConfig, sd.dbPath, ledgerHash, Config::REPLAY, sd.trapTxHash),
+
216 envconfig(ledgerConfig, sd.dbPath, ledgerHash, StartUpType::REPLAY, sd.trapTxHash),
217 nullptr,
219 auto const jrb = env.rpc("ledger", "current", "full")[jss::result];
@@ -342,7 +342,7 @@ $(document).ready(function() { init_codefold(0); });
241 // replay when trapTxHash is set to an invalid transaction
242 Env env(
243 *this,
-
244 envconfig(ledgerConfig, sd.dbPath, ledgerHash, Config::REPLAY, ~sd.trapTxHash),
+
244 envconfig(ledgerConfig, sd.dbPath, ledgerHash, StartUpType::REPLAY, ~sd.trapTxHash),
245 nullptr,
247 BEAST_EXPECT(false);
@@ -368,7 +368,7 @@ $(document).ready(function() { init_codefold(0); });
265 // create a new env with the ledger "latest" specified for startup
266 Env env(
267 *this,
-
268 envconfig(ledgerConfig, sd.dbPath, "latest", Config::LOAD, std::nullopt),
+
268 envconfig(ledgerConfig, sd.dbPath, "latest", StartUpType::LOAD, std::nullopt),
269 nullptr,
271 auto jrb = env.rpc("ledger", "current", "full")[jss::result];
@@ -386,7 +386,7 @@ $(document).ready(function() { init_codefold(0); });
281 // create a new env with specific ledger index at startup
282 Env env(
283 *this,
-
284 envconfig(ledgerConfig, sd.dbPath, "43", Config::LOAD, std::nullopt),
+
284 envconfig(ledgerConfig, sd.dbPath, "43", StartUpType::LOAD, std::nullopt),
285 nullptr,
287 auto jrb = env.rpc("ledger", "current", "full")[jss::result];
@@ -429,21 +429,17 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:51
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
bool except(F &&f, String const &reason)
Definition suite.h:431
- - - -
void testLoadLatest(SetupData const &sd)
void testReplay(SetupData const &sd)
void testReplayTxFail(SetupData const &sd)
void run() override
Runs the suite.
+
static auto ledgerConfig(std::unique_ptr< Config > cfg, std::string const &dbPath, std::string const &ledger, StartUpType type, std::optional< uint256 > trapTxHash)
void testBadFiles(SetupData const &sd)
void testReplayTx(SetupData const &sd)
SetupData setupLedger(beast::temp_dir const &td)
void testLoadByHash(SetupData const &sd)
void testLoadIndex(SetupData const &sd)
-
static auto ledgerConfig(std::unique_ptr< Config > cfg, std::string const &dbPath, std::string const &ledger, Config::StartUpType type, std::optional< uint256 > trapTxHash)
void testLoad(SetupData const &sd)
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition base_uint.h:471
@@ -454,6 +450,10 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
+
StartUpType
Definition StartUpType.h:8
+ + + diff --git a/LedgerMaster_8cpp_source.html b/LedgerMaster_8cpp_source.html index 377a540f47..688b93e94c 100644 --- a/LedgerMaster_8cpp_source.html +++ b/LedgerMaster_8cpp_source.html @@ -730,7 +730,7 @@ $(document).ready(function() { init_codefold(0); });
603
604 if (it == ledgerHashes.end())
605 {
-
606 if (app_.isStopping())
+
606 if (app_.isStopping())
607 return;
608
609 {
@@ -1155,7 +1155,7 @@ $(document).ready(function() { init_codefold(0); });
1020
1021 if (ledger->header().seq <= mValidLedgerSeq)
1022 {
-
1023 auto stream = app_.journal("LedgerConsensus").info();
+
1023 auto stream = app_.journal("LedgerConsensus").info();
1024 JLOG(stream) << "Consensus built old ledger: " << ledger->header().seq << " <= " << mValidLedgerSeq;
1025 return;
1026 }
@@ -1165,7 +1165,7 @@ $(document).ready(function() { init_codefold(0); });
1030
1031 if (ledger->header().seq <= mValidLedgerSeq)
1032 {
-
1033 auto stream = app_.journal("LedgerConsensus").debug();
+
1033 auto stream = app_.journal("LedgerConsensus").debug();
1034 JLOG(stream) << "Consensus ledger fully validated";
1035 return;
1036 }
@@ -1231,7 +1231,7 @@ $(document).ready(function() { init_codefold(0); });
1096
1097 if (maxSeq > mValidLedgerSeq)
1098 {
-
1099 auto stream = app_.journal("LedgerConsensus").debug();
+
1099 auto stream = app_.journal("LedgerConsensus").debug();
1100 JLOG(stream) << "Consensus triggered check of ledger";
1101 checkAccept(maxLedger, maxSeq);
1102 }
@@ -1569,7 +1569,7 @@ $(document).ready(function() { init_codefold(0); });
1422{
- +
1424 {
1425 JLOG(m_journal.debug()) << "newPFWork: Creating job. path find threads: " << mPathFindThread;
1426 if (app_.getJobQueue().addJob(jtUPDATE_PF, name, [this]() { updatePaths(); }))
@@ -1579,7 +1579,7 @@ $(document).ready(function() { init_codefold(0); });
1430 }
1431 // If we're stopping don't give callers the expectation that their
1432 // request will be fulfilled, even if it may be serviced.
-
1433 return mPathFindThread > 0 && !app_.isStopping();
+
1433 return mPathFindThread > 0 && !app_.isStopping();
1434}
1435
@@ -2311,13 +2311,11 @@ $(document).ready(function() { init_codefold(0); });
virtual Config & config()=0
virtual LedgerIndex getMaxDisallowedLedger()=0
Ensure that a newly-started validator does not sign proposals older than the last ledger it persisted...
-
virtual beast::Journal journal(std::string const &name)=0
-
virtual bool isStopping() const =0
Holds transactions which were deferred to the next pass of consensus.
void insert(std::shared_ptr< STTx const > const &txn)
std::shared_ptr< STTx const > popAcctTransaction(std::shared_ptr< STTx const > const &tx)
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:256
-
bool LEDGER_REPLAY
Definition Config.h:203
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
+
bool LEDGER_REPLAY
Definition Config.h:204
@@ -2504,9 +2502,11 @@ $(document).ready(function() { init_codefold(0); });
virtual OpenLedger & openLedger()=0
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
+
virtual bool isStopping() const =0
virtual LedgerReplayer & getLedgerReplayer()=0
virtual TimeKeeper & timeKeeper()=0
virtual OrderBookDB & getOrderBookDB()=0
+
virtual beast::Journal journal(std::string const &name)=0
time_point now() const override
Returns the current time, using the server's clock.
Definition TimeKeeper.h:43
time_point closeTime() const
Returns the predicted close time, in network time.
Definition TimeKeeper.h:55
static time_point now()
@@ -2560,8 +2560,8 @@ $(document).ready(function() { init_codefold(0); });
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
constexpr std::size_t calculatePercent(std::size_t count, std::size_t total)
Calculate one number divided by another number in percentage.
static void populateFetchPack(SHAMap const &want, SHAMap const *have, std::uint32_t cnt, protocol::TMGetObjectByHash *into, std::uint32_t seq, bool withLeaves=true)
Populate a fetch pack with data from the map the recipient wants.
-
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:924
-
SizedItem
Definition Config.h:24
+
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:923
+
SizedItem
Definition Config.h:26
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition View.cpp:735
LedgerIndex getCandidateLedger(LedgerIndex requested)
Find a ledger index from which we could easily get the requested ledger.
Definition View.h:399
diff --git a/LedgerReplayMsgHandler_8cpp_source.html b/LedgerReplayMsgHandler_8cpp_source.html index 9c92938017..5364a539c4 100644 --- a/LedgerReplayMsgHandler_8cpp_source.html +++ b/LedgerReplayMsgHandler_8cpp_source.html @@ -390,7 +390,7 @@ $(document).ready(function() { init_codefold(0); });
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
Definition SHAMapItem.h:137
LedgerHeader deserializeHeader(Slice data, bool hasHash=false)
Deserialize a ledger header from a byte array.
-
uint256 calculateLedgerHash(LedgerHeader const &info)
Definition Ledger.cpp:35
+
uint256 calculateLedgerHash(LedgerHeader const &info)
Definition Ledger.cpp:34
void addRaw(LedgerHeader const &, Serializer &, bool includeHash=false)
@ txNode
transaction plus metadata
diff --git a/LedgerReplay__test_8cpp_source.html b/LedgerReplay__test_8cpp_source.html index 03c05b93f3..d308ec96bb 100644 --- a/LedgerReplay__test_8cpp_source.html +++ b/LedgerReplay__test_8cpp_source.html @@ -621,7 +621,7 @@ $(document).ready(function() { init_codefold(0); });
445 assert(param.initLedgers > 0);
- +
449 }
450
@@ -987,8 +987,8 @@ $(document).ready(function() { init_codefold(0); });
781logAll(LedgerServer& server, LedgerReplayClient& client, beast::severities::Severity level = Severity::kTrace)
782{
-
783 server.app.logs().threshold(level);
-
784 client.app.logs().threshold(level);
+
783 server.app.logs().threshold(level);
+
784 client.app.logs().threshold(level);
785}
786// logAll(net.server, net.client);
@@ -1686,10 +1686,9 @@ $(document).ready(function() { init_codefold(0); });
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
virtual Config & config()=0
-
virtual Logs & logs()=0
- +
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
-
bool LEDGER_REPLAY
Definition Config.h:203
+
bool LEDGER_REPLAY
Definition Config.h:204
@@ -1722,6 +1721,7 @@ $(document).ready(function() { init_codefold(0); });
std::uint32_t id_t
Uniquely identifies a peer.
A public key.
Definition PublicKey.h:42
A consumption charge.
Definition Charge.h:10
+
virtual Logs & logs()=0
virtual LedgerMaster & getLedgerMaster()=0
An immutable linear range of bytes.
Definition Slice.h:26
diff --git a/LedgerReplayer_8cpp_source.html b/LedgerReplayer_8cpp_source.html index 81251ba170..681039ff85 100644 --- a/LedgerReplayer_8cpp_source.html +++ b/LedgerReplayer_8cpp_source.html @@ -123,7 +123,7 @@ $(document).ready(function() { init_codefold(0); });
35 bool newSkipList = false;
36 {
-
38 if (app_.isStopping())
+
38 if (app_.isStopping())
39 return;
41 {
@@ -195,7 +195,7 @@ $(document).ready(function() { init_codefold(0); });
105 bool newDelta = false;
106 {
-
108 if (app_.isStopping())
+
108 if (app_.isStopping())
109 return;
110 auto i = deltas_.find(*skipListItem);
111 if (i != deltas_.end())
@@ -302,7 +302,7 @@ $(document).ready(function() { init_codefold(0); });
206 removeCannotLocked(skipLists_);
207 removeCannotLocked(deltas_);
208 }
-
209 JLOG(j_.debug())
+
209 JLOG(j_.debug())
210 << " LedgerReplayer sweep lock duration "
211 << std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - start).count()
212 << "ms";
@@ -313,7 +313,7 @@ $(document).ready(function() { init_codefold(0); });
216LedgerReplayer::stop()
217{
-
218 JLOG(j_.info()) << "Stopping...";
+
218 JLOG(j_.info()) << "Stopping...";
219 {
221 std::for_each(tasks_.begin(), tasks_.end(), [](auto& i) { i->cancel(); });
@@ -330,7 +330,7 @@ $(document).ready(function() { init_codefold(0); });
232 deltas_.clear();
233 }
234
-
235 JLOG(j_.info()) << "Stopped";
+
235 JLOG(j_.info()) << "Stopped";
236}
237
@@ -340,7 +340,6 @@ $(document).ready(function() { init_codefold(0); });
Stream info() const
Definition Journal.h:306
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
-
virtual bool isStopping() const =0
Manages the lifetime of inbound ledgers.
@@ -361,6 +360,7 @@ $(document).ready(function() { init_codefold(0); });
void createDeltas(std::shared_ptr< LedgerReplayTask > task)
Create LedgerDeltaAcquire subtasks for the LedgerReplayTask task.
LedgerReplayer(Application &app, InboundLedgers &inboundLedgers, std::unique_ptr< PeerSetBuilder > peerSetBuilder)
hash_map< uint256, std::weak_ptr< LedgerDeltaAcquire > > deltas_
+
virtual bool isStopping() const =0
bool isNonZero() const
Definition base_uint.h:513
T find(T... args)
diff --git a/Ledger_8cpp_source.html b/Ledger_8cpp_source.html index 7cf37aaa02..c9b7556e9d 100644 --- a/Ledger_8cpp_source.html +++ b/Ledger_8cpp_source.html @@ -90,1170 +90,1169 @@ $(document).ready(function() { init_codefold(0); });
7#include <xrpld/app/rdb/backend/SQLiteDatabase.h>
8#include <xrpld/consensus/LedgerTiming.h>
9#include <xrpld/core/Config.h>
-
10#include <xrpld/core/SociDB.h>
-
11
-
12#include <xrpl/basics/Log.h>
-
13#include <xrpl/basics/contract.h>
-
14#include <xrpl/beast/utility/instrumentation.h>
-
15#include <xrpl/core/JobQueue.h>
-
16#include <xrpl/json/to_string.h>
-
17#include <xrpl/nodestore/Database.h>
-
18#include <xrpl/nodestore/detail/DatabaseNodeImp.h>
-
19#include <xrpl/protocol/Feature.h>
-
20#include <xrpl/protocol/HashPrefix.h>
-
21#include <xrpl/protocol/Indexes.h>
-
22#include <xrpl/protocol/PublicKey.h>
-
23#include <xrpl/protocol/SecretKey.h>
-
24#include <xrpl/protocol/digest.h>
-
25#include <xrpl/protocol/jss.h>
-
26
-
27#include <utility>
-
28#include <vector>
-
29
-
30namespace xrpl {
-
31
- -
33
- -
- -
36{
-
37 // VFALCO This has to match addRaw in View.h.
-
38 return sha512Half(
- -
40 std::uint32_t(info.seq),
- -
42 info.parentHash,
-
43 info.txHash,
-
44 info.accountHash,
- - - - -
49}
+
10
+
11#include <xrpl/basics/Log.h>
+
12#include <xrpl/basics/contract.h>
+
13#include <xrpl/beast/utility/instrumentation.h>
+
14#include <xrpl/core/JobQueue.h>
+
15#include <xrpl/json/to_string.h>
+
16#include <xrpl/nodestore/Database.h>
+
17#include <xrpl/nodestore/detail/DatabaseNodeImp.h>
+
18#include <xrpl/protocol/Feature.h>
+
19#include <xrpl/protocol/HashPrefix.h>
+
20#include <xrpl/protocol/Indexes.h>
+
21#include <xrpl/protocol/PublicKey.h>
+
22#include <xrpl/protocol/SecretKey.h>
+
23#include <xrpl/protocol/digest.h>
+
24#include <xrpl/protocol/jss.h>
+
25
+
26#include <utility>
+
27#include <vector>
+
28
+
29namespace xrpl {
+
30
+ +
32
+ +
+ +
35{
+
36 // VFALCO This has to match addRaw in View.h.
+
37 return sha512Half(
+ +
39 std::uint32_t(info.seq),
+ +
41 info.parentHash,
+
42 info.txHash,
+
43 info.accountHash,
+ + + + +
48}
-
50
-
51//------------------------------------------------------------------------------
-
52
-
-
53class Ledger::sles_iter_impl : public sles_type::iter_base
-
54{
-
55private:
- -
57
-
58public:
-
59 sles_iter_impl() = delete;
- -
61 operator=(sles_iter_impl const&) = delete;
-
62
-
63 sles_iter_impl(sles_iter_impl const&) = default;
-
64
-
- -
66 {
-
67 }
+
49
+
50//------------------------------------------------------------------------------
+
51
+
+
52class Ledger::sles_iter_impl : public sles_type::iter_base
+
53{
+
54private:
+ +
56
+
57public:
+
58 sles_iter_impl() = delete;
+ +
60 operator=(sles_iter_impl const&) = delete;
+
61
+
62 sles_iter_impl(sles_iter_impl const&) = default;
+
63
+
+ +
65 {
+
66 }
-
68
- -
-
70 copy() const override
-
71 {
- -
73 }
+
67
+ +
+
69 copy() const override
+
70 {
+ +
72 }
-
74
-
75 bool
-
-
76 equal(base_type const& impl) const override
-
77 {
-
78 if (auto const p = dynamic_cast<sles_iter_impl const*>(&impl))
-
79 return iter_ == p->iter_;
-
80 return false;
-
81 }
+
73
+
74 bool
+
+
75 equal(base_type const& impl) const override
+
76 {
+
77 if (auto const p = dynamic_cast<sles_iter_impl const*>(&impl))
+
78 return iter_ == p->iter_;
+
79 return false;
+
80 }
-
82
-
83 void
-
-
84 increment() override
-
85 {
-
86 ++iter_;
-
87 }
+
81
+
82 void
+
+
83 increment() override
+
84 {
+
85 ++iter_;
+
86 }
-
88
-
89 sles_type::value_type
-
-
90 dereference() const override
-
91 {
-
92 SerialIter sit(iter_->slice());
-
93 return std::make_shared<SLE const>(sit, iter_->key());
-
94 }
+
87
+
88 sles_type::value_type
+
+
89 dereference() const override
+
90 {
+
91 SerialIter sit(iter_->slice());
+
92 return std::make_shared<SLE const>(sit, iter_->key());
+
93 }
-
95};
+
94};
-
96
-
97//------------------------------------------------------------------------------
-
98
-
-
99class Ledger::txs_iter_impl : public txs_type::iter_base
-
100{
-
101private:
- - -
104
-
105public:
-
106 txs_iter_impl() = delete;
- -
108 operator=(txs_iter_impl const&) = delete;
-
109
-
110 txs_iter_impl(txs_iter_impl const&) = default;
-
111
-
-
112 txs_iter_impl(bool metadata, SHAMap::const_iterator iter) : metadata_(metadata), iter_(std::move(iter))
-
113 {
-
114 }
+
95
+
96//------------------------------------------------------------------------------
+
97
+
+
98class Ledger::txs_iter_impl : public txs_type::iter_base
+
99{
+
100private:
+ + +
103
+
104public:
+
105 txs_iter_impl() = delete;
+ +
107 operator=(txs_iter_impl const&) = delete;
+
108
+
109 txs_iter_impl(txs_iter_impl const&) = default;
+
110
+
+
111 txs_iter_impl(bool metadata, SHAMap::const_iterator iter) : metadata_(metadata), iter_(std::move(iter))
+
112 {
+
113 }
-
115
- -
-
117 copy() const override
-
118 {
- -
120 }
+
114
+ +
+
116 copy() const override
+
117 {
+ +
119 }
-
121
-
122 bool
-
-
123 equal(base_type const& impl) const override
-
124 {
-
125 if (auto const p = dynamic_cast<txs_iter_impl const*>(&impl))
-
126 return iter_ == p->iter_;
-
127 return false;
-
128 }
+
120
+
121 bool
+
+
122 equal(base_type const& impl) const override
+
123 {
+
124 if (auto const p = dynamic_cast<txs_iter_impl const*>(&impl))
+
125 return iter_ == p->iter_;
+
126 return false;
+
127 }
-
129
-
130 void
-
-
131 increment() override
-
132 {
-
133 ++iter_;
-
134 }
+
128
+
129 void
+
+
130 increment() override
+
131 {
+
132 ++iter_;
+
133 }
-
135
-
136 txs_type::value_type
-
-
137 dereference() const override
-
138 {
-
139 auto const& item = *iter_;
-
140 if (metadata_)
-
141 return deserializeTxPlusMeta(item);
-
142 return {deserializeTx(item), nullptr};
-
143 }
+
134
+
135 txs_type::value_type
+
+
136 dereference() const override
+
137 {
+
138 auto const& item = *iter_;
+
139 if (metadata_)
+
140 return deserializeTxPlusMeta(item);
+
141 return {deserializeTx(item), nullptr};
+
142 }
-
144};
+
143};
-
145
-
146//------------------------------------------------------------------------------
-
147
-
-
148Ledger::Ledger(create_genesis_t, Config const& config, std::vector<uint256> const& amendments, Family& family)
-
149 : mImmutable(false)
-
150 , txMap_(SHAMapType::TRANSACTION, family)
-
151 , stateMap_(SHAMapType::STATE, family)
-
152 , rules_{config.features}
-
153 , j_(beast::Journal(beast::Journal::getNullSink()))
-
154{
-
155 header_.seq = 1;
- - -
158
-
159 static auto const id = calcAccountID(generateKeyPair(KeyType::secp256k1, generateSeed("masterpassphrase")).first);
-
160 {
-
161 auto const sle = std::make_shared<SLE>(keylet::account(id));
-
162 sle->setFieldU32(sfSequence, 1);
-
163 sle->setAccountID(sfAccount, id);
-
164 sle->setFieldAmount(sfBalance, header_.drops);
-
165 rawInsert(sle);
-
166 }
-
167
-
168 if (!amendments.empty())
-
169 {
-
170 auto const sle = std::make_shared<SLE>(keylet::amendments());
-
171 sle->setFieldV256(sfAmendments, STVector256{amendments});
-
172 rawInsert(sle);
-
173 }
-
174
-
175 {
- -
177 // Whether featureXRPFees is supported will depend on startup options.
-
178 if (std::find(amendments.begin(), amendments.end(), featureXRPFees) != amendments.end())
-
179 {
-
180 sle->at(sfBaseFeeDrops) = config.FEES.reference_fee;
-
181 sle->at(sfReserveBaseDrops) = config.FEES.account_reserve;
-
182 sle->at(sfReserveIncrementDrops) = config.FEES.owner_reserve;
-
183 }
-
184 else
-
185 {
-
186 if (auto const f = config.FEES.reference_fee.dropsAs<std::uint64_t>())
-
187 sle->at(sfBaseFee) = *f;
-
188 if (auto const f = config.FEES.account_reserve.dropsAs<std::uint32_t>())
-
189 sle->at(sfReserveBase) = *f;
-
190 if (auto const f = config.FEES.owner_reserve.dropsAs<std::uint32_t>())
-
191 sle->at(sfReserveIncrement) = *f;
-
192 sle->at(sfReferenceFeeUnits) = Config::FEE_UNITS_DEPRECATED;
-
193 }
-
194 rawInsert(sle);
-
195 }
-
196
- -
198 setImmutable();
-
199}
+
144
+
145//------------------------------------------------------------------------------
+
146
+
+
147Ledger::Ledger(create_genesis_t, Config const& config, std::vector<uint256> const& amendments, Family& family)
+
148 : mImmutable(false)
+
149 , txMap_(SHAMapType::TRANSACTION, family)
+
150 , stateMap_(SHAMapType::STATE, family)
+
151 , rules_{config.features}
+
152 , j_(beast::Journal(beast::Journal::getNullSink()))
+
153{
+
154 header_.seq = 1;
+ + +
157
+
158 static auto const id = calcAccountID(generateKeyPair(KeyType::secp256k1, generateSeed("masterpassphrase")).first);
+
159 {
+
160 auto const sle = std::make_shared<SLE>(keylet::account(id));
+
161 sle->setFieldU32(sfSequence, 1);
+
162 sle->setAccountID(sfAccount, id);
+
163 sle->setFieldAmount(sfBalance, header_.drops);
+
164 rawInsert(sle);
+
165 }
+
166
+
167 if (!amendments.empty())
+
168 {
+
169 auto const sle = std::make_shared<SLE>(keylet::amendments());
+
170 sle->setFieldV256(sfAmendments, STVector256{amendments});
+
171 rawInsert(sle);
+
172 }
+
173
+
174 {
+ +
176 // Whether featureXRPFees is supported will depend on startup options.
+
177 if (std::find(amendments.begin(), amendments.end(), featureXRPFees) != amendments.end())
+
178 {
+
179 sle->at(sfBaseFeeDrops) = config.FEES.reference_fee;
+
180 sle->at(sfReserveBaseDrops) = config.FEES.account_reserve;
+
181 sle->at(sfReserveIncrementDrops) = config.FEES.owner_reserve;
+
182 }
+
183 else
+
184 {
+
185 if (auto const f = config.FEES.reference_fee.dropsAs<std::uint64_t>())
+
186 sle->at(sfBaseFee) = *f;
+
187 if (auto const f = config.FEES.account_reserve.dropsAs<std::uint32_t>())
+
188 sle->at(sfReserveBase) = *f;
+
189 if (auto const f = config.FEES.owner_reserve.dropsAs<std::uint32_t>())
+
190 sle->at(sfReserveIncrement) = *f;
+
191 sle->at(sfReferenceFeeUnits) = Config::FEE_UNITS_DEPRECATED;
+
192 }
+
193 rawInsert(sle);
+
194 }
+
195
+ +
197 setImmutable();
+
198}
-
200
-
- -
202 LedgerHeader const& info,
-
203 bool& loaded,
-
204 bool acquire,
-
205 Config const& config,
-
206 Family& family,
- -
208 : mImmutable(true)
-
209 , txMap_(SHAMapType::TRANSACTION, info.txHash, family)
-
210 , stateMap_(SHAMapType::STATE, info.accountHash, family)
-
211 , rules_(config.features)
-
212 , header_(info)
-
213 , j_(j)
-
214{
-
215 loaded = true;
-
216
-
217 if (header_.txHash.isNonZero() && !txMap_.fetchRoot(SHAMapHash{header_.txHash}, nullptr))
-
218 {
-
219 loaded = false;
-
220 JLOG(j.warn()) << "Don't have transaction root for ledger" << header_.seq;
-
221 }
-
222
-
223 if (header_.accountHash.isNonZero() && !stateMap_.fetchRoot(SHAMapHash{header_.accountHash}, nullptr))
-
224 {
-
225 loaded = false;
-
226 JLOG(j.warn()) << "Don't have state data root for ledger" << header_.seq;
-
227 }
-
228
- - -
231
-
232 defaultFees(config);
-
233 if (!setup())
-
234 loaded = false;
-
235
-
236 if (!loaded)
-
237 {
- -
239 if (acquire)
- -
241 }
-
242}
+
199
+
+ +
201 LedgerHeader const& info,
+
202 bool& loaded,
+
203 bool acquire,
+
204 Config const& config,
+
205 Family& family,
+ +
207 : mImmutable(true)
+
208 , txMap_(SHAMapType::TRANSACTION, info.txHash, family)
+
209 , stateMap_(SHAMapType::STATE, info.accountHash, family)
+
210 , rules_(config.features)
+
211 , header_(info)
+
212 , j_(j)
+
213{
+
214 loaded = true;
+
215
+
216 if (header_.txHash.isNonZero() && !txMap_.fetchRoot(SHAMapHash{header_.txHash}, nullptr))
+
217 {
+
218 loaded = false;
+
219 JLOG(j.warn()) << "Don't have transaction root for ledger" << header_.seq;
+
220 }
+
221
+
222 if (header_.accountHash.isNonZero() && !stateMap_.fetchRoot(SHAMapHash{header_.accountHash}, nullptr))
+
223 {
+
224 loaded = false;
+
225 JLOG(j.warn()) << "Don't have state data root for ledger" << header_.seq;
+
226 }
+
227
+ + +
230
+
231 defaultFees(config);
+
232 if (!setup())
+
233 loaded = false;
+
234
+
235 if (!loaded)
+
236 {
+ +
238 if (acquire)
+ +
240 }
+
241}
-
243
-
244// Create a new ledger that follows this one
-
-
245Ledger::Ledger(Ledger const& prevLedger, NetClock::time_point closeTime)
-
246 : mImmutable(false)
-
247 , txMap_(SHAMapType::TRANSACTION, prevLedger.txMap_.family())
-
248 , stateMap_(prevLedger.stateMap_, true)
-
249 , fees_(prevLedger.fees_)
-
250 , rules_(prevLedger.rules_)
-
251 , j_(beast::Journal(beast::Journal::getNullSink()))
-
252{
-
253 header_.seq = prevLedger.header_.seq + 1;
- -
255 header_.hash = prevLedger.header().hash + uint256(1);
-
256 header_.drops = prevLedger.header().drops;
- -
258 header_.parentHash = prevLedger.header().hash;
- -
260 prevLedger.header_.closeTimeResolution, getCloseAgree(prevLedger.header()), header_.seq);
-
261
-
262 if (prevLedger.header_.closeTime == NetClock::time_point{})
-
263 {
- -
265 }
-
266 else
-
267 {
- -
269 }
-
270}
+
242
+
243// Create a new ledger that follows this one
+
+
244Ledger::Ledger(Ledger const& prevLedger, NetClock::time_point closeTime)
+
245 : mImmutable(false)
+
246 , txMap_(SHAMapType::TRANSACTION, prevLedger.txMap_.family())
+
247 , stateMap_(prevLedger.stateMap_, true)
+
248 , fees_(prevLedger.fees_)
+
249 , rules_(prevLedger.rules_)
+
250 , j_(beast::Journal(beast::Journal::getNullSink()))
+
251{
+
252 header_.seq = prevLedger.header_.seq + 1;
+ +
254 header_.hash = prevLedger.header().hash + uint256(1);
+
255 header_.drops = prevLedger.header().drops;
+ +
257 header_.parentHash = prevLedger.header().hash;
+ +
259 prevLedger.header_.closeTimeResolution, getCloseAgree(prevLedger.header()), header_.seq);
+
260
+
261 if (prevLedger.header_.closeTime == NetClock::time_point{})
+
262 {
+ +
264 }
+
265 else
+
266 {
+ +
268 }
+
269}
-
271
-
-
272Ledger::Ledger(LedgerHeader const& info, Config const& config, Family& family)
-
273 : mImmutable(true)
-
274 , txMap_(SHAMapType::TRANSACTION, info.txHash, family)
-
275 , stateMap_(SHAMapType::STATE, info.accountHash, family)
-
276 , rules_{config.features}
-
277 , header_(info)
-
278 , j_(beast::Journal(beast::Journal::getNullSink()))
-
279{
- -
281}
+
270
+
+
271Ledger::Ledger(LedgerHeader const& info, Config const& config, Family& family)
+
272 : mImmutable(true)
+
273 , txMap_(SHAMapType::TRANSACTION, info.txHash, family)
+
274 , stateMap_(SHAMapType::STATE, info.accountHash, family)
+
275 , rules_{config.features}
+
276 , header_(info)
+
277 , j_(beast::Journal(beast::Journal::getNullSink()))
+
278{
+ +
280}
-
282
-
-
283Ledger::Ledger(std::uint32_t ledgerSeq, NetClock::time_point closeTime, Config const& config, Family& family)
-
284 : mImmutable(false)
-
285 , txMap_(SHAMapType::TRANSACTION, family)
-
286 , stateMap_(SHAMapType::STATE, family)
-
287 , rules_{config.features}
-
288 , j_(beast::Journal(beast::Journal::getNullSink()))
-
289{
-
290 header_.seq = ledgerSeq;
-
291 header_.closeTime = closeTime;
- -
293 defaultFees(config);
-
294 setup();
-
295}
+
281
+
+
282Ledger::Ledger(std::uint32_t ledgerSeq, NetClock::time_point closeTime, Config const& config, Family& family)
+
283 : mImmutable(false)
+
284 , txMap_(SHAMapType::TRANSACTION, family)
+
285 , stateMap_(SHAMapType::STATE, family)
+
286 , rules_{config.features}
+
287 , j_(beast::Journal(beast::Journal::getNullSink()))
+
288{
+
289 header_.seq = ledgerSeq;
+
290 header_.closeTime = closeTime;
+ +
292 defaultFees(config);
+
293 setup();
+
294}
-
296
-
297void
-
- -
299{
-
300 // Force update, since this is the only
-
301 // place the hash transitions to valid
-
302 if (!mImmutable && rehash)
-
303 {
- - -
306 }
-
307
-
308 if (rehash)
- -
310
-
311 mImmutable = true;
- - -
314 setup();
-
315}
+
295
+
296void
+
+ +
298{
+
299 // Force update, since this is the only
+
300 // place the hash transitions to valid
+
301 if (!mImmutable && rehash)
+
302 {
+ + +
305 }
+
306
+
307 if (rehash)
+ +
309
+
310 mImmutable = true;
+ + +
313 setup();
+
314}
-
316
-
317void
-
-
318Ledger::setAccepted(NetClock::time_point closeTime, NetClock::duration closeResolution, bool correctCloseTime)
-
319{
-
320 // Used when we witnessed the consensus.
-
321 XRPL_ASSERT(!open(), "xrpl::Ledger::setAccepted : valid ledger state");
-
322
-
323 header_.closeTime = closeTime;
-
324 header_.closeTimeResolution = closeResolution;
-
325 header_.closeFlags = correctCloseTime ? 0 : sLCF_NoConsensusTime;
-
326 setImmutable();
-
327}
+
315
+
316void
+
+
317Ledger::setAccepted(NetClock::time_point closeTime, NetClock::duration closeResolution, bool correctCloseTime)
+
318{
+
319 // Used when we witnessed the consensus.
+
320 XRPL_ASSERT(!open(), "xrpl::Ledger::setAccepted : valid ledger state");
+
321
+
322 header_.closeTime = closeTime;
+
323 header_.closeTimeResolution = closeResolution;
+
324 header_.closeFlags = correctCloseTime ? 0 : sLCF_NoConsensusTime;
+
325 setImmutable();
+
326}
-
328
-
329bool
-
- -
331{
-
332 auto const s = sle.getSerializer();
- -
334}
+
327
+
328bool
+
+ +
330{
+
331 auto const s = sle.getSerializer();
+ +
333}
-
335
-
336//------------------------------------------------------------------------------
-
337
- -
- -
340{
-
341 SerialIter sit(item.slice());
- -
343}
+
334
+
335//------------------------------------------------------------------------------
+
336
+ +
+ +
339{
+
340 SerialIter sit(item.slice());
+ +
342}
-
344
- -
- -
347{
- -
349 SerialIter sit(item.slice());
-
350 {
-
351 SerialIter s(sit.getSlice(sit.getVLDataLength()));
- -
353 }
-
354 {
-
355 SerialIter s(sit.getSlice(sit.getVLDataLength()));
-
356 result.second = std::make_shared<STObject const>(s, sfMetadata);
-
357 }
-
358 return result;
-
359}
+
343
+ +
+ +
346{
+ +
348 SerialIter sit(item.slice());
+
349 {
+
350 SerialIter s(sit.getSlice(sit.getVLDataLength()));
+ +
352 }
+
353 {
+
354 SerialIter s(sit.getSlice(sit.getVLDataLength()));
+
355 result.second = std::make_shared<STObject const>(s, sfMetadata);
+
356 }
+
357 return result;
+
358}
-
360
-
361//------------------------------------------------------------------------------
-
362
-
363bool
-
-
364Ledger::exists(Keylet const& k) const
-
365{
-
366 // VFALCO NOTE Perhaps check the type for debug builds?
-
367 return stateMap_.hasItem(k.key);
-
368}
+
359
+
360//------------------------------------------------------------------------------
+
361
+
362bool
+
+
363Ledger::exists(Keylet const& k) const
+
364{
+
365 // VFALCO NOTE Perhaps check the type for debug builds?
+
366 return stateMap_.hasItem(k.key);
+
367}
-
369
-
370bool
-
-
371Ledger::exists(uint256 const& key) const
-
372{
-
373 return stateMap_.hasItem(key);
-
374}
+
368
+
369bool
+
+
370Ledger::exists(uint256 const& key) const
+
371{
+
372 return stateMap_.hasItem(key);
+
373}
-
375
- -
-
377Ledger::succ(uint256 const& key, std::optional<uint256> const& last) const
-
378{
-
379 auto item = stateMap_.upper_bound(key);
-
380 if (item == stateMap_.end())
-
381 return std::nullopt;
-
382 if (last && item->key() >= last)
-
383 return std::nullopt;
-
384 return item->key();
-
385}
+
374
+ +
+
376Ledger::succ(uint256 const& key, std::optional<uint256> const& last) const
+
377{
+
378 auto item = stateMap_.upper_bound(key);
+
379 if (item == stateMap_.end())
+
380 return std::nullopt;
+
381 if (last && item->key() >= last)
+
382 return std::nullopt;
+
383 return item->key();
+
384}
-
386
- -
-
388Ledger::read(Keylet const& k) const
-
389{
-
390 if (k.key == beast::zero)
-
391 {
-
392 // LCOV_EXCL_START
-
393 UNREACHABLE("xrpl::Ledger::read : zero key");
-
394 return nullptr;
-
395 // LCOV_EXCL_STOP
-
396 }
-
397 auto const& item = stateMap_.peekItem(k.key);
-
398 if (!item)
-
399 return nullptr;
-
400 auto sle = std::make_shared<SLE>(SerialIter{item->slice()}, item->key());
-
401 if (!k.check(*sle))
-
402 return nullptr;
-
403 return sle;
-
404}
+
385
+ +
+
387Ledger::read(Keylet const& k) const
+
388{
+
389 if (k.key == beast::zero)
+
390 {
+
391 // LCOV_EXCL_START
+
392 UNREACHABLE("xrpl::Ledger::read : zero key");
+
393 return nullptr;
+
394 // LCOV_EXCL_STOP
+
395 }
+
396 auto const& item = stateMap_.peekItem(k.key);
+
397 if (!item)
+
398 return nullptr;
+
399 auto sle = std::make_shared<SLE>(SerialIter{item->slice()}, item->key());
+
400 if (!k.check(*sle))
+
401 return nullptr;
+
402 return sle;
+
403}
-
405
-
406//------------------------------------------------------------------------------
-
407
-
408auto
-
-
409Ledger::slesBegin() const -> std::unique_ptr<sles_type::iter_base>
-
410{
- -
412}
+
404
+
405//------------------------------------------------------------------------------
+
406
+
407auto
+
+
408Ledger::slesBegin() const -> std::unique_ptr<sles_type::iter_base>
+
409{
+ +
411}
-
413
-
414auto
-
-
415Ledger::slesEnd() const -> std::unique_ptr<sles_type::iter_base>
-
416{
- -
418}
+
412
+
413auto
+
+
414Ledger::slesEnd() const -> std::unique_ptr<sles_type::iter_base>
+
415{
+ +
417}
-
419
-
420auto
-
- -
422{
-
423 return std::make_unique<sles_iter_impl>(stateMap_.upper_bound(key));
-
424}
+
418
+
419auto
+
+ +
421{
+
422 return std::make_unique<sles_iter_impl>(stateMap_.upper_bound(key));
+
423}
-
425
-
426auto
-
-
427Ledger::txsBegin() const -> std::unique_ptr<txs_type::iter_base>
-
428{
- -
430}
+
424
+
425auto
+
+
426Ledger::txsBegin() const -> std::unique_ptr<txs_type::iter_base>
+
427{
+ +
429}
-
431
-
432auto
-
-
433Ledger::txsEnd() const -> std::unique_ptr<txs_type::iter_base>
-
434{
- -
436}
+
430
+
431auto
+
+
432Ledger::txsEnd() const -> std::unique_ptr<txs_type::iter_base>
+
433{
+ +
435}
-
437
-
438bool
-
-
439Ledger::txExists(uint256 const& key) const
-
440{
-
441 return txMap_.hasItem(key);
-
442}
+
436
+
437bool
+
+
438Ledger::txExists(uint256 const& key) const
+
439{
+
440 return txMap_.hasItem(key);
+
441}
-
443
-
444auto
-
-
445Ledger::txRead(key_type const& key) const -> tx_type
-
446{
-
447 auto const& item = txMap_.peekItem(key);
-
448 if (!item)
-
449 return {};
-
450 if (!open())
-
451 {
-
452 auto result = deserializeTxPlusMeta(*item);
-
453 return {std::move(result.first), std::move(result.second)};
-
454 }
-
455 return {deserializeTx(*item), nullptr};
-
456}
+
442
+
443auto
+
+
444Ledger::txRead(key_type const& key) const -> tx_type
+
445{
+
446 auto const& item = txMap_.peekItem(key);
+
447 if (!item)
+
448 return {};
+
449 if (!open())
+
450 {
+
451 auto result = deserializeTxPlusMeta(*item);
+
452 return {std::move(result.first), std::move(result.second)};
+
453 }
+
454 return {deserializeTx(*item), nullptr};
+
455}
-
457
-
458auto
-
- -
460{
- -
462 // VFALCO Unfortunately this loads the item
-
463 // from the NodeStore needlessly.
-
464 if (!stateMap_.peekItem(key, digest))
-
465 return std::nullopt;
-
466 return digest.as_uint256();
-
467}
+
456
+
457auto
+
+ +
459{
+ +
461 // VFALCO Unfortunately this loads the item
+
462 // from the NodeStore needlessly.
+
463 if (!stateMap_.peekItem(key, digest))
+
464 return std::nullopt;
+
465 return digest.as_uint256();
+
466}
-
468
-
469//------------------------------------------------------------------------------
-
470
-
471void
-
- -
473{
-
474 if (!stateMap_.delItem(sle->key()))
-
475 LogicError("Ledger::rawErase: key not found");
-
476}
+
467
+
468//------------------------------------------------------------------------------
+
469
+
470void
+
+ +
472{
+
473 if (!stateMap_.delItem(sle->key()))
+
474 LogicError("Ledger::rawErase: key not found");
+
475}
-
477
-
478void
-
- -
480{
-
481 if (!stateMap_.delItem(key))
-
482 LogicError("Ledger::rawErase: key not found");
-
483}
+
476
+
477void
+
+ +
479{
+
480 if (!stateMap_.delItem(key))
+
481 LogicError("Ledger::rawErase: key not found");
+
482}
-
484
-
485void
-
- -
487{
-
488 Serializer ss;
-
489 sle->add(ss);
- -
491 LogicError("Ledger::rawInsert: key already exists");
-
492}
+
483
+
484void
+
+ +
486{
+
487 Serializer ss;
+
488 sle->add(ss);
+ +
490 LogicError("Ledger::rawInsert: key already exists");
+
491}
-
493
-
494void
-
- -
496{
-
497 Serializer ss;
-
498 sle->add(ss);
- -
500 LogicError("Ledger::rawReplace: key not found");
-
501}
+
492
+
493void
+
+ +
495{
+
496 Serializer ss;
+
497 sle->add(ss);
+ +
499 LogicError("Ledger::rawReplace: key not found");
+
500}
-
502
-
503void
-
- -
505 uint256 const& key,
- -
507 std::shared_ptr<Serializer const> const& metaData)
-
508{
-
509 XRPL_ASSERT(metaData, "xrpl::Ledger::rawTxInsert : non-null metadata input");
-
510
-
511 // low-level - just add to table
-
512 Serializer s(txn->getDataLength() + metaData->getDataLength() + 16);
-
513 s.addVL(txn->peekData());
-
514 s.addVL(metaData->peekData());
- -
516 LogicError("duplicate_tx: " + to_string(key));
-
517}
+
501
+
502void
+
+ +
504 uint256 const& key,
+ +
506 std::shared_ptr<Serializer const> const& metaData)
+
507{
+
508 XRPL_ASSERT(metaData, "xrpl::Ledger::rawTxInsert : non-null metadata input");
+
509
+
510 // low-level - just add to table
+
511 Serializer s(txn->getDataLength() + metaData->getDataLength() + 16);
+
512 s.addVL(txn->peekData());
+
513 s.addVL(metaData->peekData());
+ +
515 LogicError("duplicate_tx: " + to_string(key));
+
516}
-
518
- -
- -
521 uint256 const& key,
- -
523 std::shared_ptr<Serializer const> const& metaData)
-
524{
-
525 XRPL_ASSERT(metaData, "xrpl::Ledger::rawTxInsertWithHash : non-null metadata input");
-
526
-
527 // low-level - just add to table
-
528 Serializer s(txn->getDataLength() + metaData->getDataLength() + 16);
-
529 s.addVL(txn->peekData());
-
530 s.addVL(metaData->peekData());
-
531 auto item = make_shamapitem(key, s.slice());
-
532 auto hash = sha512Half(HashPrefix::txNode, item->slice(), item->key());
- -
534 LogicError("duplicate_tx: " + to_string(key));
-
535
-
536 return hash;
-
537}
+
517
+ +
+ +
520 uint256 const& key,
+ +
522 std::shared_ptr<Serializer const> const& metaData)
+
523{
+
524 XRPL_ASSERT(metaData, "xrpl::Ledger::rawTxInsertWithHash : non-null metadata input");
+
525
+
526 // low-level - just add to table
+
527 Serializer s(txn->getDataLength() + metaData->getDataLength() + 16);
+
528 s.addVL(txn->peekData());
+
529 s.addVL(metaData->peekData());
+
530 auto item = make_shamapitem(key, s.slice());
+
531 auto hash = sha512Half(HashPrefix::txNode, item->slice(), item->key());
+ +
533 LogicError("duplicate_tx: " + to_string(key));
+
534
+
535 return hash;
+
536}
-
538
-
539bool
-
- -
541{
-
542 bool ret = true;
-
543
-
544 try
-
545 {
- -
547 }
-
548 catch (SHAMapMissingNode const&)
-
549 {
-
550 ret = false;
-
551 }
-
552 catch (std::exception const& ex)
-
553 {
-
554 JLOG(j_.error()) << "Exception in " << __func__ << ": " << ex.what();
-
555 Rethrow();
-
556 }
-
557
-
558 try
-
559 {
-
560 if (auto const sle = read(keylet::fees()))
-
561 {
-
562 bool oldFees = false;
-
563 bool newFees = false;
-
564 {
-
565 auto const baseFee = sle->at(~sfBaseFee);
-
566 auto const reserveBase = sle->at(~sfReserveBase);
-
567 auto const reserveIncrement = sle->at(~sfReserveIncrement);
-
568 if (baseFee)
-
569 fees_.base = *baseFee;
-
570 if (reserveBase)
-
571 fees_.reserve = *reserveBase;
-
572 if (reserveIncrement)
-
573 fees_.increment = *reserveIncrement;
-
574 oldFees = baseFee || reserveBase || reserveIncrement;
-
575 }
-
576 {
-
577 auto const baseFeeXRP = sle->at(~sfBaseFeeDrops);
-
578 auto const reserveBaseXRP = sle->at(~sfReserveBaseDrops);
-
579 auto const reserveIncrementXRP = sle->at(~sfReserveIncrementDrops);
-
580 auto assign = [&ret](XRPAmount& dest, std::optional<STAmount> const& src) {
-
581 if (src)
-
582 {
-
583 if (src->native())
-
584 dest = src->xrp();
-
585 else
-
586 ret = false;
-
587 }
-
588 };
-
589 assign(fees_.base, baseFeeXRP);
-
590 assign(fees_.reserve, reserveBaseXRP);
-
591 assign(fees_.increment, reserveIncrementXRP);
-
592 newFees = baseFeeXRP || reserveBaseXRP || reserveIncrementXRP;
-
593 }
-
594 if (oldFees && newFees)
-
595 // Should be all of one or the other, but not both
-
596 ret = false;
-
597 if (!rules_.enabled(featureXRPFees) && newFees)
-
598 // Can't populate the new fees before the amendment is enabled
-
599 ret = false;
-
600 }
-
601 }
-
602 catch (SHAMapMissingNode const&)
-
603 {
-
604 ret = false;
-
605 }
-
606 catch (std::exception const& ex)
-
607 {
-
608 JLOG(j_.error()) << "Exception in " << __func__ << ": " << ex.what();
-
609 Rethrow();
-
610 }
-
611
-
612 return ret;
-
613}
+
537
+
538bool
+
+ +
540{
+
541 bool ret = true;
+
542
+
543 try
+
544 {
+ +
546 }
+
547 catch (SHAMapMissingNode const&)
+
548 {
+
549 ret = false;
+
550 }
+
551 catch (std::exception const& ex)
+
552 {
+
553 JLOG(j_.error()) << "Exception in " << __func__ << ": " << ex.what();
+
554 Rethrow();
+
555 }
+
556
+
557 try
+
558 {
+
559 if (auto const sle = read(keylet::fees()))
+
560 {
+
561 bool oldFees = false;
+
562 bool newFees = false;
+
563 {
+
564 auto const baseFee = sle->at(~sfBaseFee);
+
565 auto const reserveBase = sle->at(~sfReserveBase);
+
566 auto const reserveIncrement = sle->at(~sfReserveIncrement);
+
567 if (baseFee)
+
568 fees_.base = *baseFee;
+
569 if (reserveBase)
+
570 fees_.reserve = *reserveBase;
+
571 if (reserveIncrement)
+
572 fees_.increment = *reserveIncrement;
+
573 oldFees = baseFee || reserveBase || reserveIncrement;
+
574 }
+
575 {
+
576 auto const baseFeeXRP = sle->at(~sfBaseFeeDrops);
+
577 auto const reserveBaseXRP = sle->at(~sfReserveBaseDrops);
+
578 auto const reserveIncrementXRP = sle->at(~sfReserveIncrementDrops);
+
579 auto assign = [&ret](XRPAmount& dest, std::optional<STAmount> const& src) {
+
580 if (src)
+
581 {
+
582 if (src->native())
+
583 dest = src->xrp();
+
584 else
+
585 ret = false;
+
586 }
+
587 };
+
588 assign(fees_.base, baseFeeXRP);
+
589 assign(fees_.reserve, reserveBaseXRP);
+
590 assign(fees_.increment, reserveIncrementXRP);
+
591 newFees = baseFeeXRP || reserveBaseXRP || reserveIncrementXRP;
+
592 }
+
593 if (oldFees && newFees)
+
594 // Should be all of one or the other, but not both
+
595 ret = false;
+
596 if (!rules_.enabled(featureXRPFees) && newFees)
+
597 // Can't populate the new fees before the amendment is enabled
+
598 ret = false;
+
599 }
+
600 }
+
601 catch (SHAMapMissingNode const&)
+
602 {
+
603 ret = false;
+
604 }
+
605 catch (std::exception const& ex)
+
606 {
+
607 JLOG(j_.error()) << "Exception in " << __func__ << ": " << ex.what();
+
608 Rethrow();
+
609 }
+
610
+
611 return ret;
+
612}
-
614
-
615void
-
- -
617{
-
618 XRPL_ASSERT(fees_.base == 0 && fees_.reserve == 0 && fees_.increment == 0, "xrpl::Ledger::defaultFees : zero fees");
-
619 if (fees_.base == 0)
-
620 fees_.base = config.FEES.reference_fee;
-
621 if (fees_.reserve == 0)
- -
623 if (fees_.increment == 0)
- -
625}
+
613
+
614void
+
+ +
616{
+
617 XRPL_ASSERT(fees_.base == 0 && fees_.reserve == 0 && fees_.increment == 0, "xrpl::Ledger::defaultFees : zero fees");
+
618 if (fees_.base == 0)
+
619 fees_.base = config.FEES.reference_fee;
+
620 if (fees_.reserve == 0)
+ +
622 if (fees_.increment == 0)
+ +
624}
-
626
- -
-
628Ledger::peek(Keylet const& k) const
-
629{
-
630 auto const& value = stateMap_.peekItem(k.key);
-
631 if (!value)
-
632 return nullptr;
-
633 auto sle = std::make_shared<SLE>(SerialIter{value->slice()}, value->key());
-
634 if (!k.check(*sle))
-
635 return nullptr;
-
636 return sle;
-
637}
+
625
+ +
+
627Ledger::peek(Keylet const& k) const
+
628{
+
629 auto const& value = stateMap_.peekItem(k.key);
+
630 if (!value)
+
631 return nullptr;
+
632 auto sle = std::make_shared<SLE>(SerialIter{value->slice()}, value->key());
+
633 if (!k.check(*sle))
+
634 return nullptr;
+
635 return sle;
+
636}
-
638
- -
- -
641{
-
642 hash_set<PublicKey> negUnl;
-
643 if (auto sle = read(keylet::negativeUNL()); sle && sle->isFieldPresent(sfDisabledValidators))
-
644 {
-
645 auto const& nUnlData = sle->getFieldArray(sfDisabledValidators);
-
646 for (auto const& n : nUnlData)
-
647 {
-
648 if (n.isFieldPresent(sfPublicKey))
-
649 {
-
650 auto d = n.getFieldVL(sfPublicKey);
-
651 auto s = makeSlice(d);
-
652 if (!publicKeyType(s))
-
653 {
-
654 continue;
-
655 }
-
656 negUnl.emplace(s);
-
657 }
-
658 }
-
659 }
-
660
-
661 return negUnl;
-
662}
+
637
+ +
+ +
640{
+
641 hash_set<PublicKey> negUnl;
+
642 if (auto sle = read(keylet::negativeUNL()); sle && sle->isFieldPresent(sfDisabledValidators))
+
643 {
+
644 auto const& nUnlData = sle->getFieldArray(sfDisabledValidators);
+
645 for (auto const& n : nUnlData)
+
646 {
+
647 if (n.isFieldPresent(sfPublicKey))
+
648 {
+
649 auto d = n.getFieldVL(sfPublicKey);
+
650 auto s = makeSlice(d);
+
651 if (!publicKeyType(s))
+
652 {
+
653 continue;
+
654 }
+
655 negUnl.emplace(s);
+
656 }
+
657 }
+
658 }
+
659
+
660 return negUnl;
+
661}
-
663
- -
- -
666{
-
667 if (auto sle = read(keylet::negativeUNL()); sle && sle->isFieldPresent(sfValidatorToDisable))
-
668 {
-
669 auto d = sle->getFieldVL(sfValidatorToDisable);
-
670 auto s = makeSlice(d);
-
671 if (publicKeyType(s))
-
672 return PublicKey(s);
-
673 }
-
674
-
675 return std::nullopt;
-
676}
+
662
+ +
+ +
665{
+
666 if (auto sle = read(keylet::negativeUNL()); sle && sle->isFieldPresent(sfValidatorToDisable))
+
667 {
+
668 auto d = sle->getFieldVL(sfValidatorToDisable);
+
669 auto s = makeSlice(d);
+
670 if (publicKeyType(s))
+
671 return PublicKey(s);
+
672 }
+
673
+
674 return std::nullopt;
+
675}
-
677
- -
- -
680{
-
681 if (auto sle = read(keylet::negativeUNL()); sle && sle->isFieldPresent(sfValidatorToReEnable))
-
682 {
-
683 auto d = sle->getFieldVL(sfValidatorToReEnable);
-
684 auto s = makeSlice(d);
-
685 if (publicKeyType(s))
-
686 return PublicKey(s);
-
687 }
-
688
-
689 return std::nullopt;
-
690}
+
676
+ +
+ +
679{
+
680 if (auto sle = read(keylet::negativeUNL()); sle && sle->isFieldPresent(sfValidatorToReEnable))
+
681 {
+
682 auto d = sle->getFieldVL(sfValidatorToReEnable);
+
683 auto s = makeSlice(d);
+
684 if (publicKeyType(s))
+
685 return PublicKey(s);
+
686 }
+
687
+
688 return std::nullopt;
+
689}
-
691
-
692void
-
- -
694{
-
695 auto sle = peek(keylet::negativeUNL());
-
696 if (!sle)
-
697 return;
-
698
-
699 bool const hasToDisable = sle->isFieldPresent(sfValidatorToDisable);
-
700 bool const hasToReEnable = sle->isFieldPresent(sfValidatorToReEnable);
-
701
-
702 if (!hasToDisable && !hasToReEnable)
-
703 return;
-
704
-
705 STArray newNUnl;
-
706 if (sle->isFieldPresent(sfDisabledValidators))
-
707 {
-
708 auto const& oldNUnl = sle->getFieldArray(sfDisabledValidators);
-
709 for (auto v : oldNUnl)
-
710 {
-
711 if (hasToReEnable && v.isFieldPresent(sfPublicKey) &&
-
712 v.getFieldVL(sfPublicKey) == sle->getFieldVL(sfValidatorToReEnable))
-
713 continue;
-
714 newNUnl.push_back(v);
-
715 }
-
716 }
-
717
-
718 if (hasToDisable)
-
719 {
-
720 newNUnl.push_back(STObject::makeInnerObject(sfDisabledValidator));
-
721 newNUnl.back().setFieldVL(sfPublicKey, sle->getFieldVL(sfValidatorToDisable));
-
722 newNUnl.back().setFieldU32(sfFirstLedgerSequence, seq());
-
723 }
-
724
-
725 if (!newNUnl.empty())
-
726 {
-
727 sle->setFieldArray(sfDisabledValidators, newNUnl);
-
728 if (hasToReEnable)
-
729 sle->makeFieldAbsent(sfValidatorToReEnable);
-
730 if (hasToDisable)
-
731 sle->makeFieldAbsent(sfValidatorToDisable);
-
732 rawReplace(sle);
-
733 }
-
734 else
-
735 {
-
736 rawErase(sle);
-
737 }
-
738}
+
690
+
691void
+
+ +
693{
+
694 auto sle = peek(keylet::negativeUNL());
+
695 if (!sle)
+
696 return;
+
697
+
698 bool const hasToDisable = sle->isFieldPresent(sfValidatorToDisable);
+
699 bool const hasToReEnable = sle->isFieldPresent(sfValidatorToReEnable);
+
700
+
701 if (!hasToDisable && !hasToReEnable)
+
702 return;
+
703
+
704 STArray newNUnl;
+
705 if (sle->isFieldPresent(sfDisabledValidators))
+
706 {
+
707 auto const& oldNUnl = sle->getFieldArray(sfDisabledValidators);
+
708 for (auto v : oldNUnl)
+
709 {
+
710 if (hasToReEnable && v.isFieldPresent(sfPublicKey) &&
+
711 v.getFieldVL(sfPublicKey) == sle->getFieldVL(sfValidatorToReEnable))
+
712 continue;
+
713 newNUnl.push_back(v);
+
714 }
+
715 }
+
716
+
717 if (hasToDisable)
+
718 {
+
719 newNUnl.push_back(STObject::makeInnerObject(sfDisabledValidator));
+
720 newNUnl.back().setFieldVL(sfPublicKey, sle->getFieldVL(sfValidatorToDisable));
+
721 newNUnl.back().setFieldU32(sfFirstLedgerSequence, seq());
+
722 }
+
723
+
724 if (!newNUnl.empty())
+
725 {
+
726 sle->setFieldArray(sfDisabledValidators, newNUnl);
+
727 if (hasToReEnable)
+
728 sle->makeFieldAbsent(sfValidatorToReEnable);
+
729 if (hasToDisable)
+
730 sle->makeFieldAbsent(sfValidatorToDisable);
+
731 rawReplace(sle);
+
732 }
+
733 else
+
734 {
+
735 rawErase(sle);
+
736 }
+
737}
-
739
-
740//------------------------------------------------------------------------------
-
741bool
-
-
742Ledger::walkLedger(beast::Journal j, bool parallel) const
-
743{
-
744 std::vector<SHAMapMissingNode> missingNodes1;
-
745 std::vector<SHAMapMissingNode> missingNodes2;
-
746
- -
748 !stateMap_.fetchRoot(SHAMapHash{header_.accountHash}, nullptr))
-
749 {
- -
751 }
-
752 else
-
753 {
-
754 if (parallel)
-
755 return stateMap_.walkMapParallel(missingNodes1, 32);
-
756 else
-
757 stateMap_.walkMap(missingNodes1, 32);
-
758 }
-
759
-
760 if (!missingNodes1.empty())
-
761 {
-
762 if (auto stream = j.info())
-
763 {
-
764 stream << missingNodes1.size() << " missing account node(s)";
-
765 stream << "First: " << missingNodes1[0].what();
-
766 }
-
767 }
-
768
- -
770 !txMap_.fetchRoot(SHAMapHash{header_.txHash}, nullptr))
-
771 {
- -
773 }
-
774 else
-
775 {
-
776 txMap_.walkMap(missingNodes2, 32);
-
777 }
-
778
-
779 if (!missingNodes2.empty())
-
780 {
-
781 if (auto stream = j.info())
-
782 {
-
783 stream << missingNodes2.size() << " missing transaction node(s)";
-
784 stream << "First: " << missingNodes2[0].what();
-
785 }
-
786 }
-
787 return missingNodes1.empty() && missingNodes2.empty();
-
788}
+
738
+
739//------------------------------------------------------------------------------
+
740bool
+
+
741Ledger::walkLedger(beast::Journal j, bool parallel) const
+
742{
+
743 std::vector<SHAMapMissingNode> missingNodes1;
+
744 std::vector<SHAMapMissingNode> missingNodes2;
+
745
+ +
747 !stateMap_.fetchRoot(SHAMapHash{header_.accountHash}, nullptr))
+
748 {
+ +
750 }
+
751 else
+
752 {
+
753 if (parallel)
+
754 return stateMap_.walkMapParallel(missingNodes1, 32);
+
755 else
+
756 stateMap_.walkMap(missingNodes1, 32);
+
757 }
+
758
+
759 if (!missingNodes1.empty())
+
760 {
+
761 if (auto stream = j.info())
+
762 {
+
763 stream << missingNodes1.size() << " missing account node(s)";
+
764 stream << "First: " << missingNodes1[0].what();
+
765 }
+
766 }
+
767
+ +
769 !txMap_.fetchRoot(SHAMapHash{header_.txHash}, nullptr))
+
770 {
+ +
772 }
+
773 else
+
774 {
+
775 txMap_.walkMap(missingNodes2, 32);
+
776 }
+
777
+
778 if (!missingNodes2.empty())
+
779 {
+
780 if (auto stream = j.info())
+
781 {
+
782 stream << missingNodes2.size() << " missing transaction node(s)";
+
783 stream << "First: " << missingNodes2[0].what();
+
784 }
+
785 }
+
786 return missingNodes1.empty() && missingNodes2.empty();
+
787}
-
789
-
790bool
-
- -
792{
- - -
795 {
-
796 return true;
-
797 }
-
798
-
799 // LCOV_EXCL_START
-
800 Json::Value j = getJson({*this, {}});
-
801
-
802 j[jss::accountTreeHash] = to_string(header_.accountHash);
-
803 j[jss::transTreeHash] = to_string(header_.txHash);
-
804
-
805 JLOG(ledgerJ.fatal()) << "ledger is not sensible" << j;
-
806
-
807 UNREACHABLE("xrpl::Ledger::assertSensible : ledger is not sensible");
-
808
-
809 return false;
-
810 // LCOV_EXCL_STOP
-
811}
+
788
+
789bool
+
+ +
791{
+ + +
794 {
+
795 return true;
+
796 }
+
797
+
798 // LCOV_EXCL_START
+
799 Json::Value j = getJson({*this, {}});
+
800
+
801 j[jss::accountTreeHash] = to_string(header_.accountHash);
+
802 j[jss::transTreeHash] = to_string(header_.txHash);
+
803
+
804 JLOG(ledgerJ.fatal()) << "ledger is not sensible" << j;
+
805
+
806 UNREACHABLE("xrpl::Ledger::assertSensible : ledger is not sensible");
+
807
+
808 return false;
+
809 // LCOV_EXCL_STOP
+
810}
-
812
-
813// update the skip list with the information from our previous ledger
-
814// VFALCO TODO Document this skip list concept
-
815void
-
- -
817{
-
818 if (header_.seq == 0) // genesis ledger has no previous ledger
-
819 return;
-
820
-
821 std::uint32_t prevIndex = header_.seq - 1;
-
822
-
823 // update record of every 256th ledger
-
824 if ((prevIndex & 0xff) == 0)
-
825 {
-
826 auto const k = keylet::skip(prevIndex);
-
827 auto sle = peek(k);
- -
829
-
830 bool created;
-
831 if (!sle)
-
832 {
-
833 sle = std::make_shared<SLE>(k);
-
834 created = true;
-
835 }
-
836 else
-
837 {
-
838 hashes = static_cast<decltype(hashes)>(sle->getFieldV256(sfHashes));
-
839 created = false;
-
840 }
-
841
-
842 XRPL_ASSERT(hashes.size() <= 256, "xrpl::Ledger::updateSkipList : first maximum hashes size");
- -
844 sle->setFieldV256(sfHashes, STVector256(hashes));
-
845 sle->setFieldU32(sfLastLedgerSequence, prevIndex);
-
846 if (created)
-
847 rawInsert(sle);
-
848 else
-
849 rawReplace(sle);
-
850 }
-
851
-
852 // update record of past 256 ledger
-
853 auto const k = keylet::skip();
-
854 auto sle = peek(k);
- -
856 bool created;
-
857 if (!sle)
-
858 {
-
859 sle = std::make_shared<SLE>(k);
-
860 created = true;
-
861 }
-
862 else
-
863 {
-
864 hashes = static_cast<decltype(hashes)>(sle->getFieldV256(sfHashes));
-
865 created = false;
-
866 }
-
867 XRPL_ASSERT(hashes.size() <= 256, "xrpl::Ledger::updateSkipList : second maximum hashes size");
-
868 if (hashes.size() == 256)
-
869 hashes.erase(hashes.begin());
- -
871 sle->setFieldV256(sfHashes, STVector256(hashes));
-
872 sle->setFieldU32(sfLastLedgerSequence, prevIndex);
-
873 if (created)
-
874 rawInsert(sle);
-
875 else
-
876 rawReplace(sle);
-
877}
+
811
+
812// update the skip list with the information from our previous ledger
+
813// VFALCO TODO Document this skip list concept
+
814void
+
+ +
816{
+
817 if (header_.seq == 0) // genesis ledger has no previous ledger
+
818 return;
+
819
+
820 std::uint32_t prevIndex = header_.seq - 1;
+
821
+
822 // update record of every 256th ledger
+
823 if ((prevIndex & 0xff) == 0)
+
824 {
+
825 auto const k = keylet::skip(prevIndex);
+
826 auto sle = peek(k);
+ +
828
+
829 bool created;
+
830 if (!sle)
+
831 {
+
832 sle = std::make_shared<SLE>(k);
+
833 created = true;
+
834 }
+
835 else
+
836 {
+
837 hashes = static_cast<decltype(hashes)>(sle->getFieldV256(sfHashes));
+
838 created = false;
+
839 }
+
840
+
841 XRPL_ASSERT(hashes.size() <= 256, "xrpl::Ledger::updateSkipList : first maximum hashes size");
+ +
843 sle->setFieldV256(sfHashes, STVector256(hashes));
+
844 sle->setFieldU32(sfLastLedgerSequence, prevIndex);
+
845 if (created)
+
846 rawInsert(sle);
+
847 else
+
848 rawReplace(sle);
+
849 }
+
850
+
851 // update record of past 256 ledger
+
852 auto const k = keylet::skip();
+
853 auto sle = peek(k);
+ +
855 bool created;
+
856 if (!sle)
+
857 {
+
858 sle = std::make_shared<SLE>(k);
+
859 created = true;
+
860 }
+
861 else
+
862 {
+
863 hashes = static_cast<decltype(hashes)>(sle->getFieldV256(sfHashes));
+
864 created = false;
+
865 }
+
866 XRPL_ASSERT(hashes.size() <= 256, "xrpl::Ledger::updateSkipList : second maximum hashes size");
+
867 if (hashes.size() == 256)
+
868 hashes.erase(hashes.begin());
+ +
870 sle->setFieldV256(sfHashes, STVector256(hashes));
+
871 sle->setFieldU32(sfLastLedgerSequence, prevIndex);
+
872 if (created)
+
873 rawInsert(sle);
+
874 else
+
875 rawReplace(sle);
+
876}
-
878
-
879bool
-
- -
881{
-
882 return header_.seq % FLAG_LEDGER_INTERVAL == 0;
-
883}
+
877
+
878bool
+
+ +
880{
+
881 return header_.seq % FLAG_LEDGER_INTERVAL == 0;
+
882}
-
884bool
-
- -
886{
-
887 return (header_.seq + 1) % FLAG_LEDGER_INTERVAL == 0;
-
888}
+
883bool
+
+ +
885{
+
886 return (header_.seq + 1) % FLAG_LEDGER_INTERVAL == 0;
+
887}
-
889
-
890bool
-
- -
892{
-
893 return seq % FLAG_LEDGER_INTERVAL == 0;
-
894}
+
888
+
889bool
+
+ +
891{
+
892 return seq % FLAG_LEDGER_INTERVAL == 0;
+
893}
-
895
-
896static bool
-
- -
898{
-
899 auto j = app.journal("Ledger");
-
900 auto seq = ledger->header().seq;
-
901 if (!app.pendingSaves().startWork(seq))
-
902 {
-
903 // The save was completed synchronously
-
904 JLOG(j.debug()) << "Save aborted";
-
905 return true;
-
906 }
-
907
-
908 auto const db = dynamic_cast<SQLiteDatabase*>(&app.getRelationalDatabase());
-
909 if (!db)
-
910 Throw<std::runtime_error>("Failed to get relational database");
-
911
-
912 auto const res = db->saveValidatedLedger(ledger, current);
-
913
-
914 // Clients can now trust the database for
-
915 // information about this ledger sequence.
-
916 app.pendingSaves().finishWork(seq);
-
917 return res;
-
918}
+
894
+
895static bool
+
+ +
897{
+
898 auto j = app.journal("Ledger");
+
899 auto seq = ledger->header().seq;
+
900 if (!app.pendingSaves().startWork(seq))
+
901 {
+
902 // The save was completed synchronously
+
903 JLOG(j.debug()) << "Save aborted";
+
904 return true;
+
905 }
+
906
+
907 auto const db = dynamic_cast<SQLiteDatabase*>(&app.getRelationalDatabase());
+
908 if (!db)
+
909 Throw<std::runtime_error>("Failed to get relational database");
+
910
+
911 auto const res = db->saveValidatedLedger(ledger, current);
+
912
+
913 // Clients can now trust the database for
+
914 // information about this ledger sequence.
+
915 app.pendingSaves().finishWork(seq);
+
916 return res;
+
917}
-
919
-
923bool
-
-
924pendSaveValidated(Application& app, std::shared_ptr<Ledger const> const& ledger, bool isSynchronous, bool isCurrent)
-
925{
-
926 if (!app.getHashRouter().setFlags(ledger->header().hash, HashRouterFlags::SAVED))
-
927 {
-
928 // We have tried to save this ledger recently
-
929 auto stream = app.journal("Ledger").debug();
-
930 JLOG(stream) << "Double pend save for " << ledger->header().seq;
-
931
-
932 if (!isSynchronous || !app.pendingSaves().pending(ledger->header().seq))
-
933 {
-
934 // Either we don't need it to be finished
-
935 // or it is finished
-
936 return true;
-
937 }
-
938 }
-
939
-
940 XRPL_ASSERT(ledger->isImmutable(), "xrpl::pendSaveValidated : immutable ledger");
-
941
-
942 if (!app.pendingSaves().shouldWork(ledger->header().seq, isSynchronous))
-
943 {
-
944 auto stream = app.journal("Ledger").debug();
-
945 JLOG(stream) << "Pend save with seq in pending saves " << ledger->header().seq;
-
946
-
947 return true;
-
948 }
-
949
-
950 // See if we can use the JobQueue.
-
951 if (!isSynchronous &&
-
952 app.getJobQueue().addJob(
-
953 isCurrent ? jtPUBLEDGER : jtPUBOLDLEDGER, std::to_string(ledger->seq()), [&app, ledger, isCurrent]() {
-
954 saveValidatedLedger(app, ledger, isCurrent);
-
955 }))
-
956 {
-
957 return true;
-
958 }
-
959
-
960 // The JobQueue won't do the Job. Do the save synchronously.
-
961 return saveValidatedLedger(app, ledger, isCurrent);
-
962}
+
918
+
922bool
+
+
923pendSaveValidated(Application& app, std::shared_ptr<Ledger const> const& ledger, bool isSynchronous, bool isCurrent)
+
924{
+
925 if (!app.getHashRouter().setFlags(ledger->header().hash, HashRouterFlags::SAVED))
+
926 {
+
927 // We have tried to save this ledger recently
+
928 auto stream = app.journal("Ledger").debug();
+
929 JLOG(stream) << "Double pend save for " << ledger->header().seq;
+
930
+
931 if (!isSynchronous || !app.pendingSaves().pending(ledger->header().seq))
+
932 {
+
933 // Either we don't need it to be finished
+
934 // or it is finished
+
935 return true;
+
936 }
+
937 }
+
938
+
939 XRPL_ASSERT(ledger->isImmutable(), "xrpl::pendSaveValidated : immutable ledger");
+
940
+
941 if (!app.pendingSaves().shouldWork(ledger->header().seq, isSynchronous))
+
942 {
+
943 auto stream = app.journal("Ledger").debug();
+
944 JLOG(stream) << "Pend save with seq in pending saves " << ledger->header().seq;
+
945
+
946 return true;
+
947 }
+
948
+
949 // See if we can use the JobQueue.
+
950 if (!isSynchronous &&
+
951 app.getJobQueue().addJob(
+
952 isCurrent ? jtPUBLEDGER : jtPUBOLDLEDGER, std::to_string(ledger->seq()), [&app, ledger, isCurrent]() {
+
953 saveValidatedLedger(app, ledger, isCurrent);
+
954 }))
+
955 {
+
956 return true;
+
957 }
+
958
+
959 // The JobQueue won't do the Job. Do the save synchronously.
+
960 return saveValidatedLedger(app, ledger, isCurrent);
+
961}
-
963
-
964void
-
- -
966{
- -
968 txMap_.unshare();
-
969}
+
962
+
963void
+
+ +
965{
+ +
967 txMap_.unshare();
+
968}
-
970
-
971void
-
- -
973{
- - -
976}
+
969
+
970void
+
+ +
972{
+ + +
975}
-
977//------------------------------------------------------------------------------
-
978
-
979/*
-
980 * Make ledger using info loaded from database.
-
981 *
-
982 * @param LedgerHeader: Ledger information.
-
983 * @param app: Link to the Application.
-
984 * @param acquire: Acquire the ledger if not found locally.
-
985 * @return Shared pointer to the ledger.
-
986 */
- -
-
988loadLedgerHelper(LedgerHeader const& info, Application& app, bool acquire)
-
989{
-
990 bool loaded;
-
991 auto ledger =
-
992 std::make_shared<Ledger>(info, loaded, acquire, app.config(), app.getNodeFamily(), app.journal("Ledger"));
-
993
-
994 if (!loaded)
-
995 ledger.reset();
-
996
-
997 return ledger;
-
998}
+
976//------------------------------------------------------------------------------
+
977
+
978/*
+
979 * Make ledger using info loaded from database.
+
980 *
+
981 * @param LedgerHeader: Ledger information.
+
982 * @param app: Link to the Application.
+
983 * @param acquire: Acquire the ledger if not found locally.
+
984 * @return Shared pointer to the ledger.
+
985 */
+ +
+
987loadLedgerHelper(LedgerHeader const& info, Application& app, bool acquire)
+
988{
+
989 bool loaded;
+
990 auto ledger =
+
991 std::make_shared<Ledger>(info, loaded, acquire, app.config(), app.getNodeFamily(), app.journal("Ledger"));
+
992
+
993 if (!loaded)
+
994 ledger.reset();
+
995
+
996 return ledger;
+
997}
-
999
-
1000static void
-
- -
1002{
-
1003 if (!ledger)
-
1004 return;
-
1005
-
1006 XRPL_ASSERT(
-
1007 ledger->header().seq < XRP_LEDGER_EARLIEST_FEES || ledger->read(keylet::fees()),
-
1008 "xrpl::finishLoadByIndexOrHash : valid ledger fees");
-
1009 ledger->setImmutable();
-
1010
-
1011 JLOG(j.trace()) << "Loaded ledger: " << to_string(ledger->header().hash);
-
1012
-
1013 ledger->setFull();
-
1014}
+
998
+
999static void
+
+ +
1001{
+
1002 if (!ledger)
+
1003 return;
+
1004
+
1005 XRPL_ASSERT(
+
1006 ledger->header().seq < XRP_LEDGER_EARLIEST_FEES || ledger->read(keylet::fees()),
+
1007 "xrpl::finishLoadByIndexOrHash : valid ledger fees");
+
1008 ledger->setImmutable();
+
1009
+
1010 JLOG(j.trace()) << "Loaded ledger: " << to_string(ledger->header().hash);
+
1011
+
1012 ledger->setFull();
+
1013}
-
1015
- -
- -
1018{
- -
1020 if (!info)
-
1021 return {std::shared_ptr<Ledger>(), {}, {}};
-
1022 return {loadLedgerHelper(*info, app, true), info->seq, info->hash};
-
1023}
+
1014
+ +
+ +
1017{
+ +
1019 if (!info)
+
1020 return {std::shared_ptr<Ledger>(), {}, {}};
+
1021 return {loadLedgerHelper(*info, app, true), info->seq, info->hash};
+
1022}
-
1024
- -
-
1026loadByIndex(std::uint32_t ledgerIndex, Application& app, bool acquire)
-
1027{
- -
1029 {
-
1030 std::shared_ptr<Ledger> ledger = loadLedgerHelper(*info, app, acquire);
-
1031 finishLoadByIndexOrHash(ledger, app.config(), app.journal("Ledger"));
-
1032 return ledger;
-
1033 }
-
1034 return {};
-
1035}
+
1023
+ +
+
1025loadByIndex(std::uint32_t ledgerIndex, Application& app, bool acquire)
+
1026{
+ +
1028 {
+
1029 std::shared_ptr<Ledger> ledger = loadLedgerHelper(*info, app, acquire);
+
1030 finishLoadByIndexOrHash(ledger, app.config(), app.journal("Ledger"));
+
1031 return ledger;
+
1032 }
+
1033 return {};
+
1034}
-
1036
- -
-
1038loadByHash(uint256 const& ledgerHash, Application& app, bool acquire)
-
1039{
- -
1041 {
-
1042 std::shared_ptr<Ledger> ledger = loadLedgerHelper(*info, app, acquire);
-
1043 finishLoadByIndexOrHash(ledger, app.config(), app.journal("Ledger"));
-
1044 XRPL_ASSERT(!ledger || ledger->header().hash == ledgerHash, "xrpl::loadByHash : ledger hash match if loaded");
-
1045 return ledger;
-
1046 }
-
1047 return {};
-
1048}
+
1035
+ +
+
1037loadByHash(uint256 const& ledgerHash, Application& app, bool acquire)
+
1038{
+ +
1040 {
+
1041 std::shared_ptr<Ledger> ledger = loadLedgerHelper(*info, app, acquire);
+
1042 finishLoadByIndexOrHash(ledger, app.config(), app.journal("Ledger"));
+
1043 XRPL_ASSERT(!ledger || ledger->header().hash == ledgerHash, "xrpl::loadByHash : ledger hash match if loaded");
+
1044 return ledger;
+
1045 }
+
1046 return {};
+
1047}
-
1049
-
1050} // namespace xrpl
+
1048
+
1049} // namespace xrpl
T begin(T... args)
Represents a JSON value.
Definition json_value.h:130
A generic endpoint for log messages.
Definition Journal.h:40
@@ -1265,79 +1264,78 @@ $(document).ready(function() { init_codefold(0); });
Stream warn() const
Definition Journal.h:312
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
- -
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:141
-
FeeSetup FEES
Definition Config.h:184
+ +
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
+
FeeSetup FEES
Definition Config.h:185
virtual void missingNodeAcquireByHash(uint256 const &refHash, std::uint32_t refNum)=0
Acquire ledger that has a missing node by ledger hash.
bool setFlags(uint256 const &key, HashRouterFlags flags)
Set the flags on a hash.
bool addJob(JobType type, std::string const &name, JobHandler &&jobHandler)
Adds a job to the JobQueue.
Definition JobQueue.h:145
- +
sles_iter_impl(sles_iter_impl const &)=default
-
void increment() override
Definition Ledger.cpp:84
+
void increment() override
Definition Ledger.cpp:83
-
SHAMap::const_iterator iter_
Definition Ledger.cpp:56
-
bool equal(base_type const &impl) const override
Definition Ledger.cpp:76
-
std::unique_ptr< base_type > copy() const override
Definition Ledger.cpp:70
+
SHAMap::const_iterator iter_
Definition Ledger.cpp:55
+
bool equal(base_type const &impl) const override
Definition Ledger.cpp:75
+
std::unique_ptr< base_type > copy() const override
Definition Ledger.cpp:69
sles_iter_impl & operator=(sles_iter_impl const &)=delete
-
sles_type::value_type dereference() const override
Definition Ledger.cpp:90
-
sles_iter_impl(SHAMap::const_iterator iter)
Definition Ledger.cpp:65
- +
sles_type::value_type dereference() const override
Definition Ledger.cpp:89
+
sles_iter_impl(SHAMap::const_iterator iter)
Definition Ledger.cpp:64
+ -
bool equal(base_type const &impl) const override
Definition Ledger.cpp:123
-
SHAMap::const_iterator iter_
Definition Ledger.cpp:103
+
bool equal(base_type const &impl) const override
Definition Ledger.cpp:122
+
SHAMap::const_iterator iter_
Definition Ledger.cpp:102
txs_iter_impl(txs_iter_impl const &)=default
-
std::unique_ptr< base_type > copy() const override
Definition Ledger.cpp:117
- -
txs_iter_impl(bool metadata, SHAMap::const_iterator iter)
Definition Ledger.cpp:112
-
void increment() override
Definition Ledger.cpp:131
-
txs_type::value_type dereference() const override
Definition Ledger.cpp:137
+
std::unique_ptr< base_type > copy() const override
Definition Ledger.cpp:116
+ +
txs_iter_impl(bool metadata, SHAMap::const_iterator iter)
Definition Ledger.cpp:111
+
void increment() override
Definition Ledger.cpp:130
+
txs_type::value_type dereference() const override
Definition Ledger.cpp:136
txs_iter_impl & operator=(txs_iter_impl const &)=delete
Holds a ledger.
Definition Ledger.h:60
-
bool txExists(uint256 const &key) const override
Definition Ledger.cpp:439
-
std::unique_ptr< txs_type::iter_base > txsEnd() const override
Definition Ledger.cpp:433
+
bool txExists(uint256 const &key) const override
Definition Ledger.cpp:438
+
std::unique_ptr< txs_type::iter_base > txsEnd() const override
Definition Ledger.cpp:432
Fees fees_
Definition Ledger.h:385
-
bool isFlagLedger() const
Returns true if the ledger is a flag ledger.
Definition Ledger.cpp:880
-
std::optional< digest_type > digest(key_type const &key) const override
Return the digest associated with the key.
Definition Ledger.cpp:459
-
void rawTxInsert(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData) override
Definition Ledger.cpp:504
-
std::optional< PublicKey > validatorToDisable() const
get the to be disabled validator's master public key if any
Definition Ledger.cpp:665
-
uint256 rawTxInsertWithHash(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData)
Definition Ledger.cpp:520
-
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
Definition Ledger.cpp:388
-
void updateNegativeUNL()
update the Negative UNL ledger component.
Definition Ledger.cpp:693
-
bool assertSensible(beast::Journal ledgerJ) const
Definition Ledger.cpp:791
-
bool isVotingLedger() const
Returns true if the ledger directly precedes a flag ledger.
Definition Ledger.cpp:885
-
std::unique_ptr< sles_type::iter_base > slesBegin() const override
Definition Ledger.cpp:409
+
bool isFlagLedger() const
Returns true if the ledger is a flag ledger.
Definition Ledger.cpp:879
+
std::optional< digest_type > digest(key_type const &key) const override
Return the digest associated with the key.
Definition Ledger.cpp:458
+
void rawTxInsert(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData) override
Definition Ledger.cpp:503
+
std::optional< PublicKey > validatorToDisable() const
get the to be disabled validator's master public key if any
Definition Ledger.cpp:664
+
uint256 rawTxInsertWithHash(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData)
Definition Ledger.cpp:519
+
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
Definition Ledger.cpp:387
+
void updateNegativeUNL()
update the Negative UNL ledger component.
Definition Ledger.cpp:692
+
bool assertSensible(beast::Journal ledgerJ) const
Definition Ledger.cpp:790
+
bool isVotingLedger() const
Returns true if the ledger directly precedes a flag ledger.
Definition Ledger.cpp:884
+
std::unique_ptr< sles_type::iter_base > slesBegin() const override
Definition Ledger.cpp:408
Rules rules_
Definition Ledger.h:386
-
void invariants() const
Definition Ledger.cpp:972
-
hash_set< PublicKey > negativeUNL() const
get Negative UNL validators' master public keys
Definition Ledger.cpp:640
-
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
Definition Ledger.cpp:486
-
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
Definition Ledger.cpp:495
-
void setImmutable(bool rehash=true)
Definition Ledger.cpp:298
-
void updateSkipList()
Definition Ledger.cpp:816
-
void defaultFees(Config const &config)
Definition Ledger.cpp:616
+
void invariants() const
Definition Ledger.cpp:971
+
hash_set< PublicKey > negativeUNL() const
get Negative UNL validators' master public keys
Definition Ledger.cpp:639
+
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
Definition Ledger.cpp:485
+
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
Definition Ledger.cpp:494
+
void setImmutable(bool rehash=true)
Definition Ledger.cpp:297
+
void updateSkipList()
Definition Ledger.cpp:815
+
void defaultFees(Config const &config)
Definition Ledger.cpp:615
bool open() const override
Returns true if this reflects an open ledger.
Definition Ledger.h:118
-
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
Definition Ledger.cpp:472
+
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
Definition Ledger.cpp:471
LedgerHeader const & header() const override
Returns information about the ledger.
Definition Ledger.h:124
-
void setAccepted(NetClock::time_point closeTime, NetClock::duration closeResolution, bool correctCloseTime)
Definition Ledger.cpp:318
+
void setAccepted(NetClock::time_point closeTime, NetClock::duration closeResolution, bool correctCloseTime)
Definition Ledger.cpp:317
bool mImmutable
Definition Ledger.h:374
Ledger(Ledger const &)=delete
-
std::shared_ptr< SLE > peek(Keylet const &k) const
Definition Ledger.cpp:628
+
std::shared_ptr< SLE > peek(Keylet const &k) const
Definition Ledger.cpp:627
LedgerHeader header_
Definition Ledger.h:387
-
bool addSLE(SLE const &sle)
Definition Ledger.cpp:330
-
std::unique_ptr< txs_type::iter_base > txsBegin() const override
Definition Ledger.cpp:427
-
std::unique_ptr< sles_type::iter_base > slesEnd() const override
Definition Ledger.cpp:415
+
bool addSLE(SLE const &sle)
Definition Ledger.cpp:329
+
std::unique_ptr< txs_type::iter_base > txsBegin() const override
Definition Ledger.cpp:426
+
std::unique_ptr< sles_type::iter_base > slesEnd() const override
Definition Ledger.cpp:414
SHAMap stateMap_
Definition Ledger.h:380
-
std::optional< uint256 > succ(uint256 const &key, std::optional< uint256 > const &last=std::nullopt) const override
Definition Ledger.cpp:377
+
std::optional< uint256 > succ(uint256 const &key, std::optional< uint256 > const &last=std::nullopt) const override
Definition Ledger.cpp:376
SHAMap txMap_
Definition Ledger.h:377
beast::Journal j_
Definition Ledger.h:388
-
bool walkLedger(beast::Journal j, bool parallel=false) const
Definition Ledger.cpp:742
-
void unshare() const
Definition Ledger.cpp:965
-
std::unique_ptr< sles_type::iter_base > slesUpperBound(uint256 const &key) const override
Definition Ledger.cpp:421
-
std::optional< PublicKey > validatorToReEnable() const
get the to be re-enabled validator's master public key if any
Definition Ledger.cpp:679
-
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
Definition Ledger.cpp:445
-
bool setup()
Definition Ledger.cpp:540
-
bool exists(Keylet const &k) const override
Determine if a state item exists.
Definition Ledger.cpp:364
+
bool walkLedger(beast::Journal j, bool parallel=false) const
Definition Ledger.cpp:741
+
void unshare() const
Definition Ledger.cpp:964
+
std::unique_ptr< sles_type::iter_base > slesUpperBound(uint256 const &key) const override
Definition Ledger.cpp:420
+
std::optional< PublicKey > validatorToReEnable() const
get the to be re-enabled validator's master public key if any
Definition Ledger.cpp:678
+
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
Definition Ledger.cpp:444
+
bool setup()
Definition Ledger.cpp:539
+
bool exists(Keylet const &k) const override
Determine if a state item exists.
Definition Ledger.cpp:363
void finishWork(LedgerIndex seq)
Finish working on a ledger.
bool shouldWork(LedgerIndex seq, bool isSynchronous)
Check if a ledger should be dispatched.
bool startWork(LedgerIndex seq)
Start working on a ledger.
@@ -1395,6 +1393,7 @@ $(document).ready(function() { init_codefold(0); });
virtual PendingSaves & pendingSaves()=0
virtual HashRouter & getHashRouter()=0
virtual Family & getNodeFamily()=0
+
virtual beast::Journal journal(std::string const &name)=0
constexpr value_type drops() const
Returns the number of drops.
Definition XRPAmount.h:157
std::optional< Dest > dropsAs() const
Definition XRPAmount.h:167
@@ -1420,38 +1419,38 @@ $(document).ready(function() { init_codefold(0); });
Keylet const & fees() noexcept
The (fixed) index of the object containing the ledger fees.
Definition Indexes.cpp:194
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES
The XRP Ledger mainnet's earliest ledger with a FeeSettings object.
-
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition Ledger.cpp:1038
+
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition Ledger.cpp:1037
-
std::shared_ptr< Ledger > loadLedgerHelper(LedgerHeader const &info, Application &app, bool acquire)
Definition Ledger.cpp:988
+
std::shared_ptr< Ledger > loadLedgerHelper(LedgerHeader const &info, Application &app, bool acquire)
Definition Ledger.cpp:987
bool isCurrent(ValidationParms const &p, NetClock::time_point now, NetClock::time_point signTime, NetClock::time_point seenTime)
Whether a validation is still current.
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
-
static void finishLoadByIndexOrHash(std::shared_ptr< Ledger > const &ledger, Config const &config, beast::Journal j)
Definition Ledger.cpp:1001
-
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition Ledger.cpp:891
+
static void finishLoadByIndexOrHash(std::shared_ptr< Ledger > const &ledger, Config const &config, beast::Journal j)
Definition Ledger.cpp:1000
+
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition Ledger.cpp:890
static Hasher::result_type digest(void const *data, std::size_t size) noexcept
Definition tokens.cpp:137
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
Definition SHAMapItem.h:137
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
sha512_half_hasher::result_type sha512Half(Args const &... args)
Returns the SHA512-Half of a series of objects.
Definition digest.h:204
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
Rules makeRulesGivenLedger(DigestAwareReadView const &ledger, Rules const &current)
Definition ReadView.cpp:50
-
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > deserializeTxPlusMeta(SHAMapItem const &item)
Deserialize a SHAMapItem containing STTx + STObject metadata.
Definition Ledger.cpp:346
-
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Application &app)
Definition Ledger.cpp:1017
-
std::shared_ptr< STTx const > deserializeTx(SHAMapItem const &item)
Deserialize a SHAMapItem containing a single STTx.
Definition Ledger.cpp:339
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
-
static bool saveValidatedLedger(Application &app, std::shared_ptr< Ledger const > const &ledger, bool current)
Definition Ledger.cpp:897
+
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > deserializeTxPlusMeta(SHAMapItem const &item)
Deserialize a SHAMapItem containing STTx + STObject metadata.
Definition Ledger.cpp:345
+
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Application &app)
Definition Ledger.cpp:1016
+
std::shared_ptr< STTx const > deserializeTx(SHAMapItem const &item)
Deserialize a SHAMapItem containing a single STTx.
Definition Ledger.cpp:338
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
+
static bool saveValidatedLedger(Application &app, std::shared_ptr< Ledger const > const &ledger, bool current)
Definition Ledger.cpp:896
auto constexpr ledgerDefaultTimeResolution
Initial resolution of ledger close time.
@ hotACCOUNT_NODE
Definition NodeObject.h:15
Seed generateSeed(std::string const &passPhrase)
Generate a seed deterministically.
Definition Seed.cpp:57
std::chrono::duration< Rep, Period > getNextLedgerTimeResolution(std::chrono::duration< Rep, Period > previousResolution, bool previousAgree, Seq ledgerSeq)
Calculates the close time resolution for the specified ledger.
std::pair< PublicKey, SecretKey > generateKeyPair(KeyType type, Seed const &seed)
Generate a key pair deterministically.
-
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:924
+
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:923
bool getCloseAgree(LedgerHeader const &info)
-
uint256 calculateLedgerHash(LedgerHeader const &info)
Definition Ledger.cpp:35
+
uint256 calculateLedgerHash(LedgerHeader const &info)
Definition Ledger.cpp:34
@ current
This was a new validation and was added.
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
base_uint< 256 > uint256
Definition base_uint.h:526
-
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1026
+
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1025
std::chrono::time_point< Clock, Duration > roundCloseTime(std::chrono::time_point< Clock, Duration > closeTime, std::chrono::duration< Rep, Period > closeResolution)
Calculates the close time for a ledger, given a close time resolution.
@ jtPUBLEDGER
Definition Job.h:47
@ jtPUBOLDLEDGER
Definition Job.h:23
@@ -1474,9 +1473,9 @@ $(document).ready(function() { init_codefold(0); });
T push_back(T... args)
T size(T... args)
-
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:48
-
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:51
-
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:54
+
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:50
+
XRPAmount account_reserve
The account reserve requirement in drops.
Definition Config.h:53
+
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition Config.h:56
XRPAmount reserve
XRPAmount increment
XRPAmount base
diff --git a/Ledger_8h_source.html b/Ledger_8h_source.html index 1b98e38060..58fbccad34 100644 --- a/Ledger_8h_source.html +++ b/Ledger_8h_source.html @@ -472,71 +472,71 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
Wraps a DigestAwareReadView to provide caching.
Definition CachedView.h:133
- +
Tracks the number of instances of an object.
ReadView that associates keys with digests.
Definition ReadView.h:229
Holds a ledger.
Definition Ledger.h:60
-
bool txExists(uint256 const &key) const override
Definition Ledger.cpp:439
-
std::unique_ptr< txs_type::iter_base > txsEnd() const override
Definition Ledger.cpp:433
+
bool txExists(uint256 const &key) const override
Definition Ledger.cpp:438
+
std::unique_ptr< txs_type::iter_base > txsEnd() const override
Definition Ledger.cpp:432
Fees fees_
Definition Ledger.h:385
-
bool isFlagLedger() const
Returns true if the ledger is a flag ledger.
Definition Ledger.cpp:880
-
std::optional< digest_type > digest(key_type const &key) const override
Return the digest associated with the key.
Definition Ledger.cpp:459
-
void rawTxInsert(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData) override
Definition Ledger.cpp:504
-
std::optional< PublicKey > validatorToDisable() const
get the to be disabled validator's master public key if any
Definition Ledger.cpp:665
+
bool isFlagLedger() const
Returns true if the ledger is a flag ledger.
Definition Ledger.cpp:879
+
std::optional< digest_type > digest(key_type const &key) const override
Return the digest associated with the key.
Definition Ledger.cpp:458
+
void rawTxInsert(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData) override
Definition Ledger.cpp:503
+
std::optional< PublicKey > validatorToDisable() const
get the to be disabled validator's master public key if any
Definition Ledger.cpp:664
void setLedgerInfo(LedgerHeader const &info)
Definition Ledger.h:130
-
uint256 rawTxInsertWithHash(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData)
Definition Ledger.cpp:520
-
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
Definition Ledger.cpp:388
+
uint256 rawTxInsertWithHash(uint256 const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData)
Definition Ledger.cpp:519
+
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
Definition Ledger.cpp:387
void setValidated() const
Definition Ledger.h:235
-
void updateNegativeUNL()
update the Negative UNL ledger component.
Definition Ledger.cpp:693
-
bool assertSensible(beast::Journal ledgerJ) const
Definition Ledger.cpp:791
-
bool isVotingLedger() const
Returns true if the ledger directly precedes a flag ledger.
Definition Ledger.cpp:885
-
std::unique_ptr< sles_type::iter_base > slesBegin() const override
Definition Ledger.cpp:409
+
void updateNegativeUNL()
update the Negative UNL ledger component.
Definition Ledger.cpp:692
+
bool assertSensible(beast::Journal ledgerJ) const
Definition Ledger.cpp:790
+
bool isVotingLedger() const
Returns true if the ledger directly precedes a flag ledger.
Definition Ledger.cpp:884
+
std::unique_ptr< sles_type::iter_base > slesBegin() const override
Definition Ledger.cpp:408
Rules rules_
Definition Ledger.h:386
-
void invariants() const
Definition Ledger.cpp:972
-
hash_set< PublicKey > negativeUNL() const
get Negative UNL validators' master public keys
Definition Ledger.cpp:640
+
void invariants() const
Definition Ledger.cpp:971
+
hash_set< PublicKey > negativeUNL() const
get Negative UNL validators' master public keys
Definition Ledger.cpp:639
Ledger(Ledger &&)=delete
-
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
Definition Ledger.cpp:486
-
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
Definition Ledger.cpp:495
-
void setImmutable(bool rehash=true)
Definition Ledger.cpp:298
+
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
Definition Ledger.cpp:485
+
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
Definition Ledger.cpp:494
+
void setImmutable(bool rehash=true)
Definition Ledger.cpp:297
SHAMap const & stateMap() const
Definition Ledger.h:278
-
void updateSkipList()
Definition Ledger.cpp:816
+
void updateSkipList()
Definition Ledger.cpp:815
SHAMap const & txMap() const
Definition Ledger.h:290
bool isImmutable() const
Definition Ledger.h:247
-
void defaultFees(Config const &config)
Definition Ledger.cpp:616
+
void defaultFees(Config const &config)
Definition Ledger.cpp:615
bool open() const override
Returns true if this reflects an open ledger.
Definition Ledger.h:118
-
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
Definition Ledger.cpp:472
+
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
Definition Ledger.cpp:471
LedgerHeader const & header() const override
Returns information about the ledger.
Definition Ledger.h:124
-
void setAccepted(NetClock::time_point closeTime, NetClock::duration closeResolution, bool correctCloseTime)
Definition Ledger.cpp:318
+
void setAccepted(NetClock::time_point closeTime, NetClock::duration closeResolution, bool correctCloseTime)
Definition Ledger.cpp:317
bool mImmutable
Definition Ledger.h:374
Ledger(Ledger const &)=delete
Ledger & operator=(Ledger const &)=delete
-
std::shared_ptr< SLE > peek(Keylet const &k) const
Definition Ledger.cpp:628
+
std::shared_ptr< SLE > peek(Keylet const &k) const
Definition Ledger.cpp:627
LedgerHeader header_
Definition Ledger.h:387
std::mutex mutex_
Definition Ledger.h:383
SHAMap & txMap()
Definition Ledger.h:296
void setTotalDrops(std::uint64_t totDrops)
Definition Ledger.h:272
~Ledger()=default
-
bool addSLE(SLE const &sle)
Definition Ledger.cpp:330
+
bool addSLE(SLE const &sle)
Definition Ledger.cpp:329
void rawDestroyXRP(XRPAmount const &fee) override
Destroy XRP.
Definition Ledger.h:204
-
std::unique_ptr< txs_type::iter_base > txsBegin() const override
Definition Ledger.cpp:427
-
std::unique_ptr< sles_type::iter_base > slesEnd() const override
Definition Ledger.cpp:415
+
std::unique_ptr< txs_type::iter_base > txsBegin() const override
Definition Ledger.cpp:426
+
std::unique_ptr< sles_type::iter_base > slesEnd() const override
Definition Ledger.cpp:414
SHAMap & stateMap()
Definition Ledger.h:284
SHAMap stateMap_
Definition Ledger.h:380
-
std::optional< uint256 > succ(uint256 const &key, std::optional< uint256 > const &last=std::nullopt) const override
Definition Ledger.cpp:377
+
std::optional< uint256 > succ(uint256 const &key, std::optional< uint256 > const &last=std::nullopt) const override
Definition Ledger.cpp:376
Ledger & operator=(Ledger &&)=delete
SHAMap txMap_
Definition Ledger.h:377
Rules const & rules() const override
Returns the tx processing rules.
Definition Ledger.h:142
Fees const & fees() const override
Returns the fees for the base ledger.
Definition Ledger.h:136
beast::Journal j_
Definition Ledger.h:388
-
bool walkLedger(beast::Journal j, bool parallel=false) const
Definition Ledger.cpp:742
-
void unshare() const
Definition Ledger.cpp:965
-
std::unique_ptr< sles_type::iter_base > slesUpperBound(uint256 const &key) const override
Definition Ledger.cpp:421
-
std::optional< PublicKey > validatorToReEnable() const
get the to be re-enabled validator's master public key if any
Definition Ledger.cpp:679
-
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
Definition Ledger.cpp:445
-
bool setup()
Definition Ledger.cpp:540
+
bool walkLedger(beast::Journal j, bool parallel=false) const
Definition Ledger.cpp:741
+
void unshare() const
Definition Ledger.cpp:964
+
std::unique_ptr< sles_type::iter_base > slesUpperBound(uint256 const &key) const override
Definition Ledger.cpp:420
+
std::optional< PublicKey > validatorToReEnable() const
get the to be re-enabled validator's master public key if any
Definition Ledger.cpp:678
+
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
Definition Ledger.cpp:444
+
bool setup()
Definition Ledger.cpp:539
void setFull() const
Definition Ledger.h:263
-
bool exists(Keylet const &k) const override
Determine if a state item exists.
Definition Ledger.cpp:364
+
bool exists(Keylet const &k) const override
Determine if a state item exists.
Definition Ledger.cpp:363
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > tx_type
Definition ReadView.h:33
uint256 key_type
Definition ReadView.h:35
Rules controlling protocol behavior.
Definition Rules.h:18
@@ -554,17 +554,17 @@ $(document).ready(function() { init_codefold(0); });
T is_same_v
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition Ledger.cpp:1038
-
std::shared_ptr< Ledger > loadLedgerHelper(LedgerHeader const &info, Application &app, bool acquire)
Definition Ledger.cpp:988
+
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition Ledger.cpp:1037
+
std::shared_ptr< Ledger > loadLedgerHelper(LedgerHeader const &info, Application &app, bool acquire)
Definition Ledger.cpp:987
bool isCurrent(ValidationParms const &p, NetClock::time_point now, NetClock::time_point signTime, NetClock::time_point seenTime)
Whether a validation is still current.
-
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition Ledger.cpp:891
-
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > deserializeTxPlusMeta(SHAMapItem const &item)
Deserialize a SHAMapItem containing STTx + STObject metadata.
Definition Ledger.cpp:346
-
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Application &app)
Definition Ledger.cpp:1017
-
std::shared_ptr< STTx const > deserializeTx(SHAMapItem const &item)
Deserialize a SHAMapItem containing a single STTx.
Definition Ledger.cpp:339
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
-
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:924
-
uint256 calculateLedgerHash(LedgerHeader const &info)
Definition Ledger.cpp:35
-
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1026
+
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition Ledger.cpp:890
+
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > deserializeTxPlusMeta(SHAMapItem const &item)
Deserialize a SHAMapItem containing STTx + STObject metadata.
Definition Ledger.cpp:345
+
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Application &app)
Definition Ledger.cpp:1016
+
std::shared_ptr< STTx const > deserializeTx(SHAMapItem const &item)
Deserialize a SHAMapItem containing a single STTx.
Definition Ledger.cpp:338
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
+
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:923
+
uint256 calculateLedgerHash(LedgerHeader const &info)
Definition Ledger.cpp:34
+
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition Ledger.cpp:1025
std::uint32_t constexpr FLAG_LEDGER_INTERVAL
Definition Ledger.h:394
diff --git a/LoadFeeTrack__test_8cpp_source.html b/LoadFeeTrack__test_8cpp_source.html index 9d8907d01b..3d1bf5328c 100644 --- a/LoadFeeTrack__test_8cpp_source.html +++ b/LoadFeeTrack__test_8cpp_source.html @@ -147,8 +147,8 @@ $(document).ready(function() { init_codefold(0); });
60
61} // namespace xrpl
A testsuite class.
Definition suite.h:51
- -
FeeSetup FEES
Definition Config.h:184
+ +
FeeSetup FEES
Definition Config.h:185
void run() override
Runs the suite.
Manages the current fee schedule.
@@ -156,7 +156,7 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
constexpr XRPAmount DROPS_PER_XRP
Number of drops per 1 XRP.
Definition XRPAmount.h:237
XRPAmount scaleFeeLoad(XRPAmount fee, LoadFeeTrack const &feeTrack, Fees const &fees, bool bUnlimited)
-
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:48
+
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition Config.h:50
Reflects the fee settings for a particular ledger.
XRPAmount reserve
XRPAmount increment
diff --git a/LogLevel_8cpp_source.html b/LogLevel_8cpp_source.html index 557fcf39d6..27f752019c 100644 --- a/LogLevel_8cpp_source.html +++ b/LogLevel_8cpp_source.html @@ -105,8 +105,8 @@ $(document).ready(function() { init_codefold(0); });
23
-
24 lev[jss::base] = Logs::toString(Logs::fromSeverity(context.app.logs().threshold()));
- +
24 lev[jss::base] = Logs::toString(Logs::fromSeverity(context.app.logs().threshold()));
+
26 for (auto const& [k, v] : logTable)
27 lev[k] = v;
28
@@ -124,7 +124,7 @@ $(document).ready(function() { init_codefold(0); });
40 if (!context.params.isMember(jss::partition))
41 {
42 // set base log threshold
-
43 context.app.logs().threshold(severity);
+
43 context.app.logs().threshold(severity);
44 return Json::objectValue;
45 }
46
@@ -135,9 +135,9 @@ $(document).ready(function() { init_codefold(0); });
51 std::string partition(context.params[jss::partition].asString());
52
53 if (boost::iequals(partition, "base"))
-
54 context.app.logs().threshold(severity);
+
54 context.app.logs().threshold(severity);
55 else
-
56 context.app.logs().get(partition).threshold(severity);
+
56 context.app.logs().get(partition).threshold(severity);
57
58 return Json::objectValue;
59 }
@@ -152,7 +152,6 @@ $(document).ready(function() { init_codefold(0); });
std::string asString() const
Returns the unquoted string value.
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Severity threshold() const
Returns the minimum severity level this sink will report.
-
virtual Logs & logs()=0
beast::severities::Severity threshold() const
Definition Log.cpp:140
beast::Journal::Sink & get(std::string const &name)
Definition Log.cpp:120
static LogSeverity fromSeverity(beast::severities::Severity level)
Definition Log.cpp:196
@@ -160,6 +159,7 @@ $(document).ready(function() { init_codefold(0); });
static LogSeverity fromString(std::string const &s)
Definition Log.cpp:278
static std::string toString(LogSeverity s)
Definition Log.cpp:253
static beast::severities::Severity toSeverity(LogSeverity level)
Definition Log.cpp:225
+
virtual Logs & logs()=0
@ objectValue
object value (collection of name/value pairs).
Definition json_value.h:26
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Json::Value doLogLevel(RPC::JsonContext &)
Definition LogLevel.cpp:15
diff --git a/LogRotate_8cpp_source.html b/LogRotate_8cpp_source.html index 444edcb561..2b3b28a787 100644 --- a/LogRotate_8cpp_source.html +++ b/LogRotate_8cpp_source.html @@ -94,15 +94,15 @@ $(document).ready(function() { init_codefold(0); });
11{
12 context.app.getPerfLog().rotate();
-
13 return RPC::makeObjectValue(context.app.logs().rotate());
+
13 return RPC::makeObjectValue(context.app.logs().rotate());
14}
15
16} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
-
virtual Logs & logs()=0
std::string rotate()
Definition Log.cpp:180
virtual perf::PerfLog & getPerfLog()=0
+
virtual Logs & logs()=0
virtual void rotate()=0
Rotate perf log file.
Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
Definition Handler.h:46
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
diff --git a/Main_8cpp_source.html b/Main_8cpp_source.html index 9023b95739..b9417d52d5 100644 --- a/Main_8cpp_source.html +++ b/Main_8cpp_source.html @@ -82,15 +82,15 @@ $(document).ready(function() { init_codefold(0); });
1#include <xrpld/app/main/Application.h>
-
2#include <xrpld/app/rdb/Vacuum.h>
-
3#include <xrpld/core/Config.h>
-
4#include <xrpld/core/ConfigSections.h>
-
5#include <xrpld/core/TimeKeeper.h>
-
6#include <xrpld/rpc/RPCCall.h>
-
7
-
8#include <xrpl/basics/Log.h>
-
9#include <xrpl/beast/core/CurrentThreadName.h>
-
10#include <xrpl/protocol/BuildInfo.h>
+
2#include <xrpld/core/Config.h>
+
3#include <xrpld/core/ConfigSections.h>
+
4#include <xrpld/core/TimeKeeper.h>
+
5#include <xrpld/rpc/RPCCall.h>
+
6
+
7#include <xrpl/basics/Log.h>
+
8#include <xrpl/beast/core/CurrentThreadName.h>
+
9#include <xrpl/protocol/BuildInfo.h>
+
10#include <xrpl/server/Vacuum.h>
11
12#include <boost/asio/io_context.hpp>
13#include <boost/process/v1/args.hpp>
@@ -634,7 +634,7 @@ $(document).ready(function() { init_codefold(0); });
546 try
547 {
548 auto setup = setup_DatabaseCon(*config);
-
549 if (!doVacuumDB(setup, config->journal()))
+
549 if (!doVacuumDB(setup, config->journal()))
550 return -1;
551 }
552 catch (std::exception const& e)
@@ -689,7 +689,7 @@ $(document).ready(function() { init_codefold(0); });
601
602 if (vm.count("start"))
603 {
-
604 config->START_UP = Config::FRESH;
+
604 config->START_UP = StartUpType::FRESH;
605 }
606
607 if (vm.count("import"))
@@ -700,7 +700,7 @@ $(document).ready(function() { init_codefold(0); });
612 config->START_LEDGER = vm["ledger"].as<std::string>();
613 if (vm.count("replay"))
614 {
-
615 config->START_UP = Config::REPLAY;
+
615 config->START_UP = StartUpType::REPLAY;
616 if (vm.count("trap_tx_hash"))
617 {
618 uint256 tmp = {};
@@ -719,16 +719,16 @@ $(document).ready(function() { init_codefold(0); });
631 }
632 }
633 else
-
634 config->START_UP = Config::LOAD;
+
634 config->START_UP = StartUpType::LOAD;
635 }
636 else if (vm.count("ledgerfile"))
637 {
638 config->START_LEDGER = vm["ledgerfile"].as<std::string>();
-
639 config->START_UP = Config::LOAD_FILE;
+
639 config->START_UP = StartUpType::LOAD_FILE;
640 }
641 else if (vm.count("load") || config->FAST_LOAD)
642 {
-
643 config->START_UP = Config::LOAD;
+
643 config->START_UP = StartUpType::LOAD;
644 }
645
646 if (vm.count("trap_tx_hash") && vm.count("replay") == 0)
@@ -739,13 +739,13 @@ $(document).ready(function() { init_codefold(0); });
651
652 if (vm.count("net") && !config->FAST_LOAD)
653 {
-
654 if ((config->START_UP == Config::LOAD) || (config->START_UP == Config::REPLAY))
+
654 if ((config->START_UP == StartUpType::LOAD) || (config->START_UP == StartUpType::REPLAY))
655 {
656 std::cerr << "Net and load/replay options are incompatible" << std::endl;
657 return -1;
658 }
659
-
660 config->START_UP = Config::NETWORK;
+
660 config->START_UP = StartUpType::NETWORK;
661 }
662
663 if (vm.count("valid"))
@@ -905,11 +905,6 @@ $(document).ready(function() { init_codefold(0); });
Unit test runner interface.
Definition runner.h:23
void arg(std::string const &s)
Set the argument string.
Definition runner.h:45
Associates a unit test type with metadata.
Definition suite_info.h:19
- - - - -
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition base_uint.h:471
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition rpc.h:15
@@ -942,15 +937,20 @@ $(document).ready(function() { init_codefold(0); });
std::atomic< bool > envUseIPv4
Definition envconfig.cpp:9
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
int run(int argc, char **argv)
Definition Main.cpp:322
+
bool doVacuumDB(DatabaseCon::Setup const &setup, beast::Journal j)
doVacuumDB Creates, initialises, and performs cleanup on a database.
Definition Vacuum.cpp:10
std::unique_ptr< beast::Journal::Sink > setDebugLogSink(std::unique_ptr< beast::Journal::Sink > sink)
Set the sink for the debug journal.
Definition Log.cpp:439
bool adjustDescriptorLimit(int needed, beast::Journal j)
Definition Main.cpp:59
-
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
-
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
+
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
+
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition Config.cpp:1043
static std::string const & systemName()
-
bool doVacuumDB(DatabaseCon::Setup const &setup, beast::Journal j)
doVacuumDB Creates, initialises, and performs cleanup on a database.
Definition Vacuum.cpp:8
void printHelp(po::options_description const &desc)
Definition Main.cpp:103
+ + + + +
T push_back(T... args)
T reserve(T... args)
diff --git a/Manifest_8cpp_source.html b/Manifest_8cpp_source.html index 75cd1f2a88..5cd32f6a1e 100644 --- a/Manifest_8cpp_source.html +++ b/Manifest_8cpp_source.html @@ -81,607 +81,606 @@ $(document).ready(function() { init_codefold(0); });
Manifest.cpp
-
1#include <xrpld/app/misc/Manifest.h>
-
2#include <xrpld/app/rdb/Wallet.h>
-
3#include <xrpld/core/DatabaseCon.h>
-
4
-
5#include <xrpl/basics/Log.h>
-
6#include <xrpl/basics/StringUtilities.h>
-
7#include <xrpl/basics/base64.h>
-
8#include <xrpl/json/json_reader.h>
-
9#include <xrpl/protocol/PublicKey.h>
-
10#include <xrpl/protocol/Sign.h>
-
11
-
12#include <boost/algorithm/string/trim.hpp>
-
13
-
14#include <numeric>
-
15#include <stdexcept>
-
16
-
17namespace xrpl {
-
18
- -
- -
21{
-
22 auto const mk = toBase58(TokenType::NodePublic, m.masterKey);
-
23
-
24 if (m.revoked())
-
25 return "Revocation Manifest " + mk;
-
26
-
27 if (!m.signingKey)
-
28 Throw<std::runtime_error>("No SigningKey in manifest " + mk);
-
29
-
30 return "Manifest " + mk + " (" + std::to_string(m.sequence) + ": " +
- -
32}
+
1#include <xrpl/basics/Log.h>
+
2#include <xrpl/basics/StringUtilities.h>
+
3#include <xrpl/basics/base64.h>
+
4#include <xrpl/json/json_reader.h>
+
5#include <xrpl/protocol/PublicKey.h>
+
6#include <xrpl/protocol/Sign.h>
+
7#include <xrpl/rdb/DatabaseCon.h>
+
8#include <xrpl/server/Manifest.h>
+
9#include <xrpl/server/Wallet.h>
+
10
+
11#include <boost/algorithm/string/trim.hpp>
+
12
+
13#include <numeric>
+
14#include <stdexcept>
+
15
+
16namespace xrpl {
+
17
+ +
+ +
20{
+
21 auto const mk = toBase58(TokenType::NodePublic, m.masterKey);
+
22
+
23 if (m.revoked())
+
24 return "Revocation Manifest " + mk;
+
25
+
26 if (!m.signingKey)
+
27 Throw<std::runtime_error>("No SigningKey in manifest " + mk);
+
28
+
29 return "Manifest " + mk + " (" + std::to_string(m.sequence) + ": " +
+ +
31}
-
33
- -
- -
36{
-
37 if (s.empty())
-
38 return std::nullopt;
-
39
-
40 static SOTemplate const manifestFormat{
-
41 // A manifest must include:
-
42 // - the master public key
-
43 {sfPublicKey, soeREQUIRED},
-
44
-
45 // - a signature with that public key
-
46 {sfMasterSignature, soeREQUIRED},
-
47
-
48 // - a sequence number
-
49 {sfSequence, soeREQUIRED},
-
50
-
51 // It may, optionally, contain:
-
52 // - a version number which defaults to 0
-
53 {sfVersion, soeDEFAULT},
-
54
-
55 // - a domain name
-
56 {sfDomain, soeOPTIONAL},
-
57
-
58 // - an ephemeral signing key that can be changed as necessary
-
59 {sfSigningPubKey, soeOPTIONAL},
-
60
-
61 // - a signature using the ephemeral signing key, if it is present
-
62 {sfSignature, soeOPTIONAL},
-
63 };
-
64
-
65 try
-
66 {
-
67 SerialIter sit{s};
-
68 STObject st{sit, sfGeneric};
-
69
-
70 st.applyTemplate(manifestFormat);
-
71
-
72 // We only understand "version 0" manifests at this time:
-
73 if (st.isFieldPresent(sfVersion) && st.getFieldU16(sfVersion) != 0)
-
74 return std::nullopt;
-
75
-
76 auto const pk = st.getFieldVL(sfPublicKey);
-
77
-
78 if (!publicKeyType(makeSlice(pk)))
-
79 return std::nullopt;
-
80
-
81 PublicKey const masterKey = PublicKey(makeSlice(pk));
-
82 std::uint32_t const seq = st.getFieldU32(sfSequence);
-
83
-
84 std::string domain;
-
85
-
86 std::optional<PublicKey> signingKey;
-
87
-
88 if (st.isFieldPresent(sfDomain))
-
89 {
-
90 auto const d = st.getFieldVL(sfDomain);
-
91
-
92 domain.assign(reinterpret_cast<char const*>(d.data()), d.size());
-
93
-
94 if (!isProperlyFormedTomlDomain(domain))
-
95 return std::nullopt;
-
96 }
-
97
-
98 bool const hasEphemeralKey = st.isFieldPresent(sfSigningPubKey);
-
99 bool const hasEphemeralSig = st.isFieldPresent(sfSignature);
-
100
-
101 if (Manifest::revoked(seq))
-
102 {
-
103 // Revocation manifests should not specify a new signing key
-
104 // or a signing key signature.
-
105 if (hasEphemeralKey)
-
106 return std::nullopt;
-
107
-
108 if (hasEphemeralSig)
-
109 return std::nullopt;
-
110 }
-
111 else
-
112 {
-
113 // Regular manifests should contain a signing key and an
-
114 // associated signature.
-
115 if (!hasEphemeralKey)
-
116 return std::nullopt;
-
117
-
118 if (!hasEphemeralSig)
-
119 return std::nullopt;
-
120
-
121 auto const spk = st.getFieldVL(sfSigningPubKey);
-
122
-
123 if (!publicKeyType(makeSlice(spk)))
-
124 return std::nullopt;
-
125
-
126 signingKey.emplace(makeSlice(spk));
-
127
-
128 // The signing and master keys can't be the same
-
129 if (*signingKey == masterKey)
-
130 return std::nullopt;
-
131 }
-
132
-
133 std::string const serialized(reinterpret_cast<char const*>(s.data()), s.size());
-
134
-
135 // If the manifest is revoked, then the signingKey will be unseated
-
136 return Manifest(serialized, masterKey, signingKey, seq, domain);
-
137 }
-
138 catch (std::exception const& ex)
-
139 {
-
140 JLOG(journal.error()) << "Exception in " << __func__ << ": " << ex.what();
-
141 return std::nullopt;
-
142 }
-
143}
+
32
+ +
+ +
35{
+
36 if (s.empty())
+
37 return std::nullopt;
+
38
+
39 static SOTemplate const manifestFormat{
+
40 // A manifest must include:
+
41 // - the master public key
+
42 {sfPublicKey, soeREQUIRED},
+
43
+
44 // - a signature with that public key
+
45 {sfMasterSignature, soeREQUIRED},
+
46
+
47 // - a sequence number
+
48 {sfSequence, soeREQUIRED},
+
49
+
50 // It may, optionally, contain:
+
51 // - a version number which defaults to 0
+
52 {sfVersion, soeDEFAULT},
+
53
+
54 // - a domain name
+
55 {sfDomain, soeOPTIONAL},
+
56
+
57 // - an ephemeral signing key that can be changed as necessary
+
58 {sfSigningPubKey, soeOPTIONAL},
+
59
+
60 // - a signature using the ephemeral signing key, if it is present
+
61 {sfSignature, soeOPTIONAL},
+
62 };
+
63
+
64 try
+
65 {
+
66 SerialIter sit{s};
+
67 STObject st{sit, sfGeneric};
+
68
+
69 st.applyTemplate(manifestFormat);
+
70
+
71 // We only understand "version 0" manifests at this time:
+
72 if (st.isFieldPresent(sfVersion) && st.getFieldU16(sfVersion) != 0)
+
73 return std::nullopt;
+
74
+
75 auto const pk = st.getFieldVL(sfPublicKey);
+
76
+
77 if (!publicKeyType(makeSlice(pk)))
+
78 return std::nullopt;
+
79
+
80 PublicKey const masterKey = PublicKey(makeSlice(pk));
+
81 std::uint32_t const seq = st.getFieldU32(sfSequence);
+
82
+
83 std::string domain;
+
84
+
85 std::optional<PublicKey> signingKey;
+
86
+
87 if (st.isFieldPresent(sfDomain))
+
88 {
+
89 auto const d = st.getFieldVL(sfDomain);
+
90
+
91 domain.assign(reinterpret_cast<char const*>(d.data()), d.size());
+
92
+
93 if (!isProperlyFormedTomlDomain(domain))
+
94 return std::nullopt;
+
95 }
+
96
+
97 bool const hasEphemeralKey = st.isFieldPresent(sfSigningPubKey);
+
98 bool const hasEphemeralSig = st.isFieldPresent(sfSignature);
+
99
+
100 if (Manifest::revoked(seq))
+
101 {
+
102 // Revocation manifests should not specify a new signing key
+
103 // or a signing key signature.
+
104 if (hasEphemeralKey)
+
105 return std::nullopt;
+
106
+
107 if (hasEphemeralSig)
+
108 return std::nullopt;
+
109 }
+
110 else
+
111 {
+
112 // Regular manifests should contain a signing key and an
+
113 // associated signature.
+
114 if (!hasEphemeralKey)
+
115 return std::nullopt;
+
116
+
117 if (!hasEphemeralSig)
+
118 return std::nullopt;
+
119
+
120 auto const spk = st.getFieldVL(sfSigningPubKey);
+
121
+
122 if (!publicKeyType(makeSlice(spk)))
+
123 return std::nullopt;
+
124
+
125 signingKey.emplace(makeSlice(spk));
+
126
+
127 // The signing and master keys can't be the same
+
128 if (*signingKey == masterKey)
+
129 return std::nullopt;
+
130 }
+
131
+
132 std::string const serialized(reinterpret_cast<char const*>(s.data()), s.size());
+
133
+
134 // If the manifest is revoked, then the signingKey will be unseated
+
135 return Manifest(serialized, masterKey, signingKey, seq, domain);
+
136 }
+
137 catch (std::exception const& ex)
+
138 {
+
139 JLOG(journal.error()) << "Exception in " << __func__ << ": " << ex.what();
+
140 return std::nullopt;
+
141 }
+
142}
-
144
-
145template <class Stream>
-
146Stream&
-
-
147logMftAct(Stream& s, std::string const& action, PublicKey const& pk, std::uint32_t seq)
-
148{
-
149 s << "Manifest: " << action << ";Pk: " << toBase58(TokenType::NodePublic, pk) << ";Seq: " << seq << ";";
-
150 return s;
-
151}
+
143
+
144template <class Stream>
+
145Stream&
+
+
146logMftAct(Stream& s, std::string const& action, PublicKey const& pk, std::uint32_t seq)
+
147{
+
148 s << "Manifest: " << action << ";Pk: " << toBase58(TokenType::NodePublic, pk) << ";Seq: " << seq << ";";
+
149 return s;
+
150}
-
152
-
153template <class Stream>
-
154Stream&
-
-
155logMftAct(Stream& s, std::string const& action, PublicKey const& pk, std::uint32_t seq, std::uint32_t oldSeq)
-
156{
-
157 s << "Manifest: " << action << ";Pk: " << toBase58(TokenType::NodePublic, pk) << ";Seq: " << seq
-
158 << ";OldSeq: " << oldSeq << ";";
-
159 return s;
-
160}
+
151
+
152template <class Stream>
+
153Stream&
+
+
154logMftAct(Stream& s, std::string const& action, PublicKey const& pk, std::uint32_t seq, std::uint32_t oldSeq)
+
155{
+
156 s << "Manifest: " << action << ";Pk: " << toBase58(TokenType::NodePublic, pk) << ";Seq: " << seq
+
157 << ";OldSeq: " << oldSeq << ";";
+
158 return s;
+
159}
-
161
-
162bool
-
- -
164{
- - -
167 st.set(sit);
-
168
-
169 // The manifest must either have a signing key or be revoked. This check
-
170 // prevents us from accessing an unseated signingKey in the next check.
-
171 if (!revoked() && !signingKey)
-
172 return false;
-
173
-
174 // Signing key and signature are not required for
-
175 // master key revocations
- -
177 return false;
-
178
-
179 return xrpl::verify(st, HashPrefix::manifest, masterKey, sfMasterSignature);
-
180}
+
160
+
161bool
+
+ +
163{
+ + +
166 st.set(sit);
+
167
+
168 // The manifest must either have a signing key or be revoked. This check
+
169 // prevents us from accessing an unseated signingKey in the next check.
+
170 if (!revoked() && !signingKey)
+
171 return false;
+
172
+
173 // Signing key and signature are not required for
+
174 // master key revocations
+ +
176 return false;
+
177
+
178 return xrpl::verify(st, HashPrefix::manifest, masterKey, sfMasterSignature);
+
179}
-
181
- -
- -
184{
- - -
187 st.set(sit);
-
188 return st.getHash(HashPrefix::manifest);
-
189}
+
180
+ +
+ +
183{
+ + +
186 st.set(sit);
+
187 return st.getHash(HashPrefix::manifest);
+
188}
-
190
-
191bool
-
- -
193{
-
194 /*
-
195 The maximum possible sequence number means that the master key
-
196 has been revoked.
-
197 */
-
198 return revoked(sequence);
-
199}
+
189
+
190bool
+
+ +
192{
+
193 /*
+
194 The maximum possible sequence number means that the master key
+
195 has been revoked.
+
196 */
+
197 return revoked(sequence);
+
198}
-
200
-
201bool
-
- -
203{
-
204 // The maximum possible sequence number means that the master key has
-
205 // been revoked.
- -
207}
+
199
+
200bool
+
+ +
202{
+
203 // The maximum possible sequence number means that the master key has
+
204 // been revoked.
+ +
206}
-
208
- -
- -
211{
- - -
214 st.set(sit);
-
215 if (!get(st, sfSignature))
-
216 return std::nullopt;
-
217 return st.getFieldVL(sfSignature);
-
218}
+
207
+ +
+ +
210{
+ + +
213 st.set(sit);
+
214 if (!get(st, sfSignature))
+
215 return std::nullopt;
+
216 return st.getFieldVL(sfSignature);
+
217}
-
219
-
220Blob
-
- -
222{
- - -
225 st.set(sit);
-
226 return st.getFieldVL(sfMasterSignature);
-
227}
+
218
+
219Blob
+
+ +
221{
+ + +
224 st.set(sit);
+
225 return st.getFieldVL(sfMasterSignature);
+
226}
-
228
- -
- -
231{
-
232 try
-
233 {
-
234 std::string tokenStr;
-
235
-
236 tokenStr.reserve(
-
237 std::accumulate(blob.cbegin(), blob.cend(), std::size_t(0), [](std::size_t init, std::string const& s) {
-
238 return init + s.size();
-
239 }));
-
240
-
241 for (auto const& line : blob)
-
242 tokenStr += boost::algorithm::trim_copy(line);
-
243
-
244 tokenStr = base64_decode(tokenStr);
-
245
-
246 Json::Reader r;
-
247 Json::Value token;
-
248
-
249 if (r.parse(tokenStr, token))
-
250 {
-
251 auto const m = token.get("manifest", Json::Value{});
-
252 auto const k = token.get("validation_secret_key", Json::Value{});
-
253
-
254 if (m.isString() && k.isString())
-
255 {
-
256 auto const key = strUnHex(k.asString());
-
257
-
258 if (key && key->size() == 32)
-
259 return ValidatorToken{m.asString(), makeSlice(*key)};
-
260 }
-
261 }
-
262
-
263 return std::nullopt;
-
264 }
-
265 catch (std::exception const& ex)
-
266 {
-
267 JLOG(journal.error()) << "Exception in " << __func__ << ": " << ex.what();
-
268 return std::nullopt;
-
269 }
-
270}
+
227
+ +
+ +
230{
+
231 try
+
232 {
+
233 std::string tokenStr;
+
234
+
235 tokenStr.reserve(
+
236 std::accumulate(blob.cbegin(), blob.cend(), std::size_t(0), [](std::size_t init, std::string const& s) {
+
237 return init + s.size();
+
238 }));
+
239
+
240 for (auto const& line : blob)
+
241 tokenStr += boost::algorithm::trim_copy(line);
+
242
+
243 tokenStr = base64_decode(tokenStr);
+
244
+
245 Json::Reader r;
+
246 Json::Value token;
+
247
+
248 if (r.parse(tokenStr, token))
+
249 {
+
250 auto const m = token.get("manifest", Json::Value{});
+
251 auto const k = token.get("validation_secret_key", Json::Value{});
+
252
+
253 if (m.isString() && k.isString())
+
254 {
+
255 auto const key = strUnHex(k.asString());
+
256
+
257 if (key && key->size() == 32)
+
258 return ValidatorToken{m.asString(), makeSlice(*key)};
+
259 }
+
260 }
+
261
+
262 return std::nullopt;
+
263 }
+
264 catch (std::exception const& ex)
+
265 {
+
266 JLOG(journal.error()) << "Exception in " << __func__ << ": " << ex.what();
+
267 return std::nullopt;
+
268 }
+
269}
-
271
- -
- -
274{
- -
276 auto const iter = map_.find(pk);
-
277
-
278 if (iter != map_.end() && !iter->second.revoked())
-
279 return iter->second.signingKey;
-
280
-
281 return pk;
-
282}
+
270
+ +
+ +
273{
+ +
275 auto const iter = map_.find(pk);
+
276
+
277 if (iter != map_.end() && !iter->second.revoked())
+
278 return iter->second.signingKey;
+
279
+
280 return pk;
+
281}
-
283
- -
- -
286{
- -
288
-
289 if (auto const iter = signingToMasterKeys_.find(pk); iter != signingToMasterKeys_.end())
-
290 return iter->second;
-
291
-
292 return pk;
-
293}
+
282
+ +
+ +
285{
+ +
287
+
288 if (auto const iter = signingToMasterKeys_.find(pk); iter != signingToMasterKeys_.end())
+
289 return iter->second;
+
290
+
291 return pk;
+
292}
-
294
- -
- -
297{
- -
299 auto const iter = map_.find(pk);
-
300
-
301 if (iter != map_.end() && !iter->second.revoked())
-
302 return iter->second.sequence;
-
303
-
304 return std::nullopt;
-
305}
+
293
+ +
+ +
296{
+ +
298 auto const iter = map_.find(pk);
+
299
+
300 if (iter != map_.end() && !iter->second.revoked())
+
301 return iter->second.sequence;
+
302
+
303 return std::nullopt;
+
304}
-
306
- -
- -
309{
- -
311 auto const iter = map_.find(pk);
-
312
-
313 if (iter != map_.end() && !iter->second.revoked())
-
314 return iter->second.domain;
-
315
-
316 return std::nullopt;
-
317}
+
305
+ +
+ +
308{
+ +
310 auto const iter = map_.find(pk);
+
311
+
312 if (iter != map_.end() && !iter->second.revoked())
+
313 return iter->second.domain;
+
314
+
315 return std::nullopt;
+
316}
-
318
- -
- -
321{
- -
323 auto const iter = map_.find(pk);
-
324
-
325 if (iter != map_.end() && !iter->second.revoked())
-
326 return iter->second.serialized;
-
327
-
328 return std::nullopt;
-
329}
+
317
+ +
+ +
320{
+ +
322 auto const iter = map_.find(pk);
+
323
+
324 if (iter != map_.end() && !iter->second.revoked())
+
325 return iter->second.serialized;
+
326
+
327 return std::nullopt;
+
328}
-
330
-
331bool
-
- -
333{
- -
335 auto const iter = map_.find(pk);
-
336
-
337 if (iter != map_.end())
-
338 return iter->second.revoked();
-
339
-
340 return false;
-
341}
+
329
+
330bool
+
+ +
332{
+ +
334 auto const iter = map_.find(pk);
+
335
+
336 if (iter != map_.end())
+
337 return iter->second.revoked();
+
338
+
339 return false;
+
340}
-
342
- -
- -
345{
-
346 // Check the manifest against the conditions that do not require a
-
347 // `unique_lock` (write lock) on the `mutex_`. Since the signature can be
-
348 // relatively expensive, the `checkSignature` parameter determines if the
-
349 // signature should be checked. Since `prewriteCheck` is run twice (see
-
350 // comment below), `checkSignature` only needs to be set to true on the
-
351 // first run.
-
352 auto prewriteCheck =
-
353 [this, &m](auto const& iter, bool checkSignature, auto const& lock) -> std::optional<ManifestDisposition> {
-
354 XRPL_ASSERT(lock.owns_lock(), "xrpl::ManifestCache::applyManifest::prewriteCheck : locked");
-
355 (void)lock; // not used. parameter is present to ensure the mutex is
-
356 // locked when the lambda is called.
-
357 if (iter != map_.end() && m.sequence <= iter->second.sequence)
-
358 {
-
359 // We received a manifest whose sequence number is not strictly
-
360 // greater than the one we already know about. This can happen in
-
361 // several cases including when we receive manifests from a peer who
-
362 // doesn't have the latest data.
-
363 if (auto stream = j_.debug())
-
364 logMftAct(stream, "Stale", m.masterKey, m.sequence, iter->second.sequence);
- -
366 }
-
367
-
368 if (checkSignature && !m.verify())
-
369 {
-
370 if (auto stream = j_.warn())
-
371 logMftAct(stream, "Invalid", m.masterKey, m.sequence);
- -
373 }
-
374
-
375 // If the master key associated with a manifest is or might be
-
376 // compromised and is, therefore, no longer trustworthy.
-
377 //
-
378 // A manifest revocation essentially marks a manifest as compromised. By
-
379 // setting the sequence number to the highest value possible, the
-
380 // manifest is effectively neutered and cannot be superseded by a forged
-
381 // one.
-
382 bool const revoked = m.revoked();
-
383
-
384 if (auto stream = j_.warn(); stream && revoked)
-
385 logMftAct(stream, "Revoked", m.masterKey, m.sequence);
-
386
-
387 // Sanity check: the master key of this manifest should not be used as
-
388 // the ephemeral key of another manifest:
-
389 if (auto const x = signingToMasterKeys_.find(m.masterKey); x != signingToMasterKeys_.end())
-
390 {
-
391 JLOG(j_.warn()) << to_string(m) << ": Master key already used as ephemeral key for "
-
392 << toBase58(TokenType::NodePublic, x->second);
-
393
- -
395 }
-
396
-
397 if (!revoked)
-
398 {
-
399 if (!m.signingKey)
-
400 {
-
401 JLOG(j_.warn()) << to_string(m)
-
402 << ": is not revoked and the manifest has no "
-
403 "signing key. Hence, the manifest is "
-
404 "invalid";
- -
406 }
-
407
-
408 // Sanity check: the ephemeral key of this manifest should not be
-
409 // used as the master or ephemeral key of another manifest:
-
410 if (auto const x = signingToMasterKeys_.find(*m.signingKey); x != signingToMasterKeys_.end())
-
411 {
-
412 JLOG(j_.warn()) << to_string(m) << ": Ephemeral key already used as ephemeral key for "
-
413 << toBase58(TokenType::NodePublic, x->second);
-
414
- -
416 }
-
417
-
418 if (auto const x = map_.find(*m.signingKey); x != map_.end())
-
419 {
-
420 JLOG(j_.warn()) << to_string(m) << ": Ephemeral key used as master key for " << to_string(x->second);
-
421
- -
423 }
-
424 }
-
425
-
426 return std::nullopt;
-
427 };
-
428
-
429 {
- -
431 if (auto d = prewriteCheck(map_.find(m.masterKey), /*checkSig*/ true, sl))
-
432 return *d;
-
433 }
-
434
- -
436 auto const iter = map_.find(m.masterKey);
-
437 // Since we released the previously held read lock, it's possible that the
-
438 // collections have been written to. This means we need to run
-
439 // `prewriteCheck` again. This re-does work, but `prewriteCheck` is
-
440 // relatively inexpensive to run, and doing it this way allows us to run
-
441 // `prewriteCheck` under a `shared_lock` above.
-
442 // Note, the signature has already been checked above, so it
-
443 // doesn't need to happen again (signature checks are somewhat expensive).
-
444 // Note: It's a mistake to use an upgradable lock. This is a recipe for
-
445 // deadlock.
-
446 if (auto d = prewriteCheck(iter, /*checkSig*/ false, sl))
-
447 return *d;
-
448
-
449 bool const revoked = m.revoked();
-
450 // This is the first manifest we are seeing for a master key. This should
-
451 // only ever happen once per validator run.
-
452 if (iter == map_.end())
-
453 {
-
454 if (auto stream = j_.info())
-
455 logMftAct(stream, "AcceptedNew", m.masterKey, m.sequence);
-
456
-
457 if (!revoked)
- -
459
-
460 auto masterKey = m.masterKey;
-
461 map_.emplace(std::move(masterKey), std::move(m));
-
462
-
463 // Something has changed. Keep track of it.
-
464 seq_++;
-
465
- -
467 }
-
468
-
469 // An ephemeral key was revoked and superseded by a new key. This is
-
470 // expected, but should happen infrequently.
-
471 if (auto stream = j_.info())
-
472 logMftAct(stream, "AcceptedUpdate", m.masterKey, m.sequence, iter->second.sequence);
-
473
-
474 signingToMasterKeys_.erase(*iter->second.signingKey);
-
475
-
476 if (!revoked)
- -
478
-
479 iter->second = std::move(m);
-
480
-
481 // Something has changed. Keep track of it.
-
482 seq_++;
-
483
- -
485}
+
341
+ +
+ +
344{
+
345 // Check the manifest against the conditions that do not require a
+
346 // `unique_lock` (write lock) on the `mutex_`. Since the signature can be
+
347 // relatively expensive, the `checkSignature` parameter determines if the
+
348 // signature should be checked. Since `prewriteCheck` is run twice (see
+
349 // comment below), `checkSignature` only needs to be set to true on the
+
350 // first run.
+
351 auto prewriteCheck =
+
352 [this, &m](auto const& iter, bool checkSignature, auto const& lock) -> std::optional<ManifestDisposition> {
+
353 XRPL_ASSERT(lock.owns_lock(), "xrpl::ManifestCache::applyManifest::prewriteCheck : locked");
+
354 (void)lock; // not used. parameter is present to ensure the mutex is
+
355 // locked when the lambda is called.
+
356 if (iter != map_.end() && m.sequence <= iter->second.sequence)
+
357 {
+
358 // We received a manifest whose sequence number is not strictly
+
359 // greater than the one we already know about. This can happen in
+
360 // several cases including when we receive manifests from a peer who
+
361 // doesn't have the latest data.
+
362 if (auto stream = j_.debug())
+
363 logMftAct(stream, "Stale", m.masterKey, m.sequence, iter->second.sequence);
+ +
365 }
+
366
+
367 if (checkSignature && !m.verify())
+
368 {
+
369 if (auto stream = j_.warn())
+
370 logMftAct(stream, "Invalid", m.masterKey, m.sequence);
+ +
372 }
+
373
+
374 // If the master key associated with a manifest is or might be
+
375 // compromised and is, therefore, no longer trustworthy.
+
376 //
+
377 // A manifest revocation essentially marks a manifest as compromised. By
+
378 // setting the sequence number to the highest value possible, the
+
379 // manifest is effectively neutered and cannot be superseded by a forged
+
380 // one.
+
381 bool const revoked = m.revoked();
+
382
+
383 if (auto stream = j_.warn(); stream && revoked)
+
384 logMftAct(stream, "Revoked", m.masterKey, m.sequence);
+
385
+
386 // Sanity check: the master key of this manifest should not be used as
+
387 // the ephemeral key of another manifest:
+
388 if (auto const x = signingToMasterKeys_.find(m.masterKey); x != signingToMasterKeys_.end())
+
389 {
+
390 JLOG(j_.warn()) << to_string(m) << ": Master key already used as ephemeral key for "
+
391 << toBase58(TokenType::NodePublic, x->second);
+
392
+ +
394 }
+
395
+
396 if (!revoked)
+
397 {
+
398 if (!m.signingKey)
+
399 {
+
400 JLOG(j_.warn()) << to_string(m)
+
401 << ": is not revoked and the manifest has no "
+
402 "signing key. Hence, the manifest is "
+
403 "invalid";
+ +
405 }
+
406
+
407 // Sanity check: the ephemeral key of this manifest should not be
+
408 // used as the master or ephemeral key of another manifest:
+
409 if (auto const x = signingToMasterKeys_.find(*m.signingKey); x != signingToMasterKeys_.end())
+
410 {
+
411 JLOG(j_.warn()) << to_string(m) << ": Ephemeral key already used as ephemeral key for "
+
412 << toBase58(TokenType::NodePublic, x->second);
+
413
+ +
415 }
+
416
+
417 if (auto const x = map_.find(*m.signingKey); x != map_.end())
+
418 {
+
419 JLOG(j_.warn()) << to_string(m) << ": Ephemeral key used as master key for " << to_string(x->second);
+
420
+ +
422 }
+
423 }
+
424
+
425 return std::nullopt;
+
426 };
+
427
+
428 {
+ +
430 if (auto d = prewriteCheck(map_.find(m.masterKey), /*checkSig*/ true, sl))
+
431 return *d;
+
432 }
+
433
+ +
435 auto const iter = map_.find(m.masterKey);
+
436 // Since we released the previously held read lock, it's possible that the
+
437 // collections have been written to. This means we need to run
+
438 // `prewriteCheck` again. This re-does work, but `prewriteCheck` is
+
439 // relatively inexpensive to run, and doing it this way allows us to run
+
440 // `prewriteCheck` under a `shared_lock` above.
+
441 // Note, the signature has already been checked above, so it
+
442 // doesn't need to happen again (signature checks are somewhat expensive).
+
443 // Note: It's a mistake to use an upgradable lock. This is a recipe for
+
444 // deadlock.
+
445 if (auto d = prewriteCheck(iter, /*checkSig*/ false, sl))
+
446 return *d;
+
447
+
448 bool const revoked = m.revoked();
+
449 // This is the first manifest we are seeing for a master key. This should
+
450 // only ever happen once per validator run.
+
451 if (iter == map_.end())
+
452 {
+
453 if (auto stream = j_.info())
+
454 logMftAct(stream, "AcceptedNew", m.masterKey, m.sequence);
+
455
+
456 if (!revoked)
+ +
458
+
459 auto masterKey = m.masterKey;
+
460 map_.emplace(std::move(masterKey), std::move(m));
+
461
+
462 // Something has changed. Keep track of it.
+
463 seq_++;
+
464
+ +
466 }
+
467
+
468 // An ephemeral key was revoked and superseded by a new key. This is
+
469 // expected, but should happen infrequently.
+
470 if (auto stream = j_.info())
+
471 logMftAct(stream, "AcceptedUpdate", m.masterKey, m.sequence, iter->second.sequence);
+
472
+
473 signingToMasterKeys_.erase(*iter->second.signingKey);
+
474
+
475 if (!revoked)
+ +
477
+
478 iter->second = std::move(m);
+
479
+
480 // Something has changed. Keep track of it.
+
481 seq_++;
+
482
+ +
484}
-
486
-
487void
-
- -
489{
-
490 auto db = dbCon.checkoutDb();
-
491 xrpl::getManifests(*db, dbTable, *this, j_);
-
492}
+
485
+
486void
+
+ +
488{
+
489 auto db = dbCon.checkoutDb();
+
490 xrpl::getManifests(*db, dbTable, *this, j_);
+
491}
-
493
-
494bool
-
- -
496 DatabaseCon& dbCon,
-
497 std::string const& dbTable,
-
498 std::string const& configManifest,
-
499 std::vector<std::string> const& configRevocation)
-
500{
-
501 load(dbCon, dbTable);
-
502
-
503 if (!configManifest.empty())
-
504 {
-
505 auto mo = deserializeManifest(base64_decode(configManifest));
-
506 if (!mo)
-
507 {
-
508 JLOG(j_.error()) << "Malformed validator_token in config";
-
509 return false;
-
510 }
-
511
-
512 if (mo->revoked())
-
513 {
-
514 JLOG(j_.warn()) << "Configured manifest revokes public key";
-
515 }
-
516
-
517 if (applyManifest(std::move(*mo)) == ManifestDisposition::invalid)
-
518 {
-
519 JLOG(j_.error()) << "Manifest in config was rejected";
-
520 return false;
-
521 }
-
522 }
-
523
-
524 if (!configRevocation.empty())
-
525 {
-
526 std::string revocationStr;
-
527 revocationStr.reserve(std::accumulate(
-
528 configRevocation.cbegin(),
-
529 configRevocation.cend(),
-
530 std::size_t(0),
-
531 [](std::size_t init, std::string const& s) { return init + s.size(); }));
-
532
-
533 for (auto const& line : configRevocation)
-
534 revocationStr += boost::algorithm::trim_copy(line);
-
535
-
536 auto mo = deserializeManifest(base64_decode(revocationStr));
-
537
-
538 if (!mo || !mo->revoked() || applyManifest(std::move(*mo)) == ManifestDisposition::invalid)
-
539 {
-
540 JLOG(j_.error()) << "Invalid validator key revocation in config";
-
541 return false;
-
542 }
-
543 }
-
544
-
545 return true;
-
546}
+
492
+
493bool
+
+ +
495 DatabaseCon& dbCon,
+
496 std::string const& dbTable,
+
497 std::string const& configManifest,
+
498 std::vector<std::string> const& configRevocation)
+
499{
+
500 load(dbCon, dbTable);
+
501
+
502 if (!configManifest.empty())
+
503 {
+
504 auto mo = deserializeManifest(base64_decode(configManifest));
+
505 if (!mo)
+
506 {
+
507 JLOG(j_.error()) << "Malformed validator_token in config";
+
508 return false;
+
509 }
+
510
+
511 if (mo->revoked())
+
512 {
+
513 JLOG(j_.warn()) << "Configured manifest revokes public key";
+
514 }
+
515
+
516 if (applyManifest(std::move(*mo)) == ManifestDisposition::invalid)
+
517 {
+
518 JLOG(j_.error()) << "Manifest in config was rejected";
+
519 return false;
+
520 }
+
521 }
+
522
+
523 if (!configRevocation.empty())
+
524 {
+
525 std::string revocationStr;
+
526 revocationStr.reserve(std::accumulate(
+
527 configRevocation.cbegin(),
+
528 configRevocation.cend(),
+
529 std::size_t(0),
+
530 [](std::size_t init, std::string const& s) { return init + s.size(); }));
+
531
+
532 for (auto const& line : configRevocation)
+
533 revocationStr += boost::algorithm::trim_copy(line);
+
534
+
535 auto mo = deserializeManifest(base64_decode(revocationStr));
+
536
+
537 if (!mo || !mo->revoked() || applyManifest(std::move(*mo)) == ManifestDisposition::invalid)
+
538 {
+
539 JLOG(j_.error()) << "Invalid validator key revocation in config";
+
540 return false;
+
541 }
+
542 }
+
543
+
544 return true;
+
545}
-
547
-
548void
-
- -
550 DatabaseCon& dbCon,
-
551 std::string const& dbTable,
-
552 std::function<bool(PublicKey const&)> const& isTrusted)
-
553{
- -
555 auto db = dbCon.checkoutDb();
-
556
-
557 saveManifests(*db, dbTable, isTrusted, map_, j_);
-
558}
+
546
+
547void
+
+ +
549 DatabaseCon& dbCon,
+
550 std::string const& dbTable,
+
551 std::function<bool(PublicKey const&)> const& isTrusted)
+
552{
+ +
554 auto db = dbCon.checkoutDb();
+
555
+
556 saveManifests(*db, dbTable, isTrusted, map_, j_);
+
557}
-
559} // namespace xrpl
+
558} // namespace xrpl
T accumulate(T... args)
T assign(T... args)
@@ -695,22 +694,22 @@ $(document).ready(function() { init_codefold(0); });
Stream debug() const
Definition Journal.h:300
Stream info() const
Definition Journal.h:306
Stream warn() const
Definition Journal.h:312
- -
LockedSociSession checkoutDb()
+ +
LockedSociSession checkoutDb()
std::atomic< std::uint32_t > seq_
Definition Manifest.h:235
std::shared_mutex mutex_
Definition Manifest.h:227
-
bool load(DatabaseCon &dbCon, std::string const &dbTable, std::string const &configManifest, std::vector< std::string > const &configRevocation)
Populate manifest cache with manifests in database and config.
Definition Manifest.cpp:495
-
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
Definition Manifest.cpp:273
-
ManifestDisposition applyManifest(Manifest m)
Add manifest to cache.
Definition Manifest.cpp:344
-
std::optional< std::string > getDomain(PublicKey const &pk) const
Returns domain claimed by a given public key.
Definition Manifest.cpp:308
-
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:285
+
bool load(DatabaseCon &dbCon, std::string const &dbTable, std::string const &configManifest, std::vector< std::string > const &configRevocation)
Populate manifest cache with manifests in database and config.
Definition Manifest.cpp:494
+
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
Definition Manifest.cpp:272
+
ManifestDisposition applyManifest(Manifest m)
Add manifest to cache.
Definition Manifest.cpp:343
+
std::optional< std::string > getDomain(PublicKey const &pk) const
Returns domain claimed by a given public key.
Definition Manifest.cpp:307
+
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:284
hash_map< PublicKey, PublicKey > signingToMasterKeys_
Master public keys stored by current ephemeral public key.
Definition Manifest.h:233
-
std::optional< std::string > getManifest(PublicKey const &pk) const
Returns manifest corresponding to a given public key.
Definition Manifest.cpp:320
+
std::optional< std::string > getManifest(PublicKey const &pk) const
Returns manifest corresponding to a given public key.
Definition Manifest.cpp:319
hash_map< PublicKey, Manifest > map_
Active manifests stored by master public key.
Definition Manifest.h:230
-
std::optional< std::uint32_t > getSequence(PublicKey const &pk) const
Returns master key's current manifest sequence.
Definition Manifest.cpp:296
-
void save(DatabaseCon &dbCon, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted)
Save cached manifests to database.
Definition Manifest.cpp:549
+
std::optional< std::uint32_t > getSequence(PublicKey const &pk) const
Returns master key's current manifest sequence.
Definition Manifest.cpp:295
+
void save(DatabaseCon &dbCon, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted)
Save cached manifests to database.
Definition Manifest.cpp:548
beast::Journal j_
Definition Manifest.h:226
-
bool revoked(PublicKey const &pk) const
Returns true if master key has been revoked in a manifest.
Definition Manifest.cpp:332
+
bool revoked(PublicKey const &pk) const
Returns true if master key has been revoked in a manifest.
Definition Manifest.cpp:331
A public key.
Definition PublicKey.h:42
Defines the fields and their attributes within a STObject.
Definition SOTemplate.h:88
@@ -733,7 +732,9 @@ $(document).ready(function() { init_codefold(0); });
T is_same_v
T max(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
Stream & logMftAct(Stream &s, std::string const &action, PublicKey const &pk, std::uint32_t seq)
Definition Manifest.cpp:147
+
Stream & logMftAct(Stream &s, std::string const &action, PublicKey const &pk, std::uint32_t seq)
Definition Manifest.cpp:146
+
void getManifests(soci::session &session, std::string const &dbTable, ManifestCache &mCache, beast::Journal j)
getManifests Loads a manifest from the wallet database and stores it in the cache.
Definition Wallet.cpp:23
+
void saveManifests(soci::session &session, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted, hash_map< PublicKey, Manifest > const &map, beast::Journal j)
saveManifests Saves all given manifests to the database.
Definition Wallet.cpp:63
bool isProperlyFormedTomlDomain(std::string_view domain)
Determines if the given string looks like a TOML-file hosting domain.
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
T get(Section const &section, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
@@ -745,15 +746,13 @@ $(document).ready(function() { init_codefold(0); });
SField const sfGeneric
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition AccountID.cpp:92
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
-
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition Manifest.cpp:35
-
std::optional< ValidatorToken > loadValidatorToken(std::vector< std::string > const &blob, beast::Journal journal)
Definition Manifest.cpp:230
+
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition Manifest.cpp:34
std::optional< Blob > strUnHex(std::size_t strSize, Iterator begin, Iterator end)
-
void saveManifests(soci::session &session, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted, hash_map< PublicKey, Manifest > const &map, beast::Journal j)
saveManifests Saves all given manifests to the database.
Definition Wallet.cpp:62
@ manifest
Manifest.
-
void getManifests(soci::session &session, std::string const &dbTable, ManifestCache &mCache, beast::Journal j)
getManifests Loads a manifest from the wallet database and stores it in the cache.
Definition Wallet.cpp:22
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition Slice.h:213
+
std::optional< ValidatorToken > loadValidatorToken(std::vector< std::string > const &blob, beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
Definition Manifest.cpp:229
ManifestDisposition
Definition Manifest.h:183
@ badMasterKey
The master key is not acceptable to us.
@ stale
Sequence is too old.
@@ -768,16 +767,16 @@ $(document).ready(function() { init_codefold(0); }); -
static bool revoked(std::uint32_t sequence)
Returns true if manifest revokes master key.
Definition Manifest.cpp:202
+
static bool revoked(std::uint32_t sequence)
Returns true if manifest revokes master key.
Definition Manifest.cpp:201
PublicKey masterKey
The master key associated with this manifest.
Definition Manifest.h:66
std::string serialized
The manifest in serialized form.
Definition Manifest.h:63
-
Blob getMasterSignature() const
Returns manifest master key signature.
Definition Manifest.cpp:221
-
std::optional< Blob > getSignature() const
Returns manifest signature.
Definition Manifest.cpp:210
+
Blob getMasterSignature() const
Returns manifest master key signature.
Definition Manifest.cpp:220
+
std::optional< Blob > getSignature() const
Returns manifest signature.
Definition Manifest.cpp:209
std::optional< PublicKey > signingKey
The ephemeral key associated with this manifest.
Definition Manifest.h:72
std::uint32_t sequence
The sequence number of this manifest.
Definition Manifest.h:75
-
bool revoked() const
Returns true if manifest revokes master key.
Definition Manifest.cpp:192
-
uint256 hash() const
Returns hash of serialized manifest data.
Definition Manifest.cpp:183
-
bool verify() const
Returns true if manifest signature is valid.
Definition Manifest.cpp:163
+
bool revoked() const
Returns true if manifest revokes master key.
Definition Manifest.cpp:191
+
uint256 hash() const
Returns hash of serialized manifest data.
Definition Manifest.cpp:182
+
bool verify() const
Returns true if manifest signature is valid.
Definition Manifest.cpp:162
T to_string(T... args)
diff --git a/Manifest_8h_source.html b/Manifest_8h_source.html index 91b5bba39d..f23d7ef783 100644 --- a/Manifest_8h_source.html +++ b/Manifest_8h_source.html @@ -74,7 +74,7 @@ $(document).ready(function() { init_codefold(0); });
@@ -249,7 +249,7 @@ $(document).ready(function() { init_codefold(0); });
177
- +
180 std::vector<std::string> const& blob,
182
@@ -389,24 +389,24 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
static Sink & getNullSink()
Returns a Sink which does nothing.
- +
Remembers manifests with the highest sequence number.
Definition Manifest.h:224
void for_each_manifest(Function &&f) const
Invokes the callback once for every populated manifest.
Definition Manifest.h:388
std::atomic< std::uint32_t > seq_
Definition Manifest.h:235
std::shared_mutex mutex_
Definition Manifest.h:227
void for_each_manifest(PreFun &&pf, EachFun &&f) const
Invokes the callback once for every populated manifest.
Definition Manifest.h:416
-
bool load(DatabaseCon &dbCon, std::string const &dbTable, std::string const &configManifest, std::vector< std::string > const &configRevocation)
Populate manifest cache with manifests in database and config.
Definition Manifest.cpp:495
-
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
Definition Manifest.cpp:273
-
ManifestDisposition applyManifest(Manifest m)
Add manifest to cache.
Definition Manifest.cpp:344
+
bool load(DatabaseCon &dbCon, std::string const &dbTable, std::string const &configManifest, std::vector< std::string > const &configRevocation)
Populate manifest cache with manifests in database and config.
Definition Manifest.cpp:494
+
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
Definition Manifest.cpp:272
+
ManifestDisposition applyManifest(Manifest m)
Add manifest to cache.
Definition Manifest.cpp:343
ManifestCache(beast::Journal j=beast::Journal(beast::Journal::getNullSink()))
Definition Manifest.h:238
-
std::optional< std::string > getDomain(PublicKey const &pk) const
Returns domain claimed by a given public key.
Definition Manifest.cpp:308
-
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:285
+
std::optional< std::string > getDomain(PublicKey const &pk) const
Returns domain claimed by a given public key.
Definition Manifest.cpp:307
+
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:284
std::uint32_t sequence() const
A monotonically increasing number used to detect new manifests.
Definition Manifest.h:244
hash_map< PublicKey, PublicKey > signingToMasterKeys_
Master public keys stored by current ephemeral public key.
Definition Manifest.h:233
-
std::optional< std::string > getManifest(PublicKey const &pk) const
Returns manifest corresponding to a given public key.
Definition Manifest.cpp:320
+
std::optional< std::string > getManifest(PublicKey const &pk) const
Returns manifest corresponding to a given public key.
Definition Manifest.cpp:319
hash_map< PublicKey, Manifest > map_
Active manifests stored by master public key.
Definition Manifest.h:230
-
std::optional< std::uint32_t > getSequence(PublicKey const &pk) const
Returns master key's current manifest sequence.
Definition Manifest.cpp:296
-
void save(DatabaseCon &dbCon, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted)
Save cached manifests to database.
Definition Manifest.cpp:549
+
std::optional< std::uint32_t > getSequence(PublicKey const &pk) const
Returns master key's current manifest sequence.
Definition Manifest.cpp:295
+
void save(DatabaseCon &dbCon, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted)
Save cached manifests to database.
Definition Manifest.cpp:548
beast::Journal j_
Definition Manifest.h:226
A public key.
Definition PublicKey.h:42
A secret key.
Definition SecretKey.h:18
@@ -419,12 +419,12 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
Definition base_uint.h:552
-
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition Manifest.cpp:35
-
std::optional< ValidatorToken > loadValidatorToken(std::vector< std::string > const &blob, beast::Journal journal)
Definition Manifest.cpp:230
+
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition Manifest.cpp:34
bool operator!=(Buffer const &lhs, Buffer const &rhs) noexcept
Definition Buffer.h:209
@ manifest
Manifest.
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition Slice.h:213
+
std::optional< ValidatorToken > loadValidatorToken(std::vector< std::string > const &blob, beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
Definition Manifest.cpp:229
ManifestDisposition
Definition Manifest.h:183
@ badMasterKey
The master key is not acceptable to us.
@ stale
Sequence is too old.
@@ -441,14 +441,14 @@ $(document).ready(function() { init_codefold(0); });
PublicKey masterKey
The master key associated with this manifest.
Definition Manifest.h:66
Manifest(Manifest &&other)=default
std::string serialized
The manifest in serialized form.
Definition Manifest.h:63
-
Blob getMasterSignature() const
Returns manifest master key signature.
Definition Manifest.cpp:221
+
Blob getMasterSignature() const
Returns manifest master key signature.
Definition Manifest.cpp:220
std::string domain
The domain, if one was specified in the manifest; empty otherwise.
Definition Manifest.h:78
-
std::optional< Blob > getSignature() const
Returns manifest signature.
Definition Manifest.cpp:210
+
std::optional< Blob > getSignature() const
Returns manifest signature.
Definition Manifest.cpp:209
std::optional< PublicKey > signingKey
The ephemeral key associated with this manifest.
Definition Manifest.h:72
std::uint32_t sequence
The sequence number of this manifest.
Definition Manifest.h:75
-
bool revoked() const
Returns true if manifest revokes master key.
Definition Manifest.cpp:192
-
uint256 hash() const
Returns hash of serialized manifest data.
Definition Manifest.cpp:183
-
bool verify() const
Returns true if manifest signature is valid.
Definition Manifest.cpp:163
+
bool revoked() const
Returns true if manifest revokes master key.
Definition Manifest.cpp:191
+
uint256 hash() const
Returns hash of serialized manifest data.
Definition Manifest.cpp:182
+
bool verify() const
Returns true if manifest signature is valid.
Definition Manifest.cpp:162
Manifest & operator=(Manifest &&other)=default
Manifest()=delete
Manifest(std::string const &serialized_, PublicKey const &masterKey_, std::optional< PublicKey > const &signingKey_, std::uint32_t seq, std::string const &domain_)
Definition Manifest.h:82
diff --git a/Manifest__test_8cpp_source.html b/Manifest__test_8cpp_source.html index 629d20211f..da958050ba 100644 --- a/Manifest__test_8cpp_source.html +++ b/Manifest__test_8cpp_source.html @@ -83,16 +83,16 @@ $(document).ready(function() { init_codefold(0); });
1#include <test/jtx.h>
2
-
3#include <xrpld/app/main/DBInit.h>
-
4#include <xrpld/app/misc/Manifest.h>
-
5#include <xrpld/app/misc/ValidatorList.h>
-
6#include <xrpld/app/rdb/Wallet.h>
-
7
-
8#include <xrpl/basics/base64.h>
-
9#include <xrpl/basics/contract.h>
-
10#include <xrpl/protocol/STExchange.h>
-
11#include <xrpl/protocol/SecretKey.h>
-
12#include <xrpl/protocol/Sign.h>
+
3#include <xrpld/app/misc/ValidatorList.h>
+
4
+
5#include <xrpl/basics/base64.h>
+
6#include <xrpl/basics/contract.h>
+
7#include <xrpl/protocol/STExchange.h>
+
8#include <xrpl/protocol/SecretKey.h>
+
9#include <xrpl/protocol/Sign.h>
+
10#include <xrpl/rdb/DBInit.h>
+
11#include <xrpl/server/Manifest.h>
+
12#include <xrpl/server/Wallet.h>
13
14#include <boost/algorithm/string.hpp>
15#include <boost/filesystem.hpp>
@@ -306,7 +306,7 @@ $(document).ready(function() { init_codefold(0); });
197 setup.dataDir = getDatabasePath();
198 assert(!setup.useGlobalPragma);
199
-
200 auto dbCon = makeTestWalletDB(setup, dbName, env.journal);
+
200 auto dbCon = makeTestWalletDB(setup, dbName, env.journal);
201
202 auto getPopulatedManifests = [](ManifestCache const& cache) -> std::vector<Manifest const*> {
@@ -540,14 +540,14 @@ $(document).ready(function() { init_codefold(0); });
425 "r7C0kw"
426 "2AiTzSCjIzditQ8=";
427
-
428 auto const token = loadValidatorToken(tokenBlob);
+
428 auto const token = loadValidatorToken(tokenBlob);
429 BEAST_EXPECT(token);
430 BEAST_EXPECT(token->validationSecret == *valSecret);
431 BEAST_EXPECT(token->manifest == manifest);
432 }
433 {
434 std::vector<std::string> const badToken = {"bad token"};
-
435 BEAST_EXPECT(!loadValidatorToken(badToken));
+
435 BEAST_EXPECT(!loadValidatorToken(badToken));
436 }
437 }
@@ -1008,13 +1008,13 @@ $(document).ready(function() { init_codefold(0); });
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:516
Remembers manifests with the highest sequence number.
Definition Manifest.h:224
-
bool load(DatabaseCon &dbCon, std::string const &dbTable, std::string const &configManifest, std::vector< std::string > const &configRevocation)
Populate manifest cache with manifests in database and config.
Definition Manifest.cpp:495
-
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
Definition Manifest.cpp:273
-
ManifestDisposition applyManifest(Manifest m)
Add manifest to cache.
Definition Manifest.cpp:344
-
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:285
+
bool load(DatabaseCon &dbCon, std::string const &dbTable, std::string const &configManifest, std::vector< std::string > const &configRevocation)
Populate manifest cache with manifests in database and config.
Definition Manifest.cpp:494
+
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
Definition Manifest.cpp:272
+
ManifestDisposition applyManifest(Manifest m)
Add manifest to cache.
Definition Manifest.cpp:343
+
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:284
std::uint32_t sequence() const
A monotonically increasing number used to detect new manifests.
Definition Manifest.h:244
-
void save(DatabaseCon &dbCon, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted)
Save cached manifests to database.
Definition Manifest.cpp:549
-
bool revoked(PublicKey const &pk) const
Returns true if master key has been revoked in a manifest.
Definition Manifest.cpp:332
+
void save(DatabaseCon &dbCon, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted)
Save cached manifests to database.
Definition Manifest.cpp:548
+
bool revoked(PublicKey const &pk) const
Returns true if master key has been revoked in a manifest.
Definition Manifest.cpp:331
A public key.
Definition PublicKey.h:42
void addWithoutSigningFields(Serializer &s) const
Definition STObject.h:957
@@ -1074,14 +1074,14 @@ $(document).ready(function() { init_codefold(0); });
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
std::string base64_encode(std::uint8_t const *data, std::size_t len)
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
-
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition Manifest.cpp:35
-
std::optional< ValidatorToken > loadValidatorToken(std::vector< std::string > const &blob, beast::Journal journal)
Definition Manifest.cpp:230
+
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition Manifest.cpp:34
SecretKey randomSecretKey()
Create a secret key using secure random numbers.
-
std::unique_ptr< DatabaseCon > makeTestWalletDB(DatabaseCon::Setup const &setup, std::string const &dbname, beast::Journal j)
makeTestWalletDB Opens a test wallet database with an arbitrary name.
Definition Wallet.cpp:15
@ manifest
Manifest.
+
std::unique_ptr< DatabaseCon > makeTestWalletDB(DatabaseCon::Setup const &setup, std::string const &dbname, beast::Journal j)
makeTestWalletDB Opens a test wallet database with an arbitrary name.
Definition Wallet.cpp:16
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition Slice.h:213
+
std::optional< ValidatorToken > loadValidatorToken(std::vector< std::string > const &blob, beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
Definition Manifest.cpp:229
@ badMasterKey
The master key is not acceptable to us.
@ stale
Sequence is too old.
@ accepted
Manifest is valid.
@@ -1093,9 +1093,9 @@ $(document).ready(function() { init_codefold(0); });
T reserve(T... args)
T size(T... args)
T sort(T... args)
- -
boost::filesystem::path dataDir
Definition DatabaseCon.h:73
- + +
boost::filesystem::path dataDir
Definition DatabaseCon.h:72
+
PublicKey masterKey
The master key associated with this manifest.
Definition Manifest.h:66
std::string serialized
The manifest in serialized form.
Definition Manifest.h:63
diff --git a/NegativeUNLVote_8h_source.html b/NegativeUNLVote_8h_source.html index 816d4f8024..0355b991e5 100644 --- a/NegativeUNLVote_8h_source.html +++ b/NegativeUNLVote_8h_source.html @@ -205,7 +205,7 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
Validations< RCLValidationsAdaptor > RCLValidations
Alias for RCL-specific instantiation of generic Validations.
+
Validations< RCLValidationsAdaptor > RCLValidations
Alias for RCL-specific instantiation of generic Validations.
std::uint32_t constexpr FLAG_LEDGER_INTERVAL
Definition Ledger.h:394
diff --git a/NegativeUNL__test_8cpp_source.html b/NegativeUNL__test_8cpp_source.html index e3c05af619..76686025d5 100644 --- a/NegativeUNL__test_8cpp_source.html +++ b/NegativeUNL__test_8cpp_source.html @@ -1941,7 +1941,7 @@ $(document).ready(function() { init_codefold(0); });
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
ApplyResult apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition apply.cpp:117
@ tefFAILURE
Definition TER.h:146
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition AccountID.cpp:92
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
std::uint32_t LedgerIndex
A ledger index.
Definition Protocol.h:254
diff --git a/NetworkID__test_8cpp_source.html b/NetworkID__test_8cpp_source.html index 0afd283a10..5eb55e282e 100644 --- a/NetworkID__test_8cpp_source.html +++ b/NetworkID__test_8cpp_source.html @@ -236,7 +236,7 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:51
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
virtual Config & config()=0
-
uint32_t NETWORK_ID
Definition Config.h:137
+
uint32_t NETWORK_ID
Definition Config.h:138
Slice slice() const noexcept
Definition Serializer.h:44
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html index cf308c1877..5087ad0706 100644 --- a/NetworkOPs_8cpp_source.html +++ b/NetworkOPs_8cpp_source.html @@ -3204,7 +3204,7 @@ $(document).ready(function() { init_codefold(0); });
3018 // If the offer create is not self funded then add the owner balance
3019 if (account != amount.issue().account)
3020 {
-
3021 auto const ownerFunds = accountFunds(*ledger, account, amount, fhIGNORE_FREEZE, app_.journal("View"));
+
3021 auto const ownerFunds = accountFunds(*ledger, account, amount, fhIGNORE_FREEZE, app_.journal("View"));
3022 jvObj[jss::transaction][jss::owner_funds] = ownerFunds.getText();
3023 }
3024 }
@@ -4325,7 +4325,7 @@ $(document).ready(function() { init_codefold(0); });
4065 STAmount saDirRate;
4066
4067 auto const rate = transferRate(view, book.out.account);
-
4068 auto viewJ = app_.journal("View");
+
4068 auto viewJ = app_.journal("View");
4069
4070 while (!bDone && iLimit-- > 0)
4071 {
@@ -4743,7 +4743,6 @@ $(document).ready(function() { init_codefold(0); });
virtual std::chrono::milliseconds getIOLatency()=0
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
virtual std::optional< PublicKey const > getValidationPublicKey() const =0
virtual std::pair< PublicKey, SecretKey > const & nodeIdentity()=0
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
@@ -4759,14 +4758,14 @@ $(document).ready(function() { init_codefold(0); });
PublicKey const & identity() const
Definition ClusterNode.h:44
std::string const & name() const
Definition ClusterNode.h:26
std::size_t size() const
The number of nodes in the cluster list.
Definition Cluster.cpp:30
-
uint32_t NETWORK_ID
Definition Config.h:137
-
std::string SERVER_DOMAIN
Definition Config.h:258
-
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:150
-
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:141
-
std::size_t NODE_SIZE
Definition Config.h:193
+
uint32_t NETWORK_ID
Definition Config.h:138
+
std::string SERVER_DOMAIN
Definition Config.h:259
+
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:151
+
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
+
std::size_t NODE_SIZE
Definition Config.h:194
virtual Json::Value getInfo()=0
virtual void clearFailures()=0
-
std::shared_ptr< InfoSub > pointer
Definition InfoSub.h:34
+
std::shared_ptr< InfoSub > pointer
Definition InfoSub.h:33
Currency currency
Definition Issue.h:15
AccountID account
Definition Issue.h:16
A pool of threads to perform work.
Definition JobQueue.h:37
@@ -4791,7 +4790,7 @@ $(document).ready(function() { init_codefold(0); });
std::uint32_t getLoadBase() const
Manages load sources.
Definition LoadManager.h:26
void heartbeat()
Reset the stall detection timer.
-
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:285
+
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Definition Manifest.cpp:284
State accounting records two attributes for each possible server state: 1) Amount of time spent in ea...
void json(Json::Value &obj) const
Output state counters in JSON format.
std::chrono::steady_clock::time_point const processStart_
@@ -5024,6 +5023,7 @@ $(document).ready(function() { init_codefold(0); });
virtual OrderBookDB & getOrderBookDB()=0
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
virtual ManifestCache & validatorManifests()=0
+
virtual beast::Journal journal(std::string const &name)=0
time_point now() const override
Returns the current time, using the server's clock.
Definition TimeKeeper.h:43
std::chrono::seconds closeOffset() const
Definition TimeKeeper.h:62
@@ -5207,9 +5207,9 @@ $(document).ready(function() { init_codefold(0); });
PublicKey masterKey
The master key associated with this manifest.
Definition Manifest.h:66
std::string serialized
The manifest in serialized form.
Definition Manifest.h:63
-
Blob getMasterSignature() const
Returns manifest master key signature.
Definition Manifest.cpp:221
+
Blob getMasterSignature() const
Returns manifest master key signature.
Definition Manifest.cpp:220
std::string domain
The domain, if one was specified in the manifest; empty otherwise.
Definition Manifest.h:78
-
std::optional< Blob > getSignature() const
Returns manifest signature.
Definition Manifest.cpp:210
+
std::optional< Blob > getSignature() const
Returns manifest signature.
Definition Manifest.cpp:209
std::optional< PublicKey > signingKey
The ephemeral key associated with this manifest.
Definition Manifest.h:72
std::uint32_t sequence
The sequence number of this manifest.
Definition Manifest.h:75
Server fees published on server subscription.
diff --git a/NetworkOPs_8h_source.html b/NetworkOPs_8h_source.html index e26bbadbdc..92046ed01e 100644 --- a/NetworkOPs_8h_source.html +++ b/NetworkOPs_8h_source.html @@ -316,7 +316,7 @@ $(document).ready(function() { init_codefold(0); });
Specifies an order book.
Definition Book.h:16
Holds transactions which were deferred to the next pass of consensus.
-
Abstracts the source of subscription data.
Definition InfoSub.h:48
+
Abstracts the source of subscription data.
Definition InfoSub.h:47
A pool of threads to perform work.
Definition JobQueue.h:37
Provides server functionality for clients.
Definition NetworkOPs.h:69
diff --git a/NoRippleCheck__test_8cpp_source.html b/NoRippleCheck__test_8cpp_source.html index f060849479..21e7a2055e 100644 --- a/NoRippleCheck__test_8cpp_source.html +++ b/NoRippleCheck__test_8cpp_source.html @@ -459,7 +459,7 @@ $(document).ready(function() { init_codefold(0); });
static LimitRange constexpr noRippleCheck
Limits for the no_ripple_check command.
- +
char const * getEnvLocalhostAddr()
Definition envconfig.h:16
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
diff --git a/NodeFamily_8cpp_source.html b/NodeFamily_8cpp_source.html index 9df0566766..8adaaaef32 100644 --- a/NodeFamily_8cpp_source.html +++ b/NodeFamily_8cpp_source.html @@ -208,7 +208,7 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Definition chrono.h:93
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
-
SizedItem
Definition Config.h:24
+
SizedItem
Definition Config.h:26
constexpr std::chrono::seconds fullBelowExpiration
diff --git a/NodeIdentity_8cpp_source.html b/NodeIdentity_8cpp_source.html index b13a299a72..edd61bb22d 100644 --- a/NodeIdentity_8cpp_source.html +++ b/NodeIdentity_8cpp_source.html @@ -83,65 +83,66 @@ $(document).ready(function() { init_codefold(0); });
1#include <xrpld/app/main/Application.h>
2#include <xrpld/app/main/NodeIdentity.h>
-
3#include <xrpld/app/rdb/Wallet.h>
-
4#include <xrpld/core/Config.h>
-
5#include <xrpld/core/ConfigSections.h>
-
6
-
7namespace xrpl {
-
8
- -
-
10getNodeIdentity(Application& app, boost::program_options::variables_map const& cmdline)
-
11{
- -
13
-
14 if (cmdline.count("nodeid"))
-
15 {
-
16 seed = parseGenericSeed(cmdline["nodeid"].as<std::string>(), false);
-
17
-
18 if (!seed)
-
19 Throw<std::runtime_error>("Invalid 'nodeid' in command line");
-
20 }
-
21 else if (app.config().exists(SECTION_NODE_SEED))
-
22 {
-
23 seed = parseBase58<Seed>(app.config().section(SECTION_NODE_SEED).lines().front());
-
24
-
25 if (!seed)
-
26 Throw<std::runtime_error>("Invalid [" SECTION_NODE_SEED "] in configuration file");
-
27 }
-
28
-
29 if (seed)
-
30 {
-
31 auto secretKey = generateSecretKey(KeyType::secp256k1, *seed);
-
32 auto publicKey = derivePublicKey(KeyType::secp256k1, secretKey);
-
33
-
34 return {publicKey, secretKey};
-
35 }
-
36
-
37 auto db = app.getWalletDB().checkoutDb();
-
38
-
39 if (cmdline.count("newnodeid") != 0)
- -
41
-
42 return getNodeIdentity(*db);
-
43}
+
3#include <xrpld/core/Config.h>
+
4#include <xrpld/core/ConfigSections.h>
+
5
+
6#include <xrpl/server/Wallet.h>
+
7
+
8namespace xrpl {
+
9
+ +
+
11getNodeIdentity(Application& app, boost::program_options::variables_map const& cmdline)
+
12{
+ +
14
+
15 if (cmdline.count("nodeid"))
+
16 {
+
17 seed = parseGenericSeed(cmdline["nodeid"].as<std::string>(), false);
+
18
+
19 if (!seed)
+
20 Throw<std::runtime_error>("Invalid 'nodeid' in command line");
+
21 }
+
22 else if (app.config().exists(SECTION_NODE_SEED))
+
23 {
+
24 seed = parseBase58<Seed>(app.config().section(SECTION_NODE_SEED).lines().front());
+
25
+
26 if (!seed)
+
27 Throw<std::runtime_error>("Invalid [" SECTION_NODE_SEED "] in configuration file");
+
28 }
+
29
+
30 if (seed)
+
31 {
+
32 auto secretKey = generateSecretKey(KeyType::secp256k1, *seed);
+
33 auto publicKey = derivePublicKey(KeyType::secp256k1, secretKey);
+
34
+
35 return {publicKey, secretKey};
+
36 }
+
37
+
38 auto db = app.getWalletDB().checkoutDb();
+
39
+
40 if (cmdline.count("newnodeid") != 0)
+ +
42
+
43 return getNodeIdentity(*db);
+
44}
-
44
-
45} // namespace xrpl
+
45
+
46} // namespace xrpl
virtual Config & config()=0
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
Section & section(std::string const &name)
Returns the section with the given name.
-
LockedSociSession checkoutDb()
+
LockedSociSession checkoutDb()
std::vector< std::string > const & lines() const
Returns all the lines in the section.
Definition BasicConfig.h:49
T front(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
std::pair< PublicKey, SecretKey > getNodeIdentity(Application &app, boost::program_options::variables_map const &cmdline)
The cryptographic credentials identifying this server instance.
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
+
std::pair< PublicKey, SecretKey > getNodeIdentity(soci::session &session)
Returns a stable public and private key for this node.
Definition Wallet.cpp:102
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
-
void clearNodeIdentity(soci::session &session)
Delete any saved public/private key associated with this node.
Definition Wallet.cpp:95
+
void clearNodeIdentity(soci::session &session)
Delete any saved public/private key associated with this node.
Definition Wallet.cpp:96
std::optional< Seed > parseGenericSeed(std::string const &str, bool rfc1751=true)
Attempt to parse a string as a seed.
Definition Seed.cpp:78
diff --git a/NodeIdentity_8h_source.html b/NodeIdentity_8h_source.html index b4c86cbfe5..64c21ef238 100644 --- a/NodeIdentity_8h_source.html +++ b/NodeIdentity_8h_source.html @@ -93,11 +93,11 @@ $(document).ready(function() { init_codefold(0); });
10namespace xrpl {
11
-
18getNodeIdentity(Application& app, boost::program_options::variables_map const& cmdline);
+
18getNodeIdentity(Application& app, boost::program_options::variables_map const& cmdline);
19
20} // namespace xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
std::pair< PublicKey, SecretKey > getNodeIdentity(Application &app, boost::program_options::variables_map const &cmdline)
The cryptographic credentials identifying this server instance.
+
std::pair< PublicKey, SecretKey > getNodeIdentity(soci::session &session)
Returns a stable public and private key for this node.
Definition Wallet.cpp:102
diff --git a/Node_8cpp_source.html b/Node_8cpp_source.html index 9e84336a78..ac6ae4ce77 100644 --- a/Node_8cpp_source.html +++ b/Node_8cpp_source.html @@ -88,12 +88,12 @@ $(document).ready(function() { init_codefold(0); });
5#include <xrpld/app/ledger/TransactionMaster.h>
6#include <xrpld/app/rdb/RelationalDatabase.h>
7#include <xrpld/app/rdb/backend/detail/Node.h>
-
8#include <xrpld/core/DatabaseCon.h>
-
9#include <xrpld/core/SociDB.h>
-
10
-
11#include <xrpl/basics/BasicConfig.h>
-
12#include <xrpl/basics/StringUtilities.h>
-
13#include <xrpl/json/to_string.h>
+
8
+
9#include <xrpl/basics/BasicConfig.h>
+
10#include <xrpl/basics/StringUtilities.h>
+
11#include <xrpl/json/to_string.h>
+
12#include <xrpl/rdb/DatabaseCon.h>
+
13#include <xrpl/rdb/SociDB.h>
14
15#include <boost/range/adaptor/transformed.hpp>
16
@@ -145,8 +145,8 @@ $(document).ready(function() { init_codefold(0); });
64 tx->getSession() << boost::str(
65 boost::format("PRAGMA cache_size=-%d;") % kilobytes(config.getValueFor(SizedItem::txnDBCache)));
66
-
67 if (!setup.standAlone || setup.startUp == Config::LOAD || setup.startUp == Config::LOAD_FILE ||
-
68 setup.startUp == Config::REPLAY)
+
67 if (!setup.standAlone || setup.startUp == StartUpType::LOAD || setup.startUp == StartUpType::LOAD_FILE ||
+
69 {
70 // Check if AccountTransactions has primary key
71 std::string cid, name, type;
@@ -257,7 +257,7 @@ $(document).ready(function() { init_codefold(0); });
162 std::shared_ptr<Ledger const> const& ledger,
163 bool current)
164{
-
165 auto j = app.journal("Ledger");
+
165 auto j = app.journal("Ledger");
166 auto seq = ledger->header().seq;
167
168 // TODO(tom): Fix this hard-coded SQL!
@@ -1275,16 +1275,12 @@ $(document).ready(function() { init_codefold(0); });
Stream warn() const
Definition Journal.h:312
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
- -
uint32_t NETWORK_ID
Definition Config.h:137
-
bool useTxTables() const
Definition Config.h:317
- - - + +
uint32_t NETWORK_ID
Definition Config.h:138
+
bool useTxTables() const
Definition Config.h:318
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1015
- -
LockedSociSession checkoutDb()
+ +
LockedSociSession checkoutDb()
void failedSave(std::uint32_t seq, uint256 const &hash)
std::chrono::time_point< NetClock > time_point
Definition chrono.h:45
@@ -1301,6 +1297,7 @@ $(document).ready(function() { init_codefold(0); });
virtual NodeStore::Database & getNodeStore()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
+
virtual beast::Journal journal(std::string const &name)=0
bool inLedger(uint256 const &hash, std::uint32_t ledger, std::optional< uint32_t > tseq, std::optional< uint32_t > netID)
static Transaction::pointer transactionFromSQL(boost::optional< std::uint64_t > const &ledgerSeq, boost::optional< std::string > const &status, Blob const &rawTxn, Application &app)
@@ -1358,14 +1355,14 @@ $(document).ready(function() { init_codefold(0); });
constexpr std::array< char const *, 8 > TxDBInit
Definition DBInit.h:52
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition AccountID.cpp:92
@ hotLEDGER
Definition NodeObject.h:14
-
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:924
+
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition Ledger.cpp:923
@ current
This was a new validation and was added.
base_uint< 256 > uint256
Definition base_uint.h:526
constexpr auto megabytes(T value) noexcept
-
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
+
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition Config.cpp:1043
std::uint32_t LedgerIndex
A ledger index.
Definition Protocol.h:254
void addRaw(LedgerHeader const &, Serializer &, bool includeHash=false)
std::vector< unsigned char > Blob
Storage for linear binary data.
Definition Blob.h:10
@@ -1380,7 +1377,10 @@ $(document).ready(function() { init_codefold(0); });
constexpr auto LgrDBName
Definition DBInit.h:23
constexpr std::array< char const *, 5 > LgrDBInit
Definition DBInit.h:25
bool isPseudoTx(STObject const &tx)
Check whether a transaction is a pseudo-transaction.
Definition STTx.cpp:776
-
void convert(soci::blob &from, std::vector< std::uint8_t > &to)
Definition SociDB.cpp:126
+ + + +
void convert(soci::blob &from, std::vector< std::uint8_t > &to)
Definition SociDB.cpp:124
error_code_i
Definition ErrorCodes.h:20
@ rpcDB_DESERIALIZATION
Definition ErrorCodes.h:114
@@ -1394,12 +1394,12 @@ $(document).ready(function() { init_codefold(0); });
T str(T... args)
- - -
std::array< std::string, 4 > txPragma
Definition DatabaseCon.h:89
-
Config::StartUpType startUp
Definition DatabaseCon.h:71
- -
std::array< std::string, 1 > lgrPragma
Definition DatabaseCon.h:90
+ + +
std::array< std::string, 4 > txPragma
Definition DatabaseCon.h:88
+ + +
std::array< std::string, 1 > lgrPragma
Definition DatabaseCon.h:89
diff --git a/Node_8h_source.html b/Node_8h_source.html index c9583de124..55b3e19ccf 100644 --- a/Node_8h_source.html +++ b/Node_8h_source.html @@ -225,8 +225,8 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
- - + + @@ -271,8 +271,8 @@ $(document).ready(function() { init_codefold(0); }); - - + + diff --git a/OfferStream_8cpp_source.html b/OfferStream_8cpp_source.html index ad70a5e4c8..280a433e8f 100644 --- a/OfferStream_8cpp_source.html +++ b/OfferStream_8cpp_source.html @@ -139,7 +139,7 @@ $(document).ready(function() { init_codefold(0); });
53
54 if (p == nullptr)
55 {
-
56 JLOG(j_.error()) << "Missing directory " << tip_.dir() << " for offer " << tip_.index();
+
56 JLOG(j_.error()) << "Missing directory " << tip_.dir() << " for offer " << tip_.index();
57 return;
58 }
59
@@ -149,7 +149,7 @@ $(document).ready(function() { init_codefold(0); });
63 if (it == v.end())
64 {
-
65 JLOG(j_.error()) << "Missing offer " << tip_.index() << " for directory " << tip_.dir();
+
65 JLOG(j_.error()) << "Missing offer " << tip_.index() << " for directory " << tip_.dir();
66 return;
67 }
68
@@ -159,7 +159,7 @@ $(document).ready(function() { init_codefold(0); });
71 view.update(p);
-
73 JLOG(j_.trace()) << "Missing offer " << tip_.index() << " removed from directory " << tip_.dir();
+
73 JLOG(j_.trace()) << "Missing offer " << tip_.index() << " removed from directory " << tip_.dir();
74}
75
76static STAmount
@@ -311,7 +311,7 @@ $(document).ready(function() { init_codefold(0); });
213 using tp = NetClock::time_point;
214 if (entry->isFieldPresent(sfExpiration) && tp{d{(*entry)[sfExpiration]}} <= expire_)
215 {
-
216 JLOG(j_.trace()) << "Removing expired offer " << entry->key();
+
216 JLOG(j_.trace()) << "Removing expired offer " << entry->key();
217 permRmOffer(entry->key());
218 continue;
219 }
@@ -323,7 +323,7 @@ $(document).ready(function() { init_codefold(0); });
225 // Remove if either amount is zero
226 if (amount.empty())
227 {
-
228 JLOG(j_.warn()) << "Removing bad offer " << entry->key();
+
228 JLOG(j_.warn()) << "Removing bad offer " << entry->key();
229 permRmOffer(entry->key());
230 offer_ = TOffer<TIn, TOut>{};
231 continue;
@@ -333,7 +333,7 @@ $(document).ready(function() { init_codefold(0); });
235 isDeepFrozen(view_, offer_.owner(), offer_.issueIn().currency, offer_.issueIn().account);
236 if (deepFrozen)
237 {
-
238 JLOG(j_.trace()) << "Removing deep frozen unfunded offer " << entry->key();
+
238 JLOG(j_.trace()) << "Removing deep frozen unfunded offer " << entry->key();
239 permRmOffer(entry->key());
240 offer_ = TOffer<TIn, TOut>{};
241 continue;
@@ -342,7 +342,7 @@ $(document).ready(function() { init_codefold(0); });
244 if (entry->isFieldPresent(sfDomainID) &&
245 !permissioned_dex::offerInDomain(view_, entry->key(), entry->getFieldH256(sfDomainID), j_))
246 {
-
247 JLOG(j_.trace()) << "Removing offer no longer in domain " << entry->key();
+
247 JLOG(j_.trace()) << "Removing offer no longer in domain " << entry->key();
248 permRmOffer(entry->key());
249 offer_ = TOffer<TIn, TOut>{};
250 continue;
@@ -363,11 +363,11 @@ $(document).ready(function() { init_codefold(0); });
265 if (original_funds == *ownerFunds_)
266 {
267 permRmOffer(entry->key());
-
268 JLOG(j_.trace()) << "Removing unfunded offer " << entry->key();
+
268 JLOG(j_.trace()) << "Removing unfunded offer " << entry->key();
269 }
270 else
271 {
-
272 JLOG(j_.trace()) << "Removing became unfunded offer " << entry->key();
+
272 JLOG(j_.trace()) << "Removing became unfunded offer " << entry->key();
273 }
274 offer_ = TOffer<TIn, TOut>{};
275 // See comment at top of loop for how the offer is removed
@@ -416,11 +416,11 @@ $(document).ready(function() { init_codefold(0); });
318 if (original_funds == *ownerFunds_)
319 {
320 permRmOffer(entry->key());
-
321 JLOG(j_.trace()) << "Removing tiny offer due to reduced quality " << entry->key();
+
321 JLOG(j_.trace()) << "Removing tiny offer due to reduced quality " << entry->key();
322 }
323 else
324 {
-
325 JLOG(j_.trace()) << "Removing tiny offer that became tiny due "
+
325 JLOG(j_.trace()) << "Removing tiny offer that became tiny due "
326 "to reduced quality "
327 << entry->key();
328 }
@@ -470,6 +470,9 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
+
Stream error() const
Definition Journal.h:318
+
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
+
Stream warn() const
Definition Journal.h:312
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:114
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
diff --git a/OrderBookDB_8cpp_source.html b/OrderBookDB_8cpp_source.html index 7d2c49d7b6..76d8ddb9b9 100644 --- a/OrderBookDB_8cpp_source.html +++ b/OrderBookDB_8cpp_source.html @@ -167,7 +167,7 @@ $(document).ready(function() { init_codefold(0); });
79 {
80 for (auto& sle : ledger->sles)
81 {
-
82 if (app_.isStopping())
+
82 if (app_.isStopping())
83 {
84 JLOG(j_.info()) << "Update halted because the process is stopping";
85 seq_.store(0);
@@ -418,13 +418,12 @@ $(document).ready(function() { init_codefold(0); });
TxMeta const & getMeta() const
virtual Config & config()=0
-
virtual bool isStopping() const =0
Specifies an order book.
Definition Book.h:16
Issue in
Definition Book.h:18
std::optional< uint256 > domain
Definition Book.h:20
Issue out
Definition Book.h:19
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
bool standalone() const
Definition Config.h:311
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
bool standalone() const
Definition Config.h:312
A currency issued by an account.
Definition Issue.h:13
Currency currency
Definition Issue.h:15
AccountID account
Definition Issue.h:16
@@ -456,6 +455,7 @@ $(document).ready(function() { init_codefold(0); });
virtual JobQueue & getJobQueue()=0
virtual NetworkOPs & getOPs()=0
virtual LedgerMaster & getLedgerMaster()=0
+
virtual bool isStopping() const =0
STArray & getNodes()
Definition TxMeta.h:69
T emplace_back(T... args)
T end(T... args)
diff --git a/OverlayImpl_8cpp_source.html b/OverlayImpl_8cpp_source.html index fe9ab5ebd3..bf6932d5ba 100644 --- a/OverlayImpl_8cpp_source.html +++ b/OverlayImpl_8cpp_source.html @@ -86,23 +86,23 @@ $(document).ready(function() { init_codefold(0); });
3#include <xrpld/app/misc/ValidatorList.h>
4#include <xrpld/app/misc/ValidatorSite.h>
5#include <xrpld/app/rdb/RelationalDatabase.h>
-
6#include <xrpld/app/rdb/Wallet.h>
-
7#include <xrpld/overlay/Cluster.h>
-
8#include <xrpld/overlay/detail/ConnectAttempt.h>
-
9#include <xrpld/overlay/detail/PeerImp.h>
-
10#include <xrpld/overlay/detail/TrafficCount.h>
-
11#include <xrpld/overlay/detail/Tuning.h>
-
12#include <xrpld/overlay/predicates.h>
-
13#include <xrpld/peerfinder/make_Manager.h>
-
14#include <xrpld/rpc/handlers/GetCounts.h>
-
15#include <xrpld/rpc/json_body.h>
-
16
-
17#include <xrpl/basics/base64.h>
-
18#include <xrpl/basics/make_SSLContext.h>
-
19#include <xrpl/basics/random.h>
-
20#include <xrpl/beast/core/LexicalCast.h>
-
21#include <xrpl/protocol/STTx.h>
-
22#include <xrpl/server/SimpleWriter.h>
+
6#include <xrpld/overlay/Cluster.h>
+
7#include <xrpld/overlay/detail/ConnectAttempt.h>
+
8#include <xrpld/overlay/detail/PeerImp.h>
+
9#include <xrpld/overlay/detail/TrafficCount.h>
+
10#include <xrpld/overlay/detail/Tuning.h>
+
11#include <xrpld/overlay/predicates.h>
+
12#include <xrpld/peerfinder/make_Manager.h>
+
13#include <xrpld/rpc/handlers/GetCounts.h>
+
14#include <xrpld/rpc/json_body.h>
+
15
+
16#include <xrpl/basics/base64.h>
+
17#include <xrpl/basics/make_SSLContext.h>
+
18#include <xrpl/basics/random.h>
+
19#include <xrpl/beast/core/LexicalCast.h>
+
20#include <xrpl/protocol/STTx.h>
+
21#include <xrpl/server/SimpleWriter.h>
+
22#include <xrpl/server/Wallet.h>
23
24#include <boost/algorithm/string/predicate.hpp>
25#include <boost/asio/executor_work_guard.hpp>
@@ -231,7 +231,7 @@ $(document).ready(function() { init_codefold(0); });
131 endpoint_type remote_endpoint)
132{
133 auto const id = next_id_++;
-
134 beast::WrappedSink sink(app_.logs()["Peer"], makePrefix(id));
+
134 beast::WrappedSink sink(app_.logs()["Peer"], makePrefix(id));
135 beast::Journal journal(sink);
136
137 Handoff handoff;
@@ -460,7 +460,7 @@ $(document).ready(function() { init_codefold(0); });
351 next_id_++,
352 slot,
-
353 app_.journal("Peer"),
+
353 app_.journal("Peer"),
354 *this);
355
@@ -701,7 +701,7 @@ $(document).ready(function() { init_codefold(0); });
580 if (app_.validators().listed(mo->masterKey))
581 {
582 auto db = app_.getWalletDB().checkoutDb();
-
583 addValidatorManifest(*db, serialized);
+
583 addValidatorManifest(*db, serialized);
584 }
585 }
586 }
@@ -1693,26 +1693,24 @@ $(document).ready(function() { init_codefold(0); });
Wraps a Journal::Sink to prefix its output with a string.
Definition WrappedSink.h:14
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
virtual std::optional< PublicKey const > getValidationPublicKey() const =0
-
virtual Logs & logs()=0
Holds unparsed configuration information.
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
Section & section(std::string const &name)
Returns the section with the given name.
std::optional< std::string > member(PublicKey const &node) const
Determines whether a node belongs in the cluster.
Definition Cluster.cpp:19
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:238
-
std::vector< std::string > IPS
Definition Config.h:122
-
bool standalone() const
Definition Config.h:311
-
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:251
-
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:245
-
std::vector< std::string > IPS_FIXED
Definition Config.h:125
-
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:248
-
LockedSociSession checkoutDb()
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
+
std::vector< std::string > IPS
Definition Config.h:124
+
bool standalone() const
Definition Config.h:312
+
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:252
+
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
+
std::vector< std::string > IPS_FIXED
Definition Config.h:127
+
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:249
+
LockedSociSession checkoutDb()
std::optional< std::set< PeerShortID > > shouldRelay(uint256 const &key)
Determines whether the hashed item should be relayed.
virtual void pubManifest(Manifest const &)=0
void for_each_manifest(Function &&f) const
Invokes the callback once for every populated manifest.
Definition Manifest.h:388
-
ManifestDisposition applyManifest(Manifest m)
Add manifest to cache.
Definition Manifest.cpp:344
+
ManifestDisposition applyManifest(Manifest m)
Add manifest to cache.
Definition Manifest.cpp:343
std::uint32_t sequence() const
A monotonically increasing number used to detect new manifests.
Definition Manifest.h:244
virtual Json::Value getServerInfo(bool human, bool admin, bool counters)=0
@@ -1811,6 +1809,7 @@ $(document).ready(function() { init_codefold(0); });
void setup(Setup const &setup, beast::Journal journal)
+
virtual Logs & logs()=0
virtual ValidatorList & validators()=0
virtual NetworkOPs & getOPs()=0
virtual PeerReservationTable & peerReservations()=0
@@ -1818,6 +1817,7 @@ $(document).ready(function() { init_codefold(0); });
virtual HashRouter & getHashRouter()=0
virtual ValidatorSite & validatorSites()=0
virtual ManifestCache & validatorManifests()=0
+
virtual beast::Journal journal(std::string const &name)=0
void addCount(category cat, bool inbound, int bytes)
Account for traffic associated with the given category.
auto const & getCounts() const
An up-to-date copy of all the counters.
@@ -1868,10 +1868,10 @@ $(document).ready(function() { init_codefold(0); });
std::optional< ProtocolVersion > negotiateProtocolVersion(std::vector< ProtocolVersion > const &versions)
Given a list of supported protocol versions, choose the one we prefer.
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
Definition Handoff.h:12
std::shared_ptr< boost::asio::ssl::context > make_SSLContext(std::string const &cipherList)
Create a self-signed SSL context that allows anonymous Diffie Hellman.
-
void addValidatorManifest(soci::session &session, std::string const &serialized)
addValidatorManifest Saves the manifest of a validator to the database.
Definition Wallet.cpp:87
std::string base64_encode(std::uint8_t const *data, std::size_t len)
Json::Value getCountsJson(Application &app, int minObjectCount)
Definition GetCounts.cpp:39
-
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition Manifest.cpp:35
+
void addValidatorManifest(soci::session &session, std::string const &serialized)
addValidatorManifest Saves the manifest of a validator to the database.
Definition Wallet.cpp:88
+
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition Manifest.cpp:34
beast::xor_shift_engine & default_prng()
Return the default random engine.
@ manifest
Manifest.
constexpr Number squelch(Number const &x, Number const &limit) noexcept
Definition Number.h:737
diff --git a/PathFind_8cpp_source.html b/PathFind_8cpp_source.html index c1c74cb12f..d52f6a83a9 100644 --- a/PathFind_8cpp_source.html +++ b/PathFind_8cpp_source.html @@ -152,7 +152,7 @@ $(document).ready(function() { init_codefold(0); });
std::string asString() const
Returns the unquoted string value.
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
-
int PATH_SEARCH_MAX
Definition Config.h:179
+
int PATH_SEARCH_MAX
Definition Config.h:180
void clearRequest()
Definition InfoSub.cpp:101
void setApiVersion(unsigned int apiVersion)
Definition InfoSub.cpp:119
std::shared_ptr< InfoSubRequest > const & getRequest()
Definition InfoSub.cpp:113
diff --git a/PathRequest_8cpp_source.html b/PathRequest_8cpp_source.html index 5a74c34ba4..ae87e4551b 100644 --- a/PathRequest_8cpp_source.html +++ b/PathRequest_8cpp_source.html @@ -643,7 +643,7 @@ $(document).ready(function() { init_codefold(0); });
531 *raSrcAccount, // --> Account sending from.
532 ps, // --> Path set.
533 domain, // --> Domain.
-
534 app_.logs(),
+
534 app_.logs(),
535 &rcInput);
536
537 if (!convert_all_ && !fullLiquidityPath.empty() &&
@@ -662,7 +662,7 @@ $(document).ready(function() { init_codefold(0); });
550 *raSrcAccount, // --> Account sending from.
551 ps, // --> Path set.
552 domain, // --> Domain.
-
553 app_.logs());
+
553 app_.logs());
554
555 if (rc.result() != tesSUCCESS)
556 {
@@ -834,10 +834,9 @@ $(document).ready(function() { init_codefold(0); });
Stream warn() const
Definition Journal.h:312
virtual Config & config()=0
-
virtual Logs & logs()=0
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
int PATH_SEARCH_FAST
Definition Config.h:178
-
int PATH_SEARCH
Definition Config.h:177
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
int PATH_SEARCH_FAST
Definition Config.h:179
+
int PATH_SEARCH
Definition Config.h:178
A currency issued by an account.
Definition Issue.h:13
Currency currency
Definition Issue.h:15
bool isLoadedLocal() const
@@ -898,6 +897,7 @@ $(document).ready(function() { init_codefold(0); });
AccountID const & getIssuer() const
Definition STAmount.h:466
bool empty() const
Definition STPathSet.h:363
+
virtual Logs & logs()=0
virtual LoadFeeTrack & getFeeTrack()=0
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition base_uint.h:471
diff --git a/PathRequest_8h_source.html b/PathRequest_8h_source.html index 4aeaba1b55..c72fa72173 100644 --- a/PathRequest_8h_source.html +++ b/PathRequest_8h_source.html @@ -240,7 +240,7 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
Tracks the number of instances of an object.
- +
Json::Value doUpdate(std::shared_ptr< RippleLineCache > const &, bool fast, std::function< bool(void)> const &continueCallback={})
std::optional< AccountID > raDstAccount
diff --git a/PathRequests_8cpp_source.html b/PathRequests_8cpp_source.html index 9c041f5552..207d78022b 100644 --- a/PathRequests_8cpp_source.html +++ b/PathRequests_8cpp_source.html @@ -116,7 +116,7 @@ $(document).ready(function() { init_codefold(0); });
35 // Assign to the local before the member, because the member is a
36 // weak_ptr, and will immediately discard it if there are no other
37 // references.
-
38 lineCache_ = lineCache = std::make_shared<RippleLineCache>(ledger, app_.journal("RippleLineCache"));
+
38 lineCache_ = lineCache = std::make_shared<RippleLineCache>(ledger, app_.journal("RippleLineCache"));
39 }
40 return lineCache;
41}
@@ -359,7 +359,7 @@ $(document).ready(function() { init_codefold(0); });
266 std::shared_ptr<ReadView const> const& inLedger,
267 Json::Value const& request)
268{
-
269 auto cache = std::make_shared<RippleLineCache>(inLedger, app_.journal("RippleLineCache"));
+
269 auto cache = std::make_shared<RippleLineCache>(inLedger, app_.journal("RippleLineCache"));
270
271 auto req = std::make_shared<PathRequest>(app_, [] {}, consumer, ++mLastIdentifier, *this, mJournal);
272
@@ -375,7 +375,6 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:130
Stream debug() const
Definition Journal.h:300
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
-
virtual beast::Journal journal(std::string const &name)=0
bool isStopping() const
Definition JobQueue.h:208
std::unique_ptr< LoadEvent > makeLoadEvent(JobType t, std::string const &name)
Return a scoped LoadEvent.
Definition JobQueue.cpp:143
@@ -396,6 +395,7 @@ $(document).ready(function() { init_codefold(0); });
An endpoint that consumes resources.
Definition Consumer.h:16
virtual JobQueue & getJobQueue()=0
virtual LedgerMaster & getLedgerMaster()=0
+
virtual beast::Journal journal(std::string const &name)=0
T find_if(T... args)
diff --git a/Pathfinder_8cpp_source.html b/Pathfinder_8cpp_source.html index 12a2627621..cb9ec77251 100644 --- a/Pathfinder_8cpp_source.html +++ b/Pathfinder_8cpp_source.html @@ -450,7 +450,7 @@ $(document).ready(function() { init_codefold(0); });
362 }
363 catch (std::exception const& e)
364 {
-
365 JLOG(j_.info()) << "checkpath: exception (" << e.what() << ") " << path.getJson(JsonOptions::none);
+
365 JLOG(j_.info()) << "checkpath: exception (" << e.what() << ") " << path.getJson(JsonOptions::none);
366 return tefEXCEPTION;
367 }
368}
@@ -477,7 +477,7 @@ $(document).ready(function() { init_codefold(0); });
388 STPathSet(),
389 mDomain,
-
390 app_.logs(),
+
390 app_.logs(),
391 &rcInput);
392
393 if (rc.result() == tesSUCCESS)
@@ -1351,7 +1351,6 @@ $(document).ready(function() { init_codefold(0); });
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
Stream warn() const
Definition Journal.h:312
-
virtual Logs & logs()=0
A currency issued by an account.
Definition Issue.h:13
Currency currency
Definition Issue.h:15
@@ -1440,6 +1439,7 @@ $(document).ready(function() { init_codefold(0); });
void emplace_back(Args &&... args)
Definition STPathSet.h:376
std::vector< STPathElement >::const_reference back() const
Definition STPathSet.h:400
std::vector< STPathElement >::const_iterator begin() const
Definition STPathSet.h:382
+
virtual Logs & logs()=0
virtual JobQueue & getJobQueue()=0
virtual OrderBookDB & getOrderBookDB()=0
diff --git a/PayChanClaim_8cpp_source.html b/PayChanClaim_8cpp_source.html index 22f06ef1bb..e174bb9d09 100644 --- a/PayChanClaim_8cpp_source.html +++ b/PayChanClaim_8cpp_source.html @@ -224,7 +224,7 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:130
virtual Config & config()=0
-
bool canSign() const
Definition Config.h:323
+
bool canSign() const
Definition Config.h:324
A public key.
Definition PublicKey.h:42
A secret key.
Definition SecretKey.h:18
diff --git a/PayChan_8cpp_source.html b/PayChan_8cpp_source.html index 38ec5245a5..acc91de3b3 100644 --- a/PayChan_8cpp_source.html +++ b/PayChan_8cpp_source.html @@ -408,7 +408,7 @@ $(document).ready(function() { init_codefold(0); });
310 auto const cancelAfter = (*slep)[~sfCancelAfter];
311 auto const closeTime = ctx_.view().header().parentCloseTime.time_since_epoch().count();
312 if ((cancelAfter && closeTime >= *cancelAfter) || (expiration && closeTime >= *expiration))
-
313 return closeChannel(slep, ctx_.view(), k.key, ctx_.app.journal("View"));
+
313 return closeChannel(slep, ctx_.view(), k.key, ctx_.app.journal("View"));
314 }
315
316 if (src != txAccount)
@@ -564,7 +564,7 @@ $(document).ready(function() { init_codefold(0); });
456 auto const cancelAfter = (*slep)[~sfCancelAfter];
457 auto const closeTime = ctx_.view().header().parentCloseTime.time_since_epoch().count();
458 if ((cancelAfter && closeTime >= *cancelAfter) || (curExpiration && closeTime >= *curExpiration))
-
459 return closeChannel(slep, ctx_.view(), k.key, ctx_.app.journal("View"));
+
459 return closeChannel(slep, ctx_.view(), k.key, ctx_.app.journal("View"));
460 }
461
462 if (txAccount != src && txAccount != dst)
@@ -621,7 +621,7 @@ $(document).ready(function() { init_codefold(0); });
513 {
514 // Channel will close immediately if dry or the receiver closes
515 if (dst == txAccount || (*slep)[sfBalance] == (*slep)[sfAmount])
-
516 return closeChannel(slep, ctx_.view(), k.key, ctx_.app.journal("View"));
+
516 return closeChannel(slep, ctx_.view(), k.key, ctx_.app.journal("View"));
517
518 auto const settleExpiration =
519 ctx_.view().header().parentCloseTime.time_since_epoch().count() + (*slep)[sfSettleDelay];
@@ -640,7 +640,6 @@ $(document).ready(function() { init_codefold(0); });
531} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
Stream fatal() const
Definition Journal.h:324
-
virtual beast::Journal journal(std::string const &name)=0
STTx const & tx
beast::Journal const journal
ApplyView & view()
@@ -675,6 +674,7 @@ $(document).ready(function() { init_codefold(0); });
std::uint32_t getSeqValue() const
Returns the first non-zero value of (Sequence, TicketSequence).
Definition STTx.cpp:208
Slice slice() const noexcept
Definition Serializer.h:44
+
virtual beast::Journal journal(std::string const &name)=0
static TER preclaim(PreclaimContext const &ctx)
Definition Transactor.h:198
ApplyContext & ctx_
Definition Transactor.h:108
diff --git a/PayStrand__test_8cpp_source.html b/PayStrand__test_8cpp_source.html index 20abad79fa..3e786f77fe 100644 --- a/PayStrand__test_8cpp_source.html +++ b/PayStrand__test_8cpp_source.html @@ -752,7 +752,7 @@ $(document).ready(function() { init_codefold(0); });
596 ammContext,
-
598 env.app().logs().journal("Flow"));
+
598 env.app().logs().journal("Flow"));
599 BEAST_EXPECT(ter == expTer);
600 if (sizeof...(expSteps) != 0)
601 BEAST_EXPECT(equal(strand, std::forward<decltype(expSteps)>(expSteps)...));
@@ -779,7 +779,7 @@ $(document).ready(function() { init_codefold(0); });
623 ammContext,
-
625 env.app().logs().journal("Flow"));
+
625 env.app().logs().journal("Flow"));
626 (void)_;
627 BEAST_EXPECT(ter == tesSUCCESS);
628 }
@@ -797,7 +797,7 @@ $(document).ready(function() { init_codefold(0); });
641 ammContext,
-
643 env.app().logs().journal("Flow"));
+
643 env.app().logs().journal("Flow"));
644 (void)_;
645 BEAST_EXPECT(ter == tesSUCCESS);
646 }
@@ -892,7 +892,7 @@ $(document).ready(function() { init_codefold(0); });
735
736 {
737 // The root account can't be the src or dst
-
738 auto flowJournal = env.app().logs().journal("Flow");
+
738 auto flowJournal = env.app().logs().journal("Flow");
739 {
740 // The root account can't be the dst
741 auto r = toStrand(
@@ -1063,7 +1063,7 @@ $(document).ready(function() { init_codefold(0); });
907 ammContext,
-
909 env.app().logs().journal("Flow"));
+
909 env.app().logs().journal("Flow"));
910 BEAST_EXPECT(ter == tesSUCCESS);
911 BEAST_EXPECT(equal(strand, D{alice, gw, usdC}));
912 }
@@ -1091,7 +1091,7 @@ $(document).ready(function() { init_codefold(0); });
935 ammContext,
-
937 env.app().logs().journal("Flow"));
+
937 env.app().logs().journal("Flow"));
938 BEAST_EXPECT(ter == tesSUCCESS);
939 BEAST_EXPECT(equal(strand, D{alice, gw, usdC}, B{USD.issue(), xrpIssue(), std::nullopt}, XRPS{bob}));
940 }
@@ -1267,22 +1267,22 @@ $(document).ready(function() { init_codefold(0); });
1104 PaymentSandbox sb{env.current().get(), tapNONE};
1105 {
-
1107 sb, sendMax, deliver, dstAcc, noAccount(), pathSet, std::nullopt, env.app().logs(), &inputs);
+
1107 sb, sendMax, deliver, dstAcc, noAccount(), pathSet, std::nullopt, env.app().logs(), &inputs);
1108 BEAST_EXPECT(r.result() == temBAD_PATH);
1109 }
1110 {
-
1112 sb, sendMax, deliver, noAccount(), srcAcc, pathSet, std::nullopt, env.app().logs(), &inputs);
+
1112 sb, sendMax, deliver, noAccount(), srcAcc, pathSet, std::nullopt, env.app().logs(), &inputs);
1113 BEAST_EXPECT(r.result() == temBAD_PATH);
1114 }
1115 {
-
1117 sb, noAccountAmount, deliver, dstAcc, srcAcc, pathSet, std::nullopt, env.app().logs(), &inputs);
+
1117 sb, noAccountAmount, deliver, dstAcc, srcAcc, pathSet, std::nullopt, env.app().logs(), &inputs);
1118 BEAST_EXPECT(r.result() == temBAD_PATH);
1119 }
1120 {
-
1122 sb, sendMax, noAccountAmount, dstAcc, srcAcc, pathSet, std::nullopt, env.app().logs(), &inputs);
+
1122 sb, sendMax, noAccountAmount, dstAcc, srcAcc, pathSet, std::nullopt, env.app().logs(), &inputs);
1123 BEAST_EXPECT(r.result() == temBAD_PATH);
1124 }
1125 }
@@ -1324,7 +1324,6 @@ $(document).ready(function() { init_codefold(0); });
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:516
Maintains AMM info per overall payment engine execution and individual iteration.
Definition AMMContext.h:16
-
virtual Logs & logs()=0
Specifies an order book.
Definition Book.h:16
A currency issued by an account.
Definition Issue.h:13
@@ -1343,6 +1342,7 @@ $(document).ready(function() { init_codefold(0); }); +
virtual Logs & logs()=0
static Output rippleCalculate(PaymentSandbox &view, STAmount const &saMaxAmountReq, STAmount const &saDstAmountReq, AccountID const &uDstAccountID, AccountID const &uSrcAccountID, STPathSet const &spsPaths, std::optional< uint256 > const &domainID, Logs &l, Input const *const pInputs=nullptr)
diff --git a/PaymentSandbox__test_8cpp_source.html b/PaymentSandbox__test_8cpp_source.html index fe202de079..06ff53e431 100644 --- a/PaymentSandbox__test_8cpp_source.html +++ b/PaymentSandbox__test_8cpp_source.html @@ -172,7 +172,7 @@ $(document).ready(function() { init_codefold(0); });
85
86 env.fund(XRP(10000), alice, gw1, gw2);
87
-
88 auto j = env.app().journal("View");
+
88 auto j = env.app().journal("View");
89
90 auto const USD_gw1 = gw1["USD"];
91 auto const USD_gw2 = gw2["USD"];
@@ -446,7 +446,6 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
A testsuite class.
Definition suite.h:51
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
-
virtual beast::Journal journal(std::string const &name)=0
Editable, discardable view that can build metadata for one tx.
A currency issued by an account.
Definition Issue.h:13
@@ -460,6 +459,7 @@ $(document).ready(function() { init_codefold(0); });
static int const cMaxOffset
Definition STAmount.h:46
static constexpr std::uint64_t cMinValue
Definition STAmount.h:49
static int const cMinOffset
Definition STAmount.h:45
+
virtual beast::Journal journal(std::string const &name)=0
diff --git a/Payment_8cpp_source.html b/Payment_8cpp_source.html index 2e674883dc..670d23399d 100644 --- a/Payment_8cpp_source.html +++ b/Payment_8cpp_source.html @@ -512,7 +512,7 @@ $(document).ready(function() { init_codefold(0); });
414 account_,
415 ctx_.tx.getFieldPathSet(sfPaths),
416 ctx_.tx[~sfDomainID],
-
417 ctx_.app.logs(),
+
417 ctx_.app.logs(),
418 &rcInput);
419 // VFALCO NOTE We might not need to apply, depending
420 // on the TER. But always applying *should*
@@ -698,7 +698,6 @@ $(document).ready(function() { init_codefold(0); });
T any_of(T... args)
Stream debug() const
Definition Journal.h:300
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
-
virtual Logs & logs()=0
STTx const & tx
void deliver(STAmount const &amount)
Sets the DeliveredAmount field in the metadata.
beast::Journal const journal
@@ -748,6 +747,7 @@ $(document).ready(function() { init_codefold(0); });
uint256 getTransactionID() const
Definition STTx.h:192
+
virtual Logs & logs()=0
AccountID const account_
Definition Transactor.h:112
beast::Journal const j_
Definition Transactor.h:110
diff --git a/PeerFinder_8cpp_source.html b/PeerFinder_8cpp_source.html index d3b6a8f14a..2648553403 100644 --- a/PeerFinder_8cpp_source.html +++ b/PeerFinder_8cpp_source.html @@ -334,8 +334,8 @@ $(document).ready(function() { init_codefold(0); });
Stream info() const
Definition Journal.h:306
Holds unparsed configuration information.
DBConfig is used when a client wants to delay opening a soci::session after parsing the config parame...
Definition SociDB.h:40
-
void open(soci::session &s) const
Definition SociDB.cpp:69
-
std::string connectionString() const
Definition SociDB.cpp:63
+
void open(soci::session &s) const
Definition SociDB.cpp:67
+
std::string connectionString() const
Definition SociDB.cpp:61
T emplace_back(T... args)
T empty(T... args)
T cend(T... args)
diff --git a/PeerFinder_8h_source.html b/PeerFinder_8h_source.html index 93805dfd56..fae6c03d42 100644 --- a/PeerFinder_8h_source.html +++ b/PeerFinder_8h_source.html @@ -84,24 +84,25 @@ $(document).ready(function() { init_codefold(0); });
1#pragma once
2
3#include <xrpld/core/Config.h>
-
4#include <xrpld/core/DatabaseCon.h>
-
5#include <xrpld/peerfinder/detail/Store.h>
-
6
-
7namespace xrpl {
-
8
-
15void
-
16initPeerFinderDB(soci::session& session, BasicConfig const& config, beast::Journal j);
-
17
-
24void
-
25updatePeerFinderDB(soci::session& session, int currentSchemaVersion, beast::Journal j);
-
26
-
33void
-
34readPeerFinderDB(soci::session& session, std::function<void(std::string const&, int)> const& func);
-
35
-
41void
-
42savePeerFinderDB(soci::session& session, std::vector<PeerFinder::Store::Entry> const& v);
-
43
-
44} // namespace xrpl
+
4#include <xrpld/peerfinder/detail/Store.h>
+
5
+
6#include <xrpl/rdb/DatabaseCon.h>
+
7
+
8namespace xrpl {
+
9
+
16void
+
17initPeerFinderDB(soci::session& session, BasicConfig const& config, beast::Journal j);
+
18
+
25void
+
26updatePeerFinderDB(soci::session& session, int currentSchemaVersion, beast::Journal j);
+
27
+
34void
+
35readPeerFinderDB(soci::session& session, std::function<void(std::string const&, int)> const& func);
+
36
+
42void
+
43savePeerFinderDB(soci::session& session, std::vector<PeerFinder::Store::Entry> const& v);
+
44
+
45} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
diff --git a/PeerFinder__test_8cpp_source.html b/PeerFinder__test_8cpp_source.html index 4dab816ad9..f6f605aa18 100644 --- a/PeerFinder__test_8cpp_source.html +++ b/PeerFinder__test_8cpp_source.html @@ -642,11 +642,11 @@ $(document).ready(function() { init_codefold(0); });
void pass()
Record a successful test condition.
Definition suite.h:494
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:516
- -
std::size_t PEERS_IN_MAX
Definition Config.h:162
-
std::size_t PEERS_OUT_MAX
Definition Config.h:161
+ +
std::size_t PEERS_IN_MAX
Definition Config.h:163
+
std::size_t PEERS_OUT_MAX
Definition Config.h:162
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
-
std::size_t PEERS_MAX
Definition Config.h:160
+
std::size_t PEERS_MAX
Definition Config.h:161
Manages the count of available connections for the various slots.
Definition Counts.h:14
int out_max() const
Returns the total number of outbound slots.
Definition Counts.h:84
int in_max() const
Returns the total number of inbound slots.
Definition Counts.h:146
diff --git a/PeerImp_8cpp_source.html b/PeerImp_8cpp_source.html index 3ef9bc82c9..f94cfd6a22 100644 --- a/PeerImp_8cpp_source.html +++ b/PeerImp_8cpp_source.html @@ -3562,11 +3562,11 @@ $(document).ready(function() { init_codefold(0); });
void for_each(std::function< void(ClusterNode const &)> func) const
Invokes the callback once for every cluster node.
Definition Cluster.cpp:60
std::optional< std::string > member(PublicKey const &node) const
Determines whether a node belongs in the cluster.
Definition Cluster.cpp:19
std::size_t size() const
The number of nodes in the cluster list.
Definition Cluster.cpp:30
-
int MAX_TRANSACTIONS
Definition Config.h:206
-
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:264
-
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:245
-
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:261
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:228
+
int MAX_TRANSACTIONS
Definition Config.h:207
+
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:265
+
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
+
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:262
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
bool addSuppressionPeer(uint256 const &key, PeerShortID peer)
bool shouldProcess(uint256 const &key, PeerShortID peer, HashRouterFlags &flags, std::chrono::seconds tx_interval)
diff --git a/PeerImp_8h_source.html b/PeerImp_8h_source.html index 5caeb7c72b..8e51146699 100644 --- a/PeerImp_8h_source.html +++ b/PeerImp_8h_source.html @@ -801,7 +801,7 @@ $(document).ready(function() { init_codefold(0); });
Wraps a Journal::Sink to prefix its output with a string.
Definition WrappedSink.h:14
virtual Config & config()=0
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:228
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
diff --git a/PeerReservationTable_8cpp_source.html b/PeerReservationTable_8cpp_source.html index eb29c85199..ee9c21111a 100644 --- a/PeerReservationTable_8cpp_source.html +++ b/PeerReservationTable_8cpp_source.html @@ -82,12 +82,12 @@ $(document).ready(function() { init_codefold(0); });
1#include <xrpld/app/rdb/RelationalDatabase.h>
-
2#include <xrpld/app/rdb/Wallet.h>
-
3#include <xrpld/overlay/PeerReservationTable.h>
-
4
-
5#include <xrpl/json/json_value.h>
-
6#include <xrpl/protocol/PublicKey.h>
-
7#include <xrpl/protocol/jss.h>
+
2
+
3#include <xrpl/core/PeerReservationTable.h>
+
4#include <xrpl/json/json_value.h>
+
5#include <xrpl/protocol/PublicKey.h>
+
6#include <xrpl/protocol/jss.h>
+
7#include <xrpl/server/Wallet.h>
8
9#include <algorithm>
10#include <iterator>
@@ -177,7 +177,7 @@ $(document).ready(function() { init_codefold(0); });
87 table_.insert(hint, reservation);
88
89 auto db = connection_->checkoutDb();
-
90 insertPeerReservation(*db, reservation.nodeId, reservation.description);
+
90 insertPeerReservation(*db, reservation.nodeId, reservation.description);
91
92 return previous;
93}
@@ -197,7 +197,7 @@ $(document).ready(function() { init_codefold(0); });
105 previous = *it;
106 table_.erase(it);
107 auto db = connection_->checkoutDb();
-
108 deletePeerReservation(*db, nodeId);
+
108 deletePeerReservation(*db, nodeId);
109 }
110
111 return previous;
@@ -208,8 +208,8 @@ $(document).ready(function() { init_codefold(0); });
T back_inserter(T... args)
Represents a JSON value.
Definition json_value.h:130
- -
LockedSociSession checkoutDb()
+ +
LockedSociSession checkoutDb()
std::vector< PeerReservation > list() const
std::optional< PeerReservation > insert_or_assign(PeerReservation const &reservation)
@@ -229,9 +229,9 @@ $(document).ready(function() { init_codefold(0); });
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition AccountID.cpp:92
-
std::unordered_set< PeerReservation, beast::uhash<>, KeyEqual > getPeerReservationTable(soci::session &session, beast::Journal j)
getPeerReservationTable Returns the peer reservation table.
Definition Wallet.cpp:134
-
void deletePeerReservation(soci::session &session, PublicKey const &nodeId)
deletePeerReservation Deletes an entry from the peer reservation table.
Definition Wallet.cpp:180
-
void insertPeerReservation(soci::session &session, PublicKey const &nodeId, std::string const &description)
insertPeerReservation Adds an entry to the peer reservation table.
Definition Wallet.cpp:169
+
void deletePeerReservation(soci::session &session, PublicKey const &nodeId)
deletePeerReservation Deletes an entry from the peer reservation table.
Definition Wallet.cpp:181
+
void insertPeerReservation(soci::session &session, PublicKey const &nodeId, std::string const &description)
insertPeerReservation Adds an entry to the peer reservation table.
Definition Wallet.cpp:170
+
std::unordered_set< PeerReservation, beast::uhash<>, KeyEqual > getPeerReservationTable(soci::session &session, beast::Journal j)
getPeerReservationTable Returns the peer reservation table.
Definition Wallet.cpp:135
T sort(T... args)
diff --git a/PeerReservationTable_8h_source.html b/PeerReservationTable_8h_source.html index b2295bedea..3345e28a61 100644 --- a/PeerReservationTable_8h_source.html +++ b/PeerReservationTable_8h_source.html @@ -74,7 +74,7 @@ $(document).ready(function() { init_codefold(0); });
@@ -191,7 +191,7 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
static Sink & getNullSink()
Returns a Sink which does nothing.
- +
std::vector< PeerReservation > list() const
PeerReservationTable(beast::Journal journal=beast::Journal(beast::Journal::getNullSink()))
diff --git a/PeerfinderConfig_8cpp_source.html b/PeerfinderConfig_8cpp_source.html index 598ff0cb9d..87d8753b1f 100644 --- a/PeerfinderConfig_8cpp_source.html +++ b/PeerfinderConfig_8cpp_source.html @@ -217,12 +217,12 @@ $(document).ready(function() { init_codefold(0); });
122} // namespace PeerFinder
123} // namespace xrpl
- -
std::size_t PEERS_IN_MAX
Definition Config.h:162
-
bool standalone() const
Definition Config.h:311
-
std::size_t PEERS_OUT_MAX
Definition Config.h:161
-
bool PEER_PRIVATE
Definition Config.h:154
-
std::size_t PEERS_MAX
Definition Config.h:160
+ +
std::size_t PEERS_IN_MAX
Definition Config.h:163
+
bool standalone() const
Definition Config.h:312
+
std::size_t PEERS_OUT_MAX
Definition Config.h:162
+
bool PEER_PRIVATE
Definition Config.h:155
+
std::size_t PEERS_MAX
Definition Config.h:161
T max(T... args)
T min(T... args)
diff --git a/PeerfinderManager_8cpp_source.html b/PeerfinderManager_8cpp_source.html index 78961374d9..1eb1b314e2 100644 --- a/PeerfinderManager_8cpp_source.html +++ b/PeerfinderManager_8cpp_source.html @@ -459,8 +459,8 @@ $(document).ready(function() { init_codefold(0); });
static std::shared_ptr< Source > New(std::string const &name, Strings const &strings)
A static or dynamic source of peer addresses.
Definition Source.h:19
-
Database persistence for PeerFinder using SQLite.
Definition StoreSqdb.h:12
-
void open(BasicConfig const &config)
Definition StoreSqdb.h:32
+
Database persistence for PeerFinder using SQLite.
Definition StoreSqdb.h:13
+
void open(BasicConfig const &config)
Definition StoreSqdb.h:33
A public key.
Definition PublicKey.h:42
T end(T... args)
T is_same_v
diff --git a/PeerfinderManager_8h_source.html b/PeerfinderManager_8h_source.html index cc22791397..c796132d1e 100644 --- a/PeerfinderManager_8h_source.html +++ b/PeerfinderManager_8h_source.html @@ -279,7 +279,7 @@ $(document).ready(function() { init_codefold(0); });
Subclasses can be called to write to a stream and have children.
std::string const & name() const
Returns the name of this source.
- +
Maintains a set of IP addresses used for getting into the network.
virtual void start()=0
Transition to the started state, synchronously.
virtual std::vector< beast::IP::Endpoint > autoconnect()=0
Return a set of addresses we should connect to.
diff --git a/PerfLog__test_8cpp_source.html b/PerfLog__test_8cpp_source.html index fc9d55000b..bd04bf4597 100644 --- a/PerfLog__test_8cpp_source.html +++ b/PerfLog__test_8cpp_source.html @@ -113,7 +113,7 @@ $(document).ready(function() { init_codefold(0); });
29 // We're only using Env for its Journal. That Journal gives better
30 // coverage in unit tests.
-
32 beast::Journal j_{env_.app().journal("PerfLog_test")};
+
32 beast::Journal j_{env_.app().journal("PerfLog_test")};
33
34 struct Fixture
@@ -1126,7 +1126,6 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:51
log_os< char > log
Logging output stream.
Definition suite.h:144
-
virtual beast::Journal journal(std::string const &name)=0
static JobTypes const & instance()
Definition JobTypes.h:97
static std::uint64_t jsonToUint64(Json::Value const &jsonUintAsString)
@@ -1143,6 +1142,7 @@ $(document).ready(function() { init_codefold(0); });
void run() override
Runs the suite.
void testInvalidID(WithFile withFile)
beast::Journal j_
+
virtual beast::Journal journal(std::string const &name)=0
A transaction testing environment.
Definition Env.h:119
Application & app()
Definition Env.h:251
T close(T... args)
diff --git a/RCLValidations_8cpp_source.html b/RCLValidations_8cpp_source.html index 033f42d2c8..56d38d1658 100644 --- a/RCLValidations_8cpp_source.html +++ b/RCLValidations_8cpp_source.html @@ -157,7 +157,7 @@ $(document).ready(function() { init_codefold(0); });
63 return ancestors_[ancestors_.size() - diff];
64 }
65
-
66 JLOG(j_.warn()) << "Unable to determine hash of ancestor seq=" << s << " from ledger hash=" << ledgerID_
+
66 JLOG(j_.warn()) << "Unable to determine hash of ancestor seq=" << s << " from ledger hash=" << ledgerID_
67 << " seq=" << ledgerSeq_ << " (available: " << minSeq() << "-" << seq() << ")";
68 // Default ID that is less than all others
69 return ID{0};
diff --git a/RCLValidations__test_8cpp_source.html b/RCLValidations__test_8cpp_source.html index e5f6a6221a..4a29fb6495 100644 --- a/RCLValidations__test_8cpp_source.html +++ b/RCLValidations__test_8cpp_source.html @@ -396,7 +396,7 @@ $(document).ready(function() { init_codefold(0); });
T begin(T... args)
A testsuite class.
Definition suite.h:51
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
- +
Ancestry trie of ledgers.
Definition LedgerTrie.h:323
std::uint32_t tipSupport(Ledger const &ledger) const
Return count of tip support for the specific ledger.
Definition LedgerTrie.h:564
std::uint32_t branchSupport(Ledger const &ledger) const
Return the count of branch support for the specific ledger.
Definition LedgerTrie.h:578
@@ -427,7 +427,7 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::pair< PublicKey, SecretKey > randomKeyPair(KeyType type)
Create a key pair using secure random numbers.
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
RCLValidatedLedger::Seq mismatch(RCLValidatedLedger const &a, RCLValidatedLedger const &b)
T push_back(T... args)
diff --git a/RPCCall_8cpp_source.html b/RPCCall_8cpp_source.html index 3f33a15e7e..9d5639442f 100644 --- a/RPCCall_8cpp_source.html +++ b/RPCCall_8cpp_source.html @@ -1879,9 +1879,9 @@ $(document).ready(function() { init_codefold(0); });
Stream debug() const
Definition Journal.h:300
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
- -
bool quiet() const
Definition Config.h:301
-
std::optional< beast::IP::Endpoint > rpc_ip
Definition Config.h:254
+ +
bool quiet() const
Definition Config.h:302
+
std::optional< beast::IP::Endpoint > rpc_ip
Definition Config.h:255
static void request(bool bSSL, boost::asio::io_context &io_context, std::string strSite, unsigned short const port, std::function< void(boost::asio::streambuf &sb, std::string const &strHost)> build, std::size_t responseMax, std::chrono::seconds timeout, std::function< bool(boost::system::error_code const &ecResult, int iStatus, std::string const &strData)> complete, beast::Journal &j)
Manages partitions for logging.
Definition Log.h:32
beast::Journal journal(std::string const &name)
Definition Log.cpp:134
diff --git a/RPCLedgerHelpers_8cpp_source.html b/RPCLedgerHelpers_8cpp_source.html index 881235a3ba..a78fe9c24f 100644 --- a/RPCLedgerHelpers_8cpp_source.html +++ b/RPCLedgerHelpers_8cpp_source.html @@ -485,7 +485,7 @@ $(document).ready(function() { init_codefold(0); });
387 if (ledgerIndex <= 0)
388 return Unexpected(RPC::make_param_error("Ledger index too small"));
389
-
390 auto const j = context.app.journal("RPCHandler");
+
390 auto const j = context.app.journal("RPCHandler");
391 // Try to get the hash of the desired ledger from the validated
392 // ledger
393 auto neededHash = hashOfSeq(*ledger, ledgerIndex, j);
@@ -556,8 +556,7 @@ $(document).ready(function() { init_codefold(0); });
bool isMember(char const *key) const
Return true if the object has a member named key.
Value get(UInt index, Value const &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
-
bool standalone() const
Definition Config.h:311
+
bool standalone() const
Definition Config.h:312
virtual std::shared_ptr< Ledger const > acquire(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason)=0
@@ -571,6 +570,7 @@ $(document).ready(function() { init_codefold(0); });
std::shared_ptr< Ledger const > getLedgerByHash(uint256 const &hash)
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
+
virtual beast::Journal journal(std::string const &name)=0
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition base_uint.h:471
diff --git a/RPCSub_8cpp_source.html b/RPCSub_8cpp_source.html index 474f2026ce..85c9bbe2fc 100644 --- a/RPCSub_8cpp_source.html +++ b/RPCSub_8cpp_source.html @@ -288,9 +288,9 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:40
Stream debug() const
Definition Journal.h:300
Stream info() const
Definition Journal.h:306
-
Abstracts the source of subscription data.
Definition InfoSub.h:48
-
Manages a client's subscription to data feeds.
Definition InfoSub.h:32
-
std::mutex mLock
Definition InfoSub.h:204
+
Abstracts the source of subscription data.
Definition InfoSub.h:47
+
Manages a client's subscription to data feeds.
Definition InfoSub.h:31
+
std::mutex mLock
Definition InfoSub.h:203
A pool of threads to perform work.
Definition JobQueue.h:37
bool addJob(JobType type, std::string const &name, JobHandler &&jobHandler)
Adds a job to the JobQueue.
Definition JobQueue.h:145
Manages partitions for logging.
Definition Log.h:32
diff --git a/RPCSub_8h_source.html b/RPCSub_8h_source.html index 1ed615a74f..e2bc5090f2 100644 --- a/RPCSub_8h_source.html +++ b/RPCSub_8h_source.html @@ -118,8 +118,8 @@ $(document).ready(function() { init_codefold(0); });
34
35} // namespace xrpl
-
Abstracts the source of subscription data.
Definition InfoSub.h:48
-
Manages a client's subscription to data feeds.
Definition InfoSub.h:32
+
Abstracts the source of subscription data.
Definition InfoSub.h:47
+
Manages a client's subscription to data feeds.
Definition InfoSub.h:31
A pool of threads to perform work.
Definition JobQueue.h:37
Manages partitions for logging.
Definition Log.h:32
Subscription object for JSON RPC.
Definition RPCSub.h:13
diff --git a/Regression__test_8cpp_source.html b/Regression__test_8cpp_source.html index ebb3d5762d..caac179d1c 100644 --- a/Regression__test_8cpp_source.html +++ b/Regression__test_8cpp_source.html @@ -467,7 +467,7 @@ $(document).ready(function() { init_codefold(0); });
static Hasher::result_type digest(void const *data, std::size_t size) noexcept
Definition tokens.cpp:137
ApplyResult apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition apply.cpp:117
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
std::optional< Blob > strUnHex(std::size_t strSize, Iterator begin, Iterator end)
@ tapNONE
Definition ApplyView.h:11
constexpr XRPAmount INITIAL_XRP
Configure the native currency.
diff --git a/RelationalDatabase_8cpp_source.html b/RelationalDatabase_8cpp_source.html index 6d29563b84..14081f557e 100644 --- a/RelationalDatabase_8cpp_source.html +++ b/RelationalDatabase_8cpp_source.html @@ -81,58 +81,57 @@ $(document).ready(function() { init_codefold(0); });
RelationalDatabase.cpp
-
1#include <xrpld/app/main/Application.h>
-
2#include <xrpld/app/rdb/RelationalDatabase.h>
-
3#include <xrpld/core/ConfigSections.h>
-
4
-
5namespace xrpl {
-
6
- -
8getSQLiteDatabase(Application& app, Config const& config, JobQueue& jobQueue);
-
9
- -
-
11RelationalDatabase::init(Application& app, Config const& config, JobQueue& jobQueue)
-
12{
-
13 bool use_sqlite = false;
-
14
-
15 Section const& rdb_section{config.section(SECTION_RELATIONAL_DB)};
-
16 if (!rdb_section.empty())
-
17 {
-
18 if (boost::iequals(get(rdb_section, "backend"), "sqlite"))
-
19 {
-
20 use_sqlite = true;
-
21 }
-
22 else
-
23 {
-
24 Throw<std::runtime_error>("Invalid rdb_section backend value: " + get(rdb_section, "backend"));
-
25 }
-
26 }
-
27 else
-
28 {
-
29 use_sqlite = true;
-
30 }
-
31
-
32 if (use_sqlite)
-
33 {
-
34 return getSQLiteDatabase(app, config, jobQueue);
-
35 }
-
36
- -
38}
+
1#include <xrpld/app/rdb/RelationalDatabase.h>
+
2#include <xrpld/core/ConfigSections.h>
+
3
+
4namespace xrpl {
+
5
+ +
7getSQLiteDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue);
+
8
+ +
+
10RelationalDatabase::init(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue)
+
11{
+
12 bool use_sqlite = false;
+
13
+
14 Section const& rdb_section{config.section(SECTION_RELATIONAL_DB)};
+
15 if (!rdb_section.empty())
+
16 {
+
17 if (boost::iequals(get(rdb_section, "backend"), "sqlite"))
+
18 {
+
19 use_sqlite = true;
+
20 }
+
21 else
+
22 {
+
23 Throw<std::runtime_error>("Invalid rdb_section backend value: " + get(rdb_section, "backend"));
+
24 }
+
25 }
+
26 else
+
27 {
+
28 use_sqlite = true;
+
29 }
+
30
+
31 if (use_sqlite)
+
32 {
+
33 return getSQLiteDatabase(registry, config, jobQueue);
+
34 }
+
35
+ +
37}
-
39
-
40} // namespace xrpl
- +
38
+
39} // namespace xrpl
Section & section(std::string const &name)
Returns the section with the given name.
- +
A pool of threads to perform work.
Definition JobQueue.h:37
-
static std::unique_ptr< RelationalDatabase > init(Application &app, Config const &config, JobQueue &jobQueue)
init Creates and returns an appropriate RelationalDatabase instance based on configuration.
+
static std::unique_ptr< RelationalDatabase > init(ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
init Creates and returns an appropriate RelationalDatabase instance based on configuration.
Holds a collection of configuration values.
Definition BasicConfig.h:24
+
Service registry for dependency injection.
T is_same_v
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
+
std::unique_ptr< RelationalDatabase > getSQLiteDatabase(ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
T get(Section const &section, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
-
std::unique_ptr< RelationalDatabase > getSQLiteDatabase(Application &app, Config const &config, JobQueue &jobQueue)
diff --git a/RelationalDatabase_8h_source.html b/RelationalDatabase_8h_source.html index 1cd6f5d192..9f529b33c0 100644 --- a/RelationalDatabase_8h_source.html +++ b/RelationalDatabase_8h_source.html @@ -84,13 +84,13 @@ $(document).ready(function() { init_codefold(0); });
1#pragma once
2
3#include <xrpld/app/ledger/Ledger.h>
-
4#include <xrpld/app/main/Application.h>
-
5#include <xrpld/app/misc/Transaction.h>
-
6#include <xrpld/core/Config.h>
-
7#include <xrpld/core/DatabaseCon.h>
-
8#include <xrpld/rpc/detail/RPCLedgerHelpers.h>
-
9
-
10#include <xrpl/beast/utility/instrumentation.h>
+
4#include <xrpld/app/misc/Transaction.h>
+
5#include <xrpld/core/Config.h>
+
6#include <xrpld/rpc/detail/RPCLedgerHelpers.h>
+
7
+
8#include <xrpl/beast/utility/instrumentation.h>
+
9#include <xrpl/core/ServiceRegistry.h>
+
10#include <xrpl/rdb/DatabaseCon.h>
11
12#include <boost/filesystem.hpp>
13#include <boost/variant.hpp>
@@ -191,7 +191,7 @@ $(document).ready(function() { init_codefold(0); });
92
-
102 init(Application& app, Config const& config, JobQueue& jobQueue);
+
102 init(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue);
103
104 virtual ~RelationalDatabase() = default;
105
@@ -253,13 +253,12 @@ $(document).ready(function() { init_codefold(0); });
225
226} // namespace xrpl
- - +
A pool of threads to perform work.
Definition JobQueue.h:37
virtual bool transactionDbHasSpace(Config const &config)=0
transactionDbHasSpace Checks if the transaction database has available space.
+
static std::unique_ptr< RelationalDatabase > init(ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
init Creates and returns an appropriate RelationalDatabase instance based on configuration.
-
static std::unique_ptr< RelationalDatabase > init(Application &app, Config const &config, JobQueue &jobQueue)
init Creates and returns an appropriate RelationalDatabase instance based on configuration.
virtual ~RelationalDatabase()=default
virtual std::map< LedgerIndex, LedgerHashPair > getHashesByIndex(LedgerIndex minSeq, LedgerIndex maxSeq)=0
getHashesByIndex Returns hashes of each ledger and its parent for all ledgers within the provided ran...
virtual std::optional< LedgerHeader > getNewestLedgerInfo()=0
getNewestLedgerInfo Returns the info of the newest saved ledger.
@@ -271,6 +270,7 @@ $(document).ready(function() { init_codefold(0); });
virtual bool ledgerDbHasSpace(Config const &config)=0
ledgerDbHasSpace Checks if the ledger database has available space.
virtual std::vector< std::shared_ptr< Transaction > > getTxHistory(LedgerIndex startIndex)=0
getTxHistory Returns the 20 most recent transactions starting from the given number.
virtual std::optional< LedgerHashPair > getHashesByIndex(LedgerIndex ledgerIndex)=0
getHashesByIndex Returns the hashes of the ledger and its parent as specified by the ledgerIndex.
+
Service registry for dependency injection.
T lowest(T... args)
diff --git a/RipplePathFind_8cpp_source.html b/RipplePathFind_8cpp_source.html index 6be2a28691..6db82a7acd 100644 --- a/RipplePathFind_8cpp_source.html +++ b/RipplePathFind_8cpp_source.html @@ -241,8 +241,8 @@ $(document).ready(function() { init_codefold(0); });
Members getMemberNames() const
Return a list of the member names.
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
bool standalone() const
Definition Config.h:311
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
bool standalone() const
Definition Config.h:312
std::chrono::seconds getValidatedLedgerAge()
std::shared_ptr< Ledger const > getClosedLedger()
Json::Value makeLegacyPathRequest(PathRequest::pointer &req, std::function< void(void)> completion, Resource::Consumer &consumer, std::shared_ptr< ReadView const > const &inLedger, Json::Value const &request)
diff --git a/RocksDBFactory_8cpp_source.html b/RocksDBFactory_8cpp_source.html index 20120f11e9..85aae0d158 100644 --- a/RocksDBFactory_8cpp_source.html +++ b/RocksDBFactory_8cpp_source.html @@ -271,7 +271,7 @@ $(document).ready(function() { init_codefold(0); });
188 }
189
190 void
-
191 open(bool createIfMissing) override
+
191 open(bool createIfMissing) override
192 {
193 if (m_db)
194 {
@@ -544,10 +544,10 @@ $(document).ready(function() { init_codefold(0); });
auto const data
General field definitions, or fields used in multiple transaction namespaces.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
T get(Section const &section, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
+
void open(soci::session &s, BasicConfig const &config, std::string const &dbName)
Open a soci session.
Definition SociDB.cpp:73
constexpr auto megabytes(T value) noexcept
bool get_if_exists(Section const &section, std::string const &name, T &v)
-
void open(soci::session &s, BasicConfig const &config, std::string const &dbName)
Open a soci session.
Definition SociDB.cpp:75
T push_back(T... args)
T reserve(T... args)
diff --git a/SHAMapStoreImp_8cpp_source.html b/SHAMapStoreImp_8cpp_source.html index e1d970d446..7ba02e52b8 100644 --- a/SHAMapStoreImp_8cpp_source.html +++ b/SHAMapStoreImp_8cpp_source.html @@ -84,13 +84,13 @@ $(document).ready(function() { init_codefold(0); });
1#include <xrpld/app/ledger/TransactionMaster.h>
2#include <xrpld/app/misc/NetworkOPs.h>
3#include <xrpld/app/misc/SHAMapStoreImp.h>
-
4#include <xrpld/app/rdb/State.h>
-
5#include <xrpld/app/rdb/backend/SQLiteDatabase.h>
-
6#include <xrpld/core/ConfigSections.h>
-
7
-
8#include <xrpl/beast/core/CurrentThreadName.h>
-
9#include <xrpl/nodestore/Scheduler.h>
-
10#include <xrpl/nodestore/detail/DatabaseRotatingImp.h>
+
4#include <xrpld/app/rdb/backend/SQLiteDatabase.h>
+
5#include <xrpld/core/ConfigSections.h>
+
6
+
7#include <xrpl/beast/core/CurrentThreadName.h>
+
8#include <xrpl/nodestore/Scheduler.h>
+
9#include <xrpl/nodestore/detail/DatabaseRotatingImp.h>
+
10#include <xrpl/server/State.h>
11#include <xrpl/shamap/SHAMapMissingNode.h>
12
13#include <boost/algorithm/string/predicate.hpp>
@@ -101,7 +101,7 @@ $(document).ready(function() { init_codefold(0); });
18{
-
20 initStateDB(sqlDb_, config, dbName);
+
20 initStateDB(sqlDb_, config, dbName);
21}
22
@@ -140,7 +140,7 @@ $(document).ready(function() { init_codefold(0); });
49{
-
51 xrpl::setSavedState(sqlDb_, state);
+
51 xrpl::setSavedState(sqlDb_, state);
52}
53
@@ -250,7 +250,7 @@ $(document).ready(function() { init_codefold(0); });
152 std::move(writableBackend),
153 std::move(archiveBackend),
154 nscfg,
- +
156 fdRequired_ += dbr->fdRequired();
157 dbRotating_ = dbr.get();
158 db.reset(dynamic_cast<NodeStore::Database*>(dbr.release()));
@@ -262,7 +262,7 @@ $(document).ready(function() { init_codefold(0); });
165 readThreads,
166 nscfg,
- +
168 fdRequired_ += db->fdRequired();
169 }
170 return db;
@@ -536,7 +536,7 @@ $(document).ready(function() { init_codefold(0); });
424 section,
- +
428 backend->open();
429 return backend;
430}
@@ -732,12 +732,11 @@ $(document).ready(function() { init_codefold(0); });
Stream warn() const
Definition Journal.h:312
virtual Config & config()=0
-
virtual Logs & logs()=0
Holds unparsed configuration information.
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
Section & section(std::string const &name)
Returns the section with the given name.
- -
bool useTxTables() const
Definition Config.h:317
+ +
bool useTxTables() const
Definition Config.h:318
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1015
virtual std::shared_ptr< TreeNodeCache > getTreeNodeCache()=0
Return a pointer to the Family Tree Node Cache.
virtual std::shared_ptr< FullBelowCache > getFullBelowCache()=0
Return a pointer to the Family Full Below Cache.
@@ -825,6 +824,7 @@ $(document).ready(function() { init_codefold(0); });
virtual std::optional< LedgerIndex > getAccountTransactionsMinLedgerSeq()=0
getAccountTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the AccountTransacti...
virtual void deleteTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq)=0
deleteTransactionsBeforeLedgerSeq Deletes all transactions with a sequence number less than or equal ...
Holds a collection of configuration values.
Definition BasicConfig.h:24
+
virtual Logs & logs()=0
virtual RelationalDatabase & getRelationalDatabase()=0
virtual NetworkOPs & getOPs()=0
virtual TransactionMaster & getMasterTransaction()=0
@@ -847,10 +847,10 @@ $(document).ready(function() { init_codefold(0); });
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
+
void initStateDB(soci::session &session, BasicConfig const &config, std::string const &dbName)
initStateDB Opens a session with the State database.
Definition State.cpp:6
+
void setSavedState(soci::session &session, SavedState const &state)
setSavedState Saves the given state.
Definition State.cpp:82
T get(Section const &section, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
void setLastRotated(soci::session &session, LedgerIndex seq)
setLastRotated Updates the last rotated ledger sequence.
Definition State.cpp:93
-
void setSavedState(soci::session &session, SavedState const &state)
setSavedState Saves the given state.
Definition State.cpp:82
-
void initStateDB(soci::session &session, BasicConfig const &config, std::string const &dbName)
initStateDB Opens a session with the State database.
Definition State.cpp:6
std::unique_ptr< SHAMapStore > make_SHAMapStore(Application &app, NodeStore::Scheduler &scheduler, beast::Journal journal)
@@ -871,10 +871,10 @@ $(document).ready(function() { init_codefold(0); });
T size(T... args)
T sleep_for(T... args)
static std::string nodeDatabase()
- -
std::string writableDb
Definition State.h:15
-
LedgerIndex lastRotated
Definition State.h:17
-
std::string archiveDb
Definition State.h:16
+ +
std::string writableDb
Definition State.h:13
+
LedgerIndex lastRotated
Definition State.h:15
+
std::string archiveDb
Definition State.h:14
T to_string(T... args)
diff --git a/SHAMapStoreImp_8h_source.html b/SHAMapStoreImp_8h_source.html index 5d84a79be0..f2f5b8c863 100644 --- a/SHAMapStoreImp_8h_source.html +++ b/SHAMapStoreImp_8h_source.html @@ -85,11 +85,11 @@ $(document).ready(function() { init_codefold(0); });
2
3#include <xrpld/app/ledger/LedgerMaster.h>
4#include <xrpld/app/misc/SHAMapStore.h>
-
5#include <xrpld/app/rdb/State.h>
-
6#include <xrpld/core/DatabaseCon.h>
-
7
-
8#include <xrpl/nodestore/DatabaseRotating.h>
-
9#include <xrpl/nodestore/Scheduler.h>
+
5
+
6#include <xrpl/nodestore/DatabaseRotating.h>
+
7#include <xrpl/nodestore/Scheduler.h>
+
8#include <xrpl/rdb/DatabaseCon.h>
+
9#include <xrpl/server/State.h>
10
11#include <atomic>
12#include <chrono>
@@ -397,8 +397,8 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
- -
LedgerIndex lastRotated
Definition State.h:17
+ +
LedgerIndex lastRotated
Definition State.h:15
diff --git a/SHAMapStore__test_8cpp_source.html b/SHAMapStore__test_8cpp_source.html index 3e3c544afa..54f78cec8b 100644 --- a/SHAMapStore__test_8cpp_source.html +++ b/SHAMapStore__test_8cpp_source.html @@ -583,7 +583,7 @@ $(document).ready(function() { init_codefold(0); });
474 section,
476 scheduler,
-
477 env.app().logs().journal("NodeStoreTest"))};
+
477 env.app().logs().journal("NodeStoreTest"))};
478 backend->open();
479 return backend;
480 }
@@ -617,7 +617,7 @@ $(document).ready(function() { init_codefold(0); });
507 std::move(writableBackend),
508 std::move(archiveBackend),
509 nscfg,
-
510 env.app().logs().journal("NodeStoreTest"));
+
510 env.app().logs().journal("NodeStoreTest"));
511
513 // Check basic functionality
514 using namespace std::chrono_literals;
@@ -688,7 +688,6 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:51
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
virtual Config & config()=0
-
virtual Logs & logs()=0
Section & section(std::string const &name)
Returns the section with the given name.
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1015
beast::Journal journal(std::string const &name)
Definition Log.cpp:134
@@ -702,6 +701,7 @@ $(document).ready(function() { init_codefold(0); });
virtual std::size_t getAccountTransactionCount()=0
getAccountTransactionCount Returns the number of account transactions.
virtual std::size_t getTransactionCount()=0
getTransactionCount Returns the number of transactions.
Holds a collection of configuration values.
Definition BasicConfig.h:24
+
virtual Logs & logs()=0
virtual JobQueue & getJobQueue()=0
virtual RelationalDatabase & getRelationalDatabase()=0
virtual SHAMapStore & getSHAMapStore()=0
diff --git a/SQLiteDatabase_8cpp_source.html b/SQLiteDatabase_8cpp_source.html index c5d88870c5..fa17fca977 100644 --- a/SQLiteDatabase_8cpp_source.html +++ b/SQLiteDatabase_8cpp_source.html @@ -86,10 +86,10 @@ $(document).ready(function() { init_codefold(0); });
3#include <xrpld/app/misc/detail/AccountTxPaging.h>
4#include <xrpld/app/rdb/backend/SQLiteDatabase.h>
5#include <xrpld/app/rdb/backend/detail/Node.h>
-
6#include <xrpld/core/DatabaseCon.h>
-
7#include <xrpld/core/SociDB.h>
-
8
-
9#include <xrpl/basics/StringUtilities.h>
+
6
+
7#include <xrpl/basics/StringUtilities.h>
+
8#include <xrpl/rdb/DatabaseCon.h>
+
9#include <xrpl/rdb/SociDB.h>
10
11namespace xrpl {
12
@@ -98,11 +98,11 @@ $(document).ready(function() { init_codefold(0); });
14{
15public:
-
16 SQLiteDatabaseImp(Application& app, Config const& config, JobQueue& jobQueue)
-
17 : app_(app), useTxTables_(config.useTxTables()), j_(app_.journal("SQLiteDatabaseImp"))
+
16 SQLiteDatabaseImp(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue)
+
17 : registry_(registry), useTxTables_(config.useTxTables()), j_(registry.journal("SQLiteDatabaseImp"))
18 {
19 DatabaseCon::Setup const setup = setup_DatabaseCon(config, j_);
-
20 if (!makeLedgerDBs(config, setup, DatabaseCon::CheckpointerSetup{&jobQueue, &app_.logs()}))
+
20 if (!makeLedgerDBs(config, setup, DatabaseCon::CheckpointerSetup{&jobQueue, &registry_.logs()}))
21 {
22 std::string_view constexpr error = "Failed to create ledger databases";
23
@@ -225,7 +225,7 @@ $(document).ready(function() { init_codefold(0); });
139 closeTransactionDB() override;
140
141private:
- +
143 bool const useTxTables_;
@@ -463,7 +463,7 @@ $(document).ready(function() { init_codefold(0); });
370{
371 if (existsLedger())
372 {
- +
374 return false;
375 }
376
@@ -617,7 +617,7 @@ $(document).ready(function() { init_codefold(0); });
506 if (existsTransaction())
507 {
508 auto db = checkoutTransaction();
-
509 auto const res = detail::getTxHistory(*db, app_, startIndex, 20).first;
+
509 auto const res = detail::getTxHistory(*db, registry_.app(), startIndex, 20).first;
510
511 if (!res.empty())
512 return res;
@@ -634,12 +634,12 @@ $(document).ready(function() { init_codefold(0); });
521 if (!useTxTables_)
522 return {};
523
- +
525
526 if (existsTransaction())
527 {
528 auto db = checkoutTransaction();
-
529 return detail::getOldestAccountTxs(*db, app_, ledgerMaster, options, j_).first;
+
529 return detail::getOldestAccountTxs(*db, registry_.app(), ledgerMaster, options, j_).first;
530 }
531
532 return {};
@@ -653,12 +653,12 @@ $(document).ready(function() { init_codefold(0); });
538 if (!useTxTables_)
539 return {};
540
- +
542
543 if (existsTransaction())
544 {
545 auto db = checkoutTransaction();
-
546 return detail::getNewestAccountTxs(*db, app_, ledgerMaster, options, j_).first;
+
546 return detail::getNewestAccountTxs(*db, registry_.app(), ledgerMaster, options, j_).first;
547 }
548
549 return {};
@@ -675,7 +675,7 @@ $(document).ready(function() { init_codefold(0); });
558 if (existsTransaction())
559 {
560 auto db = checkoutTransaction();
-
561 return detail::getOldestAccountTxsB(*db, app_, options, j_).first;
+
561 return detail::getOldestAccountTxsB(*db, registry_.app(), options, j_).first;
562 }
563
564 return {};
@@ -692,7 +692,7 @@ $(document).ready(function() { init_codefold(0); });
573 if (existsTransaction())
574 {
575 auto db = checkoutTransaction();
-
576 return detail::getNewestAccountTxsB(*db, app_, options, j_).first;
+
576 return detail::getNewestAccountTxsB(*db, registry_.app(), options, j_).first;
577 }
578
579 return {};
@@ -707,228 +707,224 @@ $(document).ready(function() { init_codefold(0); });
586 return {};
587
588 static std::uint32_t const page_length(200);
-
589 auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(app_), std::placeholders::_1);
+
589 auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(registry_.app()), std::placeholders::_1);
590 AccountTxs ret;
-
591 Application& app = app_;
-
592 auto onTransaction = [&ret, &app](
-
593 std::uint32_t ledger_index, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
-
594 convertBlobsToTxResult(ret, ledger_index, status, rawTxn, rawMeta, app);
-
595 };
-
596
-
597 if (existsTransaction())
-
598 {
-
599 auto db = checkoutTransaction();
-
600 auto newmarker = detail::oldestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length).first;
-
601 return {ret, newmarker};
-
602 }
-
603
-
604 return {};
-
605}
+
591 auto onTransaction = [&ret, &app = registry_.app()](
+
592 std::uint32_t ledger_index, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
+
593 convertBlobsToTxResult(ret, ledger_index, status, rawTxn, rawMeta, app);
+
594 };
+
595
+
596 if (existsTransaction())
+
597 {
+
598 auto db = checkoutTransaction();
+
599 auto newmarker = detail::oldestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length).first;
+
600 return {ret, newmarker};
+
601 }
+
602
+
603 return {};
+
604}
-
606
- -
- -
609{
-
610 if (!useTxTables_)
-
611 return {};
-
612
-
613 static std::uint32_t const page_length(200);
-
614 auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(app_), std::placeholders::_1);
-
615 AccountTxs ret;
-
616 Application& app = app_;
-
617 auto onTransaction = [&ret, &app](
-
618 std::uint32_t ledger_index, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
-
619 convertBlobsToTxResult(ret, ledger_index, status, rawTxn, rawMeta, app);
-
620 };
-
621
-
622 if (existsTransaction())
-
623 {
-
624 auto db = checkoutTransaction();
-
625 auto newmarker = detail::newestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length).first;
-
626 return {ret, newmarker};
-
627 }
-
628
-
629 return {};
-
630}
+
605
+ +
+ +
608{
+
609 if (!useTxTables_)
+
610 return {};
+
611
+
612 static std::uint32_t const page_length(200);
+
613 auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(registry_.app()), std::placeholders::_1);
+
614 AccountTxs ret;
+
615 auto onTransaction = [&ret, &app = registry_.app()](
+
616 std::uint32_t ledger_index, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
+
617 convertBlobsToTxResult(ret, ledger_index, status, rawTxn, rawMeta, app);
+
618 };
+
619
+
620 if (existsTransaction())
+
621 {
+
622 auto db = checkoutTransaction();
+
623 auto newmarker = detail::newestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length).first;
+
624 return {ret, newmarker};
+
625 }
+
626
+
627 return {};
+
628}
-
631
- -
- -
634{
-
635 if (!useTxTables_)
-
636 return {};
-
637
-
638 static std::uint32_t const page_length(500);
-
639 auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(app_), std::placeholders::_1);
-
640 MetaTxsList ret;
-
641 auto onTransaction = [&ret](std::uint32_t ledgerIndex, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
-
642 ret.emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
-
643 };
-
644
-
645 if (existsTransaction())
-
646 {
-
647 auto db = checkoutTransaction();
-
648 auto newmarker = detail::oldestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length).first;
-
649 return {ret, newmarker};
-
650 }
-
651
-
652 return {};
-
653}
+
629
+ +
+ +
632{
+
633 if (!useTxTables_)
+
634 return {};
+
635
+
636 static std::uint32_t const page_length(500);
+
637 auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(registry_.app()), std::placeholders::_1);
+
638 MetaTxsList ret;
+
639 auto onTransaction = [&ret](std::uint32_t ledgerIndex, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
+
640 ret.emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
+
641 };
+
642
+
643 if (existsTransaction())
+
644 {
+
645 auto db = checkoutTransaction();
+
646 auto newmarker = detail::oldestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length).first;
+
647 return {ret, newmarker};
+
648 }
+
649
+
650 return {};
+
651}
-
654
- -
- -
657{
-
658 if (!useTxTables_)
-
659 return {};
-
660
-
661 static std::uint32_t const page_length(500);
-
662 auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(app_), std::placeholders::_1);
-
663 MetaTxsList ret;
-
664 auto onTransaction = [&ret](std::uint32_t ledgerIndex, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
-
665 ret.emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
-
666 };
-
667
-
668 if (existsTransaction())
-
669 {
-
670 auto db = checkoutTransaction();
-
671 auto newmarker = detail::newestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length).first;
-
672 return {ret, newmarker};
-
673 }
-
674
-
675 return {};
-
676}
+
652
+ +
+ +
655{
+
656 if (!useTxTables_)
+
657 return {};
+
658
+
659 static std::uint32_t const page_length(500);
+
660 auto onUnsavedLedger = std::bind(saveLedgerAsync, std::ref(registry_.app()), std::placeholders::_1);
+
661 MetaTxsList ret;
+
662 auto onTransaction = [&ret](std::uint32_t ledgerIndex, std::string const& status, Blob&& rawTxn, Blob&& rawMeta) {
+
663 ret.emplace_back(std::move(rawTxn), std::move(rawMeta), ledgerIndex);
+
664 };
+
665
+
666 if (existsTransaction())
+
667 {
+
668 auto db = checkoutTransaction();
+
669 auto newmarker = detail::newestAccountTxPage(*db, onUnsavedLedger, onTransaction, options, page_length).first;
+
670 return {ret, newmarker};
+
671 }
+
672
+
673 return {};
+
674}
-
677
- -
- -
680 uint256 const& id,
- -
682 error_code_i& ec)
-
683{
-
684 if (!useTxTables_)
-
685 return TxSearched::unknown;
-
686
-
687 if (existsTransaction())
-
688 {
-
689 auto db = checkoutTransaction();
-
690 return detail::getTransaction(*db, app_, id, range, ec);
-
691 }
-
692
-
693 return TxSearched::unknown;
-
694}
+
675
+ +
+ +
678 uint256 const& id,
+ +
680 error_code_i& ec)
+
681{
+
682 if (!useTxTables_)
+
683 return TxSearched::unknown;
+
684
+
685 if (existsTransaction())
+
686 {
+
687 auto db = checkoutTransaction();
+
688 return detail::getTransaction(*db, registry_.app(), id, range, ec);
+
689 }
+
690
+
691 return TxSearched::unknown;
+
692}
-
695
-
696bool
-
- -
698{
-
699 if (existsLedger())
-
700 {
-
701 auto db = checkoutLedger();
-
702 return detail::dbHasSpace(*db, config, j_);
-
703 }
-
704
-
705 return true;
-
706}
+
693
+
694bool
+
+ +
696{
+
697 if (existsLedger())
+
698 {
+
699 auto db = checkoutLedger();
+
700 return detail::dbHasSpace(*db, config, j_);
+
701 }
+
702
+
703 return true;
+
704}
-
707
-
708bool
-
- -
710{
-
711 if (!useTxTables_)
-
712 return true;
-
713
-
714 if (existsTransaction())
-
715 {
-
716 auto db = checkoutTransaction();
-
717 return detail::dbHasSpace(*db, config, j_);
-
718 }
-
719
-
720 return true;
-
721}
+
705
+
706bool
+
+ +
708{
+
709 if (!useTxTables_)
+
710 return true;
+
711
+
712 if (existsTransaction())
+
713 {
+
714 auto db = checkoutTransaction();
+
715 return detail::dbHasSpace(*db, config, j_);
+
716 }
+
717
+
718 return true;
+
719}
-
722
- -
- -
725{
-
726 if (existsLedger())
-
727 {
-
728 return xrpl::getKBUsedAll(ledgerDb_->getSession());
-
729 }
-
730
-
731 return 0;
-
732}
+
720
+ +
+ +
723{
+
724 if (existsLedger())
+
725 {
+
726 return xrpl::getKBUsedAll(ledgerDb_->getSession());
+
727 }
+
728
+
729 return 0;
+
730}
-
733
- -
- -
736{
-
737 if (existsLedger())
-
738 {
-
739 return xrpl::getKBUsedDB(ledgerDb_->getSession());
-
740 }
-
741
-
742 return 0;
-
743}
+
731
+ +
+ +
734{
+
735 if (existsLedger())
+
736 {
+
737 return xrpl::getKBUsedDB(ledgerDb_->getSession());
+
738 }
+
739
+
740 return 0;
+
741}
-
744
- -
- -
747{
-
748 if (!useTxTables_)
-
749 return 0;
-
750
-
751 if (existsTransaction())
-
752 {
-
753 return xrpl::getKBUsedDB(txdb_->getSession());
-
754 }
-
755
-
756 return 0;
-
757}
+
742
+ +
+ +
745{
+
746 if (!useTxTables_)
+
747 return 0;
+
748
+
749 if (existsTransaction())
+
750 {
+
751 return xrpl::getKBUsedDB(txdb_->getSession());
+
752 }
+
753
+
754 return 0;
+
755}
-
758
-
759void
-
- -
761{
-
762 ledgerDb_.reset();
-
763}
+
756
+
757void
+
+ +
759{
+
760 ledgerDb_.reset();
+
761}
-
764
-
765void
-
- -
767{
-
768 txdb_.reset();
-
769}
+
762
+
763void
+
+ +
765{
+
766 txdb_.reset();
+
767}
-
770
- -
-
772getSQLiteDatabase(Application& app, Config const& config, JobQueue& jobQueue)
-
773{
-
774 return std::make_unique<SQLiteDatabaseImp>(app, config, jobQueue);
-
775}
+
768
+ +
+
770getSQLiteDatabase(ServiceRegistry& registry, Config const& config, JobQueue& jobQueue)
+
771{
+
772 return std::make_unique<SQLiteDatabaseImp>(registry, config, jobQueue);
+
773}
-
776
-
777} // namespace xrpl
+
774
+
775} // namespace xrpl
T bind(T... args)
A generic endpoint for log messages.
Definition Journal.h:40
Stream fatal() const
Definition Journal.h:324
- -
virtual Logs & logs()=0
- +
A pool of threads to perform work.
Definition JobQueue.h:37
std::vector< AccountTx > AccountTxs
@@ -945,44 +941,47 @@ $(document).ready(function() { init_codefold(0); });
std::optional< LedgerIndex > getAccountTransactionsMinLedgerSeq() override
getAccountTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the AccountTransacti...
void deleteTransactionByLedgerSeq(LedgerIndex ledgerSeq) override
deleteTransactionByLedgerSeq Deletes transactions from the ledger with the given sequence.
MetaTxsList getOldestAccountTxsB(AccountTxOptions const &options) override
getOldestAccountTxsB Returns the oldest transactions in binary form for the account that matches the ...
-
std::pair< AccountTxs, std::optional< AccountTxMarker > > newestAccountTxPage(AccountTxPageOptions const &options) override
newestAccountTxPage Returns the newest transactions for the account that matches the given criteria s...
+
std::pair< AccountTxs, std::optional< AccountTxMarker > > newestAccountTxPage(AccountTxPageOptions const &options) override
newestAccountTxPage Returns the newest transactions for the account that matches the given criteria s...
MetaTxsList getNewestAccountTxsB(AccountTxOptions const &options) override
getNewestAccountTxsB Returns the newest transactions in binary form for the account that matches the ...
std::optional< LedgerHeader > getNewestLedgerInfo() override
getNewestLedgerInfo Returns the info of the newest saved ledger.
uint256 getHashByIndex(LedgerIndex ledgerIndex) override
getHashByIndex Returns the hash of the ledger with the given sequence.
-
std::variant< AccountTx, TxSearched > getTransaction(uint256 const &id, std::optional< ClosedInterval< std::uint32_t > > const &range, error_code_i &ec) override
+
std::variant< AccountTx, TxSearched > getTransaction(uint256 const &id, std::optional< ClosedInterval< std::uint32_t > > const &range, error_code_i &ec) override
-
void closeTransactionDB() override
Closes the transaction database.
+
void closeTransactionDB() override
Closes the transaction database.
auto checkoutLedger()
checkoutTransaction Checks out and returns node store ledger database.
bool saveValidatedLedger(std::shared_ptr< Ledger const > const &ledger, bool current) override
saveValidatedLedger Saves a ledger into the database.
void deleteAccountTransactionsBeforeLedgerSeq(LedgerIndex ledgerSeq) override
deleteAccountTransactionsBeforeLedgerSeq Deletes all account transactions with a sequence number less...
void deleteBeforeLedgerSeq(LedgerIndex ledgerSeq) override
deleteBeforeLedgerSeq Deletes all ledgers with a sequence number less than or equal to the given ledg...
-
std::pair< MetaTxsList, std::optional< AccountTxMarker > > newestAccountTxPageB(AccountTxPageOptions const &options) override
newestAccountTxPageB Returns the newest transactions in binary form for the account that matches the ...
-
std::uint32_t getKBUsedTransaction() override
getKBUsedTransaction Returns the amount of space used by the transaction database.
+
std::pair< MetaTxsList, std::optional< AccountTxMarker > > newestAccountTxPageB(AccountTxPageOptions const &options) override
newestAccountTxPageB Returns the newest transactions in binary form for the account that matches the ...
+
std::uint32_t getKBUsedTransaction() override
getKBUsedTransaction Returns the amount of space used by the transaction database.
std::optional< LedgerHeader > getLimitedOldestLedgerInfo(LedgerIndex ledgerFirstIndex) override
getLimitedOldestLedgerInfo Returns the info of the oldest ledger whose sequence number is greater tha...
-
bool transactionDbHasSpace(Config const &config) override
transactionDbHasSpace Checks if the transaction database has available space.
-
SQLiteDatabaseImp(Application &app, Config const &config, JobQueue &jobQueue)
+
SQLiteDatabaseImp(ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
+
bool transactionDbHasSpace(Config const &config) override
transactionDbHasSpace Checks if the transaction database has available space.
+
ServiceRegistry & registry_
std::size_t getAccountTransactionCount() override
getAccountTransactionCount Returns the number of account transactions.
std::size_t getTransactionCount() override
getTransactionCount Returns the number of transactions.
-
std::uint32_t getKBUsedLedger() override
getKBUsedLedger Returns the amount of space space used by the ledger database.
+
std::uint32_t getKBUsedLedger() override
getKBUsedLedger Returns the amount of space space used by the ledger database.
AccountTxs getNewestAccountTxs(AccountTxOptions const &options) override
getNewestAccountTxs Returns the newest transactions for the account that matches the given criteria s...
-
std::pair< MetaTxsList, std::optional< AccountTxMarker > > oldestAccountTxPageB(AccountTxPageOptions const &options) override
oldestAccountTxPageB Returns the oldest transactions in binary form for the account that matches the ...
+
std::pair< MetaTxsList, std::optional< AccountTxMarker > > oldestAccountTxPageB(AccountTxPageOptions const &options) override
oldestAccountTxPageB Returns the oldest transactions in binary form for the account that matches the ...
AccountTxs getOldestAccountTxs(AccountTxOptions const &options) override
getOldestAccountTxs Returns the oldest transactions for the account that matches the given criteria s...
-
RelationalDatabase::CountMinMax getLedgerCountMinMax() override
getLedgerCountMinMax Returns the minimum ledger sequence, maximum ledger sequence and total number of...
-
bool ledgerDbHasSpace(Config const &config) override
ledgerDbHasSpace Checks if the ledger database has available space.
+
bool ledgerDbHasSpace(Config const &config) override
ledgerDbHasSpace Checks if the ledger database has available space.
std::pair< AccountTxs, std::optional< AccountTxMarker > > oldestAccountTxPage(AccountTxPageOptions const &options) override
oldestAccountTxPage Returns the oldest transactions for the account that matches the given criteria s...
std::optional< LedgerHashPair > getHashesByIndex(LedgerIndex ledgerIndex) override
getHashesByIndex Returns the hashes of the ledger and its parent as specified by the ledgerIndex.
bool existsLedger()
existsLedger Checks if the node store ledger database exists.
std::optional< LedgerIndex > getMinLedgerSeq() override
getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers table.
bool existsTransaction()
existsTransaction Checks if the node store transaction database exists.
std::optional< LedgerHeader > getLimitedNewestLedgerInfo(LedgerIndex ledgerFirstIndex) override
getLimitedNewestLedgerInfo Returns the info of the newest ledger whose sequence number is greater tha...
-
std::uint32_t getKBUsedAll() override
getKBUsedAll Returns the amount of space used by all databases.
+
std::uint32_t getKBUsedAll() override
getKBUsedAll Returns the amount of space used by all databases.
-
void closeLedgerDB() override
Closes the ledger database.
+
void closeLedgerDB() override
Closes the ledger database.
std::unique_ptr< DatabaseCon > ledgerDb_
std::optional< LedgerIndex > getTransactionsMinLedgerSeq() override
getTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the Transactions table.
+
Service registry for dependency injection.
+
virtual Logs & logs()=0
virtual LedgerMaster & getLedgerMaster()=0
+
virtual Application & app()=0
T emplace_back(T... args)
@@ -1016,16 +1015,16 @@ $(document).ready(function() { init_codefold(0); });
std::pair< std::optional< RelationalDatabase::AccountTxMarker >, int > newestAccountTxPage(soci::session &session, std::function< void(std::uint32_t)> const &onUnsavedLedger, std::function< void(std::uint32_t, std::string const &, Blob &&, Blob &&)> const &onTransaction, RelationalDatabase::AccountTxPageOptions const &options, std::uint32_t page_length)
newestAccountTxPage Searches newest transactions for given account which match given criteria startin...
Definition Node.cpp:1050
std::optional< LedgerHashPair > getHashesByIndex(soci::session &session, LedgerIndex ledgerIndex, beast::Journal j)
getHashesByIndex Returns hash of the ledger and hash of parent ledger for the ledger of given sequenc...
Definition Node.cpp:486
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
+
std::unique_ptr< RelationalDatabase > getSQLiteDatabase(ServiceRegistry &registry, Config const &config, JobQueue &jobQueue)
void saveLedgerAsync(Application &app, std::uint32_t seq)
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition RangeSet.h:34
-
std::uint32_t getKBUsedDB(soci::session &s)
Definition SociDB.cpp:112
-
std::uint32_t getKBUsedAll(soci::session &s)
Definition SociDB.cpp:104
+
std::uint32_t getKBUsedDB(soci::session &s)
Definition SociDB.cpp:110
+
std::uint32_t getKBUsedAll(soci::session &s)
Definition SociDB.cpp:102
void convertBlobsToTxResult(RelationalDatabase::AccountTxs &to, std::uint32_t ledger_index, std::string const &status, Blob const &rawTxn, Blob const &rawMeta, Application &app)
@ current
This was a new validation and was added.
base_uint< 256 > uint256
Definition base_uint.h:526
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
Definition RangeSet.h:25
-
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
-
std::unique_ptr< RelationalDatabase > getSQLiteDatabase(Application &app, Config const &config, JobQueue &jobQueue)
+
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition Config.cpp:1043
@ ledgerMaster
ledger master data for signing
error_code_i
Definition ErrorCodes.h:20
@@ -1034,8 +1033,8 @@ $(document).ready(function() { init_codefold(0); });
T ref(T... args)
- - + + diff --git a/ServerHandler_8cpp_source.html b/ServerHandler_8cpp_source.html index 775e7227bb..5d48bc56a7 100644 --- a/ServerHandler_8cpp_source.html +++ b/ServerHandler_8cpp_source.html @@ -374,7 +374,7 @@ $(document).ready(function() { init_codefold(0); });
266 // Make sure RPC is enabled on the port
267 if (session.port().protocol.count("http") == 0 && session.port().protocol.count("https") == 0)
268 {
-
269 HTTPReply(403, "Forbidden", makeOutput(session), app_.journal("RPC"));
+
269 HTTPReply(403, "Forbidden", makeOutput(session), app_.journal("RPC"));
270 session.close(true);
271 return;
272 }
@@ -382,7 +382,7 @@ $(document).ready(function() { init_codefold(0); });
274 // Check user/password authorization
275 if (!authorized(session.port(), build_map(session.request())))
276 {
-
277 HTTPReply(403, "Forbidden", makeOutput(session), app_.journal("RPC"));
+
277 HTTPReply(403, "Forbidden", makeOutput(session), app_.journal("RPC"));
278 session.close(true);
279 return;
280 }
@@ -395,7 +395,7 @@ $(document).ready(function() { init_codefold(0); });
287 if (postResult == nullptr)
288 {
289 // The coroutine was rejected, probably because we're shutting down.
-
290 HTTPReply(503, "Service Unavailable", makeOutput(*detachedSession), app_.journal("RPC"));
+
290 HTTPReply(503, "Service Unavailable", makeOutput(*detachedSession), app_.journal("RPC"));
291 detachedSession->close(true);
292 return;
293 }
@@ -540,7 +540,7 @@ $(document).ready(function() { init_codefold(0); });
422 else
423 {
424 RPC::JsonContext context{
-
425 {app_.journal("RPCHandler"),
+
425 {app_.journal("RPCHandler"),
426 app_,
427 loadType,
428 app_.getOPs(),
@@ -1337,14 +1337,13 @@ $(document).ready(function() { init_codefold(0); });
Stream warn() const
Definition Journal.h:312
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
Section & section(std::string const &name)
Returns the section with the given name.
Provides the beast::insight::Collector service.
virtual beast::insight::Group::ptr const & group(std::string const &name)=0
- -
bool BETA_RPC_API
Definition Config.h:267
-
bool standalone() const
Definition Config.h:311
+ +
bool BETA_RPC_API
Definition Config.h:268
+
bool standalone() const
Definition Config.h:312
A pool of threads to perform work.
Definition JobQueue.h:37
std::shared_ptr< Coro > postCoro(JobType t, std::string const &name, F &&f)
Creates a coroutine and adds a job to the queue which will run it.
Definition JobQueue.h:386
Provides server functionality for clients.
Definition NetworkOPs.h:69
@@ -1388,6 +1387,7 @@ $(document).ready(function() { init_codefold(0); });
virtual NetworkOPs & getOPs()=0
virtual Overlay & overlay()=0
virtual LedgerMaster & getLedgerMaster()=0
+
virtual beast::Journal journal(std::string const &name)=0
Persistent state information for a connection session.
Definition Session.h:23
virtual Port const & port()=0
Returns the Port settings for this connection.
virtual void close(bool graceful)=0
Close the session.
diff --git a/ServerStatus__test_8cpp_source.html b/ServerStatus__test_8cpp_source.html index fdd913df42..f76600084a 100644 --- a/ServerStatus__test_8cpp_source.html +++ b/ServerStatus__test_8cpp_source.html @@ -1202,7 +1202,7 @@ $(document).ready(function() { init_codefold(0); });
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
virtual Config & config()=0
Section & section(std::string const &name)
Returns the section with the given name.
-
bool ELB_SUPPORT
Definition Config.h:119
+
bool ELB_SUPPORT
Definition Config.h:121
virtual void setAmendmentBlocked()=0
diff --git a/ServiceRegistry_8h_source.html b/ServiceRegistry_8h_source.html index 12e2b8cdd6..4672d3376b 100644 --- a/ServiceRegistry_8h_source.html +++ b/ServiceRegistry_8h_source.html @@ -88,194 +88,221 @@ $(document).ready(function() { init_codefold(0); });
5#include <xrpl/basics/TaggedCache.h>
6#include <xrpl/ledger/CachedSLEs.h>
7
-
8namespace xrpl {
+
8#include <boost/asio.hpp>
9
-
10// Forward declarations
-
-
11namespace NodeStore {
-
12class Database;
-
13}
+
10namespace xrpl {
+
11
+
12// Forward declarations
+
+
13namespace NodeStore {
+
14class Database;
+
15}
-
-
14namespace Resource {
-
15class Manager;
-
16}
+
+
16namespace Resource {
+
17class Manager;
+
18}
-
17namespace perf {
-
18class PerfLog;
-
19}
-
20
-
21class AcceptedLedger;
-
22class AmendmentTable;
-
23class Cluster;
-
24class CollectorManager;
-
25class DatabaseCon;
-
26class Family;
-
27class HashRouter;
-
28class InboundLedgers;
-
29class InboundTransactions;
-
30class JobQueue;
-
31class LedgerCleaner;
-
32class LedgerMaster;
-
33class LedgerReplayer;
-
34class LoadFeeTrack;
-
35class LoadManager;
-
36class ManifestCache;
-
37class NetworkOPs;
-
38class OpenLedger;
-
39class OrderBookDB;
-
40class Overlay;
-
41class PathRequests;
-
42class PeerReservationTable;
-
43class PendingSaves;
-
44class RelationalDatabase;
-
45class ServerHandler;
-
46class SHAMapStore;
-
47class TimeKeeper;
-
48class TransactionMaster;
-
49class TxQ;
-
50class ValidatorList;
-
51class ValidatorSite;
-
52
-
53template <class Adaptor>
-
54class Validations;
-
55class RCLValidationsAdaptor;
- -
57
- -
59
-
- -
72{
-
73public:
-
74 ServiceRegistry() = default;
-
75 virtual ~ServiceRegistry() = default;
-
76
-
77 // Core infrastructure services
-
78 virtual CollectorManager&
- -
80
-
81 virtual Family&
- -
83
-
84 virtual TimeKeeper&
- +
19namespace perf {
+
20class PerfLog;
+
21}
+
22
+
23// This is temporary until we migrate all code to use ServiceRegistry.
+
24class Application;
+
25
+
26// Forward declarations
+
27class AcceptedLedger;
+
28class AmendmentTable;
+
29class Cluster;
+
30class CollectorManager;
+
31class DatabaseCon;
+
32class Family;
+
33class HashRouter;
+
34class InboundLedgers;
+
35class InboundTransactions;
+
36class JobQueue;
+
37class LedgerCleaner;
+
38class LedgerMaster;
+
39class LedgerReplayer;
+
40class LoadFeeTrack;
+
41class LoadManager;
+
42class ManifestCache;
+
43class NetworkOPs;
+
44class OpenLedger;
+
45class OrderBookDB;
+
46class Overlay;
+
47class PathRequests;
+
48class PeerReservationTable;
+
49class PendingSaves;
+
50class RelationalDatabase;
+
51class ServerHandler;
+
52class SHAMapStore;
+
53class TimeKeeper;
+
54class TransactionMaster;
+
55class TxQ;
+
56class ValidatorList;
+
57class ValidatorSite;
+
58
+
59template <class Adaptor>
+
60class Validations;
+
61class RCLValidationsAdaptor;
+ +
63
+ +
65
+
+ +
78{
+
79public:
+
80 ServiceRegistry() = default;
+
81 virtual ~ServiceRegistry() = default;
+
82
+
83 // Core infrastructure services
+
84 virtual CollectorManager&
+
86
-
87 virtual JobQueue&
- +
87 virtual Family&
+
89
-
90 virtual NodeCache&
- +
90 virtual TimeKeeper&
+
92
-
93 virtual CachedSLEs&
- +
93 virtual JobQueue&
+
95
-
96 // Protocol and validation services
-
97 virtual AmendmentTable&
- -
99
-
100 virtual HashRouter&
- -
102
-
103 virtual LoadFeeTrack&
- +
96 virtual NodeCache&
+ +
98
+
99 virtual CachedSLEs&
+ +
101
+
102 // Protocol and validation services
+
103 virtual AmendmentTable&
+
105
-
106 virtual LoadManager&
- +
106 virtual HashRouter&
+
108
-
109 virtual RCLValidations&
- +
109 virtual LoadFeeTrack&
+
111
-
112 virtual ValidatorList&
- +
112 virtual LoadManager&
+
114
-
115 virtual ValidatorSite&
- +
115 virtual RCLValidations&
+
117
-
118 virtual ManifestCache&
- +
118 virtual ValidatorList&
+
120
-
121 virtual ManifestCache&
- +
121 virtual ValidatorSite&
+
123
-
124 // Network services
-
125 virtual Overlay&
-
126 overlay() = 0;
-
127
-
128 virtual Cluster&
-
129 cluster() = 0;
-
130
-
131 virtual PeerReservationTable&
- +
124 virtual ManifestCache&
+ +
126
+
127 virtual ManifestCache&
+ +
129
+
130 // Network services
+
131 virtual Overlay&
+
132 overlay() = 0;
133
-
134 virtual Resource::Manager&
- +
134 virtual Cluster&
+
135 cluster() = 0;
136
-
137 // Storage services
-
138 virtual NodeStore::Database&
- -
140
-
141 virtual SHAMapStore&
- -
143
-
144 virtual RelationalDatabase&
- +
137 virtual PeerReservationTable&
+ +
139
+
140 virtual Resource::Manager&
+ +
142
+
143 // Storage services
+
144 virtual NodeStore::Database&
+
146
-
147 // Ledger services
-
148 virtual InboundLedgers&
- -
150
-
151 virtual InboundTransactions&
- -
153
- - +
147 virtual SHAMapStore&
+ +
149
+
150 virtual RelationalDatabase&
+ +
152
+
153 // Ledger services
+
154 virtual InboundLedgers&
+
156
-
157 virtual LedgerMaster&
- +
157 virtual InboundTransactions&
+
159
-
160 virtual LedgerCleaner&
- + +
162
-
163 virtual LedgerReplayer&
- +
163 virtual LedgerMaster&
+
165
-
166 virtual PendingSaves&
- +
166 virtual LedgerCleaner&
+
168
-
169 virtual OpenLedger&
- +
169 virtual LedgerReplayer&
+
171
-
172 virtual OpenLedger const&
-
173 openLedger() const = 0;
+
172 virtual PendingSaves&
+
174
-
175 // Transaction and operation services
-
176 virtual NetworkOPs&
-
177 getOPs() = 0;
-
178
-
179 virtual OrderBookDB&
- -
181
-
182 virtual TransactionMaster&
- +
175 virtual OpenLedger&
+ +
177
+
178 virtual OpenLedger const&
+
179 openLedger() const = 0;
+
180
+
181 // Transaction and operation services
+
182 virtual NetworkOPs&
+
183 getOPs() = 0;
184
-
185 virtual TxQ&
-
186 getTxQ() = 0;
+
185 virtual OrderBookDB&
+
187
-
188 virtual PathRequests&
- +
188 virtual TransactionMaster&
+
190
-
191 // Server services
-
192 virtual ServerHandler&
- -
194
-
195 virtual perf::PerfLog&
- -
197};
+
191 virtual TxQ&
+
192 getTxQ() = 0;
+
193
+
194 virtual PathRequests&
+ +
196
+
197 // Server services
+
198 virtual ServerHandler&
+ +
200
+
201 virtual perf::PerfLog&
+ +
203
+
204 // Configuration and state
+
205 virtual bool
+
206 isStopping() const = 0;
+
207
+
208 virtual beast::Journal
+
209 journal(std::string const& name) = 0;
+
210
+
211 virtual boost::asio::io_context&
+ +
213
+
214 virtual Logs&
+
215 logs() = 0;
+
216
+
217 // Temporary: Get the underlying Application for functions that haven't
+
218 // been migrated yet. This should be removed once all code is migrated.
+
219 virtual Application&
+
220 app() = 0;
+
221};
-
198
-
199} // namespace xrpl
+
222
+
223} // namespace xrpl
+ +
A generic endpoint for log messages.
Definition Journal.h:40
The amendment table stores the list of enabled and potential amendments.
+
Provides the beast::insight::Collector service.
@@ -288,6 +315,7 @@ $(document).ready(function() { init_codefold(0); });
Manages the lifetime of ledger replay tasks.
Manages the current fee schedule.
Manages load sources.
Definition LoadManager.h:26
+
Manages partitions for logging.
Definition Log.h:32
Remembers manifests with the highest sequence number.
Definition Manifest.h:224
Provides server functionality for clients.
Definition NetworkOPs.h:69
Persistency layer for NodeObject.
Definition Database.h:31
@@ -301,10 +329,11 @@ $(document).ready(function() { init_codefold(0); });
Tracks load and resource consumption.
class to create database, launch online delete thread, and related SQLite database
Definition SHAMapStore.h:18
-
Service registry for dependency injection.
+
Service registry for dependency injection.
virtual NodeCache & getTempNodeCache()=0
virtual perf::PerfLog & getPerfLog()=0
+
virtual Logs & logs()=0
virtual JobQueue & getJobQueue()=0
virtual RelationalDatabase & getRelationalDatabase()=0
virtual AmendmentTable & getAmendmentTable()=0
@@ -331,6 +360,8 @@ $(document).ready(function() { init_codefold(0); });
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual HashRouter & getHashRouter()=0
+
virtual bool isStopping() const =0
+
virtual boost::asio::io_context & getIOContext()=0
virtual Family & getNodeFamily()=0
virtual LedgerReplayer & getLedgerReplayer()=0
virtual ValidatorSite & validatorSites()=0
@@ -339,9 +370,11 @@ $(document).ready(function() { init_codefold(0); });
virtual OrderBookDB & getOrderBookDB()=0
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
virtual ManifestCache & validatorManifests()=0
+
virtual beast::Journal journal(std::string const &name)=0
virtual LedgerCleaner & getLedgerCleaner()=0
virtual InboundTransactions & getInboundTransactions()=0
virtual ~ServiceRegistry()=default
+
virtual Application & app()=0
Manages various times used by the server.
Definition TimeKeeper.h:12
diff --git a/SetSignerList_8cpp_source.html b/SetSignerList_8cpp_source.html index a3abd9fd0e..cab9c93902 100644 --- a/SetSignerList_8cpp_source.html +++ b/SetSignerList_8cpp_source.html @@ -283,7 +283,7 @@ $(document).ready(function() { init_codefold(0); });
187 // LCOV_EXCL_STOP
188 }
189
-
190 adjustOwnerCount(view, view.peek(accountKeylet), removeFromOwnerCount, app.journal("View"));
+
190 adjustOwnerCount(view, view.peek(accountKeylet), removeFromOwnerCount, app.journal("View"));
191
192 view.erase(signers);
193
@@ -401,7 +401,7 @@ $(document).ready(function() { init_codefold(0); });
299 view().insert(signerList);
300 writeSignersToSLE(signerList, flags);
301
-
302 auto viewJ = ctx_.app.journal("View");
+
302 auto viewJ = ctx_.app.journal("View");
303 // Add the signer list to the account's directory.
304 auto const page = ctx_.view().dirInsert(ownerDirKeylet, signerListKeylet, describeOwnerDir(account_));
305
@@ -482,7 +482,6 @@ $(document).ready(function() { init_codefold(0); });
Stream fatal() const
Definition Journal.h:324
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
-
virtual beast::Journal journal(std::string const &name)=0
STTx const & tx
ApplyView & view()
Application & app
@@ -509,6 +508,7 @@ $(document).ready(function() { init_codefold(0); });
static constexpr std::size_t minMultiSigners
Definition STTx.h:33
static constexpr std::size_t maxMultiSigners
Definition STTx.h:34
+
virtual beast::Journal journal(std::string const &name)=0
static std::tuple< NotTEC, std::uint32_t, std::vector< SignerEntries::SignerEntry >, Operation > determineOperation(STTx const &tx, ApplyFlags flags, beast::Journal j)
std::uint32_t quorum_
diff --git a/SetTrust_8cpp_source.html b/SetTrust_8cpp_source.html index 7ba5d6a4a7..9fe85f55dd 100644 --- a/SetTrust_8cpp_source.html +++ b/SetTrust_8cpp_source.html @@ -444,7 +444,7 @@ $(document).ready(function() { init_codefold(0); });
352 bool const bSetDeepFreeze = (uTxFlags & tfSetDeepFreeze);
353 bool const bClearDeepFreeze = (uTxFlags & tfClearDeepFreeze);
354
-
355 auto viewJ = ctx_.app.journal("View");
+
355 auto viewJ = ctx_.app.journal("View");
356
357 SLE::pointer sleDst = view().peek(keylet::account(uDstAccountID));
358
@@ -725,7 +725,6 @@ $(document).ready(function() { init_codefold(0); });
632
633} // namespace xrpl
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
-
virtual beast::Journal journal(std::string const &name)=0
STTx const & tx
Application & app
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
@@ -748,6 +747,7 @@ $(document).ready(function() { init_codefold(0); });
STAmount const & getFieldAmount(SField const &field) const
Definition STObject.cpp:632
std::uint32_t getFlags() const
Definition STObject.cpp:492
+
virtual beast::Journal journal(std::string const &name)=0
TER doApply() override
Definition SetTrust.cpp:298
static NotTEC checkPermission(ReadView const &view, STTx const &tx)
Definition SetTrust.cpp:109
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
Definition SetTrust.cpp:50
diff --git a/SignFor_8cpp_source.html b/SignFor_8cpp_source.html index 69b187e02e..8a3782b90d 100644 --- a/SignFor_8cpp_source.html +++ b/SignFor_8cpp_source.html @@ -128,7 +128,7 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:130
bool asBool() const
virtual Config & config()=0
-
bool canSign() const
Definition Config.h:323
+
bool canSign() const
Definition Config.h:324
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
Definition NetworkOPs.h:75
Json::Value transactionSignFor(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
diff --git a/SignHandler_8cpp_source.html b/SignHandler_8cpp_source.html index 93f53e8098..9aaa630c7a 100644 --- a/SignHandler_8cpp_source.html +++ b/SignHandler_8cpp_source.html @@ -129,7 +129,7 @@ $(document).ready(function() { init_codefold(0); });
bool asBool() const
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
-
bool canSign() const
Definition Config.h:323
+
bool canSign() const
Definition Config.h:324
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
Definition NetworkOPs.h:75
diff --git a/Simulate_8cpp_source.html b/Simulate_8cpp_source.html index 475c0ee5b6..780e2a7755 100644 --- a/Simulate_8cpp_source.html +++ b/Simulate_8cpp_source.html @@ -123,7 +123,7 @@ $(document).ready(function() { init_codefold(0); });
39 std::shared_ptr<SLE const> const sle = context.app.openLedger().current()->read(keylet::account(*srcAddressID));
40 if (!hasTicketSeq && !sle)
41 {
-
42 JLOG(context.app.journal("Simulate").debug()) << "Failed to find source account "
+
42 JLOG(context.app.journal("Simulate").debug()) << "Failed to find source account "
43 << "in current ledger: " << toBase58(*srcAddressID);
44
@@ -443,8 +443,7 @@ $(document).ready(function() { init_codefold(0); });
Value get(UInt index, Value const &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
Stream debug() const
Definition Journal.h:300
virtual Config & config()=0
-
virtual beast::Journal journal(std::string const &name)=0
-
uint32_t NETWORK_ID
Definition Config.h:137
+
uint32_t NETWORK_ID
Definition Config.h:138
std::shared_ptr< OpenView const > current() const
Returns a view to the current open ledger.
Writable ledger view that accumulates state and tx changes.
Definition OpenView.h:45
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition ReadView.h:97
@@ -458,6 +457,7 @@ $(document).ready(function() { init_codefold(0); });
virtual TxQ & getTxQ()=0
virtual LoadFeeTrack & getFeeTrack()=0
virtual OpenLedger & openLedger()=0
+
virtual beast::Journal journal(std::string const &name)=0
ApplyResult apply(Application &app, OpenView &view, std::shared_ptr< STTx const > const &tx, ApplyFlags flags, beast::Journal j)
Add a new transaction to the open ledger, hold it in the queue, or reject it.
Definition TxQ.cpp:663
SeqProxy nextQueuableSeq(std::shared_ptr< SLE const > const &sleAccount) const
Return the next sequence that would go in the TxQ for an account.
Definition TxQ.cpp:1452
diff --git a/SkipList__test_8cpp_source.html b/SkipList__test_8cpp_source.html index 9b99c03df8..a411c0d5cd 100644 --- a/SkipList__test_8cpp_source.html +++ b/SkipList__test_8cpp_source.html @@ -163,7 +163,7 @@ $(document).ready(function() { init_codefold(0); });
T back(T... args)
T begin(T... args)
A testsuite class.
Definition suite.h:51
- +
virtual TimeKeeper & timeKeeper()=0
time_point closeTime() const
Returns the predicted close time, in network time.
Definition TimeKeeper.h:55
@@ -174,7 +174,7 @@ $(document).ready(function() { init_codefold(0); });
beast::Journal const journal
Definition Env.h:160
T is_same_v
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
create_genesis_t const create_genesis
Definition Ledger.cpp:32
+
create_genesis_t const create_genesis
Definition Ledger.cpp:31
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition View.cpp:878
T next(T... args)
T push_back(T... args)
diff --git a/SociDB_8cpp_source.html b/SociDB_8cpp_source.html index a4be499ba8..a77228cc84 100644 --- a/SociDB_8cpp_source.html +++ b/SociDB_8cpp_source.html @@ -74,7 +74,7 @@ $(document).ready(function() { init_codefold(0); });
@@ -86,335 +86,335 @@ $(document).ready(function() { init_codefold(0); });
3#pragma clang diagnostic ignored "-Wdeprecated"
4#endif
5
-
6#include <xrpld/core/Config.h>
-
7#include <xrpld/core/DatabaseCon.h>
-
8#include <xrpld/core/SociDB.h>
-
9
-
10#include <xrpl/basics/ByteUtilities.h>
-
11#include <xrpl/basics/contract.h>
+
6#include <xrpl/basics/ByteUtilities.h>
+
7#include <xrpl/basics/contract.h>
+
8#include <xrpl/rdb/DatabaseCon.h>
+
9#include <xrpl/rdb/SociDB.h>
+
10
+
11#include <boost/filesystem.hpp>
12
-
13#include <boost/filesystem.hpp>
+
13#include <soci/sqlite3/soci-sqlite3.h>
14
-
15#include <soci/sqlite3/soci-sqlite3.h>
+
15#include <memory>
16
-
17#include <memory>
+
17namespace xrpl {
18
-
19namespace xrpl {
+
19static auto checkpointPageCount = 1000;
20
-
21static auto checkpointPageCount = 1000;
+
21namespace detail {
22
-
23namespace detail {
-
24
- -
-
26getSociSqliteInit(std::string const& name, std::string const& dir, std::string const& ext)
-
27{
-
28 if (name.empty())
-
29 {
-
30 Throw<std::runtime_error>("Sqlite databases must specify a dir and a name. Name: " + name + " Dir: " + dir);
-
31 }
-
32 boost::filesystem::path file(dir);
-
33 if (is_directory(file))
-
34 file /= name + ext;
-
35 return file.string();
-
36}
+ +
+
24getSociSqliteInit(std::string const& name, std::string const& dir, std::string const& ext)
+
25{
+
26 if (name.empty())
+
27 {
+
28 Throw<std::runtime_error>("Sqlite databases must specify a dir and a name. Name: " + name + " Dir: " + dir);
+
29 }
+
30 boost::filesystem::path file(dir);
+
31 if (is_directory(file))
+
32 file /= name + ext;
+
33 return file.string();
+
34}
-
37
- -
-
39getSociInit(BasicConfig const& config, std::string const& dbName)
-
40{
-
41 auto const& section = config.section("sqdb");
-
42 auto const backendName = get(section, "backend", "sqlite");
-
43
-
44 if (backendName != "sqlite")
-
45 Throw<std::runtime_error>("Unsupported soci backend: " + backendName);
-
46
-
47 auto const path = config.legacy("database_path");
-
48 auto const ext = dbName == "validators" || dbName == "peerfinder" ? ".sqlite" : ".db";
-
49 return detail::getSociSqliteInit(dbName, path, ext);
-
50}
+
35
+ +
+
37getSociInit(BasicConfig const& config, std::string const& dbName)
+
38{
+
39 auto const& section = config.section("sqdb");
+
40 auto const backendName = get(section, "backend", "sqlite");
+
41
+
42 if (backendName != "sqlite")
+
43 Throw<std::runtime_error>("Unsupported soci backend: " + backendName);
+
44
+
45 auto const path = config.legacy("database_path");
+
46 auto const ext = dbName == "validators" || dbName == "peerfinder" ? ".sqlite" : ".db";
+
47 return detail::getSociSqliteInit(dbName, path, ext);
+
48}
+
49
+
50} // namespace detail
51
-
52} // namespace detail
-
53
-
-
54DBConfig::DBConfig(std::string const& dbPath) : connectionString_(dbPath)
-
55{
-
56}
+
+
52DBConfig::DBConfig(std::string const& dbPath) : connectionString_(dbPath)
+
53{
+
54}
-
57
-
-
58DBConfig::DBConfig(BasicConfig const& config, std::string const& dbName) : DBConfig(detail::getSociInit(config, dbName))
-
59{
-
60}
+
55
+
+
56DBConfig::DBConfig(BasicConfig const& config, std::string const& dbName) : DBConfig(detail::getSociInit(config, dbName))
+
57{
+
58}
-
61
- -
- -
64{
-
65 return connectionString_;
-
66}
+
59
+ +
+ +
62{
+
63 return connectionString_;
+
64}
-
67
-
68void
-
-
69DBConfig::open(soci::session& s) const
-
70{
-
71 s.open(soci::sqlite3, connectionString());
-
72}
+
65
+
66void
+
+
67DBConfig::open(soci::session& s) const
+
68{
+
69 s.open(soci::sqlite3, connectionString());
+
70}
-
73
-
74void
-
-
75open(soci::session& s, BasicConfig const& config, std::string const& dbName)
-
76{
-
77 DBConfig(config, dbName).open(s);
-
78}
+
71
+
72void
+
+
73open(soci::session& s, BasicConfig const& config, std::string const& dbName)
+
74{
+
75 DBConfig(config, dbName).open(s);
+
76}
-
79
-
80void
-
-
81open(soci::session& s, std::string const& beName, std::string const& connectionString)
-
82{
-
83 if (beName == "sqlite")
-
84 s.open(soci::sqlite3, connectionString);
-
85 else
-
86 Throw<std::runtime_error>("Unsupported soci backend: " + beName);
-
87}
+
77
+
78void
+
+
79open(soci::session& s, std::string const& beName, std::string const& connectionString)
+
80{
+
81 if (beName == "sqlite")
+
82 s.open(soci::sqlite3, connectionString);
+
83 else
+
84 Throw<std::runtime_error>("Unsupported soci backend: " + beName);
+
85}
-
88
-
89static sqlite_api::sqlite3*
-
-
90getConnection(soci::session& s)
-
91{
-
92 sqlite_api::sqlite3* result = nullptr;
-
93 auto be = s.get_backend();
-
94 if (auto b = dynamic_cast<soci::sqlite3_session_backend*>(be))
-
95 result = b->conn_;
-
96
-
97 if (!result)
-
98 Throw<std::logic_error>("Didn't get a database connection.");
-
99
-
100 return result;
-
101}
+
86
+
87static sqlite_api::sqlite3*
+
+
88getConnection(soci::session& s)
+
89{
+
90 sqlite_api::sqlite3* result = nullptr;
+
91 auto be = s.get_backend();
+
92 if (auto b = dynamic_cast<soci::sqlite3_session_backend*>(be))
+
93 result = b->conn_;
+
94
+
95 if (!result)
+
96 Throw<std::logic_error>("Didn't get a database connection.");
+
97
+
98 return result;
+
99}
-
102
- -
-
104getKBUsedAll(soci::session& s)
-
105{
-
106 if (!getConnection(s))
-
107 Throw<std::logic_error>("No connection found.");
-
108 return static_cast<size_t>(sqlite_api::sqlite3_memory_used() / kilobytes(1));
-
109}
+
100
+ +
+
102getKBUsedAll(soci::session& s)
+
103{
+
104 if (!getConnection(s))
+
105 Throw<std::logic_error>("No connection found.");
+
106 return static_cast<size_t>(sqlite_api::sqlite3_memory_used() / kilobytes(1));
+
107}
-
110
- -
-
112getKBUsedDB(soci::session& s)
-
113{
-
114 // This function will have to be customized when other backends are added
-
115 if (auto conn = getConnection(s))
-
116 {
-
117 int cur = 0, hiw = 0;
-
118 sqlite_api::sqlite3_db_status(conn, SQLITE_DBSTATUS_CACHE_USED, &cur, &hiw, 0);
-
119 return cur / kilobytes(1);
-
120 }
-
121 Throw<std::logic_error>("");
-
122 return 0; // Silence compiler warning.
-
123}
+
108
+ +
+
110getKBUsedDB(soci::session& s)
+
111{
+
112 // This function will have to be customized when other backends are added
+
113 if (auto conn = getConnection(s))
+
114 {
+
115 int cur = 0, hiw = 0;
+
116 sqlite_api::sqlite3_db_status(conn, SQLITE_DBSTATUS_CACHE_USED, &cur, &hiw, 0);
+
117 return cur / kilobytes(1);
+
118 }
+
119 Throw<std::logic_error>("");
+
120 return 0; // Silence compiler warning.
+
121}
-
124
-
125void
-
-
126convert(soci::blob& from, std::vector<std::uint8_t>& to)
-
127{
-
128 to.resize(from.get_len());
-
129 if (to.empty())
-
130 return;
-
131 from.read(0, reinterpret_cast<char*>(&to[0]), from.get_len());
-
132}
+
122
+
123void
+
+
124convert(soci::blob& from, std::vector<std::uint8_t>& to)
+
125{
+
126 to.resize(from.get_len());
+
127 if (to.empty())
+
128 return;
+
129 from.read(0, reinterpret_cast<char*>(&to[0]), from.get_len());
+
130}
-
133
-
134void
-
-
135convert(soci::blob& from, std::string& to)
-
136{
- -
138 convert(from, tmp);
-
139 to.assign(tmp.begin(), tmp.end());
-
140}
+
131
+
132void
+
+
133convert(soci::blob& from, std::string& to)
+
134{
+ +
136 convert(from, tmp);
+
137 to.assign(tmp.begin(), tmp.end());
+
138}
-
141
-
142void
-
-
143convert(std::vector<std::uint8_t> const& from, soci::blob& to)
-
144{
-
145 if (!from.empty())
-
146 to.write(0, reinterpret_cast<char const*>(&from[0]), from.size());
-
147 else
-
148 to.trim(0);
-
149}
+
139
+
140void
+
+
141convert(std::vector<std::uint8_t> const& from, soci::blob& to)
+
142{
+
143 if (!from.empty())
+
144 to.write(0, reinterpret_cast<char const*>(&from[0]), from.size());
+
145 else
+
146 to.trim(0);
+
147}
-
150
-
151void
-
-
152convert(std::string const& from, soci::blob& to)
-
153{
-
154 if (!from.empty())
-
155 to.write(0, from.data(), from.size());
-
156 else
-
157 to.trim(0);
-
158}
+
148
+
149void
+
+
150convert(std::string const& from, soci::blob& to)
+
151{
+
152 if (!from.empty())
+
153 to.write(0, from.data(), from.size());
+
154 else
+
155 to.trim(0);
+
156}
+
157
+
158namespace {
159
-
160namespace {
-
161
-
171class WALCheckpointer : public Checkpointer
-
172{
-
173public:
-
174 WALCheckpointer(std::uintptr_t id, std::weak_ptr<soci::session> session, JobQueue& q, Logs& logs)
-
175 : id_(id), session_(std::move(session)), jobQueue_(q), j_(logs.journal("WALCheckpointer"))
-
176 {
-
177 if (auto [conn, keepAlive] = getConnection(); conn)
-
178 {
-
179 (void)keepAlive;
-
180 sqlite_api::sqlite3_wal_hook(conn, &sqliteWALHook, reinterpret_cast<void*>(id_));
-
181 }
-
182 }
-
183
- -
185 getConnection() const
-
186 {
-
187 if (auto p = session_.lock())
-
188 {
-
189 return {xrpl::getConnection(*p), p};
-
190 }
-
191 return {nullptr, std::shared_ptr<soci::session>{}};
-
192 }
-
193
- -
195 id() const override
-
196 {
-
197 return id_;
-
198 }
+
169class WALCheckpointer : public Checkpointer
+
170{
+
171public:
+
172 WALCheckpointer(std::uintptr_t id, std::weak_ptr<soci::session> session, JobQueue& q, Logs& logs)
+
173 : id_(id), session_(std::move(session)), jobQueue_(q), j_(logs.journal("WALCheckpointer"))
+
174 {
+
175 if (auto [conn, keepAlive] = getConnection(); conn)
+
176 {
+
177 (void)keepAlive;
+
178 sqlite_api::sqlite3_wal_hook(conn, &sqliteWALHook, reinterpret_cast<void*>(id_));
+
179 }
+
180 }
+
181
+ +
183 getConnection() const
+
184 {
+
185 if (auto p = session_.lock())
+
186 {
+
187 return {xrpl::getConnection(*p), p};
+
188 }
+
189 return {nullptr, std::shared_ptr<soci::session>{}};
+
190 }
+
191
+ +
193 id() const override
+
194 {
+
195 return id_;
+
196 }
+
197
+
198 ~WALCheckpointer() override = default;
199
-
200 ~WALCheckpointer() override = default;
-
201
-
202 void
-
203 schedule() override
-
204 {
-
205 {
-
206 std::lock_guard lock(mutex_);
-
207 if (running_)
-
208 return;
-
209 running_ = true;
-
210 }
-
211
-
212 // If the Job is not added to the JobQueue then we're not running_.
-
213 if (!jobQueue_.addJob(
-
214 jtWAL,
-
215 "WAL",
-
216 // If the owning DatabaseCon is destroyed, no need to checkpoint
-
217 // or keep the checkpointer alive so use a weak_ptr to this.
-
218 // There is a separate check in `checkpoint` for a valid
-
219 // connection in the rare case when the DatabaseCon is destroyed
-
220 // after locking this weak_ptr
-
221 [wp = std::weak_ptr<Checkpointer>{shared_from_this()}]() {
-
222 if (auto self = wp.lock())
-
223 self->checkpoint();
-
224 }))
-
225 {
-
226 std::lock_guard lock(mutex_);
-
227 running_ = false;
-
228 }
-
229 }
-
230
-
231 void
-
232 checkpoint() override
-
233 {
-
234 auto [conn, keepAlive] = getConnection();
-
235 (void)keepAlive;
-
236 if (!conn)
-
237 return;
-
238
-
239 int log = 0, ckpt = 0;
-
240 int ret = sqlite3_wal_checkpoint_v2(conn, nullptr, SQLITE_CHECKPOINT_PASSIVE, &log, &ckpt);
-
241
-
242 auto fname = sqlite3_db_filename(conn, "main");
-
243 if (ret != SQLITE_OK)
-
244 {
-
245 auto jm = (ret == SQLITE_LOCKED) ? j_.trace() : j_.warn();
-
246 JLOG(jm) << "WAL(" << fname << "): error " << ret;
-
247 }
-
248 else
-
249 {
-
250 JLOG(j_.trace()) << "WAL(" << fname << "): frames=" << log << ", written=" << ckpt;
-
251 }
-
252
-
253 std::lock_guard lock(mutex_);
-
254 running_ = false;
-
255 }
-
256
-
257protected:
-
258 std::uintptr_t const id_;
-
259 // session is owned by the DatabaseCon parent that holds the checkpointer.
-
260 // It is possible (though rare) for the DatabaseCon class to be destroyed
-
261 // before the checkpointer.
- -
263 std::mutex mutex_;
-
264 JobQueue& jobQueue_;
-
265
-
266 bool running_ = false;
-
267 beast::Journal const j_;
-
268
-
269 static int
-
270 sqliteWALHook(void* cpId, sqlite_api::sqlite3* conn, char const* dbName, int walSize)
-
271 {
-
272 if (walSize >= checkpointPageCount)
-
273 {
-
274 if (auto checkpointer = checkpointerFromId(reinterpret_cast<std::uintptr_t>(cpId)))
-
275 {
-
276 checkpointer->schedule();
-
277 }
-
278 else
-
279 {
-
280 sqlite_api::sqlite3_wal_hook(conn, nullptr, nullptr);
-
281 }
-
282 }
-
283 return SQLITE_OK;
-
284 }
-
285};
+
200 void
+
201 schedule() override
+
202 {
+
203 {
+
204 std::lock_guard lock(mutex_);
+
205 if (running_)
+
206 return;
+
207 running_ = true;
+
208 }
+
209
+
210 // If the Job is not added to the JobQueue then we're not running_.
+
211 if (!jobQueue_.addJob(
+
212 jtWAL,
+
213 "WAL",
+
214 // If the owning DatabaseCon is destroyed, no need to checkpoint
+
215 // or keep the checkpointer alive so use a weak_ptr to this.
+
216 // There is a separate check in `checkpoint` for a valid
+
217 // connection in the rare case when the DatabaseCon is destroyed
+
218 // after locking this weak_ptr
+
219 [wp = std::weak_ptr<Checkpointer>{shared_from_this()}]() {
+
220 if (auto self = wp.lock())
+
221 self->checkpoint();
+
222 }))
+
223 {
+
224 std::lock_guard lock(mutex_);
+
225 running_ = false;
+
226 }
+
227 }
+
228
+
229 void
+
230 checkpoint() override
+
231 {
+
232 auto [conn, keepAlive] = getConnection();
+
233 (void)keepAlive;
+
234 if (!conn)
+
235 return;
+
236
+
237 int log = 0, ckpt = 0;
+
238 int ret = sqlite3_wal_checkpoint_v2(conn, nullptr, SQLITE_CHECKPOINT_PASSIVE, &log, &ckpt);
+
239
+
240 auto fname = sqlite3_db_filename(conn, "main");
+
241 if (ret != SQLITE_OK)
+
242 {
+
243 auto jm = (ret == SQLITE_LOCKED) ? j_.trace() : j_.warn();
+
244 JLOG(jm) << "WAL(" << fname << "): error " << ret;
+
245 }
+
246 else
+
247 {
+
248 JLOG(j_.trace()) << "WAL(" << fname << "): frames=" << log << ", written=" << ckpt;
+
249 }
+
250
+
251 std::lock_guard lock(mutex_);
+
252 running_ = false;
+
253 }
+
254
+
255protected:
+
256 std::uintptr_t const id_;
+
257 // session is owned by the DatabaseCon parent that holds the checkpointer.
+
258 // It is possible (though rare) for the DatabaseCon class to be destroyed
+
259 // before the checkpointer.
+ +
261 std::mutex mutex_;
+
262 JobQueue& jobQueue_;
+
263
+
264 bool running_ = false;
+
265 beast::Journal const j_;
+
266
+
267 static int
+
268 sqliteWALHook(void* cpId, sqlite_api::sqlite3* conn, char const* dbName, int walSize)
+
269 {
+
270 if (walSize >= checkpointPageCount)
+
271 {
+
272 if (auto checkpointer = checkpointerFromId(reinterpret_cast<std::uintptr_t>(cpId)))
+
273 {
+
274 checkpointer->schedule();
+
275 }
+
276 else
+
277 {
+
278 sqlite_api::sqlite3_wal_hook(conn, nullptr, nullptr);
+
279 }
+
280 }
+
281 return SQLITE_OK;
+
282 }
+
283};
+
284
+
285} // namespace
286
-
287} // namespace
-
288
- -
- -
291{
-
292 return std::make_shared<WALCheckpointer>(id, std::move(session), queue, logs);
-
293}
+ +
+ +
289{
+
290 return std::make_shared<WALCheckpointer>(id, std::move(session), queue, logs);
+
291}
+
292
+
293} // namespace xrpl
294
-
295} // namespace xrpl
-
296
-
297#if defined(__clang__)
-
298#pragma clang diagnostic pop
-
299#endif
+
295#if defined(__clang__)
+
296#pragma clang diagnostic pop
+
297#endif
T assign(T... args)
T begin(T... args)
A generic endpoint for log messages.
Definition Journal.h:40
+
Stream trace() const
Severity stream access functions.
Definition Journal.h:294
+
Stream warn() const
Definition Journal.h:312
Holds unparsed configuration information.
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
Section & section(std::string const &name)
Returns the section with the given name.
DBConfig is used when a client wants to delay opening a soci::session after parsing the config parame...
Definition SociDB.h:40
-
void open(soci::session &s) const
Definition SociDB.cpp:69
-
std::string connectionString() const
Definition SociDB.cpp:63
+
void open(soci::session &s) const
Definition SociDB.cpp:67
+
std::string connectionString() const
Definition SociDB.cpp:61
std::string connectionString_
Definition SociDB.h:41
-
DBConfig(std::string const &dbPath)
Definition SociDB.cpp:54
+
DBConfig(std::string const &dbPath)
Definition SociDB.cpp:52
A pool of threads to perform work.
Definition JobQueue.h:37
Manages partitions for logging.
Definition Log.h:32
T data(T... args)
@@ -428,20 +428,20 @@ $(document).ready(function() { init_codefold(0); });
STL namespace.
-
std::string getSociSqliteInit(std::string const &name, std::string const &dir, std::string const &ext)
Definition SociDB.cpp:26
-
std::string getSociInit(BasicConfig const &config, std::string const &dbName)
Definition SociDB.cpp:39
+
std::string getSociSqliteInit(std::string const &name, std::string const &dir, std::string const &ext)
Definition SociDB.cpp:24
+
std::string getSociInit(BasicConfig const &config, std::string const &dbName)
Definition SociDB.cpp:37
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
static auto checkpointPageCount
Definition SociDB.cpp:21
+
static auto checkpointPageCount
Definition SociDB.cpp:19
T get(Section const &section, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
-
std::uint32_t getKBUsedDB(soci::session &s)
Definition SociDB.cpp:112
-
static sqlite_api::sqlite3 * getConnection(soci::session &s)
Definition SociDB.cpp:90
-
std::uint32_t getKBUsedAll(soci::session &s)
Definition SociDB.cpp:104
+
std::uint32_t getKBUsedDB(soci::session &s)
Definition SociDB.cpp:110
+
static sqlite_api::sqlite3 * getConnection(soci::session &s)
Definition SociDB.cpp:88
+
std::uint32_t getKBUsedAll(soci::session &s)
Definition SociDB.cpp:102
@ jtWAL
Definition Job.h:49
@ open
We haven't closed our ledger yet, but others might have.
-
std::shared_ptr< Checkpointer > makeCheckpointer(std::uintptr_t id, std::weak_ptr< soci::session > session, JobQueue &queue, Logs &logs)
Returns a new checkpointer which makes checkpoints of a soci database every checkpointPageCount pages...
Definition SociDB.cpp:290
+
std::shared_ptr< Checkpointer > makeCheckpointer(std::uintptr_t id, std::weak_ptr< soci::session >, JobQueue &, Logs &)
Returns a new checkpointer which makes checkpoints of a soci database every checkpointPageCount pages...
Definition SociDB.cpp:288
constexpr auto kilobytes(T value) noexcept
-
void convert(soci::blob &from, std::vector< std::uint8_t > &to)
Definition SociDB.cpp:126
-
std::shared_ptr< Checkpointer > checkpointerFromId(std::uintptr_t id)
+
void convert(soci::blob &from, std::vector< std::uint8_t > &to)
Definition SociDB.cpp:124
+
std::shared_ptr< Checkpointer > checkpointerFromId(std::uintptr_t id)
T resize(T... args)
diff --git a/SociDB_8h_source.html b/SociDB_8h_source.html index 42698424c2..e6fa8db257 100644 --- a/SociDB_8h_source.html +++ b/SociDB_8h_source.html @@ -74,7 +74,7 @@ $(document).ready(function() { init_codefold(0); });
@@ -175,7 +175,7 @@ $(document).ready(function() { init_codefold(0); });
virtual void schedule()=0
virtual ~Checkpointer()=default
DBConfig is used when a client wants to delay opening a soci::session after parsing the config parame...
Definition SociDB.h:40
-
std::string connectionString() const
Definition SociDB.cpp:63
+
std::string connectionString() const
Definition SociDB.cpp:61
std::string connectionString_
Definition SociDB.h:41
A pool of threads to perform work.
Definition JobQueue.h:37
Manages partitions for logging.
Definition Log.h:32
@@ -184,11 +184,11 @@ $(document).ready(function() { init_codefold(0); });
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
-
std::uint32_t getKBUsedDB(soci::session &s)
Definition SociDB.cpp:112
-
std::uint32_t getKBUsedAll(soci::session &s)
Definition SociDB.cpp:104
+
std::uint32_t getKBUsedDB(soci::session &s)
Definition SociDB.cpp:110
+
std::uint32_t getKBUsedAll(soci::session &s)
Definition SociDB.cpp:102
@ open
We haven't closed our ledger yet, but others might have.
-
std::shared_ptr< Checkpointer > makeCheckpointer(std::uintptr_t id, std::weak_ptr< soci::session > session, JobQueue &queue, Logs &logs)
Returns a new checkpointer which makes checkpoints of a soci database every checkpointPageCount pages...
Definition SociDB.cpp:290
-
void convert(soci::blob &from, std::vector< std::uint8_t > &to)
Definition SociDB.cpp:126
+
std::shared_ptr< Checkpointer > makeCheckpointer(std::uintptr_t id, std::weak_ptr< soci::session >, JobQueue &, Logs &)
Returns a new checkpointer which makes checkpoints of a soci database every checkpointPageCount pages...
Definition SociDB.cpp:288
+
void convert(soci::blob &from, std::vector< std::uint8_t > &to)
Definition SociDB.cpp:124
diff --git a/SociDB__test_8cpp_source.html b/SociDB__test_8cpp_source.html index 567c9ecc4c..9ed846fad0 100644 --- a/SociDB__test_8cpp_source.html +++ b/SociDB__test_8cpp_source.html @@ -83,383 +83,382 @@ $(document).ready(function() { init_codefold(0); });
1#include <test/jtx/TestSuite.h>
2
-
3#include <xrpld/core/SociDB.h>
-
4
-
5#include <xrpl/basics/BasicConfig.h>
-
6#include <xrpl/basics/contract.h>
-
7
-
8#include <boost/algorithm/string.hpp>
-
9#include <boost/filesystem.hpp>
-
10
-
11namespace xrpl {
-
-
12class SociDB_test final : public TestSuite
-
13{
-
14private:
-
15 static void
-
-
16 setupSQLiteConfig(BasicConfig& config, boost::filesystem::path const& dbPath)
-
17 {
-
18 config.overwrite("sqdb", "backend", "sqlite");
-
19 auto value = dbPath.string();
-
20 if (!value.empty())
-
21 config.legacy("database_path", value);
-
22 }
+
3#include <xrpl/basics/BasicConfig.h>
+
4#include <xrpl/basics/contract.h>
+
5#include <xrpl/rdb/SociDB.h>
+
6
+
7#include <boost/algorithm/string.hpp>
+
8#include <boost/filesystem.hpp>
+
9
+
10namespace xrpl {
+
+
11class SociDB_test final : public TestSuite
+
12{
+
13private:
+
14 static void
+
+
15 setupSQLiteConfig(BasicConfig& config, boost::filesystem::path const& dbPath)
+
16 {
+
17 config.overwrite("sqdb", "backend", "sqlite");
+
18 auto value = dbPath.string();
+
19 if (!value.empty())
+
20 config.legacy("database_path", value);
+
21 }
-
23
-
24 static void
-
-
25 cleanupDatabaseDir(boost::filesystem::path const& dbPath)
-
26 {
-
27 using namespace boost::filesystem;
-
28 if (!exists(dbPath) || !is_directory(dbPath) || !is_empty(dbPath))
-
29 return;
-
30 remove(dbPath);
-
31 }
+
22
+
23 static void
+
+
24 cleanupDatabaseDir(boost::filesystem::path const& dbPath)
+
25 {
+
26 using namespace boost::filesystem;
+
27 if (!exists(dbPath) || !is_directory(dbPath) || !is_empty(dbPath))
+
28 return;
+
29 remove(dbPath);
+
30 }
-
32
-
33 static void
-
-
34 setupDatabaseDir(boost::filesystem::path const& dbPath)
-
35 {
-
36 using namespace boost::filesystem;
-
37 if (!exists(dbPath))
-
38 {
-
39 create_directory(dbPath);
-
40 return;
-
41 }
-
42
-
43 if (!is_directory(dbPath))
-
44 {
-
45 // someone created a file where we want to put out directory
-
46 Throw<std::runtime_error>("Cannot create directory: " + dbPath.string());
-
47 }
-
48 }
+
31
+
32 static void
+
+
33 setupDatabaseDir(boost::filesystem::path const& dbPath)
+
34 {
+
35 using namespace boost::filesystem;
+
36 if (!exists(dbPath))
+
37 {
+
38 create_directory(dbPath);
+
39 return;
+
40 }
+
41
+
42 if (!is_directory(dbPath))
+
43 {
+
44 // someone created a file where we want to put out directory
+
45 Throw<std::runtime_error>("Cannot create directory: " + dbPath.string());
+
46 }
+
47 }
-
49 static boost::filesystem::path
-
- -
51 {
-
52 return boost::filesystem::current_path() / "socidb_test_databases";
-
53 }
+
48 static boost::filesystem::path
+
+ +
50 {
+
51 return boost::filesystem::current_path() / "socidb_test_databases";
+
52 }
-
54
-
55public:
-
- -
57 {
-
58 try
-
59 {
- -
61 }
-
62 catch (std::exception const&)
-
63 {
-
64 }
-
65 }
+
53
+
54public:
+
+ +
56 {
+
57 try
+
58 {
+ +
60 }
+
61 catch (std::exception const&)
+
62 {
+
63 }
+
64 }
-
- -
67 {
-
68 try
-
69 {
- -
71 }
-
72 catch (std::exception const&)
-
73 {
-
74 }
-
75 }
+
+ +
66 {
+
67 try
+
68 {
+ +
70 }
+
71 catch (std::exception const&)
+
72 {
+
73 }
+
74 }
-
76 void
-
- -
78 {
-
79 // confirm that files are given the correct extensions
-
80 testcase("sqliteFileNames");
- - - -
84 {{"peerfinder", ".sqlite"}, {"state", ".db"}, {"random", ".db"}, {"validators", ".sqlite"}});
-
85
-
86 for (auto const& i : d)
-
87 {
-
88 DBConfig sc(c, i.first);
-
89 BEAST_EXPECT(boost::ends_with(sc.connectionString(), i.first + i.second));
-
90 }
-
91 }
+
75 void
+
+ +
77 {
+
78 // confirm that files are given the correct extensions
+
79 testcase("sqliteFileNames");
+ + + +
83 {{"peerfinder", ".sqlite"}, {"state", ".db"}, {"random", ".db"}, {"validators", ".sqlite"}});
+
84
+
85 for (auto const& i : d)
+
86 {
+
87 DBConfig sc(c, i.first);
+
88 BEAST_EXPECT(boost::ends_with(sc.connectionString(), i.first + i.second));
+
89 }
+
90 }
-
92 void
-
- -
94 {
-
95 testcase("open");
- - -
98 DBConfig sc(c, "SociTestDB");
-
99 std::vector<std::string> const stringData({"String1", "String2", "String3"});
-
100 std::vector<int> const intData({1, 2, 3});
-
101 auto checkValues = [this, &stringData, &intData](soci::session& s) {
-
102 // Check values in db
-
103 std::vector<std::string> stringResult(20 * stringData.size());
-
104 std::vector<int> intResult(20 * intData.size());
-
105 s << "SELECT StringData, IntData FROM SociTestTable;", soci::into(stringResult), soci::into(intResult);
-
106 BEAST_EXPECT(stringResult.size() == stringData.size() && intResult.size() == intData.size());
-
107 for (int i = 0; i < stringResult.size(); ++i)
-
108 {
-
109 auto si =
-
110 std::distance(stringData.begin(), std::find(stringData.begin(), stringData.end(), stringResult[i]));
-
111 auto ii = std::distance(intData.begin(), std::find(intData.begin(), intData.end(), intResult[i]));
-
112 BEAST_EXPECT(si == ii && si < stringResult.size());
-
113 }
-
114 };
-
115
-
116 {
-
117 soci::session s;
-
118 sc.open(s);
-
119 s << "CREATE TABLE IF NOT EXISTS SociTestTable ("
-
120 " Key INTEGER PRIMARY KEY,"
-
121 " StringData TEXT,"
-
122 " IntData INTEGER"
-
123 ");";
-
124
-
125 s << "INSERT INTO SociTestTable (StringData, IntData) VALUES "
-
126 "(:stringData, :intData);",
-
127 soci::use(stringData), soci::use(intData);
-
128 checkValues(s);
-
129 }
-
130 {
-
131 // Check values in db after session was closed
-
132 soci::session s;
-
133 sc.open(s);
-
134 checkValues(s);
-
135 }
-
136 {
-
137 namespace bfs = boost::filesystem;
-
138 // Remove the database
-
139 bfs::path dbPath(sc.connectionString());
-
140 if (bfs::is_regular_file(dbPath))
-
141 bfs::remove(dbPath);
-
142 }
-
143 }
+
91 void
+
+ +
93 {
+
94 testcase("open");
+ + +
97 DBConfig sc(c, "SociTestDB");
+
98 std::vector<std::string> const stringData({"String1", "String2", "String3"});
+
99 std::vector<int> const intData({1, 2, 3});
+
100 auto checkValues = [this, &stringData, &intData](soci::session& s) {
+
101 // Check values in db
+
102 std::vector<std::string> stringResult(20 * stringData.size());
+
103 std::vector<int> intResult(20 * intData.size());
+
104 s << "SELECT StringData, IntData FROM SociTestTable;", soci::into(stringResult), soci::into(intResult);
+
105 BEAST_EXPECT(stringResult.size() == stringData.size() && intResult.size() == intData.size());
+
106 for (int i = 0; i < stringResult.size(); ++i)
+
107 {
+
108 auto si =
+
109 std::distance(stringData.begin(), std::find(stringData.begin(), stringData.end(), stringResult[i]));
+
110 auto ii = std::distance(intData.begin(), std::find(intData.begin(), intData.end(), intResult[i]));
+
111 BEAST_EXPECT(si == ii && si < stringResult.size());
+
112 }
+
113 };
+
114
+
115 {
+
116 soci::session s;
+
117 sc.open(s);
+
118 s << "CREATE TABLE IF NOT EXISTS SociTestTable ("
+
119 " Key INTEGER PRIMARY KEY,"
+
120 " StringData TEXT,"
+
121 " IntData INTEGER"
+
122 ");";
+
123
+
124 s << "INSERT INTO SociTestTable (StringData, IntData) VALUES "
+
125 "(:stringData, :intData);",
+
126 soci::use(stringData), soci::use(intData);
+
127 checkValues(s);
+
128 }
+
129 {
+
130 // Check values in db after session was closed
+
131 soci::session s;
+
132 sc.open(s);
+
133 checkValues(s);
+
134 }
+
135 {
+
136 namespace bfs = boost::filesystem;
+
137 // Remove the database
+
138 bfs::path dbPath(sc.connectionString());
+
139 if (bfs::is_regular_file(dbPath))
+
140 bfs::remove(dbPath);
+
141 }
+
142 }
-
144
-
145 void
-
- -
147 {
-
148 testcase("select");
-
149 BasicConfig c;
- -
151 DBConfig sc(c, "SociTestDB");
- -
153 std::vector<std::int64_t> const bid({-10, -20, -30});
- -
155 std::vector<std::int32_t> const id({-1, -2, -3});
-
156
-
157 {
-
158 soci::session s;
-
159 sc.open(s);
-
160
-
161 s << "DROP TABLE IF EXISTS STT;";
-
162
-
163 s << "CREATE TABLE STT ("
-
164 " I INTEGER,"
-
165 " UI INTEGER UNSIGNED,"
-
166 " BI BIGINT,"
-
167 " UBI BIGINT UNSIGNED"
-
168 ");";
-
169
-
170 s << "INSERT INTO STT (I, UI, BI, UBI) VALUES "
-
171 "(:id, :idu, :bid, :bidu);",
-
172 soci::use(id), soci::use(uid), soci::use(bid), soci::use(ubid);
-
173
-
174 try
-
175 {
-
176 std::int32_t ig = 0;
-
177 std::uint32_t uig = 0;
-
178 std::int64_t big = 0;
-
179 std::uint64_t ubig = 0;
-
180 s << "SELECT I, UI, BI, UBI from STT;", soci::into(ig), soci::into(uig), soci::into(big),
-
181 soci::into(ubig);
-
182 BEAST_EXPECT(ig == id[0] && uig == uid[0] && big == bid[0] && ubig == ubid[0]);
-
183 }
-
184 catch (std::exception&)
-
185 {
-
186 fail();
-
187 }
-
188 try
-
189 {
-
190 // SOCI requires boost::optional (not std::optional) as
-
191 // parameters.
-
192 boost::optional<std::int32_t> ig;
-
193 // Known bug: https://github.com/SOCI/soci/issues/926
-
194 // boost::optional<std::uint32_t> uig;
-
195 uint32_t uig = 0;
-
196 boost::optional<std::int64_t> big;
-
197 boost::optional<std::uint64_t> ubig;
-
198 s << "SELECT I, UI, BI, UBI from STT;", soci::into(ig), soci::into(uig), soci::into(big),
-
199 soci::into(ubig);
-
200 BEAST_EXPECT(*ig == id[0] && uig == uid[0] && *big == bid[0] && *ubig == ubid[0]);
-
201 }
-
202 catch (std::exception&)
-
203 {
-
204 fail();
-
205 }
-
206 // There are too many issues when working with soci::row and
-
207 // boost::tuple. DO NOT USE soci row! I had a set of workarounds to
-
208 // make soci row less error prone, I'm keeping these tests in case I
-
209 // try to add soci::row and boost::tuple back into soci.
-
210#if 0
-
211 try
-
212 {
-
213 std::int32_t ig = 0;
-
214 std::uint32_t uig = 0;
-
215 std::int64_t big = 0;
-
216 std::uint64_t ubig = 0;
-
217 soci::row r;
-
218 s << "SELECT I, UI, BI, UBI from STT", soci::into (r);
-
219 ig = r.get<std::int32_t>(0);
-
220 uig = r.get<std::uint32_t>(1);
-
221 big = r.get<std::int64_t>(2);
-
222 ubig = r.get<std::uint64_t>(3);
-
223 BEAST_EXPECT(ig == id[0] && uig == uid[0] && big == bid[0] &&
-
224 ubig == ubid[0]);
-
225 }
-
226 catch (std::exception&)
-
227 {
-
228 fail ();
-
229 }
-
230 try
-
231 {
-
232 std::int32_t ig = 0;
-
233 std::uint32_t uig = 0;
-
234 std::int64_t big = 0;
-
235 std::uint64_t ubig = 0;
-
236 soci::row r;
-
237 s << "SELECT I, UI, BI, UBI from STT", soci::into (r);
-
238 ig = r.get<std::int32_t>("I");
-
239 uig = r.get<std::uint32_t>("UI");
-
240 big = r.get<std::int64_t>("BI");
-
241 ubig = r.get<std::uint64_t>("UBI");
-
242 BEAST_EXPECT(ig == id[0] && uig == uid[0] && big == bid[0] &&
-
243 ubig == ubid[0]);
-
244 }
-
245 catch (std::exception&)
-
246 {
-
247 fail ();
-
248 }
-
249 try
-
250 {
-
251 boost::tuple<std::int32_t,
- - -
254 std::uint64_t> d;
-
255 s << "SELECT I, UI, BI, UBI from STT", soci::into (d);
-
256 BEAST_EXPECT(get<0>(d) == id[0] && get<1>(d) == uid[0] &&
-
257 get<2>(d) == bid[0] && get<3>(d) == ubid[0]);
-
258 }
-
259 catch (std::exception&)
-
260 {
-
261 fail ();
-
262 }
-
263#endif
-
264 }
-
265 {
-
266 namespace bfs = boost::filesystem;
-
267 // Remove the database
-
268 bfs::path dbPath(sc.connectionString());
-
269 if (bfs::is_regular_file(dbPath))
-
270 bfs::remove(dbPath);
-
271 }
-
272 }
+
143
+
144 void
+
+ +
146 {
+
147 testcase("select");
+
148 BasicConfig c;
+ +
150 DBConfig sc(c, "SociTestDB");
+ +
152 std::vector<std::int64_t> const bid({-10, -20, -30});
+ +
154 std::vector<std::int32_t> const id({-1, -2, -3});
+
155
+
156 {
+
157 soci::session s;
+
158 sc.open(s);
+
159
+
160 s << "DROP TABLE IF EXISTS STT;";
+
161
+
162 s << "CREATE TABLE STT ("
+
163 " I INTEGER,"
+
164 " UI INTEGER UNSIGNED,"
+
165 " BI BIGINT,"
+
166 " UBI BIGINT UNSIGNED"
+
167 ");";
+
168
+
169 s << "INSERT INTO STT (I, UI, BI, UBI) VALUES "
+
170 "(:id, :idu, :bid, :bidu);",
+
171 soci::use(id), soci::use(uid), soci::use(bid), soci::use(ubid);
+
172
+
173 try
+
174 {
+
175 std::int32_t ig = 0;
+
176 std::uint32_t uig = 0;
+
177 std::int64_t big = 0;
+
178 std::uint64_t ubig = 0;
+
179 s << "SELECT I, UI, BI, UBI from STT;", soci::into(ig), soci::into(uig), soci::into(big),
+
180 soci::into(ubig);
+
181 BEAST_EXPECT(ig == id[0] && uig == uid[0] && big == bid[0] && ubig == ubid[0]);
+
182 }
+
183 catch (std::exception&)
+
184 {
+
185 fail();
+
186 }
+
187 try
+
188 {
+
189 // SOCI requires boost::optional (not std::optional) as
+
190 // parameters.
+
191 boost::optional<std::int32_t> ig;
+
192 // Known bug: https://github.com/SOCI/soci/issues/926
+
193 // boost::optional<std::uint32_t> uig;
+
194 uint32_t uig = 0;
+
195 boost::optional<std::int64_t> big;
+
196 boost::optional<std::uint64_t> ubig;
+
197 s << "SELECT I, UI, BI, UBI from STT;", soci::into(ig), soci::into(uig), soci::into(big),
+
198 soci::into(ubig);
+
199 BEAST_EXPECT(*ig == id[0] && uig == uid[0] && *big == bid[0] && *ubig == ubid[0]);
+
200 }
+
201 catch (std::exception&)
+
202 {
+
203 fail();
+
204 }
+
205 // There are too many issues when working with soci::row and
+
206 // boost::tuple. DO NOT USE soci row! I had a set of workarounds to
+
207 // make soci row less error prone, I'm keeping these tests in case I
+
208 // try to add soci::row and boost::tuple back into soci.
+
209#if 0
+
210 try
+
211 {
+
212 std::int32_t ig = 0;
+
213 std::uint32_t uig = 0;
+
214 std::int64_t big = 0;
+
215 std::uint64_t ubig = 0;
+
216 soci::row r;
+
217 s << "SELECT I, UI, BI, UBI from STT", soci::into (r);
+
218 ig = r.get<std::int32_t>(0);
+
219 uig = r.get<std::uint32_t>(1);
+
220 big = r.get<std::int64_t>(2);
+
221 ubig = r.get<std::uint64_t>(3);
+
222 BEAST_EXPECT(ig == id[0] && uig == uid[0] && big == bid[0] &&
+
223 ubig == ubid[0]);
+
224 }
+
225 catch (std::exception&)
+
226 {
+
227 fail ();
+
228 }
+
229 try
+
230 {
+
231 std::int32_t ig = 0;
+
232 std::uint32_t uig = 0;
+
233 std::int64_t big = 0;
+
234 std::uint64_t ubig = 0;
+
235 soci::row r;
+
236 s << "SELECT I, UI, BI, UBI from STT", soci::into (r);
+
237 ig = r.get<std::int32_t>("I");
+
238 uig = r.get<std::uint32_t>("UI");
+
239 big = r.get<std::int64_t>("BI");
+
240 ubig = r.get<std::uint64_t>("UBI");
+
241 BEAST_EXPECT(ig == id[0] && uig == uid[0] && big == bid[0] &&
+
242 ubig == ubid[0]);
+
243 }
+
244 catch (std::exception&)
+
245 {
+
246 fail ();
+
247 }
+
248 try
+
249 {
+
250 boost::tuple<std::int32_t,
+ + +
253 std::uint64_t> d;
+
254 s << "SELECT I, UI, BI, UBI from STT", soci::into (d);
+
255 BEAST_EXPECT(get<0>(d) == id[0] && get<1>(d) == uid[0] &&
+
256 get<2>(d) == bid[0] && get<3>(d) == ubid[0]);
+
257 }
+
258 catch (std::exception&)
+
259 {
+
260 fail ();
+
261 }
+
262#endif
+
263 }
+
264 {
+
265 namespace bfs = boost::filesystem;
+
266 // Remove the database
+
267 bfs::path dbPath(sc.connectionString());
+
268 if (bfs::is_regular_file(dbPath))
+
269 bfs::remove(dbPath);
+
270 }
+
271 }
-
273 void
-
- -
275 {
-
276 testcase("deleteWithSubselect");
-
277 BasicConfig c;
- -
279 DBConfig sc(c, "SociTestDB");
-
280 {
-
281 soci::session s;
-
282 sc.open(s);
-
283 char const* dbInit[] = {
-
284 "BEGIN TRANSACTION;",
-
285 "CREATE TABLE Ledgers ( \
-
286 LedgerHash CHARACTER(64) PRIMARY KEY, \
-
287 LedgerSeq BIGINT UNSIGNED \
-
288 );",
-
289 "CREATE INDEX SeqLedger ON Ledgers(LedgerSeq);"};
-
290 for (auto const c : dbInit)
-
291 s << c;
-
292 char lh[65];
-
293 memset(lh, 'a', 64);
-
294 lh[64] = '\0';
-
295 int toIncIndex = 63;
-
296 int const numRows = 16;
-
297 std::vector<std::string> ledgerHashes;
-
298 std::vector<int> ledgerIndexes;
-
299 ledgerHashes.reserve(numRows);
-
300 ledgerIndexes.reserve(numRows);
-
301 for (int i = 0; i < numRows; ++i)
-
302 {
-
303 ++lh[toIncIndex];
-
304 if (lh[toIncIndex] == 'z')
-
305 --toIncIndex;
-
306 ledgerHashes.emplace_back(lh);
-
307 ledgerIndexes.emplace_back(i);
-
308 }
-
309 s << "INSERT INTO Ledgers (LedgerHash, LedgerSeq) VALUES "
-
310 "(:lh, :li);",
-
311 soci::use(ledgerHashes), soci::use(ledgerIndexes);
-
312
-
313 std::vector<int> ledgersLS(numRows * 2);
-
314 s << "SELECT LedgerSeq FROM Ledgers;", soci::into(ledgersLS);
-
315 BEAST_EXPECT(ledgersLS.size() == numRows);
-
316 }
-
317 namespace bfs = boost::filesystem;
-
318 // Remove the database
-
319 bfs::path dbPath(sc.connectionString());
-
320 if (bfs::is_regular_file(dbPath))
-
321 bfs::remove(dbPath);
-
322 }
+
272 void
+
+ +
274 {
+
275 testcase("deleteWithSubselect");
+
276 BasicConfig c;
+ +
278 DBConfig sc(c, "SociTestDB");
+
279 {
+
280 soci::session s;
+
281 sc.open(s);
+
282 char const* dbInit[] = {
+
283 "BEGIN TRANSACTION;",
+
284 "CREATE TABLE Ledgers ( \
+
285 LedgerHash CHARACTER(64) PRIMARY KEY, \
+
286 LedgerSeq BIGINT UNSIGNED \
+
287 );",
+
288 "CREATE INDEX SeqLedger ON Ledgers(LedgerSeq);"};
+
289 for (auto const c : dbInit)
+
290 s << c;
+
291 char lh[65];
+
292 memset(lh, 'a', 64);
+
293 lh[64] = '\0';
+
294 int toIncIndex = 63;
+
295 int const numRows = 16;
+
296 std::vector<std::string> ledgerHashes;
+
297 std::vector<int> ledgerIndexes;
+
298 ledgerHashes.reserve(numRows);
+
299 ledgerIndexes.reserve(numRows);
+
300 for (int i = 0; i < numRows; ++i)
+
301 {
+
302 ++lh[toIncIndex];
+
303 if (lh[toIncIndex] == 'z')
+
304 --toIncIndex;
+
305 ledgerHashes.emplace_back(lh);
+
306 ledgerIndexes.emplace_back(i);
+
307 }
+
308 s << "INSERT INTO Ledgers (LedgerHash, LedgerSeq) VALUES "
+
309 "(:lh, :li);",
+
310 soci::use(ledgerHashes), soci::use(ledgerIndexes);
+
311
+
312 std::vector<int> ledgersLS(numRows * 2);
+
313 s << "SELECT LedgerSeq FROM Ledgers;", soci::into(ledgersLS);
+
314 BEAST_EXPECT(ledgersLS.size() == numRows);
+
315 }
+
316 namespace bfs = boost::filesystem;
+
317 // Remove the database
+
318 bfs::path dbPath(sc.connectionString());
+
319 if (bfs::is_regular_file(dbPath))
+
320 bfs::remove(dbPath);
+
321 }
-
323 void
-
-
324 run() override
-
325 {
- - - - -
330 }
+
322 void
+
+
323 run() override
+
324 {
+ + + + +
329 }
-
331};
+
330};
-
332
-
333BEAST_DEFINE_TESTSUITE(SociDB, core, xrpl);
-
334
-
335} // namespace xrpl
+
331
+
332BEAST_DEFINE_TESTSUITE(SociDB, core, xrpl);
+
333
+
334} // namespace xrpl
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:147
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:516
Holds unparsed configuration information.
void overwrite(std::string const &section, std::string const &key, std::string const &value)
Overwrite a key/value pair with a command line argument If the section does not exist it is created.
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
DBConfig is used when a client wants to delay opening a soci::session after parsing the config parame...
Definition SociDB.h:40
-
void open(soci::session &s) const
Definition SociDB.cpp:69
-
std::string connectionString() const
Definition SociDB.cpp:63
- - -
static void setupDatabaseDir(boost::filesystem::path const &dbPath)
- - -
static boost::filesystem::path getDatabasePath()
- -
static void setupSQLiteConfig(BasicConfig &config, boost::filesystem::path const &dbPath)
-
void testSQLiteDeleteWithSubselect()
- -
void run() override
Runs the suite.
-
static void cleanupDatabaseDir(boost::filesystem::path const &dbPath)
+
void open(soci::session &s) const
Definition SociDB.cpp:67
+
std::string connectionString() const
Definition SociDB.cpp:61
+ + +
static void setupDatabaseDir(boost::filesystem::path const &dbPath)
+ + +
static boost::filesystem::path getDatabasePath()
+ +
static void setupSQLiteConfig(BasicConfig &config, boost::filesystem::path const &dbPath)
+
void testSQLiteDeleteWithSubselect()
+ +
void run() override
Runs the suite.
+
static void cleanupDatabaseDir(boost::filesystem::path const &dbPath)
T distance(T... args)
T emplace_back(T... args)
diff --git a/StartUpType_8h_source.html b/StartUpType_8h_source.html new file mode 100644 index 0000000000..909852d5fb --- /dev/null +++ b/StartUpType_8h_source.html @@ -0,0 +1,120 @@ + + + + + + + +rippled: StartUpType.h Source File + + + + + + + + + +
+
+ + + + + + +
+
rippled +
+
+
+ + + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
StartUpType.h
+
+
+
1#pragma once
+
2
+
3#include <iosfwd>
+
4#include <type_traits>
+
5
+
6namespace xrpl {
+
7
+ +
9
+
+ +
11operator<<(std::ostream& os, StartUpType const& type)
+
12{
+
13 return os << static_cast<std::underlying_type_t<StartUpType>>(type);
+
14}
+
+
15
+
16} // namespace xrpl
+ + +
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
+
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
Definition base_uint.h:612
+
StartUpType
Definition StartUpType.h:8
+ + + + + + + +
+ + + + diff --git a/State_8cpp_source.html b/State_8cpp_source.html index 73566aa15e..529515de98 100644 --- a/State_8cpp_source.html +++ b/State_8cpp_source.html @@ -74,20 +74,20 @@ $(document).ready(function() { init_codefold(0); });
State.cpp
-
1#include <xrpld/app/rdb/State.h>
+
1#include <xrpl/server/State.h>
2
3namespace xrpl {
4
5void
-
6initStateDB(soci::session& session, BasicConfig const& config, std::string const& dbName)
+
6initStateDB(soci::session& session, BasicConfig const& config, std::string const& dbName)
7{
8 open(session, config, dbName);
9
@@ -171,7 +171,7 @@ $(document).ready(function() { init_codefold(0); });
80
81void
-
82setSavedState(soci::session& session, SavedState const& state)
+
82setSavedState(soci::session& session, SavedState const& state)
83{
84 session << "UPDATE DbState"
85 " SET WritableDb = :writableDb,"
@@ -197,18 +197,18 @@ $(document).ready(function() { init_codefold(0); });
Holds unparsed configuration information.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
+
void initStateDB(soci::session &session, BasicConfig const &config, std::string const &dbName)
initStateDB Opens a session with the State database.
Definition State.cpp:6
+
void setSavedState(soci::session &session, SavedState const &state)
setSavedState Saves the given state.
Definition State.cpp:82
void setLastRotated(soci::session &session, LedgerIndex seq)
setLastRotated Updates the last rotated ledger sequence.
Definition State.cpp:93
-
void setSavedState(soci::session &session, SavedState const &state)
setSavedState Saves the given state.
Definition State.cpp:82
-
void initStateDB(soci::session &session, BasicConfig const &config, std::string const &dbName)
initStateDB Opens a session with the State database.
Definition State.cpp:6
SavedState getSavedState(soci::session &session)
getSavedState Returns the saved state.
Definition State.cpp:71
std::uint32_t LedgerIndex
A ledger index.
Definition Protocol.h:254
@ open
We haven't closed our ledger yet, but others might have.
LedgerIndex setCanDelete(soci::session &session, LedgerIndex canDelete)
setCanDelete Updates the ledger sequence which can be deleted.
Definition State.cpp:64
LedgerIndex getCanDelete(soci::session &session)
getCanDelete Returns the ledger sequence which can be deleted.
Definition State.cpp:55
- -
std::string writableDb
Definition State.h:15
-
LedgerIndex lastRotated
Definition State.h:17
-
std::string archiveDb
Definition State.h:16
+ +
std::string writableDb
Definition State.h:13
+
LedgerIndex lastRotated
Definition State.h:15
+
std::string archiveDb
Definition State.h:14
@@ -83,58 +83,56 @@ $(document).ready(function() { init_codefold(0); });
1#pragma once
2
-
3#include <xrpld/app/ledger/Ledger.h>
-
4#include <xrpld/app/misc/Manifest.h>
-
5#include <xrpld/core/Config.h>
-
6#include <xrpld/core/DatabaseCon.h>
-
7#include <xrpld/peerfinder/detail/Store.h>
+
3#include <xrpl/protocol/Protocol.h>
+
4#include <xrpl/rdb/DatabaseCon.h>
+
5#include <xrpl/server/Manifest.h>
+
6
+
7#include <boost/filesystem.hpp>
8
-
9#include <boost/filesystem.hpp>
+
9namespace xrpl {
10
-
11namespace xrpl {
-
12
-
- -
14{
- - - -
18};
+ -
19
-
26void
-
27initStateDB(soci::session& session, BasicConfig const& config, std::string const& dbName);
-
28
- -
35getCanDelete(soci::session& session);
-
36
- -
44setCanDelete(soci::session& session, LedgerIndex canDelete);
-
45
- -
53getSavedState(soci::session& session);
-
54
-
62void
-
63setSavedState(soci::session& session, SavedState const& state);
-
64
-
70void
-
71setLastRotated(soci::session& session, LedgerIndex seq);
-
72
-
73} // namespace xrpl
+
17
+
24void
+
25initStateDB(soci::session& session, BasicConfig const& config, std::string const& dbName);
+
26
+ +
33getCanDelete(soci::session& session);
+
34
+ +
42setCanDelete(soci::session& session, LedgerIndex canDelete);
+
43
+ +
51getSavedState(soci::session& session);
+
52
+
60void
+
61setSavedState(soci::session& session, SavedState const& state);
+
62
+
68void
+
69setLastRotated(soci::session& session, LedgerIndex seq);
+
70
+
71} // namespace xrpl
Holds unparsed configuration information.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
+
void initStateDB(soci::session &session, BasicConfig const &config, std::string const &dbName)
initStateDB Opens a session with the State database.
Definition State.cpp:6
+
void setSavedState(soci::session &session, SavedState const &state)
setSavedState Saves the given state.
Definition State.cpp:82
void setLastRotated(soci::session &session, LedgerIndex seq)
setLastRotated Updates the last rotated ledger sequence.
Definition State.cpp:93
-
void setSavedState(soci::session &session, SavedState const &state)
setSavedState Saves the given state.
Definition State.cpp:82
-
void initStateDB(soci::session &session, BasicConfig const &config, std::string const &dbName)
initStateDB Opens a session with the State database.
Definition State.cpp:6
SavedState getSavedState(soci::session &session)
getSavedState Returns the saved state.
Definition State.cpp:71
LedgerIndex setCanDelete(soci::session &session, LedgerIndex canDelete)
setCanDelete Updates the ledger sequence which can be deleted.
Definition State.cpp:64
LedgerIndex getCanDelete(soci::session &session)
getCanDelete Returns the ledger sequence which can be deleted.
Definition State.cpp:55
- -
std::string writableDb
Definition State.h:15
-
LedgerIndex lastRotated
Definition State.h:17
-
std::string archiveDb
Definition State.h:16
+ +
std::string writableDb
Definition State.h:13
+
LedgerIndex lastRotated
Definition State.h:15
+
std::string archiveDb
Definition State.h:14
@@ -833,9 +835,9 @@ Private Attributes
-

Implements xrpl::Application.

+

Implements xrpl::ServiceRegistry.

-

Definition at line 448 of file Application.cpp.

+

Definition at line 447 of file Application.cpp.

@@ -864,7 +866,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 454 of file Application.cpp.

+

Definition at line 453 of file Application.cpp.

@@ -893,7 +895,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 460 of file Application.cpp.

+

Definition at line 459 of file Application.cpp.

@@ -922,7 +924,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 466 of file Application.cpp.

+

Definition at line 465 of file Application.cpp.

@@ -951,7 +953,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 472 of file Application.cpp.

+

Definition at line 471 of file Application.cpp.

@@ -980,7 +982,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 478 of file Application.cpp.

+

Definition at line 477 of file Application.cpp.

@@ -1009,7 +1011,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 484 of file Application.cpp.

+

Definition at line 483 of file Application.cpp.

@@ -1038,7 +1040,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 493 of file Application.cpp.

+

Definition at line 492 of file Application.cpp.

@@ -1067,7 +1069,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 502 of file Application.cpp.

+

Definition at line 501 of file Application.cpp.

@@ -1096,7 +1098,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 508 of file Application.cpp.

+

Definition at line 507 of file Application.cpp.

@@ -1123,9 +1125,9 @@ Private Attributes
-

Implements xrpl::Application.

+

Implements xrpl::ServiceRegistry.

-

Definition at line 518 of file Application.cpp.

+

Definition at line 517 of file Application.cpp.

@@ -1154,7 +1156,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 524 of file Application.cpp.

+

Definition at line 523 of file Application.cpp.

@@ -1183,7 +1185,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 530 of file Application.cpp.

+

Definition at line 529 of file Application.cpp.

@@ -1212,7 +1214,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 536 of file Application.cpp.

+

Definition at line 535 of file Application.cpp.

@@ -1241,7 +1243,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 542 of file Application.cpp.

+

Definition at line 541 of file Application.cpp.

@@ -1270,7 +1272,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 548 of file Application.cpp.

+

Definition at line 547 of file Application.cpp.

@@ -1299,7 +1301,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 554 of file Application.cpp.

+

Definition at line 553 of file Application.cpp.

@@ -1328,7 +1330,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 560 of file Application.cpp.

+

Definition at line 559 of file Application.cpp.

@@ -1358,7 +1360,7 @@ Private Attributes
-

Definition at line 566 of file Application.cpp.

+

Definition at line 565 of file Application.cpp.

@@ -1387,7 +1389,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 573 of file Application.cpp.

+

Definition at line 572 of file Application.cpp.

@@ -1416,7 +1418,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 579 of file Application.cpp.

+

Definition at line 578 of file Application.cpp.

@@ -1445,7 +1447,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 585 of file Application.cpp.

+

Definition at line 584 of file Application.cpp.

@@ -1474,7 +1476,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 591 of file Application.cpp.

+

Definition at line 590 of file Application.cpp.

@@ -1503,7 +1505,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 597 of file Application.cpp.

+

Definition at line 596 of file Application.cpp.

@@ -1532,7 +1534,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 603 of file Application.cpp.

+

Definition at line 602 of file Application.cpp.

@@ -1561,7 +1563,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 609 of file Application.cpp.

+

Definition at line 608 of file Application.cpp.

@@ -1590,7 +1592,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 615 of file Application.cpp.

+

Definition at line 614 of file Application.cpp.

@@ -1619,7 +1621,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 621 of file Application.cpp.

+

Definition at line 620 of file Application.cpp.

@@ -1648,7 +1650,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 627 of file Application.cpp.

+

Definition at line 626 of file Application.cpp.

@@ -1677,7 +1679,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 633 of file Application.cpp.

+

Definition at line 632 of file Application.cpp.

@@ -1706,7 +1708,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 639 of file Application.cpp.

+

Definition at line 638 of file Application.cpp.

@@ -1735,7 +1737,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 645 of file Application.cpp.

+

Definition at line 644 of file Application.cpp.

@@ -1764,7 +1766,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 651 of file Application.cpp.

+

Definition at line 650 of file Application.cpp.

@@ -1793,7 +1795,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 657 of file Application.cpp.

+

Definition at line 656 of file Application.cpp.

@@ -1822,7 +1824,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 663 of file Application.cpp.

+

Definition at line 662 of file Application.cpp.

@@ -1851,7 +1853,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 669 of file Application.cpp.

+

Definition at line 668 of file Application.cpp.

@@ -1880,7 +1882,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 675 of file Application.cpp.

+

Definition at line 674 of file Application.cpp.

@@ -1909,7 +1911,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 681 of file Application.cpp.

+

Definition at line 680 of file Application.cpp.

@@ -1938,7 +1940,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 687 of file Application.cpp.

+

Definition at line 686 of file Application.cpp.

@@ -1967,7 +1969,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 693 of file Application.cpp.

+

Definition at line 692 of file Application.cpp.

@@ -1996,7 +1998,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 699 of file Application.cpp.

+

Definition at line 698 of file Application.cpp.

@@ -2025,7 +2027,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 705 of file Application.cpp.

+

Definition at line 704 of file Application.cpp.

@@ -2054,7 +2056,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 711 of file Application.cpp.

+

Definition at line 710 of file Application.cpp.

@@ -2083,7 +2085,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 717 of file Application.cpp.

+

Definition at line 716 of file Application.cpp.

@@ -2112,7 +2114,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 724 of file Application.cpp.

+

Definition at line 723 of file Application.cpp.

@@ -2141,7 +2143,7 @@ Private Attributes

Implements xrpl::ServiceRegistry.

-

Definition at line 731 of file Application.cpp.

+

Definition at line 730 of file Application.cpp.

@@ -2172,7 +2174,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 741 of file Application.cpp.

+

Definition at line 740 of file Application.cpp.

@@ -2202,7 +2204,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 1921 of file Application.cpp.

+

Definition at line 1929 of file Application.cpp.

@@ -2230,9 +2232,9 @@ Private Attributes
-

Implements xrpl::Application.

+

Implements xrpl::ServiceRegistry.

-

Definition at line 1969 of file Application.cpp.

+

Definition at line 1977 of file Application.cpp.

@@ -2251,7 +2253,7 @@ Private Attributes
-

Definition at line 756 of file Application.cpp.

+

Definition at line 755 of file Application.cpp.

@@ -2270,7 +2272,7 @@ Private Attributes
-

Definition at line 783 of file Application.cpp.

+

Definition at line 782 of file Application.cpp.

@@ -2303,7 +2305,7 @@ Private Attributes

Reimplemented from beast::PropertyStream::Source.

-

Definition at line 817 of file Application.cpp.

+

Definition at line 816 of file Application.cpp.

@@ -2322,7 +2324,7 @@ Private Attributes
-

Definition at line 824 of file Application.cpp.

+

Definition at line 823 of file Application.cpp.

@@ -2341,7 +2343,7 @@ Private Attributes
-

Definition at line 849 of file Application.cpp.

+

Definition at line 848 of file Application.cpp.

@@ -2360,7 +2362,7 @@ Private Attributes
-

Definition at line 874 of file Application.cpp.

+

Definition at line 873 of file Application.cpp.

@@ -2391,7 +2393,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 994 of file Application.cpp.

+

Definition at line 993 of file Application.cpp.

@@ -2420,7 +2422,7 @@ Private Attributes

Implements xrpl::Application.

-

Definition at line 1000 of file Application.cpp.

+

Definition at line 999 of file Application.cpp.

@@ -2447,7 +2449,7 @@ Private Attributes
-

Definition at line 1529 of file Application.cpp.

+

Definition at line 1537 of file Application.cpp.

@@ -2474,7 +2476,7 @@ Private Attributes
-

Definition at line 1550 of file Application.cpp.

+

Definition at line 1558 of file Application.cpp.

@@ -2502,7 +2504,7 @@ Private Attributes
-

Definition at line 1593 of file Application.cpp.

+

Definition at line 1601 of file Application.cpp.

@@ -2552,7 +2554,7 @@ Private Attributes
-

Definition at line 1725 of file Application.cpp.

+

Definition at line 1733 of file Application.cpp.

@@ -2579,7 +2581,36 @@ Private Attributes
-

Definition at line 1975 of file Application.cpp.

+

Definition at line 1983 of file Application.cpp.

+ +
+
+ +

◆ app()

+ +
+
+ + + + + +
+ + + + + + + +
Application & xrpl::ApplicationImp::app ()
+
+overrideprivatevirtual
+
+ +

Implements xrpl::ServiceRegistry.

+ +

Definition at line 1025 of file Application.cpp.

@@ -3075,7 +3106,7 @@ template<class Derived >
-

Definition at line 139 of file Application.cpp.

+

Definition at line 138 of file Application.cpp.

@@ -3091,7 +3122,7 @@ template<class Derived >
-

Definition at line 140 of file Application.cpp.

+

Definition at line 139 of file Application.cpp.

@@ -3107,7 +3138,7 @@ template<class Derived >
-

Definition at line 141 of file Application.cpp.

+

Definition at line 140 of file Application.cpp.

@@ -3123,7 +3154,7 @@ template<class Derived >
-

Definition at line 143 of file Application.cpp.

+

Definition at line 142 of file Application.cpp.

@@ -3139,7 +3170,7 @@ template<class Derived >
-

Definition at line 145 of file Application.cpp.

+

Definition at line 144 of file Application.cpp.

@@ -3155,7 +3186,7 @@ template<class Derived >
-

Definition at line 146 of file Application.cpp.

+

Definition at line 145 of file Application.cpp.

@@ -3171,7 +3202,7 @@ template<class Derived >
-

Definition at line 147 of file Application.cpp.

+

Definition at line 146 of file Application.cpp.

@@ -3187,7 +3218,7 @@ template<class Derived >
-

Definition at line 150 of file Application.cpp.

+

Definition at line 149 of file Application.cpp.

@@ -3203,7 +3234,7 @@ template<class Derived >
-

Definition at line 152 of file Application.cpp.

+

Definition at line 151 of file Application.cpp.

@@ -3219,7 +3250,7 @@ template<class Derived >
-

Definition at line 153 of file Application.cpp.

+

Definition at line 152 of file Application.cpp.

@@ -3235,7 +3266,7 @@ template<class Derived >
-

Definition at line 154 of file Application.cpp.

+

Definition at line 153 of file Application.cpp.

@@ -3251,7 +3282,7 @@ template<class Derived >
-

Definition at line 155 of file Application.cpp.

+

Definition at line 154 of file Application.cpp.

@@ -3267,7 +3298,7 @@ template<class Derived >
-

Definition at line 156 of file Application.cpp.

+

Definition at line 155 of file Application.cpp.

@@ -3283,7 +3314,7 @@ template<class Derived >
-

Definition at line 157 of file Application.cpp.

+

Definition at line 156 of file Application.cpp.

@@ -3299,7 +3330,7 @@ template<class Derived >
-

Definition at line 159 of file Application.cpp.

+

Definition at line 158 of file Application.cpp.

@@ -3315,7 +3346,7 @@ template<class Derived >
-

Definition at line 160 of file Application.cpp.

+

Definition at line 159 of file Application.cpp.

@@ -3331,7 +3362,7 @@ template<class Derived >
-

Definition at line 161 of file Application.cpp.

+

Definition at line 160 of file Application.cpp.

@@ -3347,7 +3378,7 @@ template<class Derived >
-

Definition at line 162 of file Application.cpp.

+

Definition at line 161 of file Application.cpp.

@@ -3363,7 +3394,7 @@ template<class Derived >
-

Definition at line 164 of file Application.cpp.

+

Definition at line 163 of file Application.cpp.

@@ -3379,7 +3410,7 @@ template<class Derived >
-

Definition at line 166 of file Application.cpp.

+

Definition at line 165 of file Application.cpp.

@@ -3395,7 +3426,7 @@ template<class Derived >
-

Definition at line 167 of file Application.cpp.

+

Definition at line 166 of file Application.cpp.

@@ -3411,7 +3442,7 @@ template<class Derived >
-

Definition at line 169 of file Application.cpp.

+

Definition at line 168 of file Application.cpp.

@@ -3427,7 +3458,7 @@ template<class Derived >
-

Definition at line 170 of file Application.cpp.

+

Definition at line 169 of file Application.cpp.

@@ -3443,7 +3474,7 @@ template<class Derived >
-

Definition at line 171 of file Application.cpp.

+

Definition at line 170 of file Application.cpp.

@@ -3459,7 +3490,7 @@ template<class Derived >
-

Definition at line 172 of file Application.cpp.

+

Definition at line 171 of file Application.cpp.

@@ -3475,7 +3506,7 @@ template<class Derived >
-

Definition at line 173 of file Application.cpp.

+

Definition at line 172 of file Application.cpp.

@@ -3491,7 +3522,7 @@ template<class Derived >
-

Definition at line 174 of file Application.cpp.

+

Definition at line 173 of file Application.cpp.

@@ -3507,7 +3538,7 @@ template<class Derived >
-

Definition at line 175 of file Application.cpp.

+

Definition at line 174 of file Application.cpp.

@@ -3523,7 +3554,7 @@ template<class Derived >
-

Definition at line 176 of file Application.cpp.

+

Definition at line 175 of file Application.cpp.

@@ -3539,7 +3570,7 @@ template<class Derived >
-

Definition at line 177 of file Application.cpp.

+

Definition at line 176 of file Application.cpp.

@@ -3555,7 +3586,7 @@ template<class Derived >
-

Definition at line 178 of file Application.cpp.

+

Definition at line 177 of file Application.cpp.

@@ -3571,7 +3602,7 @@ template<class Derived >
-

Definition at line 179 of file Application.cpp.

+

Definition at line 178 of file Application.cpp.

@@ -3587,7 +3618,7 @@ template<class Derived >
-

Definition at line 180 of file Application.cpp.

+

Definition at line 179 of file Application.cpp.

@@ -3603,7 +3634,7 @@ template<class Derived >
-

Definition at line 181 of file Application.cpp.

+

Definition at line 180 of file Application.cpp.

@@ -3619,7 +3650,7 @@ template<class Derived >
-

Definition at line 182 of file Application.cpp.

+

Definition at line 181 of file Application.cpp.

@@ -3635,7 +3666,7 @@ template<class Derived >
-

Definition at line 183 of file Application.cpp.

+

Definition at line 182 of file Application.cpp.

@@ -3651,7 +3682,7 @@ template<class Derived >
-

Definition at line 184 of file Application.cpp.

+

Definition at line 183 of file Application.cpp.

@@ -3667,7 +3698,7 @@ template<class Derived >
-

Definition at line 185 of file Application.cpp.

+

Definition at line 184 of file Application.cpp.

@@ -3683,7 +3714,7 @@ template<class Derived >
-

Definition at line 186 of file Application.cpp.

+

Definition at line 185 of file Application.cpp.

@@ -3699,7 +3730,7 @@ template<class Derived >
-

Definition at line 187 of file Application.cpp.

+

Definition at line 186 of file Application.cpp.

@@ -3715,7 +3746,7 @@ template<class Derived >
-

Definition at line 188 of file Application.cpp.

+

Definition at line 187 of file Application.cpp.

@@ -3731,7 +3762,7 @@ template<class Derived >
-

Definition at line 189 of file Application.cpp.

+

Definition at line 188 of file Application.cpp.

@@ -3747,7 +3778,7 @@ template<class Derived >
-

Definition at line 190 of file Application.cpp.

+

Definition at line 189 of file Application.cpp.

@@ -3763,7 +3794,7 @@ template<class Derived >
-

Definition at line 191 of file Application.cpp.

+

Definition at line 190 of file Application.cpp.

@@ -3779,7 +3810,7 @@ template<class Derived >
-

Definition at line 192 of file Application.cpp.

+

Definition at line 191 of file Application.cpp.

@@ -3795,7 +3826,7 @@ template<class Derived >
-

Definition at line 193 of file Application.cpp.

+

Definition at line 192 of file Application.cpp.

@@ -3811,7 +3842,7 @@ template<class Derived >
-

Definition at line 195 of file Application.cpp.

+

Definition at line 194 of file Application.cpp.

@@ -3827,7 +3858,7 @@ template<class Derived >
-

Definition at line 196 of file Application.cpp.

+

Definition at line 195 of file Application.cpp.

@@ -3843,7 +3874,7 @@ template<class Derived >
-

Definition at line 197 of file Application.cpp.

+

Definition at line 196 of file Application.cpp.

@@ -3859,7 +3890,7 @@ template<class Derived >
-

Definition at line 198 of file Application.cpp.

+

Definition at line 197 of file Application.cpp.

@@ -3875,7 +3906,7 @@ template<class Derived >
-

Definition at line 200 of file Application.cpp.

+

Definition at line 199 of file Application.cpp.

@@ -3891,7 +3922,7 @@ template<class Derived >
-

Definition at line 202 of file Application.cpp.

+

Definition at line 201 of file Application.cpp.

@@ -3907,7 +3938,7 @@ template<class Derived >
-

Definition at line 204 of file Application.cpp.

+

Definition at line 203 of file Application.cpp.

@@ -3923,7 +3954,7 @@ template<class Derived >
-

Definition at line 206 of file Application.cpp.

+

Definition at line 205 of file Application.cpp.

@@ -3939,7 +3970,7 @@ template<class Derived >
-

Definition at line 208 of file Application.cpp.

+

Definition at line 207 of file Application.cpp.

@@ -3955,7 +3986,7 @@ template<class Derived >
-

Definition at line 210 of file Application.cpp.

+

Definition at line 209 of file Application.cpp.

@@ -3979,7 +4010,7 @@ template<class Derived >
-

Definition at line 1008 of file Application.cpp.

+

Definition at line 1007 of file Application.cpp.

diff --git a/classxrpl_1_1ApplicationImp_1_1io__latency__sampler.html b/classxrpl_1_1ApplicationImp_1_1io__latency__sampler.html index 22090405da..2fe7c2607f 100644 --- a/classxrpl_1_1ApplicationImp_1_1io__latency__sampler.html +++ b/classxrpl_1_1ApplicationImp_1_1io__latency__sampler.html @@ -142,7 +142,7 @@ Private Attributes

Detailed Description

-

Definition at line 78 of file Application.cpp.

+

Definition at line 77 of file Application.cpp.

Constructor & Destructor Documentation

◆ io_latency_sampler()

@@ -182,7 +182,7 @@ Private Attributes
-

Definition at line 87 of file Application.cpp.

+

Definition at line 86 of file Application.cpp.

@@ -202,7 +202,7 @@ Private Attributes
-

Definition at line 97 of file Application.cpp.

+

Definition at line 96 of file Application.cpp.

@@ -224,7 +224,7 @@ template<class Duration >
-

Definition at line 104 of file Application.cpp.

+

Definition at line 103 of file Application.cpp.

@@ -243,7 +243,7 @@ template<class Duration >
-

Definition at line 120 of file Application.cpp.

+

Definition at line 119 of file Application.cpp.

@@ -262,7 +262,7 @@ template<class Duration >
-

Definition at line 126 of file Application.cpp.

+

Definition at line 125 of file Application.cpp.

@@ -281,7 +281,7 @@ template<class Duration >
-

Definition at line 132 of file Application.cpp.

+

Definition at line 131 of file Application.cpp.

@@ -306,7 +306,7 @@ template<class Duration >
-

Definition at line 81 of file Application.cpp.

+

Definition at line 80 of file Application.cpp.

@@ -330,7 +330,7 @@ template<class Duration >
-

Definition at line 82 of file Application.cpp.

+

Definition at line 81 of file Application.cpp.

@@ -354,7 +354,7 @@ template<class Duration >
-

Definition at line 83 of file Application.cpp.

+

Definition at line 82 of file Application.cpp.

@@ -378,7 +378,7 @@ template<class Duration >
-

Definition at line 84 of file Application.cpp.

+

Definition at line 83 of file Application.cpp.

diff --git a/classxrpl_1_1CheckpointersCollection.html b/classxrpl_1_1CheckpointersCollection.html index 740691ae27..fcda7131a2 100644 --- a/classxrpl_1_1CheckpointersCollection.html +++ b/classxrpl_1_1CheckpointersCollection.html @@ -122,7 +122,7 @@ Private Attributes

Detailed Description

-

Definition at line 15 of file DatabaseCon.cpp.

+

Definition at line 14 of file DatabaseCon.cpp.

Member Function Documentation

◆ fromId()

@@ -140,7 +140,7 @@ Private Attributes
-

Definition at line 27 of file DatabaseCon.cpp.

+

Definition at line 26 of file DatabaseCon.cpp.

@@ -160,7 +160,7 @@ Private Attributes
-

Definition at line 37 of file DatabaseCon.cpp.

+

Definition at line 36 of file DatabaseCon.cpp.

@@ -196,7 +196,7 @@ Private Attributes
-

Definition at line 44 of file DatabaseCon.cpp.

+

Definition at line 43 of file DatabaseCon.cpp.

@@ -221,7 +221,7 @@ Private Attributes
-

Definition at line 17 of file DatabaseCon.cpp.

+

Definition at line 16 of file DatabaseCon.cpp.

@@ -245,7 +245,7 @@ Private Attributes
-

Definition at line 19 of file DatabaseCon.cpp.

+

Definition at line 18 of file DatabaseCon.cpp.

@@ -269,7 +269,7 @@ Private Attributes
-

Definition at line 23 of file DatabaseCon.cpp.

+

Definition at line 22 of file DatabaseCon.cpp.

diff --git a/classxrpl_1_1Config-members.html b/classxrpl_1_1Config-members.html index 5c1923b954..384a62a7d5 100644 --- a/classxrpl_1_1Config-members.html +++ b/classxrpl_1_1Config-members.html @@ -102,52 +102,46 @@ $(function() { FETCH_DEPTHxrpl::Config FORCE_MULTI_THREADxrpl::Config FORCED_LEDGER_RANGE_PRESENTxrpl::Config - FRESH enum valuexrpl::Config - getDebugLogFile() constxrpl::Config - getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) constxrpl::Config - had_trailing_comments() constxrpl::BasicConfig - IO_WORKERSxrpl::Config - IPSxrpl::Config - IPS_FIXEDxrpl::Config - j_xrpl::Configprivate - journal() constxrpl::Config - LEDGER_HISTORYxrpl::Config - LEDGER_REPLAYxrpl::Config - legacy(std::string const &section, std::string value)xrpl::BasicConfig - legacy(std::string const &sectionName) constxrpl::BasicConfig - LOAD enum valuexrpl::Config + getDebugLogFile() constxrpl::Config + getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) constxrpl::Config + had_trailing_comments() constxrpl::BasicConfig + IO_WORKERSxrpl::Config + IPSxrpl::Config + IPS_FIXEDxrpl::Config + j_xrpl::Configprivate + journal() constxrpl::Config + LEDGER_HISTORYxrpl::Config + LEDGER_REPLAYxrpl::Config + legacy(std::string const &section, std::string value)xrpl::BasicConfig + legacy(std::string const &sectionName) constxrpl::BasicConfig load()xrpl::Configprivate - LOAD_FILE enum valuexrpl::Config - loadFromString(std::string const &fileContents)xrpl::Config - map_xrpl::BasicConfigprivate - MAX_DIVERGED_TIMExrpl::Config - MAX_JOB_QUEUE_TXxrpl::Configstatic - MAX_TRANSACTIONSxrpl::Config - MAX_UNKNOWN_TIMExrpl::Config - MIN_JOB_QUEUE_TXxrpl::Configstatic - NETWORK enum valuexrpl::Config + loadFromString(std::string const &fileContents)xrpl::Config + map_xrpl::BasicConfigprivate + MAX_DIVERGED_TIMExrpl::Config + MAX_JOB_QUEUE_TXxrpl::Configstatic + MAX_TRANSACTIONSxrpl::Config + MAX_UNKNOWN_TIMExrpl::Config + MIN_JOB_QUEUE_TXxrpl::Configstatic NETWORK_IDxrpl::Config NETWORK_QUORUMxrpl::Config NODE_SIZExrpl::Config - NORMAL enum valuexrpl::Config - operator[](std::string const &name) constxrpl::BasicConfig - operator[](std::string const &name)xrpl::BasicConfig - overwrite(std::string const &section, std::string const &key, std::string const &value)xrpl::BasicConfig - PATH_SEARCHxrpl::Config - PATH_SEARCH_FASTxrpl::Config - PATH_SEARCH_MAXxrpl::Config - PATH_SEARCH_OLDxrpl::Config - PEER_PRIVATExrpl::Config - PEERS_IN_MAXxrpl::Config - PEERS_MAXxrpl::Config - PEERS_OUT_MAXxrpl::Config - PREFETCH_WORKERSxrpl::Config - quiet() constxrpl::Config - QUIETxrpl::Configprivate - ramSize_xrpl::Configprivate - RELAY_UNTRUSTED_PROPOSALSxrpl::Config - RELAY_UNTRUSTED_VALIDATIONSxrpl::Config - REPLAY enum valuexrpl::Config + operator[](std::string const &name) constxrpl::BasicConfig + operator[](std::string const &name)xrpl::BasicConfig + overwrite(std::string const &section, std::string const &key, std::string const &value)xrpl::BasicConfig + PATH_SEARCHxrpl::Config + PATH_SEARCH_FASTxrpl::Config + PATH_SEARCH_MAXxrpl::Config + PATH_SEARCH_OLDxrpl::Config + PEER_PRIVATExrpl::Config + PEERS_IN_MAXxrpl::Config + PEERS_MAXxrpl::Config + PEERS_OUT_MAXxrpl::Config + PREFETCH_WORKERSxrpl::Config + quiet() constxrpl::Config + QUIETxrpl::Configprivate + ramSize_xrpl::Configprivate + RELAY_UNTRUSTED_PROPOSALSxrpl::Config + RELAY_UNTRUSTED_VALIDATIONSxrpl::Config rpc_ipxrpl::Config RUN_STANDALONExrpl::Configprivate section(std::string const &name)xrpl::BasicConfig @@ -156,8 +150,8 @@ $(function() { setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)xrpl::Config setupControl(bool bQuiet, bool bSilent, bool bStandalone)xrpl::Config signingEnabled_xrpl::Configprivate - silent() constxrpl::Config - SILENTxrpl::Configprivate + SILENTxrpl::Configprivate + silent() constxrpl::Config SSL_VERIFYxrpl::Config SSL_VERIFY_DIRxrpl::Config SSL_VERIFY_FILExrpl::Config @@ -165,21 +159,20 @@ $(function() { START_LEDGERxrpl::Config START_UPxrpl::Config START_VALIDxrpl::Config - StartUpType enum namexrpl::Config - SWEEP_INTERVALxrpl::Config - TRAP_TX_HASHxrpl::Config - TX_REDUCE_RELAY_ENABLExrpl::Config - TX_REDUCE_RELAY_METRICSxrpl::Config - TX_REDUCE_RELAY_MIN_PEERSxrpl::Config - TX_RELAY_PERCENTAGExrpl::Config - USE_TX_TABLESxrpl::Configprivate - useTxTables() constxrpl::Config - VALIDATION_QUORUMxrpl::Config - VALIDATOR_LIST_THRESHOLDxrpl::Config - validatorsFileNamexrpl::Configstatic - VP_REDUCE_RELAY_BASE_SQUELCH_ENABLExrpl::Config - VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERSxrpl::Config - WORKERSxrpl::Config + SWEEP_INTERVALxrpl::Config + TRAP_TX_HASHxrpl::Config + TX_REDUCE_RELAY_ENABLExrpl::Config + TX_REDUCE_RELAY_METRICSxrpl::Config + TX_REDUCE_RELAY_MIN_PEERSxrpl::Config + TX_RELAY_PERCENTAGExrpl::Config + USE_TX_TABLESxrpl::Configprivate + useTxTables() constxrpl::Config + VALIDATION_QUORUMxrpl::Config + VALIDATOR_LIST_THRESHOLDxrpl::Config + validatorsFileNamexrpl::Configstatic + VP_REDUCE_RELAY_BASE_SQUELCH_ENABLExrpl::Config + VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERSxrpl::Config + WORKERSxrpl::Config