rippled
ShardArchiveHandler_test.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2020 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #include <ripple/app/rdb/ShardArchive.h>
21 #include <ripple/beast/utility/temp_dir.h>
22 #include <ripple/core/ConfigSections.h>
23 #include <ripple/nodestore/DummyScheduler.h>
24 #include <ripple/nodestore/Manager.h>
25 #include <ripple/nodestore/impl/DecodedBlob.h>
26 #include <ripple/protocol/jss.h>
27 #include <ripple/rpc/ShardArchiveHandler.h>
28 #include <test/jtx/CaptureLogs.h>
29 #include <test/jtx/Env.h>
30 #include <test/jtx/TrustedPublisherServer.h>
31 #include <test/jtx/envconfig.h>
32 #include <test/nodestore/TestBase.h>
33 
34 namespace ripple {
35 namespace test {
36 
37 class ShardArchiveHandler_test : public beast::unit_test::suite
38 {
40 
42  createServer(jtx::Env& env, bool ssl = true)
43  {
47  env.app().getIOService(),
48  list,
49  env.timeKeeper().now() + std::chrono::seconds{3600},
50  // No future VLs
51  {},
52  ssl);
53  }
54 
55 public:
56  // Test the shard downloading module by queueing
57  // a download and verifying the contents of the
58  // state database.
59  void
61  {
62  testcase("testSingleDownloadAndStateDB");
63 
64  beast::temp_dir tempDir;
65 
66  auto c = jtx::envconfig();
67  auto& section = c->section(ConfigSection::shardDatabase());
68  section.set("path", tempDir.path());
69  section.set("max_historical_shards", "20");
70  c->setupControl(true, true, true);
71 
72  jtx::Env env(*this, std::move(c));
73  auto handler = env.app().getShardArchiveHandler();
74  BEAST_EXPECT(handler);
75  BEAST_EXPECT(dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
76 
77  std::string const rawUrl = "https://foo:443/1.tar.lz4";
78  parsedURL url;
79 
80  parseUrl(url, rawUrl);
81  handler->add(1, {url, rawUrl});
82 
83  {
84  std::lock_guard<std::mutex> lock(handler->m_);
85  std::uint64_t rowCount = 0;
86 
88  *handler->sqlDB_, [&](std::string const& url, int state) {
89  BEAST_EXPECT(state == 1);
90  BEAST_EXPECT(url == rawUrl);
91  ++rowCount;
92  });
93 
94  BEAST_EXPECT(rowCount == 1);
95  }
96 
97  handler->release();
98  }
99 
100  // Test the shard downloading module by queueing
101  // three downloads and verifying the contents of
102  // the state database.
103  void
105  {
106  testcase("testDownloadsAndStateDB");
107 
108  beast::temp_dir tempDir;
109 
110  auto c = jtx::envconfig();
111  auto& section = c->section(ConfigSection::shardDatabase());
112  section.set("path", tempDir.path());
113  section.set("max_historical_shards", "20");
114  c->setupControl(true, true, true);
115 
116  jtx::Env env(*this, std::move(c));
117  auto handler = env.app().getShardArchiveHandler();
118  BEAST_EXPECT(handler);
119  BEAST_EXPECT(dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
120 
121  Downloads const dl = {
122  {1, "https://foo:443/1.tar.lz4"},
123  {2, "https://foo:443/2.tar.lz4"},
124  {3, "https://foo:443/3.tar.lz4"}};
125 
126  for (auto const& entry : dl)
127  {
128  parsedURL url;
129  parseUrl(url, entry.second);
130  handler->add(entry.first, {url, entry.second});
131  }
132 
133  {
134  std::lock_guard<std::mutex> lock(handler->m_);
135  std::uint64_t pos = 0;
136 
138  *handler->sqlDB_, [&](std::string const& url, int state) {
139  BEAST_EXPECT(state == dl[pos].first);
140  BEAST_EXPECT(url == dl[pos].second);
141  ++pos;
142  });
143 
144  BEAST_EXPECT(pos == dl.size());
145  }
146 
147  handler->release();
148  }
149 
150  // Test the shard downloading module by initiating
151  // and completing ten downloads and verifying the
152  // contents of the filesystem and the handler's
153  // archives.
154  void
156  {
157  testcase("testDownloadsAndFileSystem");
158 
159  beast::temp_dir tempDir;
160 
161  auto c = jtx::envconfig();
162  {
163  auto& section{c->section(ConfigSection::shardDatabase())};
164  section.set("path", tempDir.path());
165  section.set("max_historical_shards", "20");
166  section.set("ledgers_per_shard", "256");
167  section.set("earliest_seq", "257");
168  }
169  {
170  auto& section{c->section(ConfigSection::nodeDatabase())};
171  section.set("ledgers_per_shard", "256");
172  section.set("earliest_seq", "257");
173  }
174  c->setupControl(true, true, true);
175 
176  jtx::Env env(
177  *this, std::move(c), nullptr, beast::severities::kDisabled);
178 
179  std::uint8_t const numberOfDownloads = 10;
180 
181  // Create some ledgers so that the ShardArchiveHandler
182  // can verify the last ledger hash for the shard
183  // downloads.
184  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
185  (numberOfDownloads + 1);
186  ++i)
187  {
188  env.close();
189  }
190 
191  auto handler = env.app().getShardArchiveHandler();
192  BEAST_EXPECT(handler);
193  BEAST_EXPECT(dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
194 
195  auto server = createServer(env);
196  auto host = server->local_endpoint().address().to_string();
197  auto port = std::to_string(server->local_endpoint().port());
198  server->stop();
199 
200  Downloads const dl = [count = numberOfDownloads, &host, &port] {
201  Downloads ret;
202 
203  for (int i = 1; i <= count; ++i)
204  {
205  ret.push_back(
206  {i,
207  (boost::format("https://%s:%d/%d.tar.lz4") % host % port %
208  i)
209  .str()});
210  }
211 
212  return ret;
213  }();
214 
215  for (auto const& entry : dl)
216  {
217  parsedURL url;
218  parseUrl(url, entry.second);
219  handler->add(entry.first, {url, entry.second});
220  }
221 
222  BEAST_EXPECT(handler->start());
223 
224  auto stateDir =
226 
227  std::unique_lock<std::mutex> lock(handler->m_);
228 
229  BEAST_EXPECT(
230  boost::filesystem::exists(stateDir) || handler->archives_.empty());
231 
232  using namespace std::chrono_literals;
233  auto waitMax = 60s;
234 
235  while (!handler->archives_.empty())
236  {
237  lock.unlock();
239 
240  if (waitMax -= 1s; waitMax <= 0s)
241  {
242  BEAST_EXPECT(false);
243  break;
244  }
245 
246  lock.lock();
247  }
248 
249  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
250  }
251 
252  // Test the shard downloading module by initiating
253  // and completing ten downloads and verifying the
254  // contents of the filesystem and the handler's
255  // archives. Then restart the application and ensure
256  // that the handler is created and started automatically.
257  void
259  {
260  testcase("testDownloadsAndRestart");
261 
262  beast::temp_dir tempDir;
263 
264  {
265  auto c = jtx::envconfig();
266  {
267  auto& section{c->section(ConfigSection::shardDatabase())};
268  section.set("path", tempDir.path());
269  section.set("max_historical_shards", "20");
270  section.set("ledgers_per_shard", "256");
271  section.set("earliest_seq", "257");
272  }
273  {
274  auto& section{c->section(ConfigSection::nodeDatabase())};
275  section.set("ledgers_per_shard", "256");
276  section.set("earliest_seq", "257");
277  }
278  c->setupControl(true, true, true);
279 
280  jtx::Env env(
281  *this, std::move(c), nullptr, beast::severities::kDisabled);
282 
283  std::uint8_t const numberOfDownloads = 10;
284 
285  // Create some ledgers so that the ShardArchiveHandler
286  // can verify the last ledger hash for the shard
287  // downloads.
288  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
289  (numberOfDownloads + 1);
290  ++i)
291  {
292  env.close();
293  }
294 
295  auto handler = env.app().getShardArchiveHandler();
296  BEAST_EXPECT(handler);
297  BEAST_EXPECT(
298  dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
299 
300  auto server = createServer(env);
301  auto host = server->local_endpoint().address().to_string();
302  auto port = std::to_string(server->local_endpoint().port());
303  server->stop();
304 
305  Downloads const dl = [count = numberOfDownloads, &host, &port] {
306  Downloads ret;
307 
308  for (int i = 1; i <= count; ++i)
309  {
310  ret.push_back(
311  {i,
312  (boost::format("https://%s:%d/%d.tar.lz4") % host %
313  port % i)
314  .str()});
315  }
316 
317  return ret;
318  }();
319 
320  for (auto const& entry : dl)
321  {
322  parsedURL url;
323  parseUrl(url, entry.second);
324  handler->add(entry.first, {url, entry.second});
325  }
326 
328  env.app().config());
329 
330  boost::filesystem::copy_file(
331  stateDir / stateDBName,
332  boost::filesystem::path(tempDir.path()) / stateDBName);
333 
334  BEAST_EXPECT(handler->start());
335 
336  std::unique_lock<std::mutex> lock(handler->m_);
337 
338  BEAST_EXPECT(
339  boost::filesystem::exists(stateDir) ||
340  handler->archives_.empty());
341 
342  using namespace std::chrono_literals;
343  auto waitMax = 60s;
344 
345  while (!handler->archives_.empty())
346  {
347  lock.unlock();
349 
350  if (waitMax -= 1s; waitMax <= 0s)
351  {
352  BEAST_EXPECT(false);
353  break;
354  }
355 
356  lock.lock();
357  }
358 
359  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
360 
361  boost::filesystem::create_directory(stateDir);
362 
363  boost::filesystem::copy_file(
364  boost::filesystem::path(tempDir.path()) / stateDBName,
365  stateDir / stateDBName);
366  }
367 
368  auto c = jtx::envconfig();
369  {
370  auto& section{c->section(ConfigSection::shardDatabase())};
371  section.set("path", tempDir.path());
372  section.set("max_historical_shards", "20");
373  section.set("shard_verification_retry_interval", "1");
374  section.set("shard_verification_max_attempts", "10000");
375  section.set("ledgers_per_shard", "256");
376  section.set("earliest_seq", "257");
377  }
378  {
379  auto& section{c->section(ConfigSection::nodeDatabase())};
380  section.set("ledgers_per_shard", "256");
381  section.set("earliest_seq", "257");
382  }
383  c->setupControl(true, true, true);
384 
385  jtx::Env env(
386  *this, std::move(c), nullptr, beast::severities::kDisabled);
387  std::uint8_t const numberOfDownloads = 10;
388 
389  // Create some ledgers so that the ShardArchiveHandler
390  // can verify the last ledger hash for the shard
391  // downloads.
392  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
393  (numberOfDownloads + 1);
394  ++i)
395  {
396  env.close();
397  }
398 
399  auto handler = env.app().getShardArchiveHandler();
400  BEAST_EXPECT(dynamic_cast<RPC::RecoveryHandler*>(handler) != nullptr);
401 
402  auto stateDir =
404 
405  std::unique_lock<std::mutex> lock(handler->m_);
406 
407  BEAST_EXPECT(
408  boost::filesystem::exists(stateDir) || handler->archives_.empty());
409 
410  using namespace std::chrono_literals;
411  auto waitMax = 60s;
412 
413  while (!handler->archives_.empty())
414  {
415  lock.unlock();
417 
418  if (waitMax -= 1s; waitMax <= 0s)
419  {
420  BEAST_EXPECT(false);
421  break;
422  }
423 
424  lock.lock();
425  }
426 
427  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
428  }
429 
430  // Ensure that downloads fail when the shard
431  // database cannot store any more shards
432  void
434  {
435  testcase("testShardCountFailure");
436  std::string capturedLogs;
437 
438  {
439  beast::temp_dir tempDir;
440 
441  auto c = jtx::envconfig();
442  {
443  auto& section{c->section(ConfigSection::shardDatabase())};
444  section.set("path", tempDir.path());
445  section.set("max_historical_shards", "1");
446  section.set("ledgers_per_shard", "256");
447  section.set("earliest_seq", "257");
448  }
449  {
450  auto& section{c->section(ConfigSection::nodeDatabase())};
451  section.set("ledgers_per_shard", "256");
452  section.set("earliest_seq", "257");
453  }
454  c->setupControl(true, true, true);
455 
456  std::unique_ptr<Logs> logs(new CaptureLogs(&capturedLogs));
457  jtx::Env env(*this, std::move(c), std::move(logs));
458 
459  std::uint8_t const numberOfDownloads = 10;
460 
461  // Create some ledgers so that the ShardArchiveHandler
462  // can verify the last ledger hash for the shard
463  // downloads.
464  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
465  (numberOfDownloads + 1);
466  ++i)
467  {
468  env.close();
469  }
470 
471  auto handler = env.app().getShardArchiveHandler();
472  BEAST_EXPECT(handler);
473  BEAST_EXPECT(
474  dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
475 
476  auto server = createServer(env);
477  auto host = server->local_endpoint().address().to_string();
478  auto port = std::to_string(server->local_endpoint().port());
479  server->stop();
480 
481  Downloads const dl = [count = numberOfDownloads, &host, &port] {
482  Downloads ret;
483 
484  for (int i = 1; i <= count; ++i)
485  {
486  ret.push_back(
487  {i,
488  (boost::format("https://%s:%d/%d.tar.lz4") % host %
489  port % i)
490  .str()});
491  }
492 
493  return ret;
494  }();
495 
496  for (auto const& entry : dl)
497  {
498  parsedURL url;
499  parseUrl(url, entry.second);
500  handler->add(entry.first, {url, entry.second});
501  }
502 
503  BEAST_EXPECT(!handler->start());
505  env.app().config());
506 
507  handler->release();
508  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
509  }
510 
511  auto const expectedErrorMessage =
512  "shards 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 maximum number of historical "
513  "shards reached";
514  BEAST_EXPECT(
515  capturedLogs.find(expectedErrorMessage) != std::string::npos);
516 
517  {
518  beast::temp_dir tempDir;
519 
520  auto c = jtx::envconfig();
521  {
522  auto& section{c->section(ConfigSection::shardDatabase())};
523  section.set("path", tempDir.path());
524  section.set("max_historical_shards", "0");
525  section.set("ledgers_per_shard", "256");
526  section.set("earliest_seq", "257");
527  }
528  {
529  auto& section{c->section(ConfigSection::nodeDatabase())};
530  section.set("ledgers_per_shard", "256");
531  section.set("earliest_seq", "257");
532  }
533  c->setupControl(true, true, true);
534 
535  std::unique_ptr<Logs> logs(new CaptureLogs(&capturedLogs));
536  jtx::Env env(*this, std::move(c), std::move(logs));
537 
538  std::uint8_t const numberOfDownloads = 1;
539 
540  // Create some ledgers so that the ShardArchiveHandler
541  // can verify the last ledger hash for the shard
542  // downloads.
543  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
544  ((numberOfDownloads * 3) + 1);
545  ++i)
546  {
547  env.close();
548  }
549 
550  auto handler = env.app().getShardArchiveHandler();
551  BEAST_EXPECT(handler);
552  BEAST_EXPECT(
553  dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
554 
555  auto server = createServer(env);
556  auto host = server->local_endpoint().address().to_string();
557  auto port = std::to_string(server->local_endpoint().port());
558  server->stop();
559 
560  Downloads const dl = [count = numberOfDownloads, &host, &port] {
561  Downloads ret;
562 
563  for (int i = 1; i <= count; ++i)
564  {
565  ret.push_back(
566  {i,
567  (boost::format("https://%s:%d/%d.tar.lz4") % host %
568  port % i)
569  .str()});
570  }
571 
572  return ret;
573  }();
574 
575  for (auto const& entry : dl)
576  {
577  parsedURL url;
578  parseUrl(url, entry.second);
579  handler->add(entry.first, {url, entry.second});
580  }
581 
582  BEAST_EXPECT(!handler->start());
584  env.app().config());
585 
586  handler->release();
587  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
588  }
589 
590  auto const expectedErrorMessage2 =
591  "shard 1 maximum number of historical shards reached";
592  BEAST_EXPECT(
593  capturedLogs.find(expectedErrorMessage2) != std::string::npos);
594  }
595 
596  // Ensure that downloads fail when the shard
597  // database has already stored one of the
598  // queued shards
599  void
601  {
602  testcase("testRedundantShardFailure");
603  std::string capturedLogs;
604 
605  {
606  beast::temp_dir tempDir;
607 
608  auto c = jtx::envconfig();
609  {
610  auto& section{c->section(ConfigSection::shardDatabase())};
611  section.set("path", tempDir.path());
612  section.set("max_historical_shards", "1");
613  section.set("ledgers_per_shard", "256");
614  section.set("earliest_seq", "257");
615  }
616  {
617  auto& section{c->section(ConfigSection::nodeDatabase())};
618  section.set("ledgers_per_shard", "256");
619  section.set("earliest_seq", "257");
620  }
621  c->setupControl(true, true, true);
622 
623  std::unique_ptr<Logs> logs(new CaptureLogs(&capturedLogs));
624  jtx::Env env(
625  *this,
626  std::move(c),
627  std::move(logs),
629 
630  std::uint8_t const numberOfDownloads = 10;
631 
632  // Create some ledgers so that the ShardArchiveHandler
633  // can verify the last ledger hash for the shard
634  // downloads.
635  for (int i = 0; i < env.app().getShardStore()->ledgersPerShard() *
636  (numberOfDownloads + 1);
637  ++i)
638  {
639  env.close();
640  }
641 
642  BEAST_EXPECT(env.app().getShardStore()->prepareShards({1}));
643 
644  auto handler = env.app().getShardArchiveHandler();
645  BEAST_EXPECT(handler);
646  BEAST_EXPECT(
647  dynamic_cast<RPC::RecoveryHandler*>(handler) == nullptr);
648 
649  auto server = createServer(env);
650  auto host = server->local_endpoint().address().to_string();
651  auto port = std::to_string(server->local_endpoint().port());
652  server->stop();
653 
654  Downloads const dl = [count = numberOfDownloads, &host, &port] {
655  Downloads ret;
656 
657  for (int i = 1; i <= count; ++i)
658  {
659  ret.push_back(
660  {i,
661  (boost::format("https://%s:%d/%d.tar.lz4") % host %
662  port % i)
663  .str()});
664  }
665 
666  return ret;
667  }();
668 
669  for (auto const& entry : dl)
670  {
671  parsedURL url;
672  parseUrl(url, entry.second);
673  handler->add(entry.first, {url, entry.second});
674  }
675 
676  BEAST_EXPECT(!handler->start());
678  env.app().config());
679 
680  handler->release();
681  BEAST_EXPECT(!boost::filesystem::exists(stateDir));
682  }
683 
684  auto const expectedErrorMessage =
685  "shard 1 is already queued for import";
686  BEAST_EXPECT(
687  capturedLogs.find(expectedErrorMessage) != std::string::npos);
688  }
689 
690  void
691  run() override
692  {
699  }
700 };
701 
702 BEAST_DEFINE_TESTSUITE_PRIO(ShardArchiveHandler, app, ripple, 3);
703 
704 } // namespace test
705 } // namespace ripple
ripple::RPC::ShardArchiveHandler::getDownloadDirectory
static boost::filesystem::path getDownloadDirectory(Config const &config)
Definition: ShardArchiveHandler.cpp:38
std::this_thread::sleep_for
T sleep_for(T... args)
std::string
STL class.
std::shared_ptr
STL class.
beast::severities::kDisabled
@ kDisabled
Definition: Journal.h:41
ripple::parsedURL
Definition: StringUtilities.h:116
std::vector
STL class.
std::string::find
T find(T... args)
ripple::ConfigSection::shardDatabase
static std::string shardDatabase()
Definition: ConfigSections.h:38
ripple::test::ShardArchiveHandler_test::testShardCountFailure
void testShardCountFailure()
Definition: ShardArchiveHandler_test.cpp:433
std::chrono::seconds
std::lock_guard
STL class.
ripple::test::jtx::Env::timeKeeper
ManualTimeKeeper & timeKeeper()
Definition: Env.h:253
ripple::Application::getShardStore
virtual NodeStore::DatabaseShard * getShardStore()=0
ripple::test::jtx::Env::app
Application & app()
Definition: Env.h:241
ripple::test::jtx::envconfig
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Definition: envconfig.h:49
ripple::test::ShardArchiveHandler_test::testDownloadsAndRestart
void testDownloadsAndRestart()
Definition: ShardArchiveHandler_test.cpp:258
ripple::test::BEAST_DEFINE_TESTSUITE_PRIO
BEAST_DEFINE_TESTSUITE_PRIO(AccountDelete, app, ripple, 2)
ripple::test::ShardArchiveHandler_test::createServer
std::shared_ptr< TrustedPublisherServer > createServer(jtx::Env &env, bool ssl=true)
Definition: ShardArchiveHandler_test.cpp:42
std::vector::push_back
T push_back(T... args)
ripple::test::ShardArchiveHandler_test::testDownloadsAndFileSystem
void testDownloadsAndFileSystem()
Definition: ShardArchiveHandler_test.cpp:155
ripple::Application::config
virtual Config & config()=0
std::unique_lock
STL class.
std::to_string
T to_string(T... args)
ripple::test::jtx::Env::close
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
ripple::parseUrl
bool parseUrl(parsedURL &pUrl, std::string const &strUrl)
Definition: StringUtilities.cpp:47
std::uint64_t
ripple::test::TrustedPublisherServer::randomValidator
static Validator randomValidator()
Definition: TrustedPublisherServer.h:148
ripple::NodeStore::DatabaseShard::prepareShards
virtual bool prepareShards(std::vector< std::uint32_t > const &shardIndexes)=0
Prepare one or more shard indexes to be imported into the database.
beast::temp_dir::path
std::string path() const
Get the native path for the temporary directory.
Definition: temp_dir.h:66
ripple::Application::getIOService
virtual boost::asio::io_service & getIOService()=0
ripple::RPC::RecoveryHandler
Definition: ShardArchiveHandler.h:167
ripple::stateDBName
static constexpr auto stateDBName
Definition: DBInit.h:252
ripple::test::CaptureLogs
Log manager for CaptureSinks.
Definition: CaptureLogs.h:31
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::test::ShardArchiveHandler_test::testRedundantShardFailure
void testRedundantShardFailure()
Definition: ShardArchiveHandler_test.cpp:600
ripple::readArchiveDB
void readArchiveDB(DatabaseCon &db, std::function< void(std::string const &, int)> const &func)
readArchiveDB Reads entries from the shard archive database and invokes the given callback for each e...
Definition: ShardArchive.cpp:32
ripple::test::ShardArchiveHandler_test::testDownloadsAndStateDB
void testDownloadsAndStateDB()
Definition: ShardArchiveHandler_test.cpp:104
ripple::test::make_TrustedPublisherServer
std::shared_ptr< TrustedPublisherServer > make_TrustedPublisherServer(boost::asio::io_context &ioc, std::vector< TrustedPublisherServer::Validator > const &validators, NetClock::time_point validUntil, std::vector< std::pair< NetClock::time_point, NetClock::time_point >> const &futures, bool useSSL=false, int version=1, bool immediateStart=true, int sequence=1)
Definition: TrustedPublisherServer.h:714
beast::severities::kDebug
@ kDebug
Definition: Journal.h:35
ripple::test::ShardArchiveHandler_test::run
void run() override
Definition: ShardArchiveHandler_test.cpp:691
ripple::test::ShardArchiveHandler_test
Definition: ShardArchiveHandler_test.cpp:37
ripple::test::ManualTimeKeeper::now
time_point now() const override
Returns the estimate of wall time, in network time.
Definition: ManualTimeKeeper.cpp:37
ripple::test::ShardArchiveHandler_test::testSingleDownloadAndStateDB
void testSingleDownloadAndStateDB()
Definition: ShardArchiveHandler_test.cpp:60
std::unique_ptr
STL class.
ripple::getShardStore
static NodeStore::Database & getShardStore(Application &app)
Definition: ShardFamily.cpp:30
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:116
ripple::ConfigSection::nodeDatabase
static std::string nodeDatabase()
Definition: ConfigSections.h:33
beast::temp_dir
RAII temporary directory.
Definition: temp_dir.h:33
ripple::Application::getShardArchiveHandler
virtual RPC::ShardArchiveHandler * getShardArchiveHandler(bool tryRecovery=false)=0