diff --git a/AccountTx_8cpp_source.html b/AccountTx_8cpp_source.html
index 8f22872aa2..1b32cf7dbd 100644
--- a/AccountTx_8cpp_source.html
+++ b/AccountTx_8cpp_source.html
@@ -567,7 +567,7 @@ $(function() {
virtual Config & config()=0
virtual RelationalDatabase & getRelationalDatabase()=0
-
+
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
bool isValidated(ReadView const &ledger)
uint256 getHashBySeq(std::uint32_t index)
Get a ledger's hash by sequence number using the cache.
diff --git a/Application_8cpp_source.html b/Application_8cpp_source.html
index 2ecae520c7..c79ddd619e 100644
--- a/Application_8cpp_source.html
+++ b/Application_8cpp_source.html
@@ -1438,835 +1438,836 @@ $(function() {
1360 if (!validators_->load(
1362 config().section(SECTION_VALIDATORS).values(),
- 1363 config().section(SECTION_VALIDATOR_LIST_KEYS).values()))
-
- 1365 JLOG(m_journal.fatal())
- 1366 <<
"Invalid entry in validator configuration.";
-
-
-
-
- 1371 if (!validatorSites_->load(
- 1372 config().section(SECTION_VALIDATOR_LIST_SITES).values()))
-
- 1374 JLOG(m_journal.fatal())
- 1375 <<
"Invalid entry in [" << SECTION_VALIDATOR_LIST_SITES <<
"]";
-
-
-
-
- 1380 m_amendmentTable->trustChanged(validators_->getQuorumKeys().second);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1401 m_collectorManager->collector());
-
-
-
- 1405 if (!m_networkOPs->beginConsensus(
- 1406 m_ledgerMaster->getClosedLedger()->info().hash))
-
- 1408 JLOG(m_journal.fatal()) <<
"Unable to start consensus";
-
-
-
-
-
-
-
-
-
- 1418 serverHandler_->setup(setup, m_journal);
-
-
-
- 1422 if (
auto stream = m_journal.fatal())
-
- 1424 stream <<
"Unable to setup server handler";
-
- 1426 stream <<
": " << e.
what();
-
-
-
-
-
-
- 1433 if (!config_->standalone())
-
-
-
- 1437 if (config_->PEER_PRIVATE && config_->IPS_FIXED.empty())
-
- 1439 JLOG(m_journal.warn())
- 1440 <<
"No outbound peer connections will be made";
-
-
-
-
- 1445 m_networkOPs->setStateTimer();
-
-
-
- 1449 JLOG(m_journal.warn()) <<
"Running in standalone mode";
-
- 1451 m_networkOPs->setStandAlone();
-
-
- 1454 if (config_->canSign())
-
- 1456 JLOG(m_journal.warn()) <<
"*** The server is configured to allow the "
- 1457 "'sign' and 'sign_for'";
- 1458 JLOG(m_journal.warn()) <<
"*** commands. These commands have security "
- 1459 "implications and have";
- 1460 JLOG(m_journal.warn()) <<
"*** been deprecated. They will be removed "
- 1461 "in a future release of";
- 1462 JLOG(m_journal.warn()) <<
"*** rippled.";
- 1463 JLOG(m_journal.warn()) <<
"*** If you do not use them to sign "
- 1464 "transactions please edit your";
- 1465 JLOG(m_journal.warn())
- 1466 <<
"*** configuration file and remove the [enable_signing] stanza.";
- 1467 JLOG(m_journal.warn()) <<
"*** If you do use them to sign transactions "
- 1468 "please migrate to a";
- 1469 JLOG(m_journal.warn())
- 1470 <<
"*** standalone signing solution as soon as possible.";
-
-
-
-
-
- 1476 for (
auto cmd : config_->section(SECTION_RPC_STARTUP).lines())
-
-
-
-
- 1481 if (!jrReader.
parse(cmd, jvCommand))
-
- 1483 JLOG(m_journal.fatal()) <<
"Couldn't parse entry in ["
- 1484 << SECTION_RPC_STARTUP <<
"]: '" << cmd;
-
-
- 1487 if (!config_->quiet())
-
- 1489 JLOG(m_journal.fatal())
- 1490 <<
"Startup RPC: " << jvCommand <<
std::endl;
-
-
-
-
-
- 1496 {journal(
"RPCHandler"),
-
-
-
-
-
-
-
+ 1363 config().section(SECTION_VALIDATOR_LIST_KEYS).values(),
+ 1364 config().VALIDATOR_LIST_THRESHOLD))
+
+ 1366 JLOG(m_journal.fatal())
+ 1367 <<
"Invalid entry in validator configuration.";
+
+
+
+
+ 1372 if (!validatorSites_->load(
+ 1373 config().section(SECTION_VALIDATOR_LIST_SITES).values()))
+
+ 1375 JLOG(m_journal.fatal())
+ 1376 <<
"Invalid entry in [" << SECTION_VALIDATOR_LIST_SITES <<
"]";
+
+
+
+
+ 1381 m_amendmentTable->trustChanged(validators_->getQuorumKeys().second);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1402 m_collectorManager->collector());
+
+
+
+ 1406 if (!m_networkOPs->beginConsensus(
+ 1407 m_ledgerMaster->getClosedLedger()->info().hash))
+
+ 1409 JLOG(m_journal.fatal()) <<
"Unable to start consensus";
+
+
+
+
+
+
+
+
+
+ 1419 serverHandler_->setup(setup, m_journal);
+
+
+
+ 1423 if (
auto stream = m_journal.fatal())
+
+ 1425 stream <<
"Unable to setup server handler";
+
+ 1427 stream <<
": " << e.
what();
+
+
+
+
+
+
+ 1434 if (!config_->standalone())
+
+
+
+ 1438 if (config_->PEER_PRIVATE && config_->IPS_FIXED.empty())
+
+ 1440 JLOG(m_journal.warn())
+ 1441 <<
"No outbound peer connections will be made";
+
+
+
+
+ 1446 m_networkOPs->setStateTimer();
+
+
+
+ 1450 JLOG(m_journal.warn()) <<
"Running in standalone mode";
+
+ 1452 m_networkOPs->setStandAlone();
+
+
+ 1455 if (config_->canSign())
+
+ 1457 JLOG(m_journal.warn()) <<
"*** The server is configured to allow the "
+ 1458 "'sign' and 'sign_for'";
+ 1459 JLOG(m_journal.warn()) <<
"*** commands. These commands have security "
+ 1460 "implications and have";
+ 1461 JLOG(m_journal.warn()) <<
"*** been deprecated. They will be removed "
+ 1462 "in a future release of";
+ 1463 JLOG(m_journal.warn()) <<
"*** rippled.";
+ 1464 JLOG(m_journal.warn()) <<
"*** If you do not use them to sign "
+ 1465 "transactions please edit your";
+ 1466 JLOG(m_journal.warn())
+ 1467 <<
"*** configuration file and remove the [enable_signing] stanza.";
+ 1468 JLOG(m_journal.warn()) <<
"*** If you do use them to sign transactions "
+ 1469 "please migrate to a";
+ 1470 JLOG(m_journal.warn())
+ 1471 <<
"*** standalone signing solution as soon as possible.";
+
+
+
+
+
+ 1477 for (
auto cmd : config_->section(SECTION_RPC_STARTUP).lines())
+
+
+
+
+ 1482 if (!jrReader.
parse(cmd, jvCommand))
+
+ 1484 JLOG(m_journal.fatal()) <<
"Couldn't parse entry in ["
+ 1485 << SECTION_RPC_STARTUP <<
"]: '" << cmd;
+
+
+ 1488 if (!config_->quiet())
+
+ 1490 JLOG(m_journal.fatal())
+ 1491 <<
"Startup RPC: " << jvCommand <<
std::endl;
+
+
+
+
+
+ 1497 {journal(
"RPCHandler"),
+
+
+
+
+
+
- 1505 RPC::apiMaximumSupportedVersion},
-
-
-
- 1509 RPC::doCommand(context, jvResult);
-
- 1511 if (!config_->quiet())
-
- 1513 JLOG(m_journal.fatal()) <<
"Result: " << jvResult <<
std::endl;
-
-
-
- 1517 validatorSites_->start();
-
-
-
-
-
- 1523ApplicationImp::start(
bool withTimers)
-
- 1525 JLOG(m_journal.info()) <<
"Application starting. Version is "
- 1526 << BuildInfo::getVersionString();
-
-
-
-
-
-
-
- 1534 m_io_latency_sampler.start();
- 1535 m_resolver->start();
- 1536 m_loadManager->start();
- 1537 m_shaMapStore->start();
-
-
- 1540 grpcServer_->start();
- 1541 ledgerCleaner_->start();
-
-
-
-
- 1546ApplicationImp::run()
-
- 1548 if (!config_->standalone())
-
-
-
-
-
- 1554 getLoadManager().activateDeadlockDetector();
-
-
-
-
- 1559 stoppingCondition_.wait(lk, [
this] {
return isTimeToStop.load(); });
-
-
- 1562 JLOG(m_journal.debug()) <<
"Application stopping";
-
- 1564 m_io_latency_sampler.cancel_async();
-
-
-
-
-
-
-
- 1572 m_io_latency_sampler.cancel();
-
- 1574 m_resolver->stop_async();
-
-
-
-
-
-
-
- 1582 boost::system::error_code ec;
- 1583 sweepTimer_.cancel(ec);
-
-
- 1586 JLOG(m_journal.error())
- 1587 <<
"Application: sweepTimer cancel error: " << ec.message();
-
-
-
- 1591 entropyTimer_.cancel(ec);
-
-
- 1594 JLOG(m_journal.error())
- 1595 <<
"Application: entropyTimer cancel error: " << ec.message();
-
-
-
-
-
- 1601 using namespace std::chrono_literals;
-
- 1603 waitHandlerCounter_.join(
"Application", 1s, m_journal);
-
- 1605 mValidations.flush();
-
- 1607 validatorSites_->stop();
-
-
- 1610 validatorManifests_->save(
- 1611 getWalletDB(),
"ValidatorManifests", [
this](
PublicKey const& pubKey) {
- 1612 return validators().listed(pubKey);
-
-
- 1615 publisherManifests_->save(
- 1616 getWalletDB(),
"PublisherManifests", [
this](
PublicKey const& pubKey) {
- 1617 return validators().trustedPublisher(pubKey);
-
-
-
-
- 1622 m_loadManager->stop();
- 1623 m_shaMapStore->stop();
-
-
-
- 1627 grpcServer_->stop();
- 1628 m_networkOPs->stop();
- 1629 serverHandler_->stop();
- 1630 m_ledgerReplayer->stop();
- 1631 m_inboundTransactions->stop();
- 1632 m_inboundLedgers->stop();
- 1633 ledgerCleaner_->stop();
- 1634 m_nodeStore->stop();
-
-
- 1637 JLOG(m_journal.info()) <<
"Done.";
-
-
-
-
-
- 1643 if (!isTimeToStop.exchange(
true))
-
-
- 1646 JLOG(m_journal.warn()) <<
"Server stopping";
-
- 1648 JLOG(m_journal.warn()) <<
"Server stopping: " << msg;
-
- 1650 stoppingCondition_.notify_all();
-
-
-
-
- 1655ApplicationImp::checkSigs()
const
-
-
-
-
-
- 1661ApplicationImp::checkSigs(
bool check)
-
-
-
-
-
- 1667ApplicationImp::isStopping()
const
-
- 1669 return isTimeToStop.load();
-
-
-
- 1673ApplicationImp::fdRequired()
const
-
-
-
-
-
-
- 1680 needed += 2 * overlay_->limit();
-
-
-
- 1684 needed +=
std::max(5, m_shaMapStore->fdRequired());
-
-
-
- 1688 for (
auto const& p : serverHandler_->setup().ports)
-
-
-
-
-
-
-
-
-
- 1698ApplicationImp::startGenesisLedger()
-
-
- 1701 (config_->START_UP == Config::FRESH) ? m_amendmentTable->getDesired()
-
-
-
-
- 1706 m_ledgerMaster->storeLedger(genesis);
-
-
- 1709 std::make_shared<Ledger>(*genesis, timeKeeper().closeTime());
- 1710 next->updateSkipList();
-
- 1712 next->info().seq < XRP_LEDGER_EARLIEST_FEES ||
- 1713 next->read(keylet::fees()),
- 1714 "ripple::ApplicationImp::startGenesisLedger : valid ledger fees");
- 1715 next->setImmutable();
- 1716 openLedger_.emplace(next, cachedSLEs_, logs_->journal(
"OpenLedger"));
- 1717 m_ledgerMaster->storeLedger(next);
- 1718 m_ledgerMaster->switchLCL(next);
-
-
-
- 1722ApplicationImp::getLastFullLedger()
-
- 1724 auto j = journal(
"Ledger");
-
-
-
-
-
-
-
-
-
- 1734 ledger->info().seq < XRP_LEDGER_EARLIEST_FEES ||
- 1735 ledger->read(keylet::fees()),
- 1736 "ripple::ApplicationImp::getLastFullLedger : valid ledger fees");
- 1737 ledger->setImmutable();
-
- 1739 if (getLedgerMaster().haveLedger(seq))
- 1740 ledger->setValidated();
-
- 1742 if (ledger->info().hash ==
hash)
-
- 1744 JLOG(j.trace()) <<
"Loaded ledger: " <<
hash;
-
-
-
- 1748 if (
auto stream = j.error())
-
- 1750 stream <<
"Failed on ledger";
-
- 1752 addJson(p, {*ledger,
nullptr, LedgerFill::full});
-
-
-
-
-
-
-
- 1760 JLOG(j.warn()) <<
"Ledger in database: " << mn.
what();
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1774 JLOG(m_journal.fatal()) <<
"Unable to open file '" << name <<
"'";
-
-
-
-
-
-
- 1781 if (!reader.
parse(ledgerFile, jLedger))
-
- 1783 JLOG(m_journal.fatal()) <<
"Unable to parse ledger JSON";
-
-
-
-
-
-
- 1790 if (ledger.
get().isMember(
"result"))
- 1791 ledger = ledger.
get()[
"result"];
-
- 1793 if (ledger.
get().isMember(
"ledger"))
- 1794 ledger = ledger.
get()[
"ledger"];
-
-
- 1797 auto closeTime = timeKeeper().closeTime();
- 1798 using namespace std::chrono_literals;
- 1799 auto closeTimeResolution = 30s;
- 1800 bool closeTimeEstimated =
false;
-
-
- 1803 if (ledger.
get().isMember(
"accountState"))
-
- 1805 if (ledger.
get().isMember(jss::ledger_index))
-
- 1807 seq = ledger.
get()[jss::ledger_index].asUInt();
-
-
- 1810 if (ledger.
get().isMember(
"close_time"))
-
-
- 1813 using d = tp::duration;
- 1814 closeTime = tp{d{ledger.
get()[
"close_time"].asUInt()}};
-
- 1816 if (ledger.
get().isMember(
"close_time_resolution"))
-
-
- 1819 closeTimeResolution =
- 1820 seconds{ledger.
get()[
"close_time_resolution"].asUInt()};
-
- 1822 if (ledger.
get().isMember(
"close_time_estimated"))
-
- 1824 closeTimeEstimated =
- 1825 ledger.
get()[
"close_time_estimated"].asBool();
-
- 1827 if (ledger.
get().isMember(
"total_coins"))
-
- 1829 totalDrops = beast::lexicalCastThrow<std::uint64_t>(
- 1830 ledger.
get()[
"total_coins"].asString());
-
-
- 1833 ledger = ledger.
get()[
"accountState"];
-
-
- 1836 if (!ledger.
get().isArrayOrNull())
-
- 1838 JLOG(m_journal.fatal()) <<
"State nodes must be an array";
-
-
-
-
- 1843 std::make_shared<Ledger>(seq, closeTime, *config_, nodeFamily_);
- 1844 loadLedger->setTotalDrops(totalDrops);
-
- 1846 for (
Json::UInt index = 0; index < ledger.
get().size(); ++index)
-
-
-
-
-
- 1852 JLOG(m_journal.fatal()) <<
"Invalid entry in ledger";
-
-
-
-
-
-
-
- 1860 JLOG(m_journal.fatal()) <<
"Invalid entry in ledger";
-
-
-
-
-
-
-
-
-
- 1870 JLOG(m_journal.fatal()) <<
"Invalid entry in ledger";
-
-
-
-
-
-
-
- 1878 if (!loadLedger->addSLE(sle))
-
- 1880 JLOG(m_journal.fatal())
- 1881 <<
"Couldn't add serialized ledger: " << uIndex;
-
-
-
-
-
-
-
- 1889 loadLedger->info().seq < XRP_LEDGER_EARLIEST_FEES ||
- 1890 loadLedger->read(keylet::fees()),
- 1891 "ripple::ApplicationImp::loadLedgerFromFile : valid ledger fees");
- 1892 loadLedger->setAccepted(
- 1893 closeTime, closeTimeResolution, !closeTimeEstimated);
-
-
-
-
-
- 1899 JLOG(m_journal.fatal()) <<
"Ledger contains invalid data: " << x.
what();
-
-
-
-
-
- 1905ApplicationImp::loadOldLedger(
-
-
-
-
-
-
-
-
-
-
-
- 1917 if (!ledgerID.
empty())
- 1918 loadLedger = loadLedgerFromFile(ledgerID);
-
- 1920 else if (ledgerID.
length() == 64)
-
-
-
- 1924 if (
hash.parseHex(ledgerID))
-
-
-
-
-
-
- 1931 auto il = std::make_shared<InboundLedger>(
-
-
-
- 1935 InboundLedger::Reason::GENERIC,
-
-
- 1938 if (il->checkLocal())
- 1939 loadLedger = il->getLedger();
-
-
-
- 1943 else if (ledgerID.
empty() || boost::iequals(ledgerID,
"latest"))
-
- 1945 loadLedger = getLastFullLedger();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1964 replayLedger = loadLedger;
-
- 1966 JLOG(m_journal.info()) <<
"Loading parent ledger";
-
- 1968 loadLedger =
loadByHash(replayLedger->info().parentHash, *
this);
-
-
- 1971 JLOG(m_journal.info())
- 1972 <<
"Loading parent ledger from node store";
-
-
- 1975 auto il = std::make_shared<InboundLedger>(
-
- 1977 replayLedger->info().parentHash,
-
- 1979 InboundLedger::Reason::GENERIC,
-
-
-
- 1983 if (il->checkLocal())
- 1984 loadLedger = il->getLedger();
-
-
-
- 1988 JLOG(m_journal.fatal()) <<
"Replay ledger missing/damaged";
-
- 1990 "ripple::ApplicationImp::loadOldLedger : replay ledger "
-
-
-
-
-
- 1996 using namespace std::chrono_literals;
- 1997 using namespace date;
-
- 1999 sys_days{January / 1 / 2018} - sys_days{January / 1 / 2000}};
- 2000 if (loadLedger->info().closeTime < ledgerWarnTimePoint)
-
- 2002 JLOG(m_journal.fatal())
- 2003 <<
"\n\n*** WARNING ***\n"
- 2004 "You are replaying a ledger from before "
- 2005 << to_string(ledgerWarnTimePoint)
-
- 2007 "This replay will not handle your ledger as it was "
-
- 2009 "handled.\nConsider running an earlier version of rippled "
-
- 2011 "get the older rules.\n*** CONTINUING ***\n";
-
-
- 2014 JLOG(m_journal.info()) <<
"Loading ledger " << loadLedger->info().hash
- 2015 <<
" seq:" << loadLedger->info().seq;
-
- 2017 if (loadLedger->info().accountHash.isZero())
-
- 2019 JLOG(m_journal.fatal()) <<
"Ledger is empty.";
-
- 2021 "ripple::ApplicationImp::loadOldLedger : ledger is empty");
-
-
-
- 2025 if (!loadLedger->walkLedger(journal(
"Ledger"),
true))
-
- 2027 JLOG(m_journal.fatal()) <<
"Ledger is missing nodes.";
-
- 2029 "ripple::ApplicationImp::loadOldLedger : ledger is missing "
-
-
-
-
- 2034 if (!loadLedger->assertSensible(journal(
"Ledger")))
-
- 2036 JLOG(m_journal.fatal()) <<
"Ledger is not sensible.";
-
- 2038 "ripple::ApplicationImp::loadOldLedger : ledger is not "
-
-
-
-
- 2043 m_ledgerMaster->setLedgerRangePresent(
- 2044 loadLedger->info().seq, loadLedger->info().seq);
-
- 2046 m_ledgerMaster->switchLCL(loadLedger);
- 2047 loadLedger->setValidated();
- 2048 m_ledgerMaster->setFullLedger(loadLedger,
true,
false);
- 2049 openLedger_.emplace(
- 2050 loadLedger, cachedSLEs_, logs_->journal(
"OpenLedger"));
-
-
-
-
-
-
- 2057 std::make_unique<LedgerReplay>(loadLedger, replayLedger);
-
- 2059 for (
auto const& [_, tx] : replayData->orderedTxns())
-
-
- 2062 auto txID = tx->getTransactionID();
- 2063 if (trapTxID == txID)
-
-
- 2066 JLOG(m_journal.debug()) <<
"Trap transaction set: " << txID;
-
-
- 2069 auto s = std::make_shared<Serializer>();
-
-
- 2072 forceValidity(getHashRouter(), txID, Validity::SigGoodOnly);
-
- 2074 openLedger_->modify(
-
-
-
-
-
-
- 2081 m_ledgerMaster->takeReplay(std::move(replayData));
-
- 2083 if (trapTxID && !trapTxID_)
-
- 2085 JLOG(m_journal.fatal())
- 2086 <<
"Ledger " << replayLedger->info().seq
- 2087 <<
" does not contain the transaction hash " << *trapTxID;
-
-
-
-
-
-
- 2094 JLOG(m_journal.fatal())
- 2095 <<
"While loading specified ledger: " << mn.
what();
-
-
- 2098 catch (boost::bad_lexical_cast&)
-
- 2100 JLOG(m_journal.fatal())
- 2101 <<
"Ledger specified '" << ledgerID <<
"' is not valid";
-
-
-
-
-
-
-
-
-
- 2111 if (!config().ELB_SUPPORT)
-
-
-
-
- 2116 reason =
"Server is shutting down";
-
-
-
- 2120 if (getOPs().isNeedNetworkLedger())
-
- 2122 reason =
"Not synchronized with network yet";
-
-
-
- 2126 if (getOPs().isAmendmentBlocked())
-
- 2128 reason =
"Server version too old";
-
-
-
- 2132 if (getOPs().isUNLBlocked())
-
- 2134 reason =
"No valid validator list available";
-
-
-
- 2138 if (getOPs().getOperatingMode() < OperatingMode::SYNCING)
-
- 2140 reason =
"Not synchronized with network";
-
-
-
- 2144 if (!getLedgerMaster().isCaughtUp(reason))
-
-
- 2147 if (getFeeTrack().isLoadedLocal())
-
- 2149 reason =
"Too much load";
-
-
-
-
-
-
-
-
-
- 2159 return logs_->journal(name);
-
-
-
- 2163ApplicationImp::setMaxDisallowedLedger()
-
- 2165 auto seq = getRelationalDatabase().getMaxLedgerSeq();
-
- 2167 maxDisallowedLedger_ = *seq;
-
- 2169 JLOG(m_journal.trace())
- 2170 <<
"Max persisted ledger is " << maxDisallowedLedger_;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 2187 return std::make_unique<ApplicationImp>(
- 2188 std::move(config), std::move(logs), std::move(timeKeeper));
-
-
-
+
+ 1506 RPC::apiMaximumSupportedVersion},
+
+
+
+ 1510 RPC::doCommand(context, jvResult);
+
+ 1512 if (!config_->quiet())
+
+ 1514 JLOG(m_journal.fatal()) <<
"Result: " << jvResult <<
std::endl;
+
+
+
+ 1518 validatorSites_->start();
+
+
+
+
+
+ 1524ApplicationImp::start(
bool withTimers)
+
+ 1526 JLOG(m_journal.info()) <<
"Application starting. Version is "
+ 1527 << BuildInfo::getVersionString();
+
+
+
+
+
+
+
+ 1535 m_io_latency_sampler.start();
+ 1536 m_resolver->start();
+ 1537 m_loadManager->start();
+ 1538 m_shaMapStore->start();
+
+
+ 1541 grpcServer_->start();
+ 1542 ledgerCleaner_->start();
+
+
+
+
+ 1547ApplicationImp::run()
+
+ 1549 if (!config_->standalone())
+
+
+
+
+
+ 1555 getLoadManager().activateDeadlockDetector();
+
+
+
+
+ 1560 stoppingCondition_.wait(lk, [
this] {
return isTimeToStop.load(); });
+
+
+ 1563 JLOG(m_journal.debug()) <<
"Application stopping";
+
+ 1565 m_io_latency_sampler.cancel_async();
+
+
+
+
+
+
+
+ 1573 m_io_latency_sampler.cancel();
+
+ 1575 m_resolver->stop_async();
+
+
+
+
+
+
+
+ 1583 boost::system::error_code ec;
+ 1584 sweepTimer_.cancel(ec);
+
+
+ 1587 JLOG(m_journal.error())
+ 1588 <<
"Application: sweepTimer cancel error: " << ec.message();
+
+
+
+ 1592 entropyTimer_.cancel(ec);
+
+
+ 1595 JLOG(m_journal.error())
+ 1596 <<
"Application: entropyTimer cancel error: " << ec.message();
+
+
+
+
+
+ 1602 using namespace std::chrono_literals;
+
+ 1604 waitHandlerCounter_.join(
"Application", 1s, m_journal);
+
+ 1606 mValidations.flush();
+
+ 1608 validatorSites_->stop();
+
+
+ 1611 validatorManifests_->save(
+ 1612 getWalletDB(),
"ValidatorManifests", [
this](
PublicKey const& pubKey) {
+ 1613 return validators().listed(pubKey);
+
+
+ 1616 publisherManifests_->save(
+ 1617 getWalletDB(),
"PublisherManifests", [
this](
PublicKey const& pubKey) {
+ 1618 return validators().trustedPublisher(pubKey);
+
+
+
+
+ 1623 m_loadManager->stop();
+ 1624 m_shaMapStore->stop();
+
+
+
+ 1628 grpcServer_->stop();
+ 1629 m_networkOPs->stop();
+ 1630 serverHandler_->stop();
+ 1631 m_ledgerReplayer->stop();
+ 1632 m_inboundTransactions->stop();
+ 1633 m_inboundLedgers->stop();
+ 1634 ledgerCleaner_->stop();
+ 1635 m_nodeStore->stop();
+
+
+ 1638 JLOG(m_journal.info()) <<
"Done.";
+
+
+
+
+
+ 1644 if (!isTimeToStop.exchange(
true))
+
+
+ 1647 JLOG(m_journal.warn()) <<
"Server stopping";
+
+ 1649 JLOG(m_journal.warn()) <<
"Server stopping: " << msg;
+
+ 1651 stoppingCondition_.notify_all();
+
+
+
+
+ 1656ApplicationImp::checkSigs()
const
+
+
+
+
+
+ 1662ApplicationImp::checkSigs(
bool check)
+
+
+
+
+
+ 1668ApplicationImp::isStopping()
const
+
+ 1670 return isTimeToStop.load();
+
+
+
+ 1674ApplicationImp::fdRequired()
const
+
+
+
+
+
+
+ 1681 needed += 2 * overlay_->limit();
+
+
+
+ 1685 needed +=
std::max(5, m_shaMapStore->fdRequired());
+
+
+
+ 1689 for (
auto const& p : serverHandler_->setup().ports)
+
+
+
+
+
+
+
+
+
+ 1699ApplicationImp::startGenesisLedger()
+
+
+ 1702 (config_->START_UP == Config::FRESH) ? m_amendmentTable->getDesired()
+
+
+
+
+ 1707 m_ledgerMaster->storeLedger(genesis);
+
+
+ 1710 std::make_shared<Ledger>(*genesis, timeKeeper().closeTime());
+ 1711 next->updateSkipList();
+
+ 1713 next->info().seq < XRP_LEDGER_EARLIEST_FEES ||
+ 1714 next->read(keylet::fees()),
+ 1715 "ripple::ApplicationImp::startGenesisLedger : valid ledger fees");
+ 1716 next->setImmutable();
+ 1717 openLedger_.emplace(next, cachedSLEs_, logs_->journal(
"OpenLedger"));
+ 1718 m_ledgerMaster->storeLedger(next);
+ 1719 m_ledgerMaster->switchLCL(next);
+
+
+
+ 1723ApplicationImp::getLastFullLedger()
+
+ 1725 auto j = journal(
"Ledger");
+
+
+
+
+
+
+
+
+
+ 1735 ledger->info().seq < XRP_LEDGER_EARLIEST_FEES ||
+ 1736 ledger->read(keylet::fees()),
+ 1737 "ripple::ApplicationImp::getLastFullLedger : valid ledger fees");
+ 1738 ledger->setImmutable();
+
+ 1740 if (getLedgerMaster().haveLedger(seq))
+ 1741 ledger->setValidated();
+
+ 1743 if (ledger->info().hash ==
hash)
+
+ 1745 JLOG(j.trace()) <<
"Loaded ledger: " <<
hash;
+
+
+
+ 1749 if (
auto stream = j.error())
+
+ 1751 stream <<
"Failed on ledger";
+
+ 1753 addJson(p, {*ledger,
nullptr, LedgerFill::full});
+
+
+
+
+
+
+
+ 1761 JLOG(j.warn()) <<
"Ledger in database: " << mn.
what();
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1775 JLOG(m_journal.fatal()) <<
"Unable to open file '" << name <<
"'";
+
+
+
+
+
+
+ 1782 if (!reader.
parse(ledgerFile, jLedger))
+
+ 1784 JLOG(m_journal.fatal()) <<
"Unable to parse ledger JSON";
+
+
+
+
+
+
+ 1791 if (ledger.
get().isMember(
"result"))
+ 1792 ledger = ledger.
get()[
"result"];
+
+ 1794 if (ledger.
get().isMember(
"ledger"))
+ 1795 ledger = ledger.
get()[
"ledger"];
+
+
+ 1798 auto closeTime = timeKeeper().closeTime();
+ 1799 using namespace std::chrono_literals;
+ 1800 auto closeTimeResolution = 30s;
+ 1801 bool closeTimeEstimated =
false;
+
+
+ 1804 if (ledger.
get().isMember(
"accountState"))
+
+ 1806 if (ledger.
get().isMember(jss::ledger_index))
+
+ 1808 seq = ledger.
get()[jss::ledger_index].asUInt();
+
+
+ 1811 if (ledger.
get().isMember(
"close_time"))
+
+
+ 1814 using d = tp::duration;
+ 1815 closeTime = tp{d{ledger.
get()[
"close_time"].asUInt()}};
+
+ 1817 if (ledger.
get().isMember(
"close_time_resolution"))
+
+
+ 1820 closeTimeResolution =
+ 1821 seconds{ledger.
get()[
"close_time_resolution"].asUInt()};
+
+ 1823 if (ledger.
get().isMember(
"close_time_estimated"))
+
+ 1825 closeTimeEstimated =
+ 1826 ledger.
get()[
"close_time_estimated"].asBool();
+
+ 1828 if (ledger.
get().isMember(
"total_coins"))
+
+ 1830 totalDrops = beast::lexicalCastThrow<std::uint64_t>(
+ 1831 ledger.
get()[
"total_coins"].asString());
+
+
+ 1834 ledger = ledger.
get()[
"accountState"];
+
+
+ 1837 if (!ledger.
get().isArrayOrNull())
+
+ 1839 JLOG(m_journal.fatal()) <<
"State nodes must be an array";
+
+
+
+
+ 1844 std::make_shared<Ledger>(seq, closeTime, *config_, nodeFamily_);
+ 1845 loadLedger->setTotalDrops(totalDrops);
+
+ 1847 for (
Json::UInt index = 0; index < ledger.
get().size(); ++index)
+
+
+
+
+
+ 1853 JLOG(m_journal.fatal()) <<
"Invalid entry in ledger";
+
+
+
+
+
+
+
+ 1861 JLOG(m_journal.fatal()) <<
"Invalid entry in ledger";
+
+
+
+
+
+
+
+
+
+ 1871 JLOG(m_journal.fatal()) <<
"Invalid entry in ledger";
+
+
+
+
+
+
+
+ 1879 if (!loadLedger->addSLE(sle))
+
+ 1881 JLOG(m_journal.fatal())
+ 1882 <<
"Couldn't add serialized ledger: " << uIndex;
+
+
+
+
+
+
+
+ 1890 loadLedger->info().seq < XRP_LEDGER_EARLIEST_FEES ||
+ 1891 loadLedger->read(keylet::fees()),
+ 1892 "ripple::ApplicationImp::loadLedgerFromFile : valid ledger fees");
+ 1893 loadLedger->setAccepted(
+ 1894 closeTime, closeTimeResolution, !closeTimeEstimated);
+
+
+
+
+
+ 1900 JLOG(m_journal.fatal()) <<
"Ledger contains invalid data: " << x.
what();
+
+
+
+
+
+ 1906ApplicationImp::loadOldLedger(
+
+
+
+
+
+
+
+
+
+
+
+ 1918 if (!ledgerID.
empty())
+ 1919 loadLedger = loadLedgerFromFile(ledgerID);
+
+ 1921 else if (ledgerID.
length() == 64)
+
+
+
+ 1925 if (
hash.parseHex(ledgerID))
+
+
+
+
+
+
+ 1932 auto il = std::make_shared<InboundLedger>(
+
+
+
+ 1936 InboundLedger::Reason::GENERIC,
+
+
+ 1939 if (il->checkLocal())
+ 1940 loadLedger = il->getLedger();
+
+
+
+ 1944 else if (ledgerID.
empty() || boost::iequals(ledgerID,
"latest"))
+
+ 1946 loadLedger = getLastFullLedger();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1965 replayLedger = loadLedger;
+
+ 1967 JLOG(m_journal.info()) <<
"Loading parent ledger";
+
+ 1969 loadLedger =
loadByHash(replayLedger->info().parentHash, *
this);
+
+
+ 1972 JLOG(m_journal.info())
+ 1973 <<
"Loading parent ledger from node store";
+
+
+ 1976 auto il = std::make_shared<InboundLedger>(
+
+ 1978 replayLedger->info().parentHash,
+
+ 1980 InboundLedger::Reason::GENERIC,
+
+
+
+ 1984 if (il->checkLocal())
+ 1985 loadLedger = il->getLedger();
+
+
+
+ 1989 JLOG(m_journal.fatal()) <<
"Replay ledger missing/damaged";
+
+ 1991 "ripple::ApplicationImp::loadOldLedger : replay ledger "
+
+
+
+
+
+ 1997 using namespace std::chrono_literals;
+ 1998 using namespace date;
+
+ 2000 sys_days{January / 1 / 2018} - sys_days{January / 1 / 2000}};
+ 2001 if (loadLedger->info().closeTime < ledgerWarnTimePoint)
+
+ 2003 JLOG(m_journal.fatal())
+ 2004 <<
"\n\n*** WARNING ***\n"
+ 2005 "You are replaying a ledger from before "
+ 2006 << to_string(ledgerWarnTimePoint)
+
+ 2008 "This replay will not handle your ledger as it was "
+
+ 2010 "handled.\nConsider running an earlier version of rippled "
+
+ 2012 "get the older rules.\n*** CONTINUING ***\n";
+
+
+ 2015 JLOG(m_journal.info()) <<
"Loading ledger " << loadLedger->info().hash
+ 2016 <<
" seq:" << loadLedger->info().seq;
+
+ 2018 if (loadLedger->info().accountHash.isZero())
+
+ 2020 JLOG(m_journal.fatal()) <<
"Ledger is empty.";
+
+ 2022 "ripple::ApplicationImp::loadOldLedger : ledger is empty");
+
+
+
+ 2026 if (!loadLedger->walkLedger(journal(
"Ledger"),
true))
+
+ 2028 JLOG(m_journal.fatal()) <<
"Ledger is missing nodes.";
+
+ 2030 "ripple::ApplicationImp::loadOldLedger : ledger is missing "
+
+
+
+
+ 2035 if (!loadLedger->assertSensible(journal(
"Ledger")))
+
+ 2037 JLOG(m_journal.fatal()) <<
"Ledger is not sensible.";
+
+ 2039 "ripple::ApplicationImp::loadOldLedger : ledger is not "
+
+
+
+
+ 2044 m_ledgerMaster->setLedgerRangePresent(
+ 2045 loadLedger->info().seq, loadLedger->info().seq);
+
+ 2047 m_ledgerMaster->switchLCL(loadLedger);
+ 2048 loadLedger->setValidated();
+ 2049 m_ledgerMaster->setFullLedger(loadLedger,
true,
false);
+ 2050 openLedger_.emplace(
+ 2051 loadLedger, cachedSLEs_, logs_->journal(
"OpenLedger"));
+
+
+
+
+
+
+ 2058 std::make_unique<LedgerReplay>(loadLedger, replayLedger);
+
+ 2060 for (
auto const& [_, tx] : replayData->orderedTxns())
+
+
+ 2063 auto txID = tx->getTransactionID();
+ 2064 if (trapTxID == txID)
+
+
+ 2067 JLOG(m_journal.debug()) <<
"Trap transaction set: " << txID;
+
+
+ 2070 auto s = std::make_shared<Serializer>();
+
+
+ 2073 forceValidity(getHashRouter(), txID, Validity::SigGoodOnly);
+
+ 2075 openLedger_->modify(
+
+
+
+
+
+
+ 2082 m_ledgerMaster->takeReplay(std::move(replayData));
+
+ 2084 if (trapTxID && !trapTxID_)
+
+ 2086 JLOG(m_journal.fatal())
+ 2087 <<
"Ledger " << replayLedger->info().seq
+ 2088 <<
" does not contain the transaction hash " << *trapTxID;
+
+
+
+
+
+
+ 2095 JLOG(m_journal.fatal())
+ 2096 <<
"While loading specified ledger: " << mn.
what();
+
+
+ 2099 catch (boost::bad_lexical_cast&)
+
+ 2101 JLOG(m_journal.fatal())
+ 2102 <<
"Ledger specified '" << ledgerID <<
"' is not valid";
+
+
+
+
+
+
+
+
+
+ 2112 if (!config().ELB_SUPPORT)
+
+
+
+
+ 2117 reason =
"Server is shutting down";
+
+
+
+ 2121 if (getOPs().isNeedNetworkLedger())
+
+ 2123 reason =
"Not synchronized with network yet";
+
+
+
+ 2127 if (getOPs().isAmendmentBlocked())
+
+ 2129 reason =
"Server version too old";
+
+
+
+ 2133 if (getOPs().isUNLBlocked())
+
+ 2135 reason =
"No valid validator list available";
+
+
+
+ 2139 if (getOPs().getOperatingMode() < OperatingMode::SYNCING)
+
+ 2141 reason =
"Not synchronized with network";
+
+
+
+ 2145 if (!getLedgerMaster().isCaughtUp(reason))
+
+
+ 2148 if (getFeeTrack().isLoadedLocal())
+
+ 2150 reason =
"Too much load";
+
+
+
+
+
+
+
+
+
+ 2160 return logs_->journal(name);
+
+
+
+ 2164ApplicationImp::setMaxDisallowedLedger()
+
+ 2166 auto seq = getRelationalDatabase().getMaxLedgerSeq();
+
+ 2168 maxDisallowedLedger_ = *seq;
+
+ 2170 JLOG(m_journal.trace())
+ 2171 <<
"Max persisted ledger is " << maxDisallowedLedger_;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2188 return std::make_unique<ApplicationImp>(
+ 2189 std::move(config), std::move(logs), std::move(timeKeeper));
+
+
+
@@ -2312,7 +2313,7 @@ $(function() {
virtual ServerHandler & getServerHandler() override
std::unique_ptr< Cluster > cluster_
Config & config() override
-void signalStop(std::string msg="") override
+void signalStop(std::string msg="") override
std::unique_ptr< ValidatorList > validators_
std::uint64_t const instanceCookie_
HashRouter & getHashRouter() override
@@ -2328,7 +2329,7 @@ $(function() {
AmendmentTable & getAmendmentTable() override
io_latency_sampler m_io_latency_sampler
static std::size_t numberOfThreads(Config const &config)
-bool isStopping() const override
+bool isStopping() const override
LoadManager & getLoadManager() override
OrderBookDB m_orderBookDB
std::unique_ptr< LoadFeeTrack > mFeeTrack
@@ -2350,7 +2351,7 @@ $(function() {
ValidatorSite & validatorSites() override
PeerReservationTable & peerReservations() override
ManifestCache & publisherManifests() override
-int fdRequired() const override
+int fdRequired() const override
Application::MutexType & getMasterMutex() override
std::unique_ptr< LedgerMaster > m_ledgerMaster
TransactionMaster & getMasterTransaction() override
@@ -2363,7 +2364,7 @@ $(function() {
std::unique_ptr< Overlay > overlay_
std::unique_ptr< HashRouter > hashRouter_
RelationalDatabase & getRelationalDatabase() override
-bool serverOkay(std::string &reason) override
+bool serverOkay(std::string &reason) override
OpenLedger & openLedger() override
std::mutex stoppingMutex_
TimeKeeper & timeKeeper() override
@@ -2384,7 +2385,7 @@ $(function() {
std::unique_ptr< ServerHandler > serverHandler_
LedgerMaster & getLedgerMaster() override
void gotTXSet(std::shared_ptr< SHAMap > const &set, bool fromAcquire)
-void start(bool withTimers) override
+void start(bool withTimers) override
std::unique_ptr< ManifestCache > publisherManifests_
boost::asio::signal_set m_signals
std::unique_ptr< LoadManager > m_loadManager
@@ -2395,16 +2396,16 @@ $(function() {
Application::MutexType m_masterMutex
std::unique_ptr< perf::PerfLog > perfLog_
bool initRelationalDatabase()
-bool checkSigs() const override
+bool checkSigs() const override
std::unique_ptr< TimeKeeper > timeKeeper_
-
+
NodeStore::Database & getNodeStore() override
PendingSaves & pendingSaves() override
std::unique_ptr< AmendmentTable > m_amendmentTable
std::optional< uint256 > trapTxID_
ApplicationImp(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
std::unique_ptr< DatabaseCon > mWalletDB
-beast::Journal journal(std::string const &name) override
+beast::Journal journal(std::string const &name) override
PathRequests & getPathRequests() override
std::optional< std::pair< PublicKey, SecretKey > > nodeIdentity_
boost::asio::steady_timer sweepTimer_
@@ -2439,7 +2440,7 @@ $(function() {
-
+
@@ -2532,7 +2533,7 @@ $(function() {
TxQ::Setup setup_TxQ(Config const &config)
Build a TxQ::Setup object from application configuration.
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
std::unique_ptr< LoadManager > make_LoadManager(Application &app, beast::Journal journal)
-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)
std::unique_ptr< ServerHandler > make_ServerHandler(Application &app, boost::asio::io_service &io_service, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
void initAccountIdCache(std::size_t count)
Initialize the global cache used to map AccountID to base58 conversions.
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_service &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
diff --git a/Application_8h_source.html b/Application_8h_source.html
index a348153809..21c937af54 100644
--- a/Application_8h_source.html
+++ b/Application_8h_source.html
@@ -395,7 +395,7 @@ $(function() {
virtual ValidatorSite & validatorSites()=0
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
virtual Resource::Manager & getResourceManager()=0
-
+
virtual NetworkOPs & getOPs()=0
virtual InboundLedgers & getInboundLedgers()=0
virtual void signalStop(std::string msg="")=0
@@ -472,7 +472,7 @@ $(function() {
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-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)
diff --git a/ConfigSections_8h_source.html b/ConfigSections_8h_source.html
index 5700ad9702..89938f7906 100644
--- a/ConfigSections_8h_source.html
+++ b/ConfigSections_8h_source.html
@@ -169,14 +169,15 @@ $(function() {
91#define SECTION_VALIDATOR_KEY_REVOCATION "validator_key_revocation"
92#define SECTION_VALIDATOR_LIST_KEYS "validator_list_keys"
93#define SECTION_VALIDATOR_LIST_SITES "validator_list_sites"
- 94#define SECTION_VALIDATORS "validators"
- 95#define SECTION_VALIDATOR_TOKEN "validator_token"
- 96#define SECTION_VETO_AMENDMENTS "veto_amendments"
- 97#define SECTION_WORKERS "workers"
-
-
-
-
+ 94#define SECTION_VALIDATOR_LIST_THRESHOLD "validator_list_threshold"
+ 95#define SECTION_VALIDATORS "validators"
+ 96#define SECTION_VALIDATOR_TOKEN "validator_token"
+ 97#define SECTION_VETO_AMENDMENTS "veto_amendments"
+ 98#define SECTION_WORKERS "workers"
+
+
+
+
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
diff --git a/Config_8cpp_source.html b/Config_8cpp_source.html
index ae4458dfaf..7f475dd195 100644
--- a/Config_8cpp_source.html
+++ b/Config_8cpp_source.html
@@ -990,132 +990,171 @@ $(function() {
- 915 if (!entries && !valKeyEntries && !valListKeys)
- 916 Throw<std::runtime_error>(
- 917 "The file specified in [" SECTION_VALIDATORS_FILE
-
- 919 "does not contain a [" SECTION_VALIDATORS
-
- 921 "[" SECTION_VALIDATOR_KEYS
-
- 923 "[" SECTION_VALIDATOR_LIST_KEYS
-
-
- 926 validatorsFile.string());
-
-
-
-
-
-
- 933 if (!
section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
- 934 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
-
- 936 Throw<std::runtime_error>(
-
- 938 "] config section is missing");
-
-
-
-
- 943 auto const part =
section(
"features");
- 944 for (
auto const& s : part.values())
-
-
-
-
- 949 Throw<std::runtime_error>(
- 950 "Unknown feature: " + s +
" in config file.");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 966 Throw<std::runtime_error>(
- 967 "The minimum number of required peers (network_quorum) exceeds "
- 968 "the maximum number of allowed peers (peers_max)");
-
-
-
-
- 973boost::filesystem::path
-
-
-
-
- 978 if (!log_file.empty() && !log_file.is_absolute())
-
-
-
- 982 log_file = boost::filesystem::absolute(log_file,
CONFIG_DIR);
-
-
- 985 if (!log_file.empty())
-
- 987 auto log_dir = log_file.parent_path();
-
- 989 if (!boost::filesystem::is_directory(log_dir))
-
- 991 boost::system::error_code ec;
- 992 boost::filesystem::create_directories(log_dir, ec);
-
-
-
-
-
- 998 std::cerr <<
"Unable to create log file path " << log_dir
- 999 <<
": " << ec.message() <<
'\n';
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1013 "ripple::Config::getValueFor : valid index input");
-
- 1015 !node || *node <= 4,
- 1016 "ripple::Config::getValueFor : unset or valid node");
-
-
-
-
-
-
-
-
-
- 1026 if (
set(temp,
"reference_fee", section) &&
-
-
-
-
-
- 1032 if (
set(temp,
"account_reserve", section))
-
- 1034 if (
set(temp,
"owner_reserve", section))
-
-
-
-
-
-
+ 915 auto valListThreshold =
+
+
+ 918 if (valListThreshold)
+ 919 section(SECTION_VALIDATOR_LIST_THRESHOLD)
+ 920 .
append(*valListThreshold);
+
+ 922 if (!entries && !valKeyEntries && !valListKeys)
+ 923 Throw<std::runtime_error>(
+ 924 "The file specified in [" SECTION_VALIDATORS_FILE
+
+ 926 "does not contain a [" SECTION_VALIDATORS
+
+ 928 "[" SECTION_VALIDATOR_KEYS
+
+ 930 "[" SECTION_VALIDATOR_LIST_KEYS
+
+
+ 933 validatorsFile.string());
+
+
+
+ 937 auto const& listThreshold =
+ 938 section(SECTION_VALIDATOR_LIST_THRESHOLD);
+ 939 if (listThreshold.lines().empty())
+
+ 941 else if (listThreshold.values().size() == 1)
+
+ 943 auto strTemp = listThreshold.values()[0];
+ 944 auto const listThreshold =
+ 945 beast::lexicalCastThrow<std::size_t>(strTemp);
+ 946 if (listThreshold == 0)
+
+
+
+ 950 section(SECTION_VALIDATOR_LIST_KEYS).values().size())
+
+ 952 Throw<std::runtime_error>(
+ 953 "Value in config section "
+ 954 "[" SECTION_VALIDATOR_LIST_THRESHOLD
+ 955 "] exceeds the number of configured list keys");
+
+ 957 return listThreshold;
+
+
+
+ 961 Throw<std::runtime_error>(
+
+ 963 "[" SECTION_VALIDATOR_LIST_THRESHOLD
+ 964 "] should contain single value only");
+
+
+
+
+
+
+
+ 972 if (!
section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
+ 973 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
+
+ 975 Throw<std::runtime_error>(
+
+ 977 "] config section is missing");
+
+
+
+
+ 982 auto const part =
section(
"features");
+ 983 for (
auto const& s : part.values())
+
+
+
+
+ 988 Throw<std::runtime_error>(
+ 989 "Unknown feature: " + s +
" in config file.");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1005 Throw<std::runtime_error>(
+ 1006 "The minimum number of required peers (network_quorum) exceeds "
+ 1007 "the maximum number of allowed peers (peers_max)");
+
+
+
+
+ 1012boost::filesystem::path
+
+
+
+
+ 1017 if (!log_file.empty() && !log_file.is_absolute())
+
+
+
+ 1021 log_file = boost::filesystem::absolute(log_file,
CONFIG_DIR);
+
+
+ 1024 if (!log_file.empty())
+
+ 1026 auto log_dir = log_file.parent_path();
+
+ 1028 if (!boost::filesystem::is_directory(log_dir))
+
+ 1030 boost::system::error_code ec;
+ 1031 boost::filesystem::create_directories(log_dir, ec);
+
+
+
+
+
+ 1037 std::cerr <<
"Unable to create log file path " << log_dir
+ 1038 <<
": " << ec.message() <<
'\n';
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1052 "ripple::Config::getValueFor : valid index input");
+
+ 1054 !node || *node <= 4,
+ 1055 "ripple::Config::getValueFor : unset or valid node");
+
+
+
+
+
+
+
+
+
+ 1065 if (
set(temp,
"reference_fee", section) &&
+
+
+
+
+
+ 1071 if (
set(temp,
"account_reserve", section))
+
+ 1073 if (
set(temp,
"owner_reserve", section))
+
+
+
+
+
+
@@ -1152,11 +1191,12 @@ $(function() {
+std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
int RELAY_UNTRUSTED_PROPOSALS
bool TX_REDUCE_RELAY_ENABLE
-boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
+boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
@@ -1172,7 +1212,7 @@ $(function() {
boost::filesystem::path CONFIG_FILE
-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.
+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.
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
boost::filesystem::path DEBUG_LOGFILE
@@ -1236,7 +1276,7 @@ $(function() {
std::string getFileContents(boost::system::error_code &ec, boost::filesystem::path const &sourcePath, std::optional< std::size_t > maxSize=std::nullopt)
IniFileSections parseIniFile(std::string const &strInput, const bool bTrim)
-FeeSetup setup_FeeVote(Section const §ion)
+FeeSetup setup_FeeVote(Section const §ion)
bool isProperlyFormedTomlDomain(std::string_view domain)
Determines if the given string looks like a TOML-file hosting domain.
constexpr std::array< std::pair< SizedItem, std::array< int, 5 > >, 13 > sizedItems
diff --git a/Config_8h_source.html b/Config_8h_source.html
index 5f4a955586..4503f3a2be 100644
--- a/Config_8h_source.html
+++ b/Config_8h_source.html
@@ -359,76 +359,78 @@ $(function() {
-
-
-
-
-
-
-
-
-
-
-
-
-
- 321 setupControl(
bool bQuiet,
bool bSilent,
bool bStandalone);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 323 setupControl(
bool bQuiet,
bool bSilent,
bool bStandalone);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
A generic endpoint for log messages.
Holds unparsed configuration information.
-
+
@@ -450,12 +452,12 @@ $(function() {
static char const *const configFileName
-
+
std::vector< std::string > IPS
bool VP_REDUCE_RELAY_ENABLE
-
+
std::optional< beast::IP::Endpoint > rpc_ip
std::size_t TX_REDUCE_RELAY_MIN_PEERS
@@ -468,22 +470,23 @@ $(function() {
+std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
int RELAY_UNTRUSTED_PROPOSALS
-beast::Journal journal() const
+beast::Journal journal() const
bool TX_REDUCE_RELAY_ENABLE
-boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
+boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
-
+
bool TX_REDUCE_RELAY_METRICS
static constexpr int MIN_JOB_QUEUE_TX
bool RUN_STANDALONE
Operate in stand-alone mode.
std::size_t TX_RELAY_PERCENTAGE
-
+
std::string SERVER_DOMAIN
static constexpr int MAX_JOB_QUEUE_TX
@@ -494,7 +497,7 @@ $(function() {
boost::filesystem::path CONFIG_FILE
-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.
+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.
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
boost::filesystem::path DEBUG_LOGFILE
@@ -536,7 +539,7 @@ $(function() {
constexpr std::chrono::seconds const defaultAmendmentMajorityTime
The minimum amount of time an amendment must hold a majority.
-FeeSetup setup_FeeVote(Section const §ion)
+FeeSetup setup_FeeVote(Section const §ion)
constexpr XRPAmount DROPS_PER_XRP
Number of drops per 1 XRP.
diff --git a/Config__test_8cpp_source.html b/Config__test_8cpp_source.html
index 8f35383a87..08f1a3b55c 100644
--- a/Config__test_8cpp_source.html
+++ b/Config__test_8cpp_source.html
@@ -100,1281 +100,1471 @@ $(function() {
22#include <xrpld/core/Config.h>
23#include <xrpld/core/ConfigSections.h>
24#include <xrpl/basics/contract.h>
- 25#include <xrpl/server/Port.h>
- 26#include <boost/filesystem.hpp>
- 27#include <boost/format.hpp>
-
-
-
-
-
-
-
-
- 36 static boost::format configContentsTemplate(R
"rippleConfig(
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 64#-------------------------------------------------------------------------------
-
-
-
-
- 69# This is primary persistent datastore for rippled. This includes transaction
- 70# metadata, account states, and ledger headers. Helpful information can be
- 71# found on https://xrpl.org/capacity-planning.html#node-db-type
- 72# delete old ledgers while maintaining at least 2000. Do not require an
- 73# external administrative command to initiate deletion.
-
-
- 76path=/Users/dummy/ripple/config/db/rocksdb
-
-
-
-
-
-
-
-
-
-
- 87# This needs to be an absolute directory reference, not a relative one.
- 88# Modify this value as required.
-
- 90/Users/dummy/ripple/config/log/debug.log
-
-
-
-
-
-
-
- 98# Where to find some other servers speaking the Ripple protocol.
-
-
-
-
- 103# Turn down default logging to save disk space in the long run.
- 104# Valid values here are trace, debug, info, warning, error, and fatal
-
- 106{ "command": "log_level", "severity": "warning" }
-
- 108# Defaults to 1 ("yes") so that certificates will be validated. To allow the use
- 109# of self-signed certificates for development or internal use, set to 0 ("no").
-
-
-
-
-
-
-
-
- 118 dbPath.empty() ? "" :
"[database_path]\n" + dbPath;
-
- 120 validatorsFile.
empty() ?
"" :
"[validators_file]\n" + validatorsFile;
- 121 return boost::str(configContentsTemplate % dbPathSection % valFileSection);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 141 path const& validatorsFile,
- 142 bool useCounter =
true)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 171 return file().string();
-
-
-
-
-
- 177 return boost::filesystem::is_directory(
dataDir_);
-
-
-
-
-
-
-
-
-
-
-
-
- 190 using namespace boost::filesystem;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 207n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
- 208n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
- 209n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
- 210n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS
- 211n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA
-
-
- 214nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5
- 215nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8
- 216nHUPDdcdb2Y5DZAJne4c2iabFuAP3F34xZUgYQT2NH7qfkdapgnz
-
- 218[validator_list_sites]
- 219recommendedripplevalidators.com
- 220moreripplevalidators.net
-
-
- 22303E74EE14CB525AFBB9F1B7D86CD58ECC4B91452294B42AB4E78F260BD905C091D
- 224030775A669685BD6ABCEBD80385921C7851783D991A8055FD21D2F3966C96F1B56
-
-
-
-
-
-
-
-
-
-
- 238 path const& validatorsFileName,
- 239 bool useCounter =
true)
-
-
-
-
- 244 validatorsFileName.empty() ?
Config::validatorsFileName
- 245 : validatorsFileName),
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 260 return absolute(
file()).string();
-
-
-
-
+ 25#include <xrpl/beast/unit_test/suite.h>
+ 26#include <xrpl/server/Port.h>
+ 27#include <boost/filesystem.hpp>
+ 28#include <boost/format.hpp>
+
+
+
+
+
+
+
+
+ 37 static boost::format configContentsTemplate(R
"rippleConfig(
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 65#-------------------------------------------------------------------------------
+
+
+
+
+ 70# This is primary persistent datastore for rippled. This includes transaction
+ 71# metadata, account states, and ledger headers. Helpful information can be
+ 72# found on https://xrpl.org/capacity-planning.html#node-db-type
+ 73# delete old ledgers while maintaining at least 2000. Do not require an
+ 74# external administrative command to initiate deletion.
+
+
+ 77path=/Users/dummy/ripple/config/db/rocksdb
+
+
+
+
+
+
+
+
+
+
+ 88# This needs to be an absolute directory reference, not a relative one.
+ 89# Modify this value as required.
+
+ 91/Users/dummy/ripple/config/log/debug.log
+
+
+
+
+
+
+
+ 99# Where to find some other servers speaking the Ripple protocol.
+
+
+
+
+ 104# Turn down default logging to save disk space in the long run.
+ 105# Valid values here are trace, debug, info, warning, error, and fatal
+
+ 107{ "command": "log_level", "severity": "warning" }
+
+ 109# Defaults to 1 ("yes") so that certificates will be validated. To allow the use
+ 110# of self-signed certificates for development or internal use, set to 0 ("no").
+
+
+
+
+
+
+
+
+ 119 dbPath.empty() ? "" :
"[database_path]\n" + dbPath;
+
+ 121 validatorsFile.
empty() ?
"" :
"[validators_file]\n" + validatorsFile;
+ 122 return boost::str(configContentsTemplate % dbPathSection % valFileSection);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 142 path const& validatorsFile,
+ 143 bool useCounter =
true)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 172 return file().string();
+
+
+
+
+
+ 178 return boost::filesystem::is_directory(
dataDir_);
+
+
+
+
+
+
+
+
+
+
+
+
+ 191 using namespace boost::filesystem;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 208n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
+ 209n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
+ 210n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
+ 211n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS
+ 212n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA
+
+
+ 215nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5
+ 216nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8
+ 217nHUPDdcdb2Y5DZAJne4c2iabFuAP3F34xZUgYQT2NH7qfkdapgnz
+
+ 219[validator_list_sites]
+ 220recommendedripplevalidators.com
+ 221moreripplevalidators.net
+
+
+ 22403E74EE14CB525AFBB9F1B7D86CD58ECC4B91452294B42AB4E78F260BD905C091D
+ 225030775A669685BD6ABCEBD80385921C7851783D991A8055FD21D2F3966C96F1B56
+
+ 227[validator_list_threshold]
+
+
+
+
+
+
+
+
+
+
+
+ 242 path const& validatorsFileName,
+ 243 bool useCounter =
true)
+
+
+
+
+ 248 validatorsFileName.empty() ?
Config::validatorsFileName
+ 249 : validatorsFileName),
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 264 return absolute(
file()).string();
-
-
-
-
-
-
- 272 using path = boost::filesystem::path;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ 276 using path = boost::filesystem::path;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- 294 BEAST_EXPECT(c.legacy("ssl_verify") ==
"0");
-
-
-
- 298 BEAST_EXPECT(c.
legacy(
"not_in_file") ==
"");
- 299 c.
legacy(
"not_in_file",
"new_value");
- 300 BEAST_EXPECT(c.
legacy(
"not_in_file") ==
"new_value");
-
-
-
-
-
-
- 307 using namespace boost::filesystem;
-
- 309 boost::format cc(
"[database_path]\n%1%\n");
+
+
+
+
+
+
+ 298 BEAST_EXPECT(c.legacy("ssl_verify") ==
"0");
+
+
+
+ 302 BEAST_EXPECT(c.
legacy(
"not_in_file") ==
"");
+ 303 c.
legacy(
"not_in_file",
"new_value");
+ 304 BEAST_EXPECT(c.
legacy(
"not_in_file") ==
"new_value");
+
+
+
+
+
- 311 auto const cwd = current_path();
- 312 path const dataDirRel(
"test_data_dir");
- 313 path const dataDirAbs(cwd / dataDirRel);
-
-
-
-
- 318 BEAST_EXPECT(c.
legacy(
"database_path") == dataDirAbs.string());
-
-
-
-
-
- 324 BEAST_EXPECT(c.
legacy(
"database_path") == dataDirAbs.string());
-
-
-
-
-
-
-
- 332 BEAST_EXPECT(c.
legacy(
"database_path") ==
"");
-
-
-
-
- 337 auto const cwd = current_path();
-
- 339 path const dataDirRel(
"test_data_dir");
- 340 path const dataDirAbs(cwd / g0.
subdir() / dataDirRel);
-
- 342 *
this, g0.
subdir(), dataDirAbs,
"",
false);
- 343 auto const& c(g.
config());
-
-
- 346 BEAST_EXPECT(c.legacy(
"database_path") == dataDirAbs.string());
-
-
-
-
-
- 352 auto const& c(g.
config());
-
-
-
- 356 BEAST_EXPECT(c.legacy(
"database_path") == nativeDbPath);
-
-
-
-
- 361 auto const& c(g.
config());
-
-
-
-
- 366 BEAST_EXPECT(c.legacy(
"database_path") == nativeDbPath);
-
-
-
-
-
-
-
-
-
-
-
- 378 "eyJ2YWxpZGF0aW9uX3ByaXZhdGVfa2V5IjoiOWVkNDVmODY2MjQxY2MxOGEyNzQ3Yj"
- 379 "U0Mzg3YzA2MjU5MDc5NzJmNGU3MTkwMjMxZmFhOTM3NDU3ZmE5ZGFmNiIsIm1hbmlm"
- 380 "ZXN0IjoiSkFBQUFBRnhJZTFGdHdtaW12R3RIMmlDY01KcUM5Z1ZGS2lsR2Z3MS92Q3"
- 381 "hIWFhMcGxjMkduTWhBa0UxYWdxWHhCd0R3RGJJRDZPTVNZdU0wRkRBbHBBZ05rOFNL"
- 382 "Rm43TU8yZmRrY3dSUUloQU9uZ3U5c0FLcVhZb3VKK2wyVjBXK3NBT2tWQitaUlM2UF"
- 383 "NobEpBZlVzWGZBaUJzVkpHZXNhYWRPSmMvYUFab2tTMXZ5bUdtVnJsSFBLV1gzWXl3"
- 384 "dTZpbjhIQVNRS1B1Z0JENjdrTWFSRkd2bXBBVEhsR0tKZHZERmxXUFl5NUFxRGVkRn"
- 385 "Y1VEphMncwaTIxZXEzTVl5d0xWSlpuRk9yN0Mwa3cyQWlUelNDakl6ZGl0UTg9In0"
-
-
-
-
- 390 static boost::format configTemplate(R
"rippleConfig(
-
-
-
-
-
-
-
- 398 auto const expectedError =
- 399 "Cannot have both [validation_seed] "
- 400 "and [validator_token] config sections";
-
-
-
-
-
-
-
-
+ 311 using namespace boost::filesystem;
+
+ 313 boost::format cc(
"[database_path]\n%1%\n");
+
+ 315 auto const cwd = current_path();
+ 316 path const dataDirRel(
"test_data_dir");
+ 317 path const dataDirAbs(cwd / dataDirRel);
+
+
+
+
+ 322 BEAST_EXPECT(c.
legacy(
"database_path") == dataDirAbs.string());
+
+
+
+
+
+ 328 BEAST_EXPECT(c.
legacy(
"database_path") == dataDirAbs.string());
+
+
+
+
+
+
+
+ 336 BEAST_EXPECT(c.
legacy(
"database_path") ==
"");
+
+
+
+
+ 341 auto const cwd = current_path();
+
+ 343 path const dataDirRel(
"test_data_dir");
+ 344 path const dataDirAbs(cwd / g0.
subdir() / dataDirRel);
+
+ 346 *
this, g0.
subdir(), dataDirAbs,
"",
false);
+ 347 auto const& c(g.
config());
+
+
+ 350 BEAST_EXPECT(c.legacy(
"database_path") == dataDirAbs.string());
+
+
+
+
+
+ 356 auto const& c(g.
config());
+
+
+
+ 360 BEAST_EXPECT(c.legacy(
"database_path") == nativeDbPath);
+
+
+
+
+ 365 auto const& c(g.
config());
+
+
+
+
+ 370 BEAST_EXPECT(c.legacy(
"database_path") == nativeDbPath);
+
+
+
+
+
+
+
+
+
+
+
+ 382 "eyJ2YWxpZGF0aW9uX3ByaXZhdGVfa2V5IjoiOWVkNDVmODY2MjQxY2MxOGEyNzQ3Yj"
+ 383 "U0Mzg3YzA2MjU5MDc5NzJmNGU3MTkwMjMxZmFhOTM3NDU3ZmE5ZGFmNiIsIm1hbmlm"
+ 384 "ZXN0IjoiSkFBQUFBRnhJZTFGdHdtaW12R3RIMmlDY01KcUM5Z1ZGS2lsR2Z3MS92Q3"
+ 385 "hIWFhMcGxjMkduTWhBa0UxYWdxWHhCd0R3RGJJRDZPTVNZdU0wRkRBbHBBZ05rOFNL"
+ 386 "Rm43TU8yZmRrY3dSUUloQU9uZ3U5c0FLcVhZb3VKK2wyVjBXK3NBT2tWQitaUlM2UF"
+ 387 "NobEpBZlVzWGZBaUJzVkpHZXNhYWRPSmMvYUFab2tTMXZ5bUdtVnJsSFBLV1gzWXl3"
+ 388 "dTZpbjhIQVNRS1B1Z0JENjdrTWFSRkd2bXBBVEhsR0tKZHZERmxXUFl5NUFxRGVkRn"
+ 389 "Y1VEphMncwaTIxZXEzTVl5d0xWSlpuRk9yN0Mwa3cyQWlUelNDakl6ZGl0UTg9In0"
+
+
+
+
+ 394 static boost::format configTemplate(R
"rippleConfig(
+
+
+
+
+
+
+
+ 402 auto const expectedError =
+ 403 "Cannot have both [validation_seed] "
+ 404 "and [validator_token] config sections";
+
+
+
+
- 410 BEAST_EXPECT(error == expectedError);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 432 BEAST_EXPECT(error ==
"");
-
-
-
-
-
-
-
-
-
-
-
-
- 445 BEAST_EXPECT(error ==
"");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 460 BEAST_EXPECT(error ==
"");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 475 BEAST_EXPECT(error ==
"");
-
-
+
+
+
+
+ 414 BEAST_EXPECT(error == expectedError);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 436 BEAST_EXPECT(error ==
"");
+
+
+
+
+
+
+
+
+
+
+
+
+ 449 BEAST_EXPECT(error ==
"");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 464 BEAST_EXPECT(error ==
"");
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
- 484 using namespace boost::filesystem;
-
-
- 487 boost::format cc(
"[validators_file]\n%1%\n");
-
- 489 std::string const missingPath =
"/no/way/this/path/exists";
- 490 auto const expectedError =
- 491 "The file specified in [validators_file] does not exist: " +
-
-
-
-
-
-
-
-
-
+ 479 BEAST_EXPECT(error ==
"");
+
+
+
+
+
+
+
+
+ 488 using namespace boost::filesystem;
+
+
+ 491 boost::format cc(
"[validators_file]\n%1%\n");
+
+ 493 std::string const missingPath =
"/no/way/this/path/exists";
+ 494 auto const expectedError =
+ 495 "The file specified in [validators_file] does not exist: " +
+
+
+
+
+
- 502 BEAST_EXPECT(error == expectedError);
-
-
-
-
- 507 *
this,
"test_cfg",
"validators.cfg");
- 508 path const invalidFile = current_path() / vtg.
subdir();
- 509 boost::format cc(
"[validators_file]\n%1%\n");
-
- 511 auto const expectedError =
- 512 "Invalid file specified in [validators_file]: " +
- 513 invalidFile.string();
-
-
-
-
-
-
-
-
+
+
+
+
+ 506 BEAST_EXPECT(error == expectedError);
+
+
+
+
+ 511 *
this,
"test_cfg",
"validators.cfg");
+ 512 path const invalidFile = current_path() / vtg.
subdir();
+ 513 boost::format cc(
"[validators_file]\n%1%\n");
+
+ 515 auto const expectedError =
+ 516 "Invalid file specified in [validators_file]: " +
+ 517 invalidFile.string();
+
+
+
+
- 523 BEAST_EXPECT(error == expectedError);
-
-
-
-
-
-
- 530n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
- 531n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
- 532n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
-
-
- 535nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5
- 536nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8
-
-
- 539 BEAST_EXPECT(c.legacy("validators_file").empty());
-
-
-
-
-
-
- 546[validator_list_sites]
-
- 548trustthesevalidators.gov
-
-
- 551021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
-
-
-
-
-
-
- 558 "ripplevalidators.com");
-
-
- 561 "trustthesevalidators.gov");
-
-
-
-
- 566 "021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801"
-
-
-
-
-
-
-
- 574[validator_list_sites]
-
- 576trustthesevalidators.gov
-
-
- 579 auto const expectedError =
- 580 "[validator_list_keys] config section is missing";
-
-
-
-
-
-
-
-
- 589 BEAST_EXPECT(error == expectedError);
-
-
-
-
- 594 *
this,
"test_cfg",
"validators.cfg");
-
-
- 597 boost::format cc(
"[validators_file]\n%1%\n");
-
-
-
-
-
+
+
+
+
+ 527 BEAST_EXPECT(error == expectedError);
+
+
+
+
+
+
+ 534n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
+ 535n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
+ 536n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
+
+
+ 539nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5
+ 540nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8
+
+
+ 543 BEAST_EXPECT(c.legacy("validators_file").empty());
+
+
+
+
+
+
+
+ 551[validator_list_sites]
+
+ 553trustthesevalidators.gov
+
+
+ 556021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
+ 558[validator_list_threshold]
+
+
+
+
+
+
+
+ 566 "ripplevalidators.com");
+
+
+ 569 "trustthesevalidators.gov");
+
+
+
+
+ 574 "021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801"
+
+
+
+
+
+ 580 c.
section(SECTION_VALIDATOR_LIST_THRESHOLD).
values()[0] ==
"1");
+
+
+
+
+
+
+ 587[validator_list_sites]
+
+ 589trustthesevalidators.gov
+
+
+ 592021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
+ 594[validator_list_threshold]
+
+
+
+
+
+
+
+ 602 "ripplevalidators.com");
-
-
-
-
-
-
-
- 611 *
this,
"test_cfg", valFileName);
-
- 613 *
this, vtg.
subdir(),
"", valFileName,
false);
-
-
- 616 auto const& c(rcg.
config());
- 617 BEAST_EXPECT(c.legacy(
"validators_file") == valFileName);
- 618 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
-
- 620 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
- 622 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
-
-
-
-
-
- 628 *
this,
"test_cfg",
"validators.txt");
- 629 auto const valFilePath =
".." / vtg.
subdir() /
"validators.txt";
-
- 631 *
this, vtg.
subdir(),
"", valFilePath,
false);
-
-
- 634 auto const& c(rcg.
config());
- 635 BEAST_EXPECT(c.legacy(
"validators_file") == valFilePath);
- 636 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
-
- 638 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
- 640 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
-
-
-
-
- 645 *
this,
"test_cfg",
"validators.txt");
-
- 647 *
this, vtg.
subdir(),
"",
"",
false);
-
-
- 650 auto const& c(rcg.
config());
- 651 BEAST_EXPECT(c.legacy(
"validators_file").empty());
- 652 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
-
- 654 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
- 656 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
-
-
-
-
-
- 662 *
this,
"test_cfg",
"validators.cfg");
-
-
- 665 *
this, vtg.
subdir(),
"validators.txt",
false);
-
-
-
-
- 670 auto const& c(rcg.
config());
- 671 BEAST_EXPECT(c.legacy(
"validators_file") == vtg.
validatorsFile());
- 672 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
-
- 674 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
- 676 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
+ 605 "trustthesevalidators.gov");
+
+
+
+
+ 610 "021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801"
+
+
+
+
+
+ 616 c.
section(SECTION_VALIDATOR_LIST_THRESHOLD).
values()[0] ==
"0");
+
+
+
+
+
+
+
+ 624[validator_list_sites]
+
+ 626trustthesevalidators.gov
+
+
+ 629021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
+ 631[validator_list_threshold]
+
+
+
+ 635 auto const expectedError =
+ 636 "Value in config section [validator_list_threshold] exceeds "
+ 637 "the number of configured list keys";
+
+
+
+
+
+
+
+
+
+ 647 BEAST_EXPECT(error == expectedError);
+
+
+
+
+
+ 653[validator_list_sites]
+
+ 655trustthesevalidators.gov
+
+
+ 658021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
+ 660[validator_list_threshold]
+
+
+
+ 664 auto const expectedError =
+ 665 "Config section [validator_list_threshold] should contain "
+
+
+
+
+
+
+
+
+
+
+ 676 BEAST_EXPECT(error == expectedError);
-
-
-
- 681 boost::format cc(R
"rippleConfig(
-
-
-
-
- 686n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
- 687n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
- 688n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
- 689n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS
- 690n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA
-
-
- 693nHB1X37qrniVugfQcuBTAjswphC1drx7QjFFojJPZwKHHnt8kU7v
- 694nHUkAWDR4cB8AgPg7VXMX6et8xRTQb2KJfgv1aBEXozwrawRKgMB
-
- 696[validator_list_sites]
-
- 698trustthesevalidators.gov
-
-
- 701021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
-
-
- 704 *
this,
"test_cfg",
"validators.cfg");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 720 boost::format cc(
"[validators_file]\n%1%\n");
-
-
- 723 *
this,
"test_cfg",
"validators.cfg");
-
- 725 auto const expectedError =
- 726 "The file specified in [validators_file] does not contain a "
- 727 "[validators], [validator_keys] or [validator_list_keys] "
-
-
-
-
-
-
-
-
-
-
-
-
- 740 BEAST_EXPECT(error == expectedError);
-
-
-
-
-
-
-
- 748 *
this,
"testSetup", explicitPath ?
"test_db" :
"",
"");
-
-
-
-
-
-
-
-
-
-
-
- 760 BEAST_EXPECT(!config.
quiet());
- 761 BEAST_EXPECT(!config.
silent());
-
-
- 764 BEAST_EXPECT(!config.
legacy(
"database_path").empty());
-
-
-
-
-
-
-
-
- 773 BEAST_EXPECT(config.
quiet());
- 774 BEAST_EXPECT(!config.
silent());
-
-
- 777 BEAST_EXPECT(!config.
legacy(
"database_path").empty());
-
-
-
-
-
-
-
-
- 786 BEAST_EXPECT(config.
quiet());
- 787 BEAST_EXPECT(config.
silent());
-
-
- 790 BEAST_EXPECT(!config.
legacy(
"database_path").empty());
-
-
-
-
-
-
-
-
- 799 BEAST_EXPECT(config.
quiet());
- 800 BEAST_EXPECT(config.
silent());
-
-
- 803 BEAST_EXPECT(!config.
legacy(
"database_path").empty());
-
-
-
-
-
-
-
-
- 812 BEAST_EXPECT(!config.
quiet());
- 813 BEAST_EXPECT(!config.
silent());
-
-
-
- 817 config.
legacy(
"database_path").empty() == !explicitPath);
-
-
-
-
-
-
-
-
- 826 BEAST_EXPECT(config.
quiet());
- 827 BEAST_EXPECT(!config.
silent());
-
-
-
- 831 config.
legacy(
"database_path").empty() == !explicitPath);
-
-
-
-
-
-
-
-
- 840 BEAST_EXPECT(config.
quiet());
- 841 BEAST_EXPECT(config.
silent());
-
-
-
- 845 config.
legacy(
"database_path").empty() == !explicitPath);
-
-
-
-
-
-
-
-
- 854 BEAST_EXPECT(config.
quiet());
- 855 BEAST_EXPECT(config.
silent());
-
-
-
- 859 config.
legacy(
"database_path").empty() == !explicitPath);
-
-
-
-
-
-
-
- 867 auto const& conf = cfg.
config();
- 868 if (!BEAST_EXPECT(conf.exists(
"port_rpc")))
-
- 870 if (!BEAST_EXPECT(conf.exists(
"port_wss_admin")))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 915 cfg.exists(SECTION_IPS) &&
- 916 cfg.section(SECTION_IPS).lines().size() == 1 &&
- 917 cfg.section(SECTION_IPS).values().size() == 1);
-
- 919 cfg.exists(SECTION_IPS_FIXED) &&
- 920 cfg.section(SECTION_IPS_FIXED).lines().size() == 2 &&
- 921 cfg.section(SECTION_IPS_FIXED).values().size() == 2);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 950 anotherserversansport
- 951 anotherserverwithport:12
-
-
-
-
-
-
-
-
-
- 961 2001:db8:3333:4444:5555:6666:7777:8888:12345
- 962 [2001:db8:3333:4444:5555:6666:7777:8888]:1
-
-
-
-
-
-
-
-
- 971 cfg.
exists(SECTION_IPS) &&
-
-
-
- 975 cfg.
exists(SECTION_IPS_FIXED) &&
-
-
- 978 BEAST_EXPECT(cfg.
IPS[0] ==
"r.ripple.com 51235");
-
- 980 BEAST_EXPECT(cfg.
IPS_FIXED[0] ==
"s1.ripple.com 51235");
- 981 BEAST_EXPECT(cfg.
IPS_FIXED[1] ==
"s2.ripple.com 51235");
- 982 BEAST_EXPECT(cfg.
IPS_FIXED[2] ==
"anotherserversansport");
- 983 BEAST_EXPECT(cfg.
IPS_FIXED[3] ==
"anotherserverwithport 12");
- 984 BEAST_EXPECT(cfg.
IPS_FIXED[4] ==
"1.1.1.1 1");
- 985 BEAST_EXPECT(cfg.
IPS_FIXED[5] ==
"1.1.1.1 1");
- 986 BEAST_EXPECT(cfg.
IPS_FIXED[6] ==
"12.34.12.123 12345");
- 987 BEAST_EXPECT(cfg.
IPS_FIXED[7] ==
"12.34.12.123 12345");
-
-
-
- 991 BEAST_EXPECT(cfg.
IPS_FIXED[9] ==
"2001:db8::");
- 992 BEAST_EXPECT(cfg.
IPS_FIXED[10] ==
"::1");
- 993 BEAST_EXPECT(cfg.
IPS_FIXED[11] ==
"::1:12345");
- 994 BEAST_EXPECT(cfg.
IPS_FIXED[12] ==
"[::1]:12345");
-
-
- 997 "2001:db8:3333:4444:5555:6666:7777:8888:12345");
-
- 999 cfg.
IPS_FIXED[14] ==
"[2001:db8:3333:4444:5555:6666:7777:8888]:1");
-
-
-
-
-
- 1005 struct TestCommentData
-
-
-
-
-
-
-
-
- 1014 {{
"password = aaaa\\#bbbb",
"password",
"aaaa#bbbb",
false},
- 1015 {
"password = aaaa#bbbb",
"password",
"aaaa",
true},
- 1016 {
"password = aaaa #bbbb",
"password",
"aaaa",
true},
-
- 1018 {
"password = #aaaa #bbbb",
"",
"password =",
true},
- 1019 {
"password = aaaa\\# #bbbb",
"password",
"aaaa#",
true},
- 1020 {
"password = aaaa\\##bbbb",
"password",
"aaaa#",
true},
- 1021 {
"aaaa#bbbb",
"",
"aaaa",
true},
- 1022 {
"aaaa\\#bbbb",
"",
"aaaa#bbbb",
false},
- 1023 {
"aaaa\\##bbbb",
"",
"aaaa#",
true},
- 1024 {
"aaaa #bbbb",
"",
"aaaa",
true},
- 1025 {
"1 #comment",
"",
"1",
true},
- 1026 {
"#whole thing is comment",
"",
"",
false},
- 1027 {
" #whole comment with space",
"",
"",
false}}};
-
- 1029 for (
auto const& t : tests)
-
-
- 1032 s.append(t.line.data());
- 1033 BEAST_EXPECT(s.had_trailing_comments() == t.had_comment);
- 1034 if (t.field.empty())
-
- 1036 BEAST_EXPECTS(s.legacy() == t.expect, s.legacy());
-
-
-
-
- 1041 BEAST_EXPECTS(
set(field, t.field.data(), s), t.line);
- 1042 BEAST_EXPECTS(field == t.expect, t.line);
-
-
-
-
-
- 1048 s.append(
"online_delete = 3000");
-
- 1050 BEAST_EXPECT(
set(od,
"online_delete", s));
- 1051 BEAST_EXPECTS(od == 3000, *(s.get<
std::string>(
"online_delete")));
-
-
-
-
- 1056 s.append(
"online_delete = 2000 #my comment on this");
-
- 1058 BEAST_EXPECT(
set(od,
"online_delete", s));
- 1059 BEAST_EXPECTS(od == 2000, *(s.get<
std::string>(
"online_delete")));
-
-
-
-
-
-
- 1066 using namespace std::string_literals;
- 1067 Section s{
"MySection"};
- 1068 s.append(
"a_string = mystring");
- 1069 s.append(
"positive_int = 2");
- 1070 s.append(
"negative_int = -3");
- 1071 s.append(
"bool_ish = 1");
-
-
- 1074 auto val_1 =
"value 1"s;
- 1075 BEAST_EXPECT(
set(val_1,
"a_string", s));
- 1076 BEAST_EXPECT(val_1 ==
"mystring");
-
- 1078 auto val_2 =
"value 2"s;
- 1079 BEAST_EXPECT(!
set(val_2,
"not_a_key", s));
- 1080 BEAST_EXPECT(val_2 ==
"value 2");
- 1081 BEAST_EXPECT(!
set(val_2,
"default"s,
"not_a_key", s));
- 1082 BEAST_EXPECT(val_2 ==
"default");
-
- 1084 auto val_3 = get<std::string>(s,
"a_string");
- 1085 BEAST_EXPECT(val_3 ==
"mystring");
- 1086 auto val_4 = get<std::string>(s,
"not_a_key");
- 1087 BEAST_EXPECT(val_4 ==
"");
- 1088 auto val_5 = get<std::string>(s,
"not_a_key",
"default");
- 1089 BEAST_EXPECT(val_5 ==
"default");
-
- 1091 auto val_6 =
"value 6"s;
-
- 1093 BEAST_EXPECT(val_6 ==
"mystring");
-
- 1095 auto val_7 =
"value 7"s;
-
- 1097 BEAST_EXPECT(val_7 ==
"value 7");
-
-
-
-
- 1102 BEAST_EXPECT(
set(val_1,
"positive_int", s));
- 1103 BEAST_EXPECT(val_1 == 2);
-
-
- 1106 BEAST_EXPECT(
set(val_2,
"negative_int", s));
- 1107 BEAST_EXPECT(val_2 == -3);
-
-
- 1110 BEAST_EXPECT(!
set(val_3,
"a_string", s));
- 1111 BEAST_EXPECT(val_3 == 3);
+
+
+
+
+ 682[validator_list_sites]
+
+ 684trustthesevalidators.gov
+
+
+ 687021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
+ 689[validator_list_threshold]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 709[validator_list_sites]
+
+ 711trustthesevalidators.gov
+
+
+ 714 auto const expectedError =
+ 715 "[validator_list_keys] config section is missing";
+
+
+
+
+
+
+
+
+
+ 725 BEAST_EXPECT(error == expectedError);
+
+
+
+
+ 730 *
this,
"test_cfg",
"validators.cfg");
+
+
+ 733 boost::format cc(
"[validators_file]\n%1%\n");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 751 *
this,
"test_cfg", valFileName);
+
+ 753 *
this, vtg.
subdir(),
"", valFileName,
false);
+
+
+ 756 auto const& c(rcg.
config());
+ 757 BEAST_EXPECT(c.legacy(
"validators_file") == valFileName);
+ 758 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
+ 760 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
+ 762 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
+ 764 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
+ 766 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
+
+
+
+
+ 772 *
this,
"test_cfg",
"validators.txt");
+ 773 auto const valFilePath =
".." / vtg.
subdir() /
"validators.txt";
+
+ 775 *
this, vtg.
subdir(),
"", valFilePath,
false);
+
+
+ 778 auto const& c(rcg.
config());
+ 779 BEAST_EXPECT(c.legacy(
"validators_file") == valFilePath);
+ 780 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
+ 782 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
+ 784 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
+ 786 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
+ 788 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
+
+
+
+ 793 *
this,
"test_cfg",
"validators.txt");
+
+ 795 *
this, vtg.
subdir(),
"",
"",
false);
+
+
+ 798 auto const& c(rcg.
config());
+ 799 BEAST_EXPECT(c.legacy(
"validators_file").empty());
+ 800 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
+ 802 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
+ 804 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
+ 806 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
+ 808 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
+
+
+
+
+ 814 *
this,
"test_cfg",
"validators.cfg");
+
+
+ 817 *
this, vtg.
subdir(),
"validators.txt",
false);
+
+
+
+
+ 822 auto const& c(rcg.
config());
+ 823 BEAST_EXPECT(c.legacy(
"validators_file") == vtg.
validatorsFile());
+ 824 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
+ 826 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
+ 828 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
+ 830 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
+ 832 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
+
+
+
+ 837 boost::format cc(R
"rippleConfig(
+
+
+
+
+ 842n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
+ 843n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
+ 844n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
+ 845n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS
+ 846n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA
+
+
+ 849nHB1X37qrniVugfQcuBTAjswphC1drx7QjFFojJPZwKHHnt8kU7v
+ 850nHUkAWDR4cB8AgPg7VXMX6et8xRTQb2KJfgv1aBEXozwrawRKgMB
+
+ 852[validator_list_sites]
+
+ 854trustthesevalidators.gov
+
+
+ 857021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
+
+ 860 *
this,
"test_cfg",
"validators.cfg");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 878 boost::format cc(R
"rippleConfig(
+
+
+
+ 882[validator_list_threshold]
+
+
+
+
+ 887 *
this,
"test_cfg",
"validators.cfg");
+
+ 889 auto const expectedError =
+ 890 "Config section [validator_list_threshold] should contain "
+
+
+
+
+
+
+
+
+
+
+
+ 902 BEAST_EXPECT(error == expectedError);
+
+
+
+
+
+
+ 909 boost::format cc(
"[validators_file]\n%1%\n");
+
+
+ 912 *
this,
"test_cfg",
"validators.cfg");
+
+ 914 auto const expectedError =
+ 915 "The file specified in [validators_file] does not contain a "
+ 916 "[validators], [validator_keys] or [validator_list_keys] "
+
+
+
+
+
+
+
+
+
+
+
+
+ 929 BEAST_EXPECT(error == expectedError);
+
+
+
+
+
+
+
+ 937 *
this,
"testSetup", explicitPath ?
"test_db" :
"",
"");
+
+
+
+
+
+
+
+
+
+
+
+ 949 BEAST_EXPECT(!config.
quiet());
+ 950 BEAST_EXPECT(!config.
silent());
+
+
+ 953 BEAST_EXPECT(!config.
legacy(
"database_path").empty());
+
+
+
+
+
+
+
+
+ 962 BEAST_EXPECT(config.
quiet());
+ 963 BEAST_EXPECT(!config.
silent());
+
+
+ 966 BEAST_EXPECT(!config.
legacy(
"database_path").empty());
+
+
+
+
+
+
+
+
+ 975 BEAST_EXPECT(config.
quiet());
+ 976 BEAST_EXPECT(config.
silent());
+
+
+ 979 BEAST_EXPECT(!config.
legacy(
"database_path").empty());
+
+
+
+
+
+
+
+
+ 988 BEAST_EXPECT(config.
quiet());
+ 989 BEAST_EXPECT(config.
silent());
+
+
+ 992 BEAST_EXPECT(!config.
legacy(
"database_path").empty());
+
+
+
+
+
+
+
+
+ 1001 BEAST_EXPECT(!config.
quiet());
+ 1002 BEAST_EXPECT(!config.
silent());
+
+
+
+ 1006 config.
legacy(
"database_path").empty() == !explicitPath);
+
+
+
+
+
+
+
+
+ 1015 BEAST_EXPECT(config.
quiet());
+ 1016 BEAST_EXPECT(!config.
silent());
+
+
+
+ 1020 config.
legacy(
"database_path").empty() == !explicitPath);
+
+
+
+
+
+
+
+
+ 1029 BEAST_EXPECT(config.
quiet());
+ 1030 BEAST_EXPECT(config.
silent());
+
+
+
+ 1034 config.
legacy(
"database_path").empty() == !explicitPath);
+
+
+
+
+
+
+
+
+ 1043 BEAST_EXPECT(config.
quiet());
+ 1044 BEAST_EXPECT(config.
silent());
+
+
+
+ 1048 config.
legacy(
"database_path").empty() == !explicitPath);
+
+
+
+
+
+
+
+ 1056 auto const& conf = cfg.
config();
+ 1057 if (!BEAST_EXPECT(conf.exists(
"port_rpc")))
+
+ 1059 if (!BEAST_EXPECT(conf.exists(
"port_wss_admin")))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1104 cfg.exists(SECTION_IPS) &&
+ 1105 cfg.section(SECTION_IPS).lines().size() == 1 &&
+ 1106 cfg.section(SECTION_IPS).values().size() == 1);
+
+ 1108 cfg.exists(SECTION_IPS_FIXED) &&
+ 1109 cfg.section(SECTION_IPS_FIXED).lines().size() == 2 &&
+ 1110 cfg.section(SECTION_IPS_FIXED).values().size() == 2);
+
- 1113 auto val_4 = get<int>(s,
"positive_int");
- 1114 BEAST_EXPECT(val_4 == 2);
- 1115 auto val_5 = get<int>(s,
"not_a_key");
- 1116 BEAST_EXPECT(val_5 == 0);
- 1117 auto val_6 = get<int>(s,
"not_a_key", 5);
- 1118 BEAST_EXPECT(val_6 == 5);
- 1119 auto val_7 = get<int>(s,
"a_string", 6);
- 1120 BEAST_EXPECT(val_7 == 6);
-
-
-
- 1124 BEAST_EXPECT(val_8 == 2);
-
-
-
- 1128 BEAST_EXPECT(val_9 == 9);
-
-
-
- 1132 BEAST_EXPECT(val_10 == 10);
-
- 1134 BEAST_EXPECT(s.get<
int>(
"not_a_key") == std::nullopt);
-
-
- 1137 s.get<
int>(
"a_string");
-
-
- 1140 catch (boost::bad_lexical_cast&)
-
-
-
-
-
-
- 1147 bool flag_1 =
false;
-
- 1149 BEAST_EXPECT(flag_1 ==
true);
-
- 1151 bool flag_2 =
false;
-
- 1153 BEAST_EXPECT(flag_2 ==
false);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1139 anotherserversansport
+ 1140 anotherserverwithport:12
+
+
+
+
+
+
+
+
+
+ 1150 2001:db8:3333:4444:5555:6666:7777:8888:12345
+ 1151 [2001:db8:3333:4444:5555:6666:7777:8888]:1
+
+
+
+
+
+
+
+
+ 1160 cfg.
exists(SECTION_IPS) &&
+
+
+
+ 1164 cfg.
exists(SECTION_IPS_FIXED) &&
+
+
+ 1167 BEAST_EXPECT(cfg.
IPS[0] ==
"r.ripple.com 51235");
-
- 1170 {
"seconds", 1, 15 * 60,
false},
- 1171 {
"minutes", 60, 14,
false},
- 1172 {
"minutes", 60, 15,
true},
- 1173 {
"hours", 3600, 10,
true},
- 1174 {
"days", 86400, 10,
true},
- 1175 {
"weeks", 604800, 2,
true},
- 1176 {
"months", 2592000, 1,
false},
- 1177 {
"years", 31536000, 1,
false}};
-
-
- 1180 for (
auto& [unit, sec, val, shouldPass] : units)
-
-
-
- 1184[amendment_majority_time]
-
-
-
-
-
-
- 1191 c.loadFromString(toLoad);
-
-
- 1194 c.AMENDMENT_MAJORITY_TIME.count() == val * sec);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1218 c.loadFromString(
"[overlay]\nmax_unknown_time=" + value);
- 1219 return c.MAX_UNKNOWN_TIME;
-
-
-
-
-
-
-
-
- 1228 BEAST_EXPECT(!testUnknown(
"none"));
- 1229 BEAST_EXPECT(!testUnknown(
"0.5"));
- 1230 BEAST_EXPECT(!testUnknown(
"180 seconds"));
- 1231 BEAST_EXPECT(!testUnknown(
"9 minutes"));
-
-
- 1234 BEAST_EXPECT(!testUnknown(
"299"));
-
-
-
-
-
-
-
-
- 1243 BEAST_EXPECT(!testUnknown(
"1801"));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 1169 BEAST_EXPECT(cfg.
IPS_FIXED[0] ==
"s1.ripple.com 51235");
+ 1170 BEAST_EXPECT(cfg.
IPS_FIXED[1] ==
"s2.ripple.com 51235");
+ 1171 BEAST_EXPECT(cfg.
IPS_FIXED[2] ==
"anotherserversansport");
+ 1172 BEAST_EXPECT(cfg.
IPS_FIXED[3] ==
"anotherserverwithport 12");
+ 1173 BEAST_EXPECT(cfg.
IPS_FIXED[4] ==
"1.1.1.1 1");
+ 1174 BEAST_EXPECT(cfg.
IPS_FIXED[5] ==
"1.1.1.1 1");
+ 1175 BEAST_EXPECT(cfg.
IPS_FIXED[6] ==
"12.34.12.123 12345");
+ 1176 BEAST_EXPECT(cfg.
IPS_FIXED[7] ==
"12.34.12.123 12345");
+
+
+
+ 1180 BEAST_EXPECT(cfg.
IPS_FIXED[9] ==
"2001:db8::");
+ 1181 BEAST_EXPECT(cfg.
IPS_FIXED[10] ==
"::1");
+ 1182 BEAST_EXPECT(cfg.
IPS_FIXED[11] ==
"::1:12345");
+ 1183 BEAST_EXPECT(cfg.
IPS_FIXED[12] ==
"[::1]:12345");
+
+
+ 1186 "2001:db8:3333:4444:5555:6666:7777:8888:12345");
+
+ 1188 cfg.
IPS_FIXED[14] ==
"[2001:db8:3333:4444:5555:6666:7777:8888]:1");
+
+
+
+
+
+ 1194 struct TestCommentData
+
+
+
+
+
+
+
+
+ 1203 {{
"password = aaaa\\#bbbb",
"password",
"aaaa#bbbb",
false},
+ 1204 {
"password = aaaa#bbbb",
"password",
"aaaa",
true},
+ 1205 {
"password = aaaa #bbbb",
"password",
"aaaa",
true},
+
+ 1207 {
"password = #aaaa #bbbb",
"",
"password =",
true},
+ 1208 {
"password = aaaa\\# #bbbb",
"password",
"aaaa#",
true},
+ 1209 {
"password = aaaa\\##bbbb",
"password",
"aaaa#",
true},
+ 1210 {
"aaaa#bbbb",
"",
"aaaa",
true},
+ 1211 {
"aaaa\\#bbbb",
"",
"aaaa#bbbb",
false},
+ 1212 {
"aaaa\\##bbbb",
"",
"aaaa#",
true},
+ 1213 {
"aaaa #bbbb",
"",
"aaaa",
true},
+ 1214 {
"1 #comment",
"",
"1",
true},
+ 1215 {
"#whole thing is comment",
"",
"",
false},
+ 1216 {
" #whole comment with space",
"",
"",
false}}};
+
+ 1218 for (
auto const& t : tests)
+
+
+ 1221 s.append(t.line.data());
+ 1222 BEAST_EXPECT(s.had_trailing_comments() == t.had_comment);
+ 1223 if (t.field.empty())
+
+ 1225 BEAST_EXPECTS(s.legacy() == t.expect, s.legacy());
+
+
+
+
+ 1230 BEAST_EXPECTS(
set(field, t.field.data(), s), t.line);
+ 1231 BEAST_EXPECTS(field == t.expect, t.line);
+
+
+
+
+
+ 1237 s.append(
"online_delete = 3000");
+
+ 1239 BEAST_EXPECT(
set(od,
"online_delete", s));
+ 1240 BEAST_EXPECTS(od == 3000, *(s.get<
std::string>(
"online_delete")));
+
+
+
+
+ 1245 s.append(
"online_delete = 2000 #my comment on this");
+
+ 1247 BEAST_EXPECT(
set(od,
"online_delete", s));
+ 1248 BEAST_EXPECTS(od == 2000, *(s.get<
std::string>(
"online_delete")));
+
+
+
+
+
+
+ 1255 using namespace std::string_literals;
+ 1256 Section s{
"MySection"};
+ 1257 s.append(
"a_string = mystring");
+ 1258 s.append(
"positive_int = 2");
+ 1259 s.append(
"negative_int = -3");
+ 1260 s.append(
"bool_ish = 1");
-
- 1263 BEAST_EXPECT(!testDiverged(
"none"));
- 1264 BEAST_EXPECT(!testDiverged(
"0.5"));
- 1265 BEAST_EXPECT(!testDiverged(
"180 seconds"));
- 1266 BEAST_EXPECT(!testDiverged(
"9 minutes"));
-
-
- 1269 BEAST_EXPECT(!testDiverged(
"0"));
- 1270 BEAST_EXPECT(!testDiverged(
"59"));
-
-
-
-
-
-
-
-
- 1279 BEAST_EXPECT(!testDiverged(
"901"));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 1263 auto val_1 =
"value 1"s;
+ 1264 BEAST_EXPECT(
set(val_1,
"a_string", s));
+ 1265 BEAST_EXPECT(val_1 ==
"mystring");
+
+ 1267 auto val_2 =
"value 2"s;
+ 1268 BEAST_EXPECT(!
set(val_2,
"not_a_key", s));
+ 1269 BEAST_EXPECT(val_2 ==
"value 2");
+ 1270 BEAST_EXPECT(!
set(val_2,
"default"s,
"not_a_key", s));
+ 1271 BEAST_EXPECT(val_2 ==
"default");
+
+ 1273 auto val_3 = get<std::string>(s,
"a_string");
+ 1274 BEAST_EXPECT(val_3 ==
"mystring");
+ 1275 auto val_4 = get<std::string>(s,
"not_a_key");
+ 1276 BEAST_EXPECT(val_4 ==
"");
+ 1277 auto val_5 = get<std::string>(s,
"not_a_key",
"default");
+ 1278 BEAST_EXPECT(val_5 ==
"default");
+
+ 1280 auto val_6 =
"value 6"s;
+
+ 1282 BEAST_EXPECT(val_6 ==
"mystring");
+
+ 1284 auto val_7 =
"value 7"s;
+
+ 1286 BEAST_EXPECT(val_7 ==
"value 7");
+
+
+
+
+ 1291 BEAST_EXPECT(
set(val_1,
"positive_int", s));
+ 1292 BEAST_EXPECT(val_1 == 2);
+
+
+ 1295 BEAST_EXPECT(
set(val_2,
"negative_int", s));
+ 1296 BEAST_EXPECT(val_2 == -3);
+
+
+ 1299 BEAST_EXPECT(!
set(val_3,
"a_string", s));
+ 1300 BEAST_EXPECT(val_3 == 3);
- 1302BEAST_DEFINE_TESTSUITE(Config, core,
ripple);
-
-
+ 1302 auto val_4 = get<int>(s,
"positive_int");
+ 1303 BEAST_EXPECT(val_4 == 2);
+ 1304 auto val_5 = get<int>(s,
"not_a_key");
+ 1305 BEAST_EXPECT(val_5 == 0);
+ 1306 auto val_6 = get<int>(s,
"not_a_key", 5);
+ 1307 BEAST_EXPECT(val_6 == 5);
+ 1308 auto val_7 = get<int>(s,
"a_string", 6);
+ 1309 BEAST_EXPECT(val_7 == 6);
+
+
+
+ 1313 BEAST_EXPECT(val_8 == 2);
+
+
+
+ 1317 BEAST_EXPECT(val_9 == 9);
+
+
+
+ 1321 BEAST_EXPECT(val_10 == 10);
+
+ 1323 BEAST_EXPECT(s.get<
int>(
"not_a_key") == std::nullopt);
+
+
+ 1326 s.get<
int>(
"a_string");
+
+
+ 1329 catch (boost::bad_lexical_cast&)
+
+
+
+
+
+
+ 1336 bool flag_1 =
false;
+
+ 1338 BEAST_EXPECT(flag_1 ==
true);
+
+ 1340 bool flag_2 =
false;
+
+ 1342 BEAST_EXPECT(flag_2 ==
false);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1359 {
"seconds", 1, 15 * 60,
false},
+ 1360 {
"minutes", 60, 14,
false},
+ 1361 {
"minutes", 60, 15,
true},
+ 1362 {
"hours", 3600, 10,
true},
+ 1363 {
"days", 86400, 10,
true},
+ 1364 {
"weeks", 604800, 2,
true},
+ 1365 {
"months", 2592000, 1,
false},
+ 1366 {
"years", 31536000, 1,
false}};
+
+
+ 1369 for (
auto& [unit, sec, val, shouldPass] : units)
+
+
+
+ 1373[amendment_majority_time]
+
+
+
+
+
+
+ 1380 c.loadFromString(toLoad);
+
+
+ 1383 c.AMENDMENT_MAJORITY_TIME.count() == val * sec);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1407 c.loadFromString(
"[overlay]\nmax_unknown_time=" + value);
+ 1408 return c.MAX_UNKNOWN_TIME;
+
+
+
+
+
+
+
+
+ 1417 BEAST_EXPECT(!testUnknown(
"none"));
+ 1418 BEAST_EXPECT(!testUnknown(
"0.5"));
+ 1419 BEAST_EXPECT(!testUnknown(
"180 seconds"));
+ 1420 BEAST_EXPECT(!testUnknown(
"9 minutes"));
+
+
+ 1423 BEAST_EXPECT(!testUnknown(
"299"));
+
+
+
+
+
+
+
+
+ 1432 BEAST_EXPECT(!testUnknown(
"1801"));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1452 BEAST_EXPECT(!testDiverged(
"none"));
+ 1453 BEAST_EXPECT(!testDiverged(
"0.5"));
+ 1454 BEAST_EXPECT(!testDiverged(
"180 seconds"));
+ 1455 BEAST_EXPECT(!testDiverged(
"9 minutes"));
+
+
+ 1458 BEAST_EXPECT(!testDiverged(
"0"));
+ 1459 BEAST_EXPECT(!testDiverged(
"59"));
+
+
+
+
+
+
+
+
+ 1468 BEAST_EXPECT(!testDiverged(
"901"));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1491BEAST_DEFINE_TESTSUITE(Config, core,
ripple);
+
+
+
@@ -1387,53 +1577,54 @@ $(function() {
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.
void legacy(std::string const §ion, std::string value)
Set a value that is not a key/value pair.
-
-
-void testSetup(bool explicitPath)
-
-void run() override
Runs the suite.
-
-
-
-
-boost::filesystem::path path
-void testValidatorsFile()
-
-
-
-
-
+
+
+void testSetup(bool explicitPath)
+
+void run() override
Runs the suite.
+
+
+
+
+boost::filesystem::path path
+void testValidatorsFile()
+
+
+
+
+
-
+
static char const *const databaseDirName
std::uint32_t LEDGER_HISTORY
std::vector< std::string > IPS_FIXED
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
std::vector< std::string > IPS
-
-
+
+std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
+
std::chrono::seconds MAX_DIVERGED_TIME
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
std::vector< std::string > const & lines() const
Returns all the lines in the section.
std::vector< std::string > const & values() const
Returns all the values in the section.
bool expectException(Functor f, std::string const &message="")
-Write a rippled config file and remove when done.
-bool dataDirExists() const
-
-bool configFileExists() const
-Config const & config() const
-
-RippledCfgGuard(beast::unit_test::suite &test, path subDir, path const &dbPath, path const &validatorsFile, bool useCounter=true)
-
-std::string configFile() const
-
-Write a validators.txt file and remove when done.
-
-std::string validatorsFile() const
-bool validatorsFileExists() const
-ValidatorsTxtGuard(beast::unit_test::suite &test, path subDir, path const &validatorsFileName, bool useCounter=true)
+Write a rippled config file and remove when done.
+bool dataDirExists() const
+
+bool configFileExists() const
+Config const & config() const
+
+RippledCfgGuard(beast::unit_test::suite &test, path subDir, path const &dbPath, path const &validatorsFile, bool useCounter=true)
+
+std::string configFile() const
+
+Write a validators.txt file and remove when done.
+
+std::string validatorsFile() const
+bool validatorsFileExists() const
+ValidatorsTxtGuard(beast::unit_test::suite &test, path subDir, path const &validatorsFileName, bool useCounter=true)
Create a directory and remove it when it's done.
path const & subdir() const
auto rmDir(path const &toRm)
@@ -1452,8 +1643,8 @@ $(function() {
field_t< CharT, Traits, Allocator > field(std::basic_string< CharT, Traits, Allocator > const &text, int width=8, int pad=0, bool right=false)
-std::string configContents(std::string const &dbPath, std::string const &validatorsFile)
-std::string valFileContents()
+std::string configContents(std::string const &dbPath, std::string const &validatorsFile)
+std::string valFileContents()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static std::optional< Seed > validationSeed(Json::Value const ¶ms)
bool set(T &target, std::string const &name, Section const §ion)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
@@ -1463,6 +1654,7 @@ $(function() {
+
std::vector< boost::asio::ip::network_v4 > admin_nets_v4
diff --git a/Connect_8cpp_source.html b/Connect_8cpp_source.html
index b4cee9c95d..08870ee2cc 100644
--- a/Connect_8cpp_source.html
+++ b/Connect_8cpp_source.html
@@ -156,7 +156,7 @@ $(function() {
static Endpoint from_string(std::string const &s)
virtual Config & config()=0
virtual Overlay & overlay()=0
-
+
virtual void connect(beast::IP::Endpoint const &address)=0
Establish a peer connection to the specified endpoint.
@ intValue
signed integer value
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
diff --git a/DatabaseCon_8cpp_source.html b/DatabaseCon_8cpp_source.html
index a1366990cf..359ed09775 100644
--- a/DatabaseCon_8cpp_source.html
+++ b/DatabaseCon_8cpp_source.html
@@ -375,7 +375,7 @@ $(function() {
std::uint32_t LEDGER_HISTORY
-
+
void setupCheckpointing(JobQueue *, Logs &)
diff --git a/Env_8cpp_source.html b/Env_8cpp_source.html
index 7efb414e1d..9e6e848b9d 100644
--- a/Env_8cpp_source.html
+++ b/Env_8cpp_source.html
@@ -796,7 +796,7 @@ $(function() {
-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)
std::string strHex(FwdIt begin, FwdIt end)
std::string transToken(TER code)
constexpr std::uint32_t asfDefaultRipple
diff --git a/FeeVote__test_8cpp_source.html b/FeeVote__test_8cpp_source.html
index 86a6ea1888..d914e8ddd2 100644
--- a/FeeVote__test_8cpp_source.html
+++ b/FeeVote__test_8cpp_source.html
@@ -191,7 +191,7 @@ $(function() {
void run() override
Runs the suite.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-FeeSetup setup_FeeVote(Section const §ion)
+FeeSetup setup_FeeVote(Section const §ion)
Fee schedule for startup / standalone, and to vote for.
XRPAmount reference_fee
The cost of a reference transaction in drops.
diff --git a/GetCounts_8cpp_source.html b/GetCounts_8cpp_source.html
index 218957903a..c1f0ac5575 100644
--- a/GetCounts_8cpp_source.html
+++ b/GetCounts_8cpp_source.html
@@ -239,7 +239,7 @@ $(function() {
virtual Family & getNodeFamily()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual RelationalDatabase & getRelationalDatabase()=0
-
+
static CountedObjects & getInstance() noexcept
List getCounts(int minimumThreshold) const
virtual std::shared_ptr< FullBelowCache > getFullBelowCache()=0
Return a pointer to the Family Full Below Cache.
diff --git a/LedgerAccept_8cpp_source.html b/LedgerAccept_8cpp_source.html
index 910af08e78..ee7b8cef6a 100644
--- a/LedgerAccept_8cpp_source.html
+++ b/LedgerAccept_8cpp_source.html
@@ -133,7 +133,7 @@ $(function() {
virtual Config & config()=0
virtual MutexType & getMasterMutex()=0
-
+
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/LedgerMaster_8cpp_source.html b/LedgerMaster_8cpp_source.html
index c6ea53c667..4c077263fa 100644
--- a/LedgerMaster_8cpp_source.html
+++ b/LedgerMaster_8cpp_source.html
@@ -2538,9 +2538,9 @@ $(function() {
std::vector< WrappedValidationType > getTrustedForLedger(ID const &ledgerID, Seq const &seq)
Get trusted full validations for a specific ledger.
std::vector< WrappedValidationType > currentTrusted()
Get the currently trusted full validations.
std::vector< std::uint32_t > fees(ID const &ledgerID, std::uint32_t baseFee)
Returns fees reported by trusted full validators in the given ledger.
-std::vector< std::shared_ptr< STValidation > > negativeUNLFilter(std::vector< std::shared_ptr< STValidation > > &&validations) const
Remove validations that are from validators on the negative UNL.
-std::size_t quorum() const
Get quorum value for current trusted key set.
-QuorumKeys getQuorumKeys() const
Get the quorum and all of the trusted keys.
+std::vector< std::shared_ptr< STValidation > > negativeUNLFilter(std::vector< std::shared_ptr< STValidation > > &&validations) const
Remove validations that are from validators on the negative UNL.
+std::size_t quorum() const
Get quorum value for current trusted key set.
+QuorumKeys getQuorumKeys() const
Get the quorum and all of the trusted keys.
Automatically unlocks and re-locks a unique_lock object.
diff --git a/Main_8cpp_source.html b/Main_8cpp_source.html
index 3355b808b9..7c0d1248de 100644
--- a/Main_8cpp_source.html
+++ b/Main_8cpp_source.html
@@ -997,7 +997,7 @@ $(function() {
static std::string const & systemName()
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
void printHelp(const po::options_description &desc)
-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)
int run(int argc, char **argv)
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html
index d68375dabc..55f1fa85a2 100644
--- a/NetworkOPs_8cpp_source.html
+++ b/NetworkOPs_8cpp_source.html
@@ -4902,10 +4902,10 @@ $(function() {
Metrics getMetrics(OpenView const &view) const
Returns fee metrics in reference fee level units.
Validator keys and manifest as set in configuration file.
-std::size_t count() const
Return the number of configured validator list sites.
-std::optional< PublicKey > localPublicKey() const
This function returns the local validator public key or a std::nullopt.
-std::optional< TimeKeeper::time_point > expires() const
Return the time when the validator list will expire.
-std::size_t quorum() const
Get quorum value for current trusted key set.
+std::size_t count() const
Return the number of configured validator list sites.
+std::optional< PublicKey > localPublicKey() const
This function returns the local validator public key or a std::nullopt.
+std::optional< TimeKeeper::time_point > expires() const
Return the time when the validator list will expire.
+std::size_t quorum() const
Get quorum value for current trusted key set.
constexpr double decimalXRP() const
Json::Value jsonClipped() const
@@ -5015,7 +5015,7 @@ $(function() {
Rules makeRulesGivenLedger(DigestAwareReadView const &ledger, Rules const ¤t)
std::string to_string_iso(date::sys_time< Duration > tp)
std::string to_string(base_uint< Bits, Tag > const &a)
-FeeSetup setup_FeeVote(Section const §ion)
+FeeSetup setup_FeeVote(Section const §ion)
Number root(Number f, unsigned d)
std::optional< std::uint64_t > mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div)
Return value*mul/div accurately.
diff --git a/Node_8cpp_source.html b/Node_8cpp_source.html
index f752c019e2..59a5117910 100644
--- a/Node_8cpp_source.html
+++ b/Node_8cpp_source.html
@@ -1364,8 +1364,8 @@ $(function() {
-
-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.
+
+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.
LockedSociSession checkoutDb()
diff --git a/OrderBookDB_8cpp_source.html b/OrderBookDB_8cpp_source.html
index 6e53d485fb..2f542ea273 100644
--- a/OrderBookDB_8cpp_source.html
+++ b/OrderBookDB_8cpp_source.html
@@ -394,7 +394,7 @@ $(function() {
-
+
A currency issued by an account.
diff --git a/OverlayImpl_8cpp_source.html b/OverlayImpl_8cpp_source.html
index 09cc4a5557..3f3528d449 100644
--- a/OverlayImpl_8cpp_source.html
+++ b/OverlayImpl_8cpp_source.html
@@ -1674,7 +1674,7 @@ $(function() {
std::optional< std::string > member(PublicKey const &node) const
Determines whether a node belongs in the cluster.
std::vector< std::string > IPS_FIXED
std::vector< std::string > IPS
-
+
std::size_t TX_REDUCE_RELAY_MIN_PEERS
bool TX_REDUCE_RELAY_ENABLE
bool TX_REDUCE_RELAY_METRICS
@@ -1782,9 +1782,9 @@ $(function() {
auto const & getCounts() const
An up-to-date copy of all the counters.
void addCount(category cat, bool inbound, int bytes)
Account for traffic associated with the given category.
-bool listed(PublicKey const &identity) const
Returns true if public key is included on any lists.
-std::optional< Json::Value > getAvailable(std::string_view pubKey, std::optional< std::uint32_t > forceVersion={})
Returns the current valid list for the given publisher key, if available, as a Json object.
-Json::Value getJson() const
Return a JSON representation of the state of the validator list.
+bool listed(PublicKey const &identity) const
Returns true if public key is included on any lists.
+std::optional< Json::Value > getAvailable(std::string_view pubKey, std::optional< std::uint32_t > forceVersion={})
Returns the current valid list for the given publisher key, if available, as a Json object.
+Json::Value getJson() const
Return a JSON representation of the state of the validator list.
Json::Value getJson() const
Return JSON representation of configured validator sites.
diff --git a/PeerImp_8cpp_source.html b/PeerImp_8cpp_source.html
index 6c63d63433..2e414268b2 100644
--- a/PeerImp_8cpp_source.html
+++ b/PeerImp_8cpp_source.html
@@ -3665,8 +3665,8 @@ $(function() {
-static void sendValidatorList(Peer &peer, std::uint64_t peerSequence, PublicKey const &publisherKey, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, HashRouter &hashRouter, beast::Journal j)
-void for_each_available(std::function< void(std::string const &manifest, std::uint32_t version, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, PublicKey const &pubKey, std::size_t maxSequence, uint256 const &hash)> func) const
Invokes the callback once for every available publisher list's raw data members.
+static void sendValidatorList(Peer &peer, std::uint64_t peerSequence, PublicKey const &publisherKey, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, HashRouter &hashRouter, beast::Journal j)
+void for_each_available(std::function< void(std::string const &manifest, std::uint32_t version, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, PublicKey const &pubKey, std::size_t maxSequence, uint256 const &hash)> func) const
Invokes the callback once for every available publisher list's raw data members.
diff --git a/PeerfinderConfig_8cpp_source.html b/PeerfinderConfig_8cpp_source.html
index bf894ef572..9f3c27b2aa 100644
--- a/PeerfinderConfig_8cpp_source.html
+++ b/PeerfinderConfig_8cpp_source.html
@@ -220,7 +220,7 @@ $(function() {
-
+
std::size_t PEERS_OUT_MAX
diff --git a/RCLValidations_8cpp_source.html b/RCLValidations_8cpp_source.html
index d8d0a9cf0c..01676961c0 100644
--- a/RCLValidations_8cpp_source.html
+++ b/RCLValidations_8cpp_source.html
@@ -362,8 +362,8 @@ $(function() {
time_point closeTime() const
Returns the predicted close time, in network time.
ValStatus add(NodeID const &nodeID, Validation const &val)
Add a new validation.
-std::optional< PublicKey > getTrustedKey(PublicKey const &identity) const
Returns master public key if public key is trusted.
-std::optional< PublicKey > getListedKey(PublicKey const &identity) const
Returns listed master public if public key is included on any lists.
+std::optional< PublicKey > getTrustedKey(PublicKey const &identity) const
Returns master public key if public key is trusted.
+std::optional< PublicKey > getListedKey(PublicKey const &identity) const
Returns listed master public if public key is included on any lists.
diff --git a/RPCCall_8cpp_source.html b/RPCCall_8cpp_source.html
index 655566ea6d..371584c8b4 100644
--- a/RPCCall_8cpp_source.html
+++ b/RPCCall_8cpp_source.html
@@ -1770,7 +1770,7 @@ $(function() {
std::optional< beast::IP::Endpoint > rpc_ip
-
+
static void request(bool bSSL, boost::asio::io_service &io_service, std::string strSite, const unsigned short port, std::function< void(boost::asio::streambuf &sb, std::string const &strHost)> build, std::size_t responseMax, std::chrono::seconds timeout, std::function< bool(const boost::system::error_code &ecResult, int iStatus, std::string const &strData)> complete, beast::Journal &j)
Manages partitions for logging.
beast::Journal journal(std::string const &name)
diff --git a/RPCHelpers_8cpp_source.html b/RPCHelpers_8cpp_source.html
index f97fe61b68..834bb2fa10 100644
--- a/RPCHelpers_8cpp_source.html
+++ b/RPCHelpers_8cpp_source.html
@@ -1232,7 +1232,7 @@ $(function() {
virtual beast::Journal journal(std::string const &name)=0
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
-
+
virtual std::shared_ptr< Ledger const > acquire(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason)=0
virtual std::shared_ptr< InboundLedger > find(LedgerHash const &hash)=0
diff --git a/RipplePathFind_8cpp_source.html b/RipplePathFind_8cpp_source.html
index 2553b83caa..1bf96dd77a 100644
--- a/RipplePathFind_8cpp_source.html
+++ b/RipplePathFind_8cpp_source.html
@@ -258,7 +258,7 @@ $(function() {
virtual Config & config()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual PathRequests & getPathRequests()=0
-
+
std::shared_ptr< Ledger const > getClosedLedger()
std::chrono::seconds getValidatedLedgerAge()
diff --git a/SHAMapStoreImp_8cpp_source.html b/SHAMapStoreImp_8cpp_source.html
index 64c571d528..be2c2082f2 100644
--- a/SHAMapStoreImp_8cpp_source.html
+++ b/SHAMapStoreImp_8cpp_source.html
@@ -786,8 +786,8 @@ $(function() {
Section & section(std::string const &name)
Returns the section with the given name.
void legacy(std::string const §ion, std::string value)
Set a value that is not a key/value pair.
-
-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.
+
+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.
virtual std::shared_ptr< FullBelowCache > getFullBelowCache()=0
Return a pointer to the Family Full Below Cache.
virtual std::shared_ptr< TreeNodeCache > getTreeNodeCache()=0
Return a pointer to the Family Tree Node Cache.
void clearLedgerCachePrior(LedgerIndex seq)
diff --git a/ServerHandler_8cpp_source.html b/ServerHandler_8cpp_source.html
index 6a59cd360d..addd38b737 100644
--- a/ServerHandler_8cpp_source.html
+++ b/ServerHandler_8cpp_source.html
@@ -1385,7 +1385,7 @@ $(function() {
Provides the beast::insight::Collector service.
virtual beast::insight::Group::ptr const & group(std::string const &name)=0
-
+
A pool of threads to perform work.
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.
diff --git a/SignFor_8cpp_source.html b/SignFor_8cpp_source.html
index f92eb7665d..0b540e9af5 100644
--- a/SignFor_8cpp_source.html
+++ b/SignFor_8cpp_source.html
@@ -141,7 +141,7 @@ $(function() {
virtual Config & config()=0
-
+
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
diff --git a/SignHandler_8cpp_source.html b/SignHandler_8cpp_source.html
index e66a2fdf4e..5c547f7783 100644
--- a/SignHandler_8cpp_source.html
+++ b/SignHandler_8cpp_source.html
@@ -142,7 +142,7 @@ $(function() {
bool isMember(const char *key) const
Return true if the object has a member named key.
virtual Config & config()=0
-
+
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
diff --git a/Submit_8cpp_source.html b/Submit_8cpp_source.html
index 484df01d1a..23a7c54b85 100644
--- a/Submit_8cpp_source.html
+++ b/Submit_8cpp_source.html
@@ -281,7 +281,7 @@ $(function() {
virtual Config & config()=0
virtual bool checkSigs() const =0
virtual HashRouter & getHashRouter()=0
-
+
std::shared_ptr< ReadView const > getCurrentLedger()
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
diff --git a/Subscribe_8cpp_source.html b/Subscribe_8cpp_source.html
index 592674a800..7f7d3aa76c 100644
--- a/Subscribe_8cpp_source.html
+++ b/Subscribe_8cpp_source.html
@@ -471,7 +471,7 @@ $(function() {
-
+
virtual error_code_i subAccountHistory(ref ispListener, AccountID const &account)=0
subscribe an account's new transactions and retrieve the account's historical transactions
virtual bool subValidations(ref ispListener)=0
virtual bool subBook(ref ispListener, Book const &)=0
diff --git a/TransactionSign_8cpp_source.html b/TransactionSign_8cpp_source.html
index 544ef41a8e..0772cced3a 100644
--- a/TransactionSign_8cpp_source.html
+++ b/TransactionSign_8cpp_source.html
@@ -1372,7 +1372,7 @@ $(function() {
std::size_t size() const noexcept
Returns the number of bytes in the buffer.
-
+
diff --git a/TxHistory_8cpp_source.html b/TxHistory_8cpp_source.html
index f74194e3a1..c806549fd5 100644
--- a/TxHistory_8cpp_source.html
+++ b/TxHistory_8cpp_source.html
@@ -156,7 +156,7 @@ $(function() {
bool isMember(const char *key) const
Return true if the object has a member named key.
virtual Config & config()=0
virtual RelationalDatabase & getRelationalDatabase()=0
-
+
virtual std::vector< std::shared_ptr< Transaction > > getTxHistory(LedgerIndex startIndex)=0
getTxHistory Returns the 20 most recent transactions starting from the given number.
void insertDeliverMax(Json::Value &tx_json, TxType txnType, unsigned int apiVersion)
Copy Amount field to DeliverMax field in transaction output JSON.
Charge const feeMediumBurdenRPC
diff --git a/TxQ_8cpp_source.html b/TxQ_8cpp_source.html
index f311ca1f11..e41c723ef9 100644
--- a/TxQ_8cpp_source.html
+++ b/TxQ_8cpp_source.html
@@ -2069,7 +2069,7 @@ $(function() {
Editable, discardable view that can build metadata for one tx.
Section & section(std::string const &name)
Returns the section with the given name.
-
+
RAII class to set and restore the Number switchover.
std::shared_ptr< OpenView const > current() const
Returns a view to the current open ledger.
Writable ledger view that accumulates state and tx changes.
diff --git a/Tx_8cpp_source.html b/Tx_8cpp_source.html
index fa38e98233..279a400804 100644
--- a/Tx_8cpp_source.html
+++ b/Tx_8cpp_source.html
@@ -433,7 +433,7 @@ $(function() {
virtual LedgerMaster & getLedgerMaster()=0
virtual TransactionMaster & getMasterTransaction()=0
-
+
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
std::optional< uint256 > txnIdFromIndex(uint32_t ledgerSeq, uint32_t txnIndex)
diff --git a/UnlList_8cpp_source.html b/UnlList_8cpp_source.html
index a0aa64ff8a..e64e61786b 100644
--- a/UnlList_8cpp_source.html
+++ b/UnlList_8cpp_source.html
@@ -128,7 +128,7 @@ $(function() {
Value & append(const Value &value)
Append value to array at the end.
virtual ValidatorList & validators()=0
-void for_each_listed(std::function< void(PublicKey const &, bool)> func) const
Invokes the callback once for every listed validation public key.
+void for_each_listed(std::function< void(PublicKey const &, bool)> func) const
Invokes the callback once for every listed validation public key.
@ objectValue
object value (collection of name/value pairs).
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
diff --git a/ValidatorList_8cpp_source.html b/ValidatorList_8cpp_source.html
index 5888aa5ab4..03b80d027c 100644
--- a/ValidatorList_8cpp_source.html
+++ b/ValidatorList_8cpp_source.html
@@ -207,1959 +207,2038 @@ $(function() {
130 ,
quorum_(minimumQuorum.value_or(1))
-
-
-
-
-
-
-
-
-
- 141 static boost::regex
const re(
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 143 static boost::regex
const re(
+
+
+
+
+
+
+
+
+
+
-
- 156 <<
"Loading configured trusted validator list publisher keys";
-
-
- 159 for (
auto key : publisherKeys)
-
- 161 JLOG(
j_.
trace()) <<
"Processing '" << key <<
"'";
-
-
+
+
+
+ 158 <<
"Loading configured trusted validator list publisher keys";
+
+
+ 161 for (
auto key : publisherKeys)
+
+ 163 JLOG(
j_.
trace()) <<
"Processing '" << key <<
"'";
-
-
- 167 JLOG(
j_.
error()) <<
"Invalid validator list publisher key: " << key;
-
-
-
-
-
-
-
-
-
- 177 <<
"Configured validator list publisher key is revoked: "
-
-
-
-
-
-
-
- 185 <<
"Duplicate validator list publisher key: " << key;
-
-
-
-
-
-
-
-
+
+
+
+
+ 169 JLOG(
j_.
error()) <<
"Invalid validator list publisher key: " << key;
+
+
+
+
+
+
+
+
+
+ 179 <<
"Configured validator list publisher key is revoked: "
+
+
+
+
+
+
+
+ 187 <<
"Duplicate validator list publisher key: " << key;
+
+
+
+
+
+
-
-
-
-
-
-
-
- 202 JLOG(
j_.
debug()) <<
"Loading configured validator keys";
-
-
- 205 for (
auto const& n : configKeys)
+
+
+
+
+
+
+ 201 "ripple::ValidatorList::load : list threshold inside range");
+ 202 JLOG(
j_.
debug()) <<
"Validator list threshold set in configuration to "
+
+
+
- 207 JLOG(
j_.
trace()) <<
"Processing '" << n <<
"'";
-
-
-
- 211 if (!boost::regex_match(n,
match, re))
-
- 213 JLOG(
j_.
error()) <<
"Malformed entry: '" << n <<
"'";
-
-
+
+
+
+
+ 211 JLOG(
j_.
debug()) <<
"Validator list threshold computed as "
+
+
+
+
-
-
+
+
-
-
- 222 JLOG(
j_.
error()) <<
"Invalid node identity: " <<
match[1];
-
-
-
-
-
-
-
-
-
-
- 233 JLOG(
j_.
warn()) <<
"Duplicate node identity: " <<
match[1];
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 251boost::filesystem::path
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 281 "ripple::ValidatorList::buildFileData : valid publisher list input");
- 282 auto const effectiveVersion =
- 283 forceVersion ? *forceVersion : pubCollection.
rawVersion;
-
-
- 286 value[jss::version] = effectiveVersion;
- 287 value[jss::public_key] = pubKey;
-
- 289 switch (effectiveVersion)
-
-
-
- 293 value[jss::blob] =
current.rawBlob;
- 294 value[jss::signature] =
current.rawSignature;
-
-
-
-
- 299 value[jss::manifest] = *
current.rawManifest;
-
-
-
-
-
- 305 auto add = [&blobs, &outerManifest = pubCollection.
rawManifest](
-
-
- 308 blob[jss::blob] = pubList.rawBlob;
- 309 blob[jss::signature] = pubList.rawSignature;
- 310 if (pubList.rawManifest &&
- 311 *pubList.rawManifest != outerManifest)
- 312 blob[jss::manifest] = *pubList.rawManifest;
-
-
-
-
-
-
-
-
-
- 322 value[jss::blobs_v2] = std::move(blobs);
-
-
-
-
- 327 <<
"Invalid VL version provided: " << effectiveVersion;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 344 boost::system::error_code ec;
-
-
-
-
-
-
-
- 352 value[jss::refresh_interval] = 24 * 60;
+
+
+
+
+
+ 225 auto const [_, inserted] =
+
+
+
+ 229 JLOG(
j_.
debug()) <<
"Added own master key "
+
+
+
+
+ 234 JLOG(
j_.
debug()) <<
"Loading configured validator keys";
+
+
+ 237 for (
auto const& n : configKeys)
+
+ 239 JLOG(
j_.
trace()) <<
"Processing '" << n <<
"'";
+
+
+
+ 243 if (!boost::regex_match(n,
match, re))
+
+ 245 JLOG(
j_.
error()) <<
"Malformed entry: '" << n <<
"'";
+
+
+
+
+
+
+
+
+ 254 JLOG(
j_.
error()) <<
"Invalid node identity: " <<
match[1];
+
+
+
+
+
+
+
+
+
+
+ 265 JLOG(
j_.
warn()) <<
"Duplicate node identity: " <<
match[1];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 283boost::filesystem::path
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 313 "ripple::ValidatorList::buildFileData : valid publisher list input");
+ 314 auto const effectiveVersion =
+ 315 forceVersion ? *forceVersion : pubCollection.
rawVersion;
+
+
+ 318 value[jss::version] = effectiveVersion;
+ 319 value[jss::public_key] = pubKey;
+
+ 321 switch (effectiveVersion)
+
+
+
+ 325 value[jss::blob] =
current.rawBlob;
+ 326 value[jss::signature] =
current.rawSignature;
+
+
+
+
+ 331 value[jss::manifest] = *
current.rawManifest;
+
+
+
+
+
+ 337 auto add = [&blobs, &outerManifest = pubCollection.
rawManifest](
+
+
+ 340 blob[jss::blob] = pubList.rawBlob;
+ 341 blob[jss::signature] = pubList.rawSignature;
+ 342 if (pubList.rawManifest &&
+ 343 *pubList.rawManifest != outerManifest)
+ 344 blob[jss::manifest] = *pubList.rawManifest;
+
+
+
+
+
+
+
+
-
-
-
-
-
- 359 JLOG(
j_.
error()) <<
"Problem writing " << filename <<
" " << ec.value()
- 360 <<
": " << ec.message();
+ 354 value[jss::blobs_v2] = std::move(blobs);
+
+
+
+
+ 359 <<
"Invalid VL version provided: " << effectiveVersion;
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 383 "ripple::ValidatorList::parseBlobs : single element result");
-
-
-
-
-
-
-
-
- 392 if (!body.
isMember(jss::blobs_v2) ||
- 393 !body[jss::blobs_v2].
isArray() ||
-
-
-
-
- 398 auto const& blobs = body[jss::blobs_v2];
-
- 400 for (
auto const& blobInfo : blobs)
-
- 402 if (!blobInfo.isObject() ||
- 403 !blobInfo.isMember(jss::signature) ||
- 404 !blobInfo[jss::signature].isString() ||
- 405 !blobInfo.isMember(jss::blob) ||
- 406 !blobInfo[jss::blob].isString())
-
-
- 409 info.
blob = blobInfo[jss::blob].asString();
- 410 info.
signature = blobInfo[jss::signature].asString();
- 411 if (blobInfo.isMember(jss::manifest))
-
- 413 if (!blobInfo[jss::manifest].isString())
-
- 415 info.
manifest = blobInfo[jss::manifest].asString();
-
-
-
- 419 result.
size() == blobs.size(),
- 420 "ripple::ValidatorList::parseBlobs(version, Jason::Value) : "
- 421 "result size matches");
-
-
-
-
-
-
-
-
-
- 431 return {{body.blob(), body.signature(), {}}};
-
-
-
-
-
-
-
-
-
- 441 result.
reserve(body.blobs_size());
- 442 for (
auto const& blob : body.blobs())
-
-
- 445 info.
blob = blob.blob();
-
- 447 if (blob.has_manifest())
-
-
-
-
-
- 453 result.
size() == body.blobs_size(),
- 454 "ripple::ValidatorList::parseBlobs(TMValidatorList) : result size "
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 376 boost::system::error_code ec;
+
+
+
+
+
+
+
+ 384 value[jss::refresh_interval] = 24 * 60;
+
+
+
+
+
+
+ 391 JLOG(
j_.
error()) <<
"Problem writing " << filename <<
" " << ec.value()
+ 392 <<
": " << ec.message();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 415 "ripple::ValidatorList::parseBlobs : single element result");
+
+
+
+
+
+
+
+
+ 424 if (!body.
isMember(jss::blobs_v2) ||
+ 425 !body[jss::blobs_v2].
isArray() ||
+
+
+
+
+ 430 auto const& blobs = body[jss::blobs_v2];
+
+ 432 for (
auto const& blobInfo : blobs)
+
+ 434 if (!blobInfo.isObject() ||
+ 435 !blobInfo.isMember(jss::signature) ||
+ 436 !blobInfo[jss::signature].isString() ||
+ 437 !blobInfo.isMember(jss::blob) ||
+ 438 !blobInfo[jss::blob].isString())
+
+
+ 441 info.
blob = blobInfo[jss::blob].asString();
+ 442 info.
signature = blobInfo[jss::signature].asString();
+ 443 if (blobInfo.isMember(jss::manifest))
+
+ 445 if (!blobInfo[jss::manifest].isString())
+
+ 447 info.
manifest = blobInfo[jss::manifest].asString();
+
+
+
+ 451 result.
size() == blobs.size(),
+ 452 "ripple::ValidatorList::parseBlobs(version, Jason::Value) : "
+ 453 "result size matches");
+
+
+
-
-
-
- 462 protocol::TMValidatorListCollection
const& largeMsg,
-
-
-
-
-
-
-
- 470 protocol::TMValidatorListCollection
const& largeMsg,
-
-
-
-
- 475 if (begin == 0 && end == 0)
- 476 end = largeMsg.blobs_size();
- 477 XRPL_ASSERT(begin < end,
"ripple::splitMessage : valid inputs");
-
-
-
- 481 auto mid = (begin + end) / 2;
-
-
-
-
-
-
-
-
-
- 491 protocol::TMValidatorListCollection
const& largeMsg,
-
-
-
-
-
-
- 498 if (end - begin == 1)
-
- 500 protocol::TMValidatorList smallMsg;
- 501 smallMsg.set_version(1);
- 502 smallMsg.set_manifest(largeMsg.manifest());
-
- 504 auto const& blob = largeMsg.blobs(begin);
- 505 smallMsg.set_blob(blob.blob());
- 506 smallMsg.set_signature(blob.signature());
-
- 508 if (blob.has_manifest())
- 509 smallMsg.set_manifest(blob.manifest());
-
-
-
- 513 "ripple::splitMessageParts : maximum message size");
-
-
- 516 std::make_shared<Message>(smallMsg, protocol::mtVALIDATORLIST),
-
-
- 519 return messages.
back().numVLs;
-
-
-
-
-
- 525 smallMsg->set_version(largeMsg.version());
- 526 smallMsg->set_manifest(largeMsg.manifest());
-
-
-
- 530 *smallMsg->add_blobs() = largeMsg.blobs(i);
-
-
-
-
-
-
- 537 return splitMessage(messages, largeMsg, maxSize, begin, end);
-
-
-
-
- 542 std::make_shared<Message>(
- 543 *smallMsg, protocol::mtVALIDATORLISTCOLLECTION),
-
- 545 smallMsg->blobs_size());
- 546 return messages.
back().numVLs;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 563 "ripple::buildValidatorListMessage(ValidatorBlobInfo) : empty messages "
-
- 565 protocol::TMValidatorList msg;
-
-
- 568 auto const version = 1;
-
- 570 msg.set_blob(currentBlob.
blob);
- 571 msg.set_signature(currentBlob.
signature);
-
- 573 msg.set_version(version);
-
-
-
- 577 "ripple::buildValidatorListMessage(ValidatorBlobInfo) : maximum "
-
-
- 580 std::make_shared<Message>(msg, protocol::mtVALIDATORLIST),
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 599 "ripple::buildValidatorListMessage(std::map<std::size_t, "
- 600 "ValidatorBlobInfo>) : empty messages input");
- 601 protocol::TMValidatorListCollection msg;
- 602 auto const version = rawVersion < 2 ? 2 : rawVersion;
- 603 msg.set_version(version);
- 604 msg.set_manifest(rawManifest);
-
- 606 for (
auto const& [sequence, blobInfo] : blobInfos)
-
- 608 if (sequence <= peerSequence)
-
- 610 protocol::ValidatorBlobInfo& blob = *msg.add_blobs();
- 611 blob.set_blob(blobInfo.blob);
- 612 blob.set_signature(blobInfo.signature);
- 613 if (blobInfo.manifest)
- 614 blob.set_manifest(*blobInfo.manifest);
-
-
- 617 msg.blobs_size() > 0,
- 618 "ripple::buildValidatorListMessage(std::map<std::size_t, "
- 619 "ValidatorBlobInfo>) : minimum message blobs");
-
-
-
-
-
-
-
-
- 628 std::make_shared<Message>(msg, protocol::mtVALIDATORLISTCOLLECTION),
-
-
- 631 return messages.
back().numVLs;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ 463 return {{body.blob(), body.signature(), {}}};
+
+
+
+
+
+
+
+
+
+ 473 result.
reserve(body.blobs_size());
+ 474 for (
auto const& blob : body.blobs())
+
+
+ 477 info.
blob = blob.blob();
+
+ 479 if (blob.has_manifest())
+
+
+
+
+
+ 485 result.
size() == body.blobs_size(),
+ 486 "ripple::ValidatorList::parseBlobs(TMValidatorList) : result size "
+
+
+
+
+
+
+
+ 494 protocol::TMValidatorListCollection
const& largeMsg,
+
+
+
+
+
+
+
+ 502 protocol::TMValidatorListCollection
const& largeMsg,
+
+
+
+
+ 507 if (begin == 0 && end == 0)
+ 508 end = largeMsg.blobs_size();
+ 509 XRPL_ASSERT(begin < end,
"ripple::splitMessage : valid inputs");
+
+
+
+ 513 auto mid = (begin + end) / 2;
+
+
+
+
+
+
+
+
+
+ 523 protocol::TMValidatorListCollection
const& largeMsg,
+
+
+
+
+
+
+ 530 if (end - begin == 1)
+
+ 532 protocol::TMValidatorList smallMsg;
+ 533 smallMsg.set_version(1);
+ 534 smallMsg.set_manifest(largeMsg.manifest());
+
+ 536 auto const& blob = largeMsg.blobs(begin);
+ 537 smallMsg.set_blob(blob.blob());
+ 538 smallMsg.set_signature(blob.signature());
+
+ 540 if (blob.has_manifest())
+ 541 smallMsg.set_manifest(blob.manifest());
+
+
+
+ 545 "ripple::splitMessageParts : maximum message size");
+
+
+ 548 std::make_shared<Message>(smallMsg, protocol::mtVALIDATORLIST),
+
+
+ 551 return messages.
back().numVLs;
+
+
+
+
+
+ 557 smallMsg->set_version(largeMsg.version());
+ 558 smallMsg->set_manifest(largeMsg.manifest());
+
+
+
+ 562 *smallMsg->add_blobs() = largeMsg.blobs(i);
+
+
+
+
+
+
+ 569 return splitMessage(messages, largeMsg, maxSize, begin, end);
+
+
+
+
+ 574 std::make_shared<Message>(
+ 575 *smallMsg, protocol::mtVALIDATORLISTCOLLECTION),
+
+ 577 smallMsg->blobs_size());
+ 578 return messages.
back().numVLs;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 595 "ripple::buildValidatorListMessage(ValidatorBlobInfo) : empty messages "
+
+ 597 protocol::TMValidatorList msg;
+
+
+ 600 auto const version = 1;
+
+ 602 msg.set_blob(currentBlob.
blob);
+ 603 msg.set_signature(currentBlob.
signature);
+
+ 605 msg.set_version(version);
+
+
+
+ 609 "ripple::buildValidatorListMessage(ValidatorBlobInfo) : maximum "
+
+
+ 612 std::make_shared<Message>(msg, protocol::mtVALIDATORLIST),
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 631 "ripple::buildValidatorListMessage(std::map<std::size_t, "
+ 632 "ValidatorBlobInfo>) : empty messages input");
+ 633 protocol::TMValidatorListCollection msg;
+ 634 auto const version = rawVersion < 2 ? 2 : rawVersion;
+ 635 msg.set_version(version);
+ 636 msg.set_manifest(rawManifest);
+
+ 638 for (
auto const& [sequence, blobInfo] : blobInfos)
+
+ 640 if (sequence <= peerSequence)
+
+ 642 protocol::ValidatorBlobInfo& blob = *msg.add_blobs();
+ 643 blob.set_blob(blobInfo.blob);
+ 644 blob.set_signature(blobInfo.signature);
+ 645 if (blobInfo.manifest)
+ 646 blob.set_manifest(*blobInfo.manifest);
+
-
- 650 "ripple::ValidatorList::buildValidatorListMessages : empty messages "
-
- 652 auto const& [currentSeq, currentBlob] = *blobInfos.
begin();
-
-
-
-
-
- 658 return total + m.numVLs;
-
- 660 if (messageVersion == 2 && peerSequence < maxSequence)
-
-
- 663 if (messages.
empty())
-
-
-
-
-
-
-
-
- 672 if (messages.
empty())
-
-
-
-
-
-
- 679 return {maxSequence, numVLs};
-
- 681 else if (messageVersion == 1 && peerSequence < currentSeq)
-
-
- 684 if (messages.
empty())
-
-
-
-
- 689 currentBlob.manifest ? *currentBlob.manifest : rawManifest,
-
-
- 692 if (messages.
empty())
-
-
-
-
-
-
- 699 return {currentSeq, numVLs};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 736 "ripple::ValidatorList::sendValidatorList : non-empty messages "
-
-
-
-
-
- 742 for (
auto const& message : messages)
-
-
-
- 746 peer.
send(message.message);
-
-
-
-
-
-
-
- 754 sent || messages.size() == 1,
- 755 "ripple::ValidatorList::sendValidatorList : sent or one message");
-
-
- 758 if (messageVersion > 1)
-
- 760 <<
"Sent " << messages.size()
- 761 <<
" validator list collection(s) containing " << numVLs
- 762 <<
" validator list(s) for " <<
strHex(publisherKey)
- 763 <<
" with sequence range " << peerSequence <<
", "
- 764 << newPeerSequence <<
" to "
-
-
-
-
-
-
- 771 "ripple::ValidatorList::sendValidatorList : one validator "
-
-
- 774 <<
"Sent validator list for " <<
strHex(publisherKey)
- 775 <<
" with sequence " << newPeerSequence <<
" to "
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 818 blobInfos[
current.sequence] = {
-
- 820 for (
auto const& [sequence, vl] : remaining)
-
- 822 blobInfos[sequence] = {vl.rawBlob, vl.rawSignature, vl.rawManifest};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 870 "ripple::ValidatorList::broadcastBlobs : valid sequence");
-
-
-
-
- 875 if (toSkip->count(peer->id()) == 0)
-
- 877 auto const peerSequence =
- 878 peer->publisherListSequence(publisherKey).value_or(0);
- 879 if (peerSequence < maxSequence)
-
- 881 if (blobInfos.
empty())
-
- 883 auto const v2 = peer->supportsFeature(
-
-
-
-
-
-
-
-
-
- 893 v2 ? messages2[peerSequence] : messages1,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 918 auto const disposition = result.bestDisposition();
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 649 msg.blobs_size() > 0,
+ 650 "ripple::buildValidatorListMessage(std::map<std::size_t, "
+ 651 "ValidatorBlobInfo>) : minimum message blobs");
+
+
+
+
+
+
+
+
+ 660 std::make_shared<Message>(msg, protocol::mtVALIDATORLISTCOLLECTION),
+
+
+ 663 return messages.
back().numVLs;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 682 "ripple::ValidatorList::buildValidatorListMessages : empty messages "
+
+ 684 auto const& [currentSeq, currentBlob] = *blobInfos.
begin();
+
+
+
+
+
+ 690 return total + m.numVLs;
+
+ 692 if (messageVersion == 2 && peerSequence < maxSequence)
+
+
+ 695 if (messages.
empty())
+
+
+
+
+
+
+
+
+ 704 if (messages.
empty())
+
+
+
+
+
+
+ 711 return {maxSequence, numVLs};
+
+ 713 else if (messageVersion == 1 && peerSequence < currentSeq)
+
+
+ 716 if (messages.
empty())
+
+
+
+
+ 721 currentBlob.manifest ? *currentBlob.manifest : rawManifest,
+
+
+ 724 if (messages.
empty())
+
+
+
+
+
+
+ 731 return {currentSeq, numVLs};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 768 "ripple::ValidatorList::sendValidatorList : non-empty messages "
+
+
+
+
+
+ 774 for (
auto const& message : messages)
+
+
+
+ 778 peer.
send(message.message);
+
+
+
+
+
+
+
+ 786 sent || messages.size() == 1,
+ 787 "ripple::ValidatorList::sendValidatorList : sent or one message");
+
+
+ 790 if (messageVersion > 1)
+
+ 792 <<
"Sent " << messages.size()
+ 793 <<
" validator list collection(s) containing " << numVLs
+ 794 <<
" validator list(s) for " <<
strHex(publisherKey)
+ 795 <<
" with sequence range " << peerSequence <<
", "
+ 796 << newPeerSequence <<
" to "
+
+
+
+
+
+
+ 803 "ripple::ValidatorList::sendValidatorList : one validator "
+
+
+ 806 <<
"Sent validator list for " <<
strHex(publisherKey)
+ 807 <<
" with sequence " << newPeerSequence <<
" to "
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 850 blobInfos[
current.sequence] = {
+
+ 852 for (
auto const& [sequence, vl] : remaining)
+
+ 854 blobInfos[sequence] = {vl.rawBlob, vl.rawSignature, vl.rawManifest};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 902 "ripple::ValidatorList::broadcastBlobs : valid sequence");
+
+
+
+
+ 907 if (toSkip->count(peer->id()) == 0)
+
+ 909 auto const peerSequence =
+ 910 peer->publisherListSequence(publisherKey).value_or(0);
+ 911 if (peerSequence < maxSequence)
+
+ 913 if (blobInfos.
empty())
+
+ 915 auto const v2 = peer->supportsFeature(
+
+
+
+
+
+
+
+
+
+ 925 v2 ? messages2[peerSequence] : messages1,
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- 945 result.publisherKey &&
-
-
-
-
-
- 951 *result.publisherKey,
-
- 953 *pubCollection.maxSequence,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 980 for (
auto const& blobInfo : blobs)
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 950 auto const disposition = result.bestDisposition();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 977 result.publisherKey &&
+
+
+
+
+
+ 983 *result.publisherKey,
+
+ 985 *pubCollection.maxSequence,
+
+
+
+
+
-
-
-
-
- 996 stats.mergeDispositions(result);
- 997 result = std::move(stats);
-
-
-
-
-
-
-
-
-
-
- 1009 auto& remaining = pubCollection.remaining;
- 1010 auto const&
current = pubCollection.current;
- 1011 for (
auto iter = remaining.begin(); iter != remaining.end();)
-
-
-
- 1015 next == remaining.end() || next->first > iter->first,
- 1016 "ripple::ValidatorList::applyLists : next is valid");
- 1017 if (iter->first <=
current.sequence ||
- 1018 (next != remaining.end() &&
- 1019 next->second.validFrom <= iter->second.validFrom))
-
- 1021 iter = remaining.erase(iter);
-
-
-
-
-
-
-
-
-
- 1031 pubCollection.fullHash =
sha512Half(pubCollection);
-
- 1033 result.
sequence = *pubCollection.maxSequence;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1012 for (
auto const& blobInfo : blobs)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1028 stats.mergeDispositions(result);
+ 1029 result = std::move(stats);
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1049 auto iNew = publisherList.
begin();
- 1050 auto iOld = oldList.
begin();
- 1051 while (iNew != publisherList.
end() || iOld != oldList.
end())
-
- 1053 if (iOld == oldList.
end() ||
- 1054 (iNew != publisherList.
end() && *iNew < *iOld))
-
-
-
-
+
+
+
+
+
+ 1041 auto& remaining = pubCollection.remaining;
+ 1042 auto const&
current = pubCollection.current;
+ 1043 for (
auto iter = remaining.begin(); iter != remaining.end();)
+
+
+
+ 1047 next == remaining.end() || next->first > iter->first,
+ 1048 "ripple::ValidatorList::applyLists : next is valid");
+ 1049 if (iter->first <=
current.sequence ||
+ 1050 (next != remaining.end() &&
+ 1051 next->second.validFrom <= iter->second.validFrom))
+
+ 1053 iter = remaining.erase(iter);
+
+
+
+
+
-
- 1061 iNew == publisherList.
end() ||
- 1062 (iOld != oldList.
end() && *iOld < *iNew))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1078 if (publisherList.
empty())
-
- 1080 JLOG(
j_.
warn()) <<
"No validator keys included in valid list";
-
-
- 1083 for (
auto const& valManifest : manifests)
+
+
+
+ 1063 pubCollection.fullHash =
sha512Half(pubCollection);
+
+ 1065 result.
sequence = *pubCollection.maxSequence;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1081 auto iNew = publisherList.
begin();
+ 1082 auto iOld = oldList.
begin();
+ 1083 while (iNew != publisherList.
end() || iOld != oldList.
end())
-
-
-
-
-
- 1090 <<
" contained untrusted validator manifest";
-
-
-
-
-
-
-
- 1098 <<
" contained invalid validator manifest";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1114 using namespace std::string_literals;
-
-
- 1117 auto const&
manifest = localManifest ? *localManifest : globalManifest;
- 1118 auto [result, pubKeyOpt] =
verify(lock, list,
manifest, blob, signature);
-
-
-
- 1122 JLOG(
j_.
info()) <<
"ValidatorList::applyList unable to retrieve the "
- 1123 "master public key from the verify function\n";
-
-
-
-
-
- 1129 JLOG(
j_.
info()) <<
"ValidatorList::applyList Invalid Public Key type"
- 1130 " retrieved from the verify function\n ";
-
+ 1085 if (iOld == oldList.
end() ||
+ 1086 (iNew != publisherList.
end() && *iNew < *iOld))
+
+
+
+
+
+
+ 1093 iNew == publisherList.
end() ||
+ 1094 (iOld != oldList.
end() && *iOld < *iNew))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1110 if (publisherList.
empty())
+
+ 1112 JLOG(
j_.
warn()) <<
"No validator keys included in valid list";
+
+
+ 1115 for (
auto const& valManifest : manifests)
+
+
+
+
+
+
+ 1122 <<
" contained untrusted validator manifest";
+
+
+
+
+
+
+
+ 1130 <<
" contained invalid validator manifest";
+
-
-
-
-
-
-
-
- 1140 if (pubCollection.maxSequence &&
-
-
-
-
-
-
-
-
- 1149 pubCollection.status,
- 1150 *pubCollection.maxSequence};
-
-
-
-
-
-
-
- 1158 auto const sequence = list[jss::sequence].
asUInt();
-
-
-
-
-
-
-
-
- 1167 pubCollection.rawManifest = globalManifest;
- 1168 if (!pubCollection.maxSequence || sequence > *pubCollection.maxSequence)
- 1169 pubCollection.maxSequence = sequence;
-
- 1171 Json::Value const& newList = list[jss::validators];
-
- 1173 if (
accepted && pubCollection.remaining.count(sequence) != 0)
-
-
-
-
-
-
- 1180 auto& publisher = pubCollection.current;
-
- 1182 oldList = std::move(pubCollection.current.list);
-
- 1184 publisher = std::move(pubCollection.remaining[sequence]);
-
- 1186 pubCollection.remaining.erase(sequence);
-
-
- 1189 publisher.sequence == sequence,
- 1190 "ripple::ValidatorList::applyList : publisher sequence match");
-
-
-
- 1194 auto& publisher =
accepted ? pubCollection.current
- 1195 : pubCollection.remaining[sequence];
- 1196 publisher.sequence = sequence;
-
- 1198 list.
isMember(jss::effective) ? list[jss::effective].
asUInt() : 0}};
-
-
- 1201 publisher.siteUri = std::move(siteUri);
- 1202 publisher.rawBlob = blob;
- 1203 publisher.rawSignature = signature;
- 1204 publisher.rawManifest = localManifest;
-
- 1206 publisher.hash = *hash;
-
-
-
-
-
- 1212 oldList = std::move(publisherList);
-
- 1214 publisherList.
clear();
-
- 1216 for (
auto const& val : newList)
-
- 1218 if (val.isObject() && val.isMember(jss::validation_public_key) &&
- 1219 val[jss::validation_public_key].isString())
-
-
- 1222 strUnHex(val[jss::validation_public_key].asString());
-
-
-
-
- 1227 <<
"Invalid node identity: "
- 1228 << val[jss::validation_public_key].asString();
-
-
-
-
-
-
-
- 1236 if (val.isMember(jss::manifest) &&
- 1237 val[jss::manifest].isString())
- 1238 manifests.
push_back(val[jss::manifest].asString());
-
-
-
-
-
-
-
-
- 1247 pubCollection.rawVersion =
std::max(pubCollection.rawVersion, version);
- 1248 if (!pubCollection.remaining.empty())
-
-
-
- 1252 pubCollection.rawVersion =
std::max(pubCollection.rawVersion, 2u);
-
-
-
- 1256 result, pubKey, pubCollection.status, *pubCollection.maxSequence};
-
-
-
-
-
-
-
-
-
-
-
-
- 1269 using namespace std::string_literals;
- 1270 using namespace boost::filesystem;
- 1271 using namespace boost::system::errc;
-
-
-
-
-
-
-
- 1279 boost::system::error_code ec;
-
-
-
-
-
-
- 1286 auto const fullPath{
canonical(filename, ec)};
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1146 using namespace std::string_literals;
+
+
+ 1149 auto const&
manifest = localManifest ? *localManifest : globalManifest;
+ 1150 auto [result, pubKeyOpt] =
verify(lock, list,
manifest, blob, signature);
+
+
+
+ 1154 JLOG(
j_.
info()) <<
"ValidatorList::applyList unable to retrieve the "
+ 1155 "master public key from the verify function\n";
+
+
+
+
+
+ 1161 JLOG(
j_.
info()) <<
"ValidatorList::applyList Invalid Public Key type"
+ 1162 " retrieved from the verify function\n ";
+
+
+
+
+
+
+
+
+
+ 1172 if (pubCollection.maxSequence &&
+
+
+
+
+
+
+
+
+ 1181 pubCollection.status,
+ 1182 *pubCollection.maxSequence};
+
+
+
+
+
+
+
+ 1190 auto const sequence = list[jss::sequence].
asUInt();
+
+
+
+
+
+
+
+
+ 1199 pubCollection.rawManifest = globalManifest;
+ 1200 if (!pubCollection.maxSequence || sequence > *pubCollection.maxSequence)
+ 1201 pubCollection.maxSequence = sequence;
+
+ 1203 Json::Value const& newList = list[jss::validators];
+
+ 1205 if (
accepted && pubCollection.remaining.count(sequence) != 0)
+
+
+
+
+
+
+ 1212 auto& publisher = pubCollection.current;
+
+ 1214 oldList = std::move(pubCollection.current.list);
+
+ 1216 publisher = std::move(pubCollection.remaining[sequence]);
+
+ 1218 pubCollection.remaining.erase(sequence);
+
+
+ 1221 publisher.sequence == sequence,
+ 1222 "ripple::ValidatorList::applyList : publisher sequence match");
+
+
+
+ 1226 auto& publisher =
accepted ? pubCollection.current
+ 1227 : pubCollection.remaining[sequence];
+ 1228 publisher.sequence = sequence;
+
+ 1230 list.
isMember(jss::effective) ? list[jss::effective].
asUInt() : 0}};
+
+
+ 1233 publisher.siteUri = std::move(siteUri);
+ 1234 publisher.rawBlob = blob;
+ 1235 publisher.rawSignature = signature;
+ 1236 publisher.rawManifest = localManifest;
+
+ 1238 publisher.hash = *hash;
+
+
+
+
+
+ 1244 oldList = std::move(publisherList);
+
+ 1246 publisherList.
clear();
+
+ 1248 for (
auto const& val : newList)
+
+ 1250 if (val.isObject() && val.isMember(jss::validation_public_key) &&
+ 1251 val[jss::validation_public_key].isString())
+
+
+ 1254 strUnHex(val[jss::validation_public_key].asString());
+
+
+
+
+ 1259 <<
"Invalid node identity: "
+ 1260 << val[jss::validation_public_key].asString();
+
+
+
+
+
+
+
+ 1268 if (val.isMember(jss::manifest) &&
+ 1269 val[jss::manifest].isString())
+ 1270 manifests.
push_back(val[jss::manifest].asString());
+
+
+
+
+
+
+
+
+ 1279 pubCollection.rawVersion =
std::max(pubCollection.rawVersion, version);
+ 1280 if (!pubCollection.remaining.empty())
+
+
+
+ 1284 pubCollection.rawVersion =
std::max(pubCollection.rawVersion, 2u);
+
+
+
+ 1288 result, pubKey, pubCollection.status, *pubCollection.maxSequence};
- 1290 auto size = file_size(fullPath, ec);
-
-
-
-
-
-
-
-
-
-
-
-
- 1303 return fullPath.root_path() ==
"/"s ?
"file://" :
"file:///";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1335 auto const revoked = m->revoked();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 1301 using namespace std::string_literals;
+ 1302 using namespace boost::filesystem;
+ 1303 using namespace boost::system::errc;
+
+
+
+
+
+
+
+ 1311 boost::system::error_code ec;
+
+
+
+
+
+
+ 1318 auto const fullPath{
canonical(filename, ec)};
+
+
+
+ 1322 auto size = file_size(fullPath, ec);
+
+
+
+
+
+
+
+
+
+
+
+
+ 1335 return fullPath.root_path() ==
"/"s ?
"file://" :
"file:///";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- 1351 auto const sig =
strUnHex(signature);
-
-
-
-
-
- 1357 if (!r.
parse(data, list))
-
-
- 1360 if (list.
isMember(jss::sequence) && list[jss::sequence].
isInt() &&
- 1361 list.
isMember(jss::expiration) && list[jss::expiration].
isInt() &&
- 1362 (!list.
isMember(jss::effective) || list[jss::effective].
isInt()) &&
-
-
- 1365 auto const sequence = list[jss::sequence].
asUInt();
-
- 1367 list.
isMember(jss::effective) ? list[jss::effective].
asUInt() : 0}};
-
-
-
-
- 1372 if (validUntil <= validFrom)
-
- 1374 else if (sequence < listCollection.current.sequence)
-
- 1376 else if (sequence == listCollection.current.sequence)
-
- 1378 else if (validUntil <= now)
-
- 1380 else if (validFrom > now)
-
-
-
-
-
-
-
-
-
-
- 1391 return !listCollection.maxSequence ||
- 1392 sequence > *listCollection.maxSequence ||
- 1393 (listCollection.remaining.count(sequence) == 0 &&
- 1394 validFrom < listCollection.remaining
- 1395 .at(*listCollection.maxSequence)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1430 return trusted(read_lock, identity);
-
-
-
-
-
-
-
-
-
-
- 1441 return std::nullopt;
-
-
-
-
-
-
-
-
-
-
- 1452 return std::nullopt;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1487 "ripple::ValidatorList::removePublisherList : valid reason input");
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1367 auto const revoked = m->revoked();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1383 auto const sig =
strUnHex(signature);
+
+
+
+
+
+ 1389 if (!r.
parse(data, list))
+
+
+ 1392 if (list.
isMember(jss::sequence) && list[jss::sequence].
isInt() &&
+ 1393 list.
isMember(jss::expiration) && list[jss::expiration].
isInt() &&
+ 1394 (!list.
isMember(jss::effective) || list[jss::effective].
isInt()) &&
+
+
+ 1397 auto const sequence = list[jss::sequence].
asUInt();
+
+ 1399 list.
isMember(jss::effective) ? list[jss::effective].
asUInt() : 0}};
+
+
+
+
+ 1404 if (validUntil <= validFrom)
+
+ 1406 else if (sequence < listCollection.current.sequence)
+
+ 1408 else if (sequence == listCollection.current.sequence)
+
+ 1410 else if (validUntil <= now)
+
+ 1412 else if (validFrom > now)
+
+
+
+
+
+
+
+
+
+
+ 1423 return !listCollection.maxSequence ||
+ 1424 sequence > *listCollection.maxSequence ||
+ 1425 (listCollection.remaining.count(sequence) == 0 &&
+ 1426 validFrom < listCollection.remaining
+ 1427 .at(*listCollection.maxSequence)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1462 return trusted(read_lock, identity);
+
+
+
+
+
+
+
+
+
+
+ 1473 return std::nullopt;
+
+
+
+
+
+
+
+
+
+
+ 1484 return std::nullopt;
+
+
+
+
+
+
- 1492 JLOG(
j_.
debug()) <<
"Removing validator list for publisher "
-
+
+
- 1495 for (
auto const& val : iList->second.current.list)
-
-
-
-
-
- 1501 if (iVal->second <= 1)
-
-
-
-
-
- 1507 iList->second.current.list.clear();
- 1508 iList->second.status = reason;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1523 return count(read_lock);
-
-
-
-
-
-
-
-
-
- 1533 auto const&
current = collection.current;
-
-
- 1536 return std::nullopt;
-
+
+
+
+
+
+
+
+
+
+ 1519 "ripple::ValidatorList::removePublisherList : valid reason input");
+
+
+
+
+ 1524 JLOG(
j_.
debug()) <<
"Removing validator list for publisher "
+
+
+ 1527 for (
auto const& val : iList->second.current.list)
+
+
+
+
+
+ 1533 if (iVal->second <= 1)
+
+
+
+
-
-
-
- 1542 auto chainedExpiration =
current.validUntil;
- 1543 for (
auto const& [sequence, check] : collection.remaining)
-
-
- 1546 if (check.validFrom <= chainedExpiration)
- 1547 chainedExpiration = check.validUntil;
-
-
-
-
-
- 1553 if (!res || chainedExpiration < *res)
-
- 1555 res = chainedExpiration;
-
-
-
-
-
-
-
- 1563 auto const&
current = collection;
- 1564 auto chainedExpiration =
current.validUntil;
-
-
- 1567 if (!res || chainedExpiration < *res)
-
- 1569 res = chainedExpiration;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 1539 iList->second.current.list.clear();
+ 1540 iList->second.status = reason;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1555 return count(read_lock);
+
+
+
+
+
+
+
+
+
+ 1565 auto const&
current = collection.current;
+
+
+ 1568 return std::nullopt;
+
+
+
+
+
+ 1574 auto chainedExpiration =
current.validUntil;
+ 1575 for (
auto const& [sequence, check] : collection.remaining)
+
+
+ 1578 if (check.validFrom <= chainedExpiration)
+ 1579 chainedExpiration = check.validUntil;
+
+
+
+
+
+ 1585 if (!res || chainedExpiration < *res)
+
+ 1587 res = chainedExpiration;
+
+
-
-
-
-
-
- 1596 if (
auto when =
expires(read_lock))
-
- 1598 if (*when == TimeKeeper::time_point::max())
-
- 1600 x[jss::expiration] =
"never";
- 1601 x[jss::status] =
"active";
-
-
-
-
+
+
+
+
+ 1595 auto const&
current = collection;
+ 1596 auto chainedExpiration =
current.validUntil;
+
+
+ 1599 if (!res || chainedExpiration < *res)
+
+ 1601 res = chainedExpiration;
+
+
+
+
-
- 1608 x[jss::status] =
"active";
-
- 1610 x[jss::status] =
"expired";
-
-
-
-
- 1615 x[jss::status] =
"unknown";
- 1616 x[jss::expiration] =
"unknown";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1633 curr[jss::pubkey_publisher] =
strHex(publicKey);
- 1634 curr[jss::available] =
-
-
-
-
- 1639 target[jss::uri] = publisherList.
siteUri;
-
-
-
-
-
-
-
-
-
- 1649 for (
auto const& key : publisherList.
list)
-
-
-
-
-
- 1655 auto const&
current = pubCollection.current;
-
-
-
- 1659 curr[jss::version] = pubCollection.rawVersion;
-
-
-
-
- 1664 for (
auto const& [sequence, future] : pubCollection.remaining)
-
- 1666 using namespace std::chrono_literals;
-
-
-
- 1670 appendList(future, r);
-
-
-
- 1674 "ripple::ValidatorList::getJson : minimum valid from");
-
- 1676 if (remaining.
size())
- 1677 curr[jss::remaining] = std::move(remaining);
-
-
-
-
-
- 1683 for (
auto const& k : trustedMasterKeys_)
-
-
-
-
-
-
- 1690 validatorManifests_.for_each_manifest([&jSigningKeys,
-
- 1692 auto it = keyListings_.find(
manifest.masterKey);
- 1693 if (it != keyListings_.end() &&
manifest.signingKey)
-
-
-
-
-
-
-
- 1701 if (!negativeUNL_.empty())
-
-
- 1704 for (
auto const& k : negativeUNL_)
-
-
-
-
-
-
-
-
-
- 1714ValidatorList::for_each_listed(
-
-
-
-
- 1719 for (
auto const& v : keyListings_)
- 1720 func(v.first, trusted(read_lock, v.first));
-
-
-
- 1724ValidatorList::for_each_available(
-
-
-
-
-
-
- 1731 uint256 const& hash)> func)
const
-
-
-
- 1735 for (
auto const& [key, plCollection] : publisherLists_)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1628 if (
auto when =
expires(read_lock))
+
+ 1630 if (*when == TimeKeeper::time_point::max())
+
+ 1632 x[jss::expiration] =
"never";
+ 1633 x[jss::status] =
"active";
+
+
+
+
+
+
+ 1640 x[jss::status] =
"active";
+
+ 1642 x[jss::status] =
"expired";
+
+
+
+
+ 1647 x[jss::status] =
"unknown";
+ 1648 x[jss::expiration] =
"unknown";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1667 curr[jss::pubkey_publisher] =
strHex(publicKey);
+ 1668 curr[jss::available] =
+
+
+
+
+ 1673 target[jss::uri] = publisherList.
siteUri;
+
+
+
+
+
+
+
+
+
+ 1683 for (
auto const& key : publisherList.
list)
+
+
+
+
+
+ 1689 auto const&
current = pubCollection.current;
+
+
+
+ 1693 curr[jss::version] = pubCollection.rawVersion;
+
+
+
+
+ 1698 for (
auto const& [sequence, future] : pubCollection.remaining)
+
+ 1700 using namespace std::chrono_literals;
+
+
+
+ 1704 appendList(future, r);
+
+
+
+ 1708 "ripple::ValidatorList::getJson : minimum valid from");
+
+ 1710 if (remaining.
size())
+ 1711 curr[jss::remaining] = std::move(remaining);
+
+
+
+
+
+ 1717 for (
auto const& k : trustedMasterKeys_)
+
+
+
+
+
+
+ 1724 validatorManifests_.for_each_manifest([&jSigningKeys,
+
+ 1726 auto it = keyListings_.find(
manifest.masterKey);
+ 1727 if (it != keyListings_.end() &&
manifest.signingKey)
+
+
+
+
+
+
+
+ 1735 if (!negativeUNL_.empty())
- 1737 if (plCollection.status != PublisherStatus::available)
-
-
- 1740 plCollection.maxSequence != 0,
- 1741 "ripple::ValidatorList::for_each_available : nonzero maxSequence");
-
- 1743 plCollection.rawManifest,
- 1744 plCollection.rawVersion,
- 1745 buildBlobInfos(plCollection),
-
- 1747 plCollection.maxSequence.value_or(0),
- 1748 plCollection.fullHash);
-
-
-
-
- 1753ValidatorList::getAvailable(
-
-
-
-
-
-
-
-
-
- 1763 JLOG(j_.
info()) <<
"Invalid requested validator list publisher key: "
-
-
-
-
-
-
- 1770 auto const iter = publisherLists_.find(
id);
-
- 1772 if (iter == publisherLists_.end() ||
- 1773 iter->second.status != PublisherStatus::available)
-
-
-
- 1777 buildFileData(
std::string{pubKey}, iter->second, forceVersion, j_);
-
-
-
-
-
- 1783ValidatorList::calculateQuorum(
-
-
-
-
-
- 1789 if (minimumQuorum_ > 0)
-
- 1791 JLOG(j_.
warn()) <<
"Using potentially unsafe quorum of "
-
- 1793 <<
" as specified on the command line";
- 1794 return *minimumQuorum_;
-
-
-
-
- 1799 for (
auto const& list : publisherLists_)
-
- 1801 if (list.second.status != PublisherStatus::available)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1844ValidatorList::updateTrusted(
-
-
-
-
-
-
- 1851 using namespace std::chrono_literals;
- 1852 if (timeKeeper_.now() > closeTime + 30s)
- 1853 closeTime = timeKeeper_.now();
-
-
-
-
-
-
-
-
- 1862 for (
auto& [pubKey, collection] : publisherLists_)
-
-
- 1865 auto& remaining = collection.remaining;
- 1866 auto const firstIter = remaining.begin();
- 1867 auto iter = firstIter;
- 1868 if (iter != remaining.end() && iter->second.validFrom <= closeTime)
-
-
- 1871 for (
auto next =
std::next(iter); next != remaining.end() &&
- 1872 next->second.validFrom <= closeTime;
-
-
-
-
- 1877 "ripple::ValidatorList::updateTrusted : sequential "
-
-
-
- 1881 iter != remaining.end(),
- 1882 "ripple::ValidatorList::updateTrusted : non-end of "
-
-
-
- 1886 auto sequence = iter->first;
- 1887 auto& candidate = iter->second;
- 1888 auto&
current = collection.current;
-
- 1890 candidate.validFrom <= closeTime,
- 1891 "ripple::ValidatorList::updateTrusted : maximum time");
-
- 1893 auto const oldList =
current.list;
- 1894 current = std::move(candidate);
- 1895 if (collection.status != PublisherStatus::available)
- 1896 collection.status = PublisherStatus::available;
-
-
- 1899 "ripple::ValidatorList::updateTrusted : sequence match");
-
-
-
- 1903 if (
current.validUntil <= closeTime)
-
-
- 1906 updatePublisherList(pubKey,
current, oldList, lock);
+
+ 1738 for (
auto const& k : negativeUNL_)
+
+
+
+
+
+
+
+
+
+ 1748ValidatorList::for_each_listed(
+
+
+
+
+ 1753 for (
auto const& v : keyListings_)
+ 1754 func(v.first, trusted(read_lock, v.first));
+
+
+
+ 1758ValidatorList::for_each_available(
+
+
+
+
+
+
+ 1765 uint256 const& hash)> func)
const
+
+
+
+ 1769 for (
auto const& [key, plCollection] : publisherLists_)
+
+ 1771 if (plCollection.status != PublisherStatus::available)
+
+
+ 1774 plCollection.maxSequence != 0,
+ 1775 "ripple::ValidatorList::for_each_available : nonzero maxSequence");
+
+ 1777 plCollection.rawManifest,
+ 1778 plCollection.rawVersion,
+ 1779 buildBlobInfos(plCollection),
+
+ 1781 plCollection.maxSequence.value_or(0),
+ 1782 plCollection.fullHash);
+
+
+
+
+ 1787ValidatorList::getAvailable(
+
+
+
+
+
+
+
+
+
+ 1797 JLOG(j_.
info()) <<
"Invalid requested validator list publisher key: "
+
+
+
+
+
+
+ 1804 auto const iter = publisherLists_.find(
id);
+
+ 1806 if (iter == publisherLists_.end() ||
+ 1807 iter->second.status != PublisherStatus::available)
+
+
+
+ 1811 buildFileData(
std::string{pubKey}, iter->second, forceVersion, j_);
+
+
+
+
+
+ 1817ValidatorList::calculateQuorum(
+
+
+
+
+
+ 1823 if (minimumQuorum_ > 0)
+
+ 1825 JLOG(j_.
warn()) <<
"Using potentially unsafe quorum of "
+
+ 1827 <<
" as specified on the command line";
+ 1828 return *minimumQuorum_;
+
+
+ 1831 if (!publisherLists_.empty())
+
+
+
+
+ 1836 for (
auto const& list : publisherLists_)
+
+ 1838 if (list.second.status != PublisherStatus::available)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1860 auto const errorThreshold =
std::min(
+
+ 1862 publisherLists_.size() - listThreshold_ + 1);
+
+
+ 1865 "ripple::ValidatorList::calculateQuorum : nonzero error threshold");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 1909ValidatorList::updateTrusted(
+
+
+
+
+
+
+ 1916 using namespace std::chrono_literals;
+ 1917 if (timeKeeper_.now() > closeTime + 30s)
+ 1918 closeTime = timeKeeper_.now();
+
+
-
- 1923 remaining.erase(firstIter,
std::next(iter));
-
-
-
-
-
- 1929 if (collection.status == PublisherStatus::available &&
- 1930 collection.current.validUntil <= closeTime)
-
- 1932 removePublisherList(lock, pubKey, PublisherStatus::expired);
-
-
- 1935 if (collection.status != PublisherStatus::available)
-
-
-
-
-
-
-
- 1943 auto it = trustedMasterKeys_.cbegin();
- 1944 while (it != trustedMasterKeys_.cend())
-
- 1946 if (!keyListings_.count(*it) || validatorManifests_.revoked(*it))
-
-
- 1949 it = trustedMasterKeys_.erase(it);
-
-
-
-
-
-
-
- 1957 for (
auto const& val : keyListings_)
-
- 1959 if (!validatorManifests_.revoked(val.first) &&
- 1960 trustedMasterKeys_.emplace(val.first).second)
-
-
-
-
-
- 1966 if (!trustChanges.
added.empty() || !trustChanges.
removed.empty())
-
- 1968 trustedSigningKeys_.clear();
-
-
-
- 1972 for (
auto const& k : trustedMasterKeys_)
-
-
- 1975 validatorManifests_.getSigningKey(k);
-
-
- 1978 "ripple::ValidatorList::updateTrusted : found signing key");
- 1979 trustedSigningKeys_.insert(*signingKey);
-
-
-
-
- 1984 << trustedMasterKeys_.size() <<
" of " << keyListings_.size()
- 1985 <<
" listed validators eligible for inclusion in the trusted set";
+
+
+
+
+
+ 1927 for (
auto& [pubKey, collection] : publisherLists_)
+
+
+ 1930 auto& remaining = collection.remaining;
+ 1931 auto const firstIter = remaining.begin();
+ 1932 auto iter = firstIter;
+ 1933 if (iter != remaining.end() && iter->second.validFrom <= closeTime)
+
+
+ 1936 for (
auto next =
std::next(iter); next != remaining.end() &&
+ 1937 next->second.validFrom <= closeTime;
+
+
+
+
+ 1942 "ripple::ValidatorList::updateTrusted : sequential "
+
+
+
+ 1946 iter != remaining.end(),
+ 1947 "ripple::ValidatorList::updateTrusted : non-end of "
+
+
+
+ 1951 auto sequence = iter->first;
+ 1952 auto& candidate = iter->second;
+ 1953 auto&
current = collection.current;
+
+ 1955 candidate.validFrom <= closeTime,
+ 1956 "ripple::ValidatorList::updateTrusted : maximum time");
+
+ 1958 auto const oldList =
current.list;
+ 1959 current = std::move(candidate);
+ 1960 if (collection.status != PublisherStatus::available)
+ 1961 collection.status = PublisherStatus::available;
+
+
+ 1964 "ripple::ValidatorList::updateTrusted : sequence match");
+
+
+
+ 1968 if (
current.validUntil <= closeTime)
+
+
+ 1971 updatePublisherList(pubKey,
current, oldList, lock);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- 1987 auto const unlSize = trustedMasterKeys_.size();
- 1988 auto effectiveUnlSize = unlSize;
- 1989 auto seenSize = seenValidators.
size();
- 1990 if (!negativeUNL_.empty())
-
- 1992 for (
auto const& k : trustedMasterKeys_)
-
- 1994 if (negativeUNL_.count(k))
-
-
-
- 1998 for (
auto const& k : negativeUNL_)
-
-
-
- 2002 for (
auto const& nid : seenValidators)
-
- 2004 if (negUnlNodeIDs.
count(nid))
-
-
-
- 2008 quorum_ = calculateQuorum(unlSize, effectiveUnlSize, seenSize);
-
- 2010 JLOG(j_.
debug()) <<
"Using quorum of " << quorum_ <<
" for new set of "
- 2011 << unlSize <<
" trusted validators ("
- 2012 << trustChanges.
added.size() <<
" added, "
- 2013 << trustChanges.
removed.size() <<
" removed)";
-
- 2015 if (unlSize < quorum_)
-
- 2017 JLOG(j_.
warn()) <<
"New quorum of " << quorum_
- 2018 <<
" exceeds the number of trusted validators ("
-
-
-
- 2022 if ((publisherLists_.size() || localPublisherList.list.size()) &&
-
-
-
-
-
-
- 2029 return trustChanges;
-
-
-
- 2033ValidatorList::getTrustedMasterKeys()
const
-
-
- 2036 return trustedMasterKeys_;
-
-
-
- 2040ValidatorList::getNegativeUNL()
const
-
-
- 2043 return negativeUNL_;
-
-
-
-
-
-
- 2050 negativeUNL_ = negUnl;
-
-
-
- 2054ValidatorList::negativeUNLFilter(
-
-
-
- 2058 auto ret = std::move(validations);
-
-
- 2061 if (!negativeUNL_.empty())
-
-
-
-
-
- 2067 [&](
auto const& v) ->
bool {
- 2068 if (auto const masterKey =
- 2069 getTrustedKey(read_lock, v->getSignerPublic());
-
-
- 2072 return negativeUNL_.count(*masterKey);
-
-
-
-
-
-
-
-
+
+ 1988 remaining.erase(firstIter,
std::next(iter));
+
+
+
+
+
+ 1994 if (collection.status == PublisherStatus::available &&
+ 1995 collection.current.validUntil <= closeTime)
+
+ 1997 removePublisherList(lock, pubKey, PublisherStatus::expired);
+
+
+ 2000 if (collection.status != PublisherStatus::available)
+
+
+
+
+
+
+
+ 2008 auto it = trustedMasterKeys_.cbegin();
+ 2009 while (it != trustedMasterKeys_.cend())
+
+ 2011 auto const kit = keyListings_.find(*it);
+ 2012 if (kit == keyListings_.end() ||
+ 2013 kit->second < listThreshold_ ||
+ 2014 validatorManifests_.revoked(*it))
+
+
+ 2017 it = trustedMasterKeys_.erase(it);
+
+
+
+
+ 2022 kit->second >= listThreshold_,
+ 2023 "ripple::ValidatorList::updateTrusted : count meets threshold");
+
+
+
+
+ 2028 for (
auto const& val : keyListings_)
+
+ 2030 if (val.second >= listThreshold_ &&
+ 2031 !validatorManifests_.revoked(val.first) &&
+ 2032 trustedMasterKeys_.emplace(val.first).second)
+
+
+
+
+
+ 2038 if (!trustChanges.
added.empty() || !trustChanges.
removed.empty())
+
+ 2040 trustedSigningKeys_.clear();
+
+
+
+ 2044 for (
auto const& k : trustedMasterKeys_)
+
+
+ 2047 validatorManifests_.getSigningKey(k);
+
+
+ 2050 "ripple::ValidatorList::updateTrusted : found signing key");
+ 2051 trustedSigningKeys_.insert(*signingKey);
+
+
+
+
+ 2056 << trustedMasterKeys_.size() <<
" of " << keyListings_.size()
+ 2057 <<
" listed validators eligible for inclusion in the trusted set";
+
+ 2059 auto const unlSize = trustedMasterKeys_.size();
+ 2060 auto effectiveUnlSize = unlSize;
+ 2061 auto seenSize = seenValidators.
size();
+ 2062 if (!negativeUNL_.empty())
+
+ 2064 for (
auto const& k : trustedMasterKeys_)
+
+ 2066 if (negativeUNL_.count(k))
+
+
+
+ 2070 for (
auto const& k : negativeUNL_)
+
+
+
+ 2074 for (
auto const& nid : seenValidators)
+
+ 2076 if (negUnlNodeIDs.
count(nid))
+
+
+
+ 2080 quorum_ = calculateQuorum(unlSize, effectiveUnlSize, seenSize);
-
-
-
-
+ 2082 JLOG(j_.
debug()) <<
"Using quorum of " << quorum_ <<
" for new set of "
+ 2083 << unlSize <<
" trusted validators ("
+ 2084 << trustChanges.
added.size() <<
" added, "
+ 2085 << trustChanges.
removed.size() <<
" removed)";
+
+ 2087 if (unlSize < quorum_)
+
+ 2089 JLOG(j_.
warn()) <<
"New quorum of " << quorum_
+ 2090 <<
" exceeds the number of trusted validators ("
+
+
+
+ 2094 if ((publisherLists_.size() || localPublisherList.list.size()) &&
+
+
+
+
+
+
+ 2101 return trustChanges;
+
+
+
+ 2105ValidatorList::getTrustedMasterKeys()
const
+
+
+ 2108 return trustedMasterKeys_;
+
+
+
+ 2112ValidatorList::getListThreshold()
const
+
+
+ 2115 return listThreshold_;
+
+
+
+ 2119ValidatorList::getNegativeUNL()
const
+
+
+ 2122 return negativeUNL_;
+
+
+
+
+
+
+ 2129 negativeUNL_ = negUnl;
+
+
+
+ 2133ValidatorList::negativeUNLFilter(
+
+
+
+ 2137 auto ret = std::move(validations);
+
+
+ 2140 if (!negativeUNL_.empty())
+
+
+
+
+
+ 2146 [&](
auto const& v) ->
bool {
+ 2147 if (auto const masterKey =
+ 2148 getTrustedKey(read_lock, v->getSignerPublic());
+
+
+ 2151 return negativeUNL_.count(*masterKey);
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2212,48 +2291,49 @@ $(function() {
An immutable linear range of bytes.
Manages various times used by the server.
time_point now() const override
Returns the current time, using the server's clock.
-std::size_t count() const
Return the number of configured validator list sites.
-std::optional< PublicKey > getTrustedKey(PublicKey const &identity) const
Returns master public key if public key is trusted.
-bool load(std::optional< PublicKey > const &localSigningKey, std::vector< std::string > const &configKeys, std::vector< std::string > const &publisherKeys)
Load configured trusted keys.
-static void sendValidatorList(Peer &peer, std::uint64_t peerSequence, PublicKey const &publisherKey, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, HashRouter &hashRouter, beast::Journal j)
-static void broadcastBlobs(PublicKey const &publisherKey, PublisherListCollection const &lists, std::size_t maxSequence, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, beast::Journal j)
-boost::filesystem::path getCacheFileName(lock_guard const &, PublicKey const &pubKey) const
Get the filename used for caching UNLs.
-std::vector< std::string > loadLists()
-PublisherList localPublisherList
-std::optional< PublicKey > localPublicKey() const
This function returns the local validator public key or a std::nullopt.
+std::size_t count() const
Return the number of configured validator list sites.
+std::optional< PublicKey > getTrustedKey(PublicKey const &identity) const
Returns master public key if public key is trusted.
+static void sendValidatorList(Peer &peer, std::uint64_t peerSequence, PublicKey const &publisherKey, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, HashRouter &hashRouter, beast::Journal j)
+static void broadcastBlobs(PublicKey const &publisherKey, PublisherListCollection const &lists, std::size_t maxSequence, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, beast::Journal j)
+boost::filesystem::path getCacheFileName(lock_guard const &, PublicKey const &pubKey) const
Get the filename used for caching UNLs.
+std::vector< std::string > loadLists()
+PublisherList localPublisherList
+std::optional< PublicKey > localPublicKey() const
This function returns the local validator public key or a std::nullopt.
ManifestCache & validatorManifests_
std::atomic< std::size_t > quorum_
-void updatePublisherList(PublicKey const &pubKey, PublisherList const ¤t, std::vector< PublicKey > const &oldList, lock_guard const &)
+void updatePublisherList(PublicKey const &pubKey, PublisherList const ¤t, std::vector< PublicKey > const &oldList, lock_guard const &)
-static Json::Value buildFileData(std::string const &pubKey, PublisherListCollection const &pubCollection, beast::Journal j)
Build a Json representation of the collection, suitable for writing to a cache file,...
-static void buildBlobInfos(std::map< std::size_t, ValidatorBlobInfo > &blobInfos, PublisherListCollection const &lists)
+static Json::Value buildFileData(std::string const &pubKey, PublisherListCollection const &pubCollection, beast::Journal j)
Build a Json representation of the collection, suitable for writing to a cache file,...
+static void buildBlobInfos(std::map< std::size_t, ValidatorBlobInfo > &blobInfos, PublisherListCollection const &lists)
hash_map< PublicKey, std::size_t > keyListings_
-bool listed(PublicKey const &identity) const
Returns true if public key is included on any lists.
-void cacheValidatorFile(lock_guard const &lock, PublicKey const &pubKey) const
Write a JSON UNL to a cache file.
+bool listed(PublicKey const &identity) const
Returns true if public key is included on any lists.
+std::size_t listThreshold_
+void cacheValidatorFile(lock_guard const &lock, PublicKey const &pubKey) const
Write a JSON UNL to a cache file.
hash_set< PublicKey > trustedMasterKeys_
-PublisherListStats applyList(std::string const &globalManifest, std::optional< std::string > const &localManifest, std::string const &blob, std::string const &signature, std::uint32_t version, std::string siteUri, std::optional< uint256 > const &hash, lock_guard const &)
Apply published list of public keys.
-Json::Value getJson() const
Return a JSON representation of the state of the validator list.
-std::optional< TimeKeeper::time_point > expires() const
Return the time when the validator list will expire.
-PublisherListStats applyListsAndBroadcast(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, NetworkOPs &networkOPs)
Apply multiple published lists of public keys, then broadcast it to all peers that have not seen it o...
+PublisherListStats applyList(std::string const &globalManifest, std::optional< std::string > const &localManifest, std::string const &blob, std::string const &signature, std::uint32_t version, std::string siteUri, std::optional< uint256 > const &hash, lock_guard const &)
Apply published list of public keys.
+Json::Value getJson() const
Return a JSON representation of the state of the validator list.
+std::optional< TimeKeeper::time_point > expires() const
Return the time when the validator list will expire.
+PublisherListStats applyListsAndBroadcast(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, NetworkOPs &networkOPs)
Apply multiple published lists of public keys, then broadcast it to all peers that have not seen it o...
-bool trustedPublisher(PublicKey const &identity) const
Returns true if public key is a trusted publisher.
-std::optional< PublicKey > getListedKey(PublicKey const &identity) const
Returns listed master public if public key is included on any lists.
+bool trustedPublisher(PublicKey const &identity) const
Returns true if public key is a trusted publisher.
+std::optional< PublicKey > getListedKey(PublicKey const &identity) const
Returns listed master public if public key is included on any lists.
boost::filesystem::path const dataPath_
boost::shared_mutex mutex_
-bool removePublisherList(lock_guard const &, PublicKey const &publisherKey, PublisherStatus reason)
Stop trusting publisher's list of keys.
-bool trusted(PublicKey const &identity) const
Returns true if public key is trusted.
-static constexpr std::size_t maxSupportedBlobs
+bool removePublisherList(lock_guard const &, PublicKey const &publisherKey, PublisherStatus reason)
Stop trusting publisher's list of keys.
+bool trusted(PublicKey const &identity) const
Returns true if public key is trusted.
+static constexpr std::size_t maxSupportedBlobs
ValidatorList(ManifestCache &validatorManifests, ManifestCache &publisherManifests, TimeKeeper &timeKeeper, std::string const &databasePath, beast::Journal j, std::optional< std::size_t > minimumQuorum=std::nullopt)
-std::pair< ListDisposition, std::optional< PublicKey > > verify(lock_guard const &, Json::Value &list, std::string const &manifest, std::string const &blob, std::string const &signature)
Check response for trusted valid published list.
-std::optional< PublicKey > localPubKey_
+std::pair< ListDisposition, std::optional< PublicKey > > verify(lock_guard const &, Json::Value &list, std::string const &manifest, std::string const &blob, std::string const &signature)
Check response for trusted valid published list.
+std::optional< PublicKey > localPubKey_
+bool load(std::optional< PublicKey > const &localSigningKey, std::vector< std::string > const &configKeys, std::vector< std::string > const &publisherKeys, std::optional< std::size_t > listThreshold={})
Load configured trusted keys.
std::optional< std::size_t > minimumQuorum_
-static std::vector< ValidatorBlobInfo > parseBlobs(std::uint32_t version, Json::Value const &body)
Pull the blob/signature/manifest information out of the appropriate Json body fields depending on the...
+static std::vector< ValidatorBlobInfo > parseBlobs(std::uint32_t version, Json::Value const &body)
Pull the blob/signature/manifest information out of the appropriate Json body fields depending on the...
hash_map< PublicKey, PublisherListCollection > publisherLists_
-PublisherListStats applyLists(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, std::optional< uint256 > const &hash={})
Apply multiple published lists of public keys.
-static std::pair< std::size_t, std::size_t > buildValidatorListMessages(std::size_t messageVersion, std::uint64_t peerSequence, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, std::vector< MessageWithHash > &messages, std::size_t maxSize=maximiumMessageSize)
-static const std::string filePrefix_
+PublisherListStats applyLists(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, std::optional< uint256 > const &hash={})
Apply multiple published lists of public keys.
+static std::pair< std::size_t, std::size_t > buildValidatorListMessages(std::size_t messageVersion, std::uint64_t peerSequence, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, std::vector< MessageWithHash > &messages, std::size_t maxSize=maximiumMessageSize)
+static const std::string filePrefix_
ManifestCache & publisherManifests_
-static constexpr std::uint32_t supportedListVersions[]
+static constexpr std::uint32_t supportedListVersions[]
@@ -2268,6 +2348,7 @@ $(function() {
+
@ arrayValue
array value (ordered list)
@ objectValue
object value (collection of name/value pairs).
@@ -2282,8 +2363,8 @@ $(function() {
@ ValidatorListPropagation
@ ValidatorList2Propagation
std::string base64_decode(std::string_view data)
-std::size_t splitMessage(std::vector< ValidatorList::MessageWithHash > &messages, protocol::TMValidatorListCollection const &largeMsg, std::size_t maxSize, std::size_t begin=0, std::size_t end=0)
-std::size_t splitMessageParts(std::vector< ValidatorList::MessageWithHash > &messages, protocol::TMValidatorListCollection const &largeMsg, std::size_t maxSize, std::size_t begin, std::size_t end)
+std::size_t splitMessage(std::vector< ValidatorList::MessageWithHash > &messages, protocol::TMValidatorListCollection const &largeMsg, std::size_t maxSize, std::size_t begin=0, std::size_t end=0)
+std::size_t splitMessageParts(std::vector< ValidatorList::MessageWithHash > &messages, protocol::TMValidatorListCollection const &largeMsg, std::size_t maxSize, std::size_t begin, std::size_t end)
@ current
This was a new validation and was added.
@ unsupported_version
List version is not supported.
@@ -2314,7 +2395,7 @@ $(function() {
void writeFileContents(boost::system::error_code &ec, boost::filesystem::path const &destPath, std::string const &contents)
sha512_half_hasher::result_type sha512Half(Args const &... args)
Returns the SHA512-Half of a series of objects.
-std::size_t buildValidatorListMessage(std::vector< ValidatorList::MessageWithHash > &messages, std::uint32_t rawVersion, std::string const &rawManifest, ValidatorBlobInfo const ¤tBlob, std::size_t maxSize)
+std::size_t buildValidatorListMessage(std::vector< ValidatorList::MessageWithHash > &messages, std::uint32_t rawVersion, std::string const &rawManifest, ValidatorBlobInfo const ¤tBlob, std::size_t maxSize)
@@ -2336,21 +2417,21 @@ $(function() {
std::optional< std::string > manifest
-
+
MessageWithHash()=default
std::map< std::size_t, PublisherList > remaining
-Describes the result of processing a Validator List (UNL), including some of the information from the...
+Describes the result of processing a Validator List (UNL), including some of the information from the...
void mergeDispositions(PublisherListStats const &src)
ListDisposition bestDisposition() const
PublisherListStats()=default
ListDisposition worstDisposition() const
-std::map< ListDisposition, std::size_t > dispositions
-std::optional< PublicKey > publisherKey
-
+std::map< ListDisposition, std::size_t > dispositions
+std::optional< PublicKey > publisherKey
+
std::vector< PublicKey > list
diff --git a/ValidatorList_8h_source.html b/ValidatorList_8h_source.html
index d8921e0203..bfd6dcc62a 100644
--- a/ValidatorList_8h_source.html
+++ b/ValidatorList_8h_source.html
@@ -263,401 +263,408 @@ $(function() {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 357 parseBlobs(protocol::TMValidatorList
const& body);
-
-
- 360 parseBlobs(protocol::TMValidatorListCollection
const& body);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 361 parseBlobs(protocol::TMValidatorList
const& body);
+
+
+ 364 parseBlobs(protocol::TMValidatorListCollection
const& body);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 629 uint256 const& hash)> func)
const;
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 486 hash_set<NodeID>
const& seenValidators,
+
+
+
+ 490 HashRouter& hashRouter);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 633 uint256 const& hash)> func)
const;
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 792 PublisherListCollection
const& lists);
-
-
-
-
-
-
-
- 800 PublisherListCollection
const& lists,
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 803 PublisherListCollection
const& lists);
+
+
+
+
+
+
+
+ 811 PublisherListCollection
const& lists,
-
-
-
-
-
-
-
- 822 boost::filesystem::path
-
-
-
-
-
- 831 PublisherListCollection
const& pubCollection,
-
-
-
-
-
- 840 PublisherListCollection
const& pubCollection,
-
-
-
- 844 template <
class Hasher>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 907template <
class Hasher>
-
-
-
-
-
-
-
-
-
-
-
- 919template <
class Hasher>
-
-
-
- 923 for (
auto const& item : blobs)
-
-
-
- 927template <
class Hasher>
-
-
-
- 931 for (
auto const& [_, item] : blobs)
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 833 boost::filesystem::path
+
+
+
+
+
+ 842 PublisherListCollection
const& pubCollection,
+
+
+
+
+
+ 851 PublisherListCollection
const& pubCollection,
+
+
+
+ 855 template <
class Hasher>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 918template <
class Hasher>
+
+
+
+
+
+
+
+
+
+
+
+ 930template <
class Hasher>
+
+
+
+ 934 for (
auto const& item : blobs)
+
-
-
-
-
- 942template <
class Hasher>
-
-
-
-
- 947 hash_append(h, msg.manifest(), msg.blob(), msg.signature(), msg.version());
-
-
- 950template <
class Hasher>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 938template <
class Hasher>
+
+
+
+ 942 for (
auto const& [_, item] : blobs)
+
+
+
+
+
+
+
+
+
+
+ 953template <
class Hasher>
+
+
+
+
+ 958 hash_append(h, msg.manifest(), msg.blob(), msg.signature(), msg.version());
+
+
+ 961template <
class Hasher>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -666,70 +673,73 @@ $(function() {
typename Clock::time_point time_point
Routing table for objects identified by hash.
Remembers manifests with the highest sequence number.
+std::chrono::time_point< NetClock > time_point
Provides server functionality for clients.
Manages the set of connected peers.
Represents a peer connection in the overlay.
Manages various times used by the server.
-std::size_t count() const
Return the number of configured validator list sites.
-std::optional< PublicKey > getTrustedKey(PublicKey const &identity) const
Returns master public key if public key is trusted.
-bool load(std::optional< PublicKey > const &localSigningKey, std::vector< std::string > const &configKeys, std::vector< std::string > const &publisherKeys)
Load configured trusted keys.
-static void sendValidatorList(Peer &peer, std::uint64_t peerSequence, PublicKey const &publisherKey, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, HashRouter &hashRouter, beast::Journal j)
-static void broadcastBlobs(PublicKey const &publisherKey, PublisherListCollection const &lists, std::size_t maxSequence, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, beast::Journal j)
-boost::filesystem::path getCacheFileName(lock_guard const &, PublicKey const &pubKey) const
Get the filename used for caching UNLs.
-std::vector< std::string > loadLists()
-PublisherList localPublisherList
-std::optional< PublicKey > localPublicKey() const
This function returns the local validator public key or a std::nullopt.
+std::size_t count() const
Return the number of configured validator list sites.
+std::optional< PublicKey > getTrustedKey(PublicKey const &identity) const
Returns master public key if public key is trusted.
+static void sendValidatorList(Peer &peer, std::uint64_t peerSequence, PublicKey const &publisherKey, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, HashRouter &hashRouter, beast::Journal j)
+static void broadcastBlobs(PublicKey const &publisherKey, PublisherListCollection const &lists, std::size_t maxSequence, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, beast::Journal j)
+boost::filesystem::path getCacheFileName(lock_guard const &, PublicKey const &pubKey) const
Get the filename used for caching UNLs.
+std::vector< std::string > loadLists()
+PublisherList localPublisherList
+std::optional< PublicKey > localPublicKey() const
This function returns the local validator public key or a std::nullopt.
ManifestCache & validatorManifests_
-hash_set< PublicKey > getTrustedMasterKeys() const
get the trusted master public keys
+hash_set< PublicKey > getTrustedMasterKeys() const
get the trusted master public keys
std::atomic< std::size_t > quorum_
-void updatePublisherList(PublicKey const &pubKey, PublisherList const ¤t, std::vector< PublicKey > const &oldList, lock_guard const &)
-void setNegativeUNL(hash_set< PublicKey > const &negUnl)
set the Negative UNL with validators' master public keys
+void updatePublisherList(PublicKey const &pubKey, PublisherList const ¤t, std::vector< PublicKey > const &oldList, lock_guard const &)
+void setNegativeUNL(hash_set< PublicKey > const &negUnl)
set the Negative UNL with validators' master public keys
-static Json::Value buildFileData(std::string const &pubKey, PublisherListCollection const &pubCollection, beast::Journal j)
Build a Json representation of the collection, suitable for writing to a cache file,...
-static void buildBlobInfos(std::map< std::size_t, ValidatorBlobInfo > &blobInfos, PublisherListCollection const &lists)
+static Json::Value buildFileData(std::string const &pubKey, PublisherListCollection const &pubCollection, beast::Journal j)
Build a Json representation of the collection, suitable for writing to a cache file,...
+static void buildBlobInfos(std::map< std::size_t, ValidatorBlobInfo > &blobInfos, PublisherListCollection const &lists)
hash_map< PublicKey, std::size_t > keyListings_
-bool listed(PublicKey const &identity) const
Returns true if public key is included on any lists.
-void cacheValidatorFile(lock_guard const &lock, PublicKey const &pubKey) const
Write a JSON UNL to a cache file.
+bool listed(PublicKey const &identity) const
Returns true if public key is included on any lists.
+std::size_t listThreshold_
+void cacheValidatorFile(lock_guard const &lock, PublicKey const &pubKey) const
Write a JSON UNL to a cache file.
hash_set< PublicKey > trustedMasterKeys_
-std::optional< Json::Value > getAvailable(std::string_view pubKey, std::optional< std::uint32_t > forceVersion={})
Returns the current valid list for the given publisher key, if available, as a Json object.
-PublisherListStats applyList(std::string const &globalManifest, std::optional< std::string > const &localManifest, std::string const &blob, std::string const &signature, std::uint32_t version, std::string siteUri, std::optional< uint256 > const &hash, lock_guard const &)
Apply published list of public keys.
-hash_set< PublicKey > negativeUNL_
-Json::Value getJson() const
Return a JSON representation of the state of the validator list.
-void for_each_available(std::function< void(std::string const &manifest, std::uint32_t version, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, PublicKey const &pubKey, std::size_t maxSequence, uint256 const &hash)> func) const
Invokes the callback once for every available publisher list's raw data members.
-std::optional< TimeKeeper::time_point > expires() const
Return the time when the validator list will expire.
-std::size_t calculateQuorum(std::size_t unlSize, std::size_t effectiveUnlSize, std::size_t seenSize)
Return quorum for trusted validator set.
-PublisherListStats applyListsAndBroadcast(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, NetworkOPs &networkOPs)
Apply multiple published lists of public keys, then broadcast it to all peers that have not seen it o...
+std::optional< Json::Value > getAvailable(std::string_view pubKey, std::optional< std::uint32_t > forceVersion={})
Returns the current valid list for the given publisher key, if available, as a Json object.
+PublisherListStats applyList(std::string const &globalManifest, std::optional< std::string > const &localManifest, std::string const &blob, std::string const &signature, std::uint32_t version, std::string siteUri, std::optional< uint256 > const &hash, lock_guard const &)
Apply published list of public keys.
+hash_set< PublicKey > negativeUNL_
+Json::Value getJson() const
Return a JSON representation of the state of the validator list.
+void for_each_available(std::function< void(std::string const &manifest, std::uint32_t version, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, PublicKey const &pubKey, std::size_t maxSequence, uint256 const &hash)> func) const
Invokes the callback once for every available publisher list's raw data members.
+std::optional< TimeKeeper::time_point > expires() const
Return the time when the validator list will expire.
+std::size_t calculateQuorum(std::size_t unlSize, std::size_t effectiveUnlSize, std::size_t seenSize)
Return quorum for trusted validator set.
+PublisherListStats applyListsAndBroadcast(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, NetworkOPs &networkOPs)
Apply multiple published lists of public keys, then broadcast it to all peers that have not seen it o...
std::lock_guard< decltype(mutex_)> lock_guard
-bool trustedPublisher(PublicKey const &identity) const
Returns true if public key is a trusted publisher.
-std::optional< PublicKey > getListedKey(PublicKey const &identity) const
Returns listed master public if public key is included on any lists.
+bool trustedPublisher(PublicKey const &identity) const
Returns true if public key is a trusted publisher.
+std::optional< PublicKey > getListedKey(PublicKey const &identity) const
Returns listed master public if public key is included on any lists.
boost::filesystem::path const dataPath_
boost::shared_mutex mutex_
-bool removePublisherList(lock_guard const &, PublicKey const &publisherKey, PublisherStatus reason)
Stop trusting publisher's list of keys.
-bool trusted(PublicKey const &identity) const
Returns true if public key is trusted.
-static constexpr std::size_t maxSupportedBlobs
-TrustChanges updateTrusted(hash_set< NodeID > const &seenValidators, NetClock::time_point closeTime, NetworkOPs &ops, Overlay &overlay, HashRouter &hashRouter)
Update trusted nodes.
-std::pair< ListDisposition, std::optional< PublicKey > > verify(lock_guard const &, Json::Value &list, std::string const &manifest, std::string const &blob, std::string const &signature)
Check response for trusted valid published list.
-void for_each_listed(std::function< void(PublicKey const &, bool)> func) const
Invokes the callback once for every listed validation public key.
-std::optional< PublicKey > localPubKey_
-std::vector< std::shared_ptr< STValidation > > negativeUNLFilter(std::vector< std::shared_ptr< STValidation > > &&validations) const
Remove validations that are from validators on the negative UNL.
+bool removePublisherList(lock_guard const &, PublicKey const &publisherKey, PublisherStatus reason)
Stop trusting publisher's list of keys.
+bool trusted(PublicKey const &identity) const
Returns true if public key is trusted.
+static constexpr std::size_t maxSupportedBlobs
+TrustChanges updateTrusted(hash_set< NodeID > const &seenValidators, NetClock::time_point closeTime, NetworkOPs &ops, Overlay &overlay, HashRouter &hashRouter)
Update trusted nodes.
+std::pair< ListDisposition, std::optional< PublicKey > > verify(lock_guard const &, Json::Value &list, std::string const &manifest, std::string const &blob, std::string const &signature)
Check response for trusted valid published list.
+std::size_t getListThreshold() const
get the validator list threshold
+void for_each_listed(std::function< void(PublicKey const &, bool)> func) const
Invokes the callback once for every listed validation public key.
+std::optional< PublicKey > localPubKey_
+std::vector< std::shared_ptr< STValidation > > negativeUNLFilter(std::vector< std::shared_ptr< STValidation > > &&validations) const
Remove validations that are from validators on the negative UNL.
+bool load(std::optional< PublicKey > const &localSigningKey, std::vector< std::string > const &configKeys, std::vector< std::string > const &publisherKeys, std::optional< std::size_t > listThreshold={})
Load configured trusted keys.
std::optional< std::size_t > minimumQuorum_
-static std::vector< ValidatorBlobInfo > parseBlobs(std::uint32_t version, Json::Value const &body)
Pull the blob/signature/manifest information out of the appropriate Json body fields depending on the...
-std::size_t quorum() const
Get quorum value for current trusted key set.
-hash_set< PublicKey > trustedSigningKeys_
+static std::vector< ValidatorBlobInfo > parseBlobs(std::uint32_t version, Json::Value const &body)
Pull the blob/signature/manifest information out of the appropriate Json body fields depending on the...
+std::size_t quorum() const
Get quorum value for current trusted key set.
+hash_set< PublicKey > trustedSigningKeys_
hash_map< PublicKey, PublisherListCollection > publisherLists_
-PublisherListStats applyLists(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, std::optional< uint256 > const &hash={})
Apply multiple published lists of public keys.
-static std::pair< std::size_t, std::size_t > buildValidatorListMessages(std::size_t messageVersion, std::uint64_t peerSequence, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, std::vector< MessageWithHash > &messages, std::size_t maxSize=maximiumMessageSize)
-QuorumKeys getQuorumKeys() const
Get the quorum and all of the trusted keys.
-static const std::string filePrefix_
+PublisherListStats applyLists(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, std::optional< uint256 > const &hash={})
Apply multiple published lists of public keys.
+static std::pair< std::size_t, std::size_t > buildValidatorListMessages(std::size_t messageVersion, std::uint64_t peerSequence, std::size_t maxSequence, std::uint32_t rawVersion, std::string const &rawManifest, std::map< std::size_t, ValidatorBlobInfo > const &blobInfos, std::vector< MessageWithHash > &messages, std::size_t maxSize=maximiumMessageSize)
+QuorumKeys getQuorumKeys() const
Get the quorum and all of the trusted keys.
+static const std::string filePrefix_
std::shared_lock< decltype(mutex_)> shared_lock
ManifestCache & publisherManifests_
-static constexpr std::uint32_t supportedListVersions[]
-hash_set< PublicKey > getNegativeUNL() const
get the master public keys of Negative UNL validators
-friend void hash_append(Hasher &h, PublisherListCollection pl)
+static constexpr std::uint32_t supportedListVersions[]
+hash_set< PublicKey > getNegativeUNL() const
get the master public keys of Negative UNL validators
+friend void hash_append(Hasher &h, PublisherListCollection pl)
@@ -738,7 +748,7 @@ $(function() {
std::enable_if_t< is_contiguously_hashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
-void hash_append(Hasher &h, TMValidatorList const &msg)
+void hash_append(Hasher &h, TMValidatorList const &msg)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void hash_append(Hasher &h, Slice const &v)
@ current
This was a new validation and was added.
@@ -774,11 +784,11 @@ $(function() {
std::optional< std::string > manifest
-
+
MessageWithHash()=default
-
-std::shared_ptr< Message > message
-
+
+std::shared_ptr< Message > message
+
@@ -787,15 +797,15 @@ $(function() {
std::optional< std::size_t > maxSequence
-Describes the result of processing a Validator List (UNL), including some of the information from the...
+Describes the result of processing a Validator List (UNL), including some of the information from the...
void mergeDispositions(PublisherListStats const &src)
ListDisposition bestDisposition() const
PublisherListStats()=default
ListDisposition worstDisposition() const
-std::map< ListDisposition, std::size_t > dispositions
-std::optional< PublicKey > publisherKey
-
-
+std::map< ListDisposition, std::size_t > dispositions
+std::optional< PublicKey > publisherKey
+
+
std::vector< PublicKey > list
@@ -808,7 +818,6 @@ $(function() {
TimeKeeper::time_point validUntil
TimeKeeper::time_point validFrom
std::vector< std::string > manifests
-
diff --git a/ValidatorList__test_8cpp_source.html b/ValidatorList__test_8cpp_source.html
index f28862d810..d5e34dec7e 100644
--- a/ValidatorList__test_8cpp_source.html
+++ b/ValidatorList__test_8cpp_source.html
@@ -504,1996 +504,3734 @@ $(function() {
426 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
427 for (
auto const& key : keys)
428 BEAST_EXPECT(trustedKeys->trustedPublisher(key));
-
-
-
-
-
-
- 435 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 439 app.config().legacy(
"database_path"),
-
-
-
- 443 auto const pubRevokedPublic =
-
-
-
-
-
-
-
- 451 pubRevokedSigning.first,
- 452 pubRevokedSigning.second,
-
-
-
-
-
-
-
- 460 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
-
- 462 BEAST_EXPECT(!trustedKeys->trustedPublisher(pubRevokedPublic));
- 463 BEAST_EXPECT(trustedKeys->trustedPublisher(legitKey));
-
-
-
-
-
-
-
- 471 using namespace std::chrono_literals;
-
-
-
- 475 auto checkAvailable =
-
- 477 auto const& trustedKeys,
- 478 auto const& hexPublic,
-
-
-
-
- 483 const auto available = trustedKeys->getAvailable(hexPublic);
-
-
-
-
-
- 489 BEAST_EXPECT(a[jss::public_key] == hexPublic);
- 490 BEAST_EXPECT(a[jss::manifest] ==
manifest);
-
-
- 493 BEAST_EXPECT(a[jss::version] == version);
-
-
- 496 BEAST_EXPECT(expected.size() == 1);
- 497 BEAST_EXPECT(a[jss::blob] == expected[0].first);
- 498 BEAST_EXPECT(a[jss::signature] == expected[0].second);
- 499 BEAST_EXPECT(!a.isMember(jss::blobs_v2));
-
- 501 else if (BEAST_EXPECT(a.isMember(jss::blobs_v2)))
-
- 503 BEAST_EXPECT(!a.isMember(jss::blob));
- 504 BEAST_EXPECT(!a.isMember(jss::signature));
- 505 auto const& blobs_v2 = a[jss::blobs_v2];
-
- 507 blobs_v2.isArray() &&
- 508 blobs_v2.size() == expected.size());
-
- 510 for (
unsigned int i = 0; i < expected.size(); ++i)
-
-
- 513 blobs_v2[i][jss::blob] == expected[i].first);
-
- 515 blobs_v2[i][jss::signature] ==
-
-
-
-
-
-
-
-
- 524 auto& app = env.
app();
- 525 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 529 app.config().legacy(
"database_path"),
-
-
-
-
- 534 for (
auto const& val : list)
-
- 536 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
- 537 BEAST_EXPECT(trustedKeys->listed(val.signingPublic));
-
-
-
- 541 auto expectUntrusted =
-
- 543 for (
auto const& val : list)
-
- 545 BEAST_EXPECT(!trustedKeys->listed(val.masterPublic));
- 546 BEAST_EXPECT(!trustedKeys->listed(val.signingPublic));
-
-
-
-
- 551 auto const publisherPublic =
-
- 553 const auto hexPublic =
- 554 strHex(publisherPublic.begin(), publisherPublic.end());
-
-
-
-
- 559 pubSigningKeys1.first,
- 560 pubSigningKeys1.second,
-
-
-
-
-
- 566 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgKeys1));
-
-
- 569 auto constexpr listSize = 20;
- 570 auto constexpr numLists = 9;
-
-
- 573 for (
auto i = 1; i <= numLists; ++i)
-
- 575 auto& list = lists[i];
- 576 list.reserve(listSize);
- 577 while (list.size() < listSize)
-
-
-
-
-
-
-
- 585 auto const version = 1;
- 586 auto const sequence1 = 1;
-
-
-
-
- 591 auto const expiredSig =
signList(expiredblob, pubSigningKeys1);
-
-
- 594 auto const sequence2 = 2;
-
-
- 597 auto const sig2 =
signList(blob2, pubSigningKeys1);
-
-
- 600 trustedKeys->applyLists(
-
-
- 603 {{expiredblob, expiredSig, {}}, {blob2, sig2, {}}},
-
-
-
-
-
- 609 expectTrusted(lists.at(2));
-
-
- 612 trustedKeys, hexPublic, manifest1, version, {{blob2, sig2}});
-
-
- 615 auto const version2 = 2;
- 616 auto const sequence7 = 7;
- 617 auto const effective7 = validUntil - 60s;
- 618 auto const expiration7 = effective7 + 3600s;
- 619 auto const blob7 = makeList(
-
-
- 622 expiration7.time_since_epoch().count(),
- 623 effective7.time_since_epoch().count());
- 624 auto const sig7 = signList(blob7, pubSigningKeys1);
-
- 626 auto const sequence8 = 8;
- 627 auto const effective8 = expiration7 - 60s;
- 628 auto const expiration8 = effective8 + 3600s;
- 629 auto const blob8 = makeList(
-
-
- 632 expiration8.time_since_epoch().count(),
- 633 effective8.time_since_epoch().count());
- 634 auto const sig8 = signList(blob8, pubSigningKeys1);
-
-
- 637 trustedKeys->applyLists(
-
-
- 640 {{blob7, sig7, {}}, {blob8, sig8, {}}},
-
-
- 643 ListDisposition::pending,
- 644 ListDisposition::pending);
-
- 646 expectUntrusted(lists.at(7));
- 647 expectUntrusted(lists.at(8));
-
-
- 650 auto const sequence6 = 6;
- 651 auto const effective6 = effective7 - 60s;
- 652 auto const expiration6 = effective6 + 3600s;
- 653 auto const blob6 = makeList(
-
-
- 656 expiration6.time_since_epoch().count(),
- 657 effective6.time_since_epoch().count());
- 658 auto const sig6 = signList(blob6, pubSigningKeys1);
-
-
- 661 auto const sequence6a = 5;
- 662 auto const effective6a = effective6 + 60s;
- 663 auto const expiration6a = effective6a + 3600s;
- 664 auto const blob6a = makeList(
-
-
- 667 expiration6a.time_since_epoch().count(),
- 668 effective6a.time_since_epoch().count());
- 669 auto const sig6a = signList(blob6a, pubSigningKeys1);
-
-
- 672 trustedKeys->applyLists(
-
-
- 675 {{blob6a, sig6a, {}}, {blob6, sig6, {}}},
-
-
- 678 ListDisposition::pending,
- 679 ListDisposition::pending);
-
- 681 expectUntrusted(lists.at(6));
- 682 expectTrusted(lists.at(2));
-
-
-
-
- 687 trustedKeys->applyLists(
-
-
- 690 {{blob7, sig7, {}}, {blob6, sig6, {}}},
-
-
- 693 ListDisposition::known_sequence,
- 694 ListDisposition::known_sequence);
-
- 696 expectUntrusted(lists.at(6));
- 697 expectUntrusted(lists.at(7));
- 698 expectTrusted(lists.at(2));
-
-
- 701 auto const untrustedManifest =
base64_encode(makeManifestString(
-
-
- 704 pubSigningKeys1.first,
- 705 pubSigningKeys1.second,
-
-
-
- 709 trustedKeys->applyLists(
- 710 untrustedManifest, version, {{blob2, sig2, {}}}, siteUri),
+
+ 430 trustedKeys->getListThreshold() == keys.size() / 2 + 1);
+
+
+
+ 434 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 438 app.config().legacy(
"database_path"),
+
+
+
+
+
+
+
+
+ 447 for (
auto const& key : keys)
+
+
+
+ 451 BEAST_EXPECT(trustedKeys->load(
+
+ 453 for (
auto const& key : keys)
+ 454 BEAST_EXPECT(trustedKeys->trustedPublisher(key));
+ 455 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+
+
+
+
+
+
+ 462 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 466 app.config().legacy(
"database_path"),
+
+
+
+ 470 auto const pubRevokedPublic =
+
+
+
+
+
+
+
+ 478 pubRevokedSigning.first,
+ 479 pubRevokedSigning.second,
+
+
+
+
+
+
+
+
+ 488 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
+
+ 490 BEAST_EXPECT(!trustedKeys->trustedPublisher(pubRevokedPublic));
+ 491 BEAST_EXPECT(trustedKeys->trustedPublisher(legitKey1));
+ 492 BEAST_EXPECT(trustedKeys->trustedPublisher(legitKey2));
+
+ 494 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+
+
+
+
+
+
+ 501 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 505 app.config().legacy(
"database_path"),
+
+
+
+ 509 auto const pubRevokedPublic =
+
+
+
+
+
+
+
+ 517 pubRevokedSigning.first,
+ 518 pubRevokedSigning.second,
+
+
+
+
+
+
+
+ 526 BEAST_EXPECT(trustedKeys->load(
+
+
+ 529 BEAST_EXPECT(!trustedKeys->trustedPublisher(pubRevokedPublic));
+ 530 BEAST_EXPECT(trustedKeys->trustedPublisher(legitKey));
+
+ 532 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+
+
+
+
+
+
+
+ 540 using namespace std::chrono_literals;
+
+
+
+ 544 auto checkAvailable =
+
+ 546 auto const& trustedKeys,
+ 547 auto const& hexPublic,
+
+
+
+
+ 552 const auto available = trustedKeys->getAvailable(hexPublic);
+
+
+
+
+
+ 558 BEAST_EXPECT(a[jss::public_key] == hexPublic);
+ 559 BEAST_EXPECT(a[jss::manifest] ==
manifest);
+
+
+ 562 BEAST_EXPECT(a[jss::version] == version);
+
+
+ 565 BEAST_EXPECT(expected.size() == 1);
+ 566 BEAST_EXPECT(a[jss::blob] == expected[0].first);
+ 567 BEAST_EXPECT(a[jss::signature] == expected[0].second);
+ 568 BEAST_EXPECT(!a.isMember(jss::blobs_v2));
+
+ 570 else if (BEAST_EXPECT(a.isMember(jss::blobs_v2)))
+
+ 572 BEAST_EXPECT(!a.isMember(jss::blob));
+ 573 BEAST_EXPECT(!a.isMember(jss::signature));
+ 574 auto const& blobs_v2 = a[jss::blobs_v2];
+
+ 576 blobs_v2.isArray() &&
+ 577 blobs_v2.size() == expected.size());
+
+ 579 for (
unsigned int i = 0; i < expected.size(); ++i)
+
+
+ 582 blobs_v2[i][jss::blob] == expected[i].first);
+
+ 584 blobs_v2[i][jss::signature] ==
+
+
+
+
+
+
+
+
+ 593 auto& app = env.
app();
+ 594 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 598 app.config().legacy(
"database_path"),
+
+
+
+
+ 603 for (
auto const& val : list)
+
+ 605 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 606 BEAST_EXPECT(trustedKeys->listed(val.signingPublic));
+
+
+
+ 610 auto expectUntrusted =
+
+ 612 for (
auto const& val : list)
+
+ 614 BEAST_EXPECT(!trustedKeys->listed(val.masterPublic));
+ 615 BEAST_EXPECT(!trustedKeys->listed(val.signingPublic));
+
+
+
+
+ 620 auto const publisherPublic =
+
+ 622 const auto hexPublic =
+ 623 strHex(publisherPublic.begin(), publisherPublic.end());
+
+
+
+
+ 628 pubSigningKeys1.first,
+ 629 pubSigningKeys1.second,
+
+
+
+
+
+ 635 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgKeys1));
+
+
+ 638 auto constexpr listSize = 20;
+ 639 auto constexpr numLists = 9;
+
+
+ 642 for (
auto i = 1; i <= numLists; ++i)
+
+ 644 auto& list = lists[i];
+ 645 list.reserve(listSize);
+ 646 while (list.size() < listSize)
+
+
+
+
+
+
+
+ 654 auto const version = 1;
+ 655 auto const sequence1 = 1;
+
+
+
+
+ 660 auto const expiredSig =
signList(expiredblob, pubSigningKeys1);
+
+
+ 663 auto const sequence2 = 2;
+
+
+ 666 auto const sig2 =
signList(blob2, pubSigningKeys1);
+
+
+ 669 trustedKeys->applyLists(
+
+
+ 672 {{expiredblob, expiredSig, {}}, {blob2, sig2, {}}},
+
+
+
+
+
+ 678 expectTrusted(lists.at(2));
+
+
+ 681 trustedKeys, hexPublic, manifest1, version, {{blob2, sig2}});
+
+
+ 684 auto const version2 = 2;
+ 685 auto const sequence7 = 7;
+ 686 auto const effective7 = validUntil - 60s;
+ 687 auto const expiration7 = effective7 + 3600s;
+ 688 auto const blob7 = makeList(
+
+
+ 691 expiration7.time_since_epoch().count(),
+ 692 effective7.time_since_epoch().count());
+ 693 auto const sig7 = signList(blob7, pubSigningKeys1);
+
+ 695 auto const sequence8 = 8;
+ 696 auto const effective8 = expiration7 - 60s;
+ 697 auto const expiration8 = effective8 + 3600s;
+ 698 auto const blob8 = makeList(
+
+
+ 701 expiration8.time_since_epoch().count(),
+ 702 effective8.time_since_epoch().count());
+ 703 auto const sig8 = signList(blob8, pubSigningKeys1);
+
+
+ 706 trustedKeys->applyLists(
+
+
+ 709 {{blob7, sig7, {}}, {blob8, sig8, {}}},
+
- 712 ListDisposition::untrusted,
- 713 ListDisposition::untrusted);
+ 712 ListDisposition::pending,
+ 713 ListDisposition::pending);
-
- 716 auto const badVersion = 666;
-
- 718 trustedKeys->applyLists(
- 719 manifest1, badVersion, {{blob2, sig2, {}}}, siteUri),
-
- 721 ListDisposition::unsupported_version,
- 722 ListDisposition::unsupported_version);
-
-
- 725 auto const sequence3 = 3;
- 726 auto const blob3 = makeList(
- 727 lists.at(3), sequence3, validUntil.time_since_epoch().count());
- 728 auto const sig3 = signList(blob3, pubSigningKeys1);
-
-
- 731 trustedKeys->applyLists(
- 732 manifest1, version, {{blob3, sig3, {}}}, siteUri),
-
- 734 ListDisposition::accepted,
- 735 ListDisposition::accepted);
-
- 737 expectUntrusted(lists.at(1));
- 738 expectUntrusted(lists.at(2));
- 739 expectTrusted(lists.at(3));
-
-
-
-
-
-
-
-
- 748 {{blob3, sig3}, {blob6, sig6}, {blob7, sig7}, {blob8, sig8}});
+ 715 expectUntrusted(lists.at(7));
+ 716 expectUntrusted(lists.at(8));
+
+
+ 719 auto const sequence6 = 6;
+ 720 auto const effective6 = effective7 - 60s;
+ 721 auto const expiration6 = effective6 + 3600s;
+ 722 auto const blob6 = makeList(
+
+
+ 725 expiration6.time_since_epoch().count(),
+ 726 effective6.time_since_epoch().count());
+ 727 auto const sig6 = signList(blob6, pubSigningKeys1);
+
+
+ 730 auto const sequence6a = 5;
+ 731 auto const effective6a = effective6 + 60s;
+ 732 auto const expiration6a = effective6a + 3600s;
+ 733 auto const blob6a = makeList(
+
+
+ 736 expiration6a.time_since_epoch().count(),
+ 737 effective6a.time_since_epoch().count());
+ 738 auto const sig6a = signList(blob6a, pubSigningKeys1);
+
+
+ 741 trustedKeys->applyLists(
+
+
+ 744 {{blob6a, sig6a, {}}, {blob6, sig6, {}}},
+
+
+ 747 ListDisposition::pending,
+ 748 ListDisposition::pending);
-
-
- 752 trustedKeys->applyLists(
-
-
- 755 {{blob2, sig2, {}}, {blob3, sig3, {}}},
-
-
- 758 ListDisposition::stale,
- 759 ListDisposition::same_sequence);
-
-
-
- 763 auto const pubSigningKeys2 =
randomKeyPair(KeyType::secp256k1);
-
-
-
- 767 pubSigningKeys2.first,
- 768 pubSigningKeys2.second,
-
-
- 771 auto const sequence4 = 4;
- 772 auto const blob4 = makeList(
- 773 lists.at(4), sequence4, validUntil.time_since_epoch().count());
- 774 auto const sig4 = signList(blob4, pubSigningKeys2);
-
-
- 777 trustedKeys->applyLists(
-
-
- 780 {{blob2, sig2, manifest1},
- 781 {blob3, sig3, manifest1},
-
-
-
- 785 ListDisposition::stale,
- 786 ListDisposition::accepted);
-
- 788 expectUntrusted(lists.at(2));
- 789 expectUntrusted(lists.at(3));
- 790 expectTrusted(lists.at(4));
-
-
-
-
-
-
- 797 {{blob4, sig4}, {blob6, sig6}, {blob7, sig7}, {blob8, sig8}});
+ 750 expectUntrusted(lists.at(6));
+ 751 expectTrusted(lists.at(2));
+
+
+
+
+ 756 trustedKeys->applyLists(
+
+
+ 759 {{blob7, sig7, {}}, {blob6, sig6, {}}},
+
+
+ 762 ListDisposition::known_sequence,
+ 763 ListDisposition::known_sequence);
+
+ 765 expectUntrusted(lists.at(6));
+ 766 expectUntrusted(lists.at(7));
+ 767 expectTrusted(lists.at(2));
+
+
+ 770 auto const untrustedManifest =
base64_encode(makeManifestString(
+
+
+ 773 pubSigningKeys1.first,
+ 774 pubSigningKeys1.second,
+
+
+
+ 778 trustedKeys->applyLists(
+ 779 untrustedManifest, version, {{blob2, sig2, {}}}, siteUri),
+
+ 781 ListDisposition::untrusted,
+ 782 ListDisposition::untrusted);
+
+
+ 785 auto const badVersion = 666;
+
+ 787 trustedKeys->applyLists(
+ 788 manifest1, badVersion, {{blob2, sig2, {}}}, siteUri),
+
+ 790 ListDisposition::unsupported_version,
+ 791 ListDisposition::unsupported_version);
+
+
+ 794 auto const sequence3 = 3;
+ 795 auto const blob3 = makeList(
+ 796 lists.at(3), sequence3, validUntil.time_since_epoch().count());
+ 797 auto const sig3 = signList(blob3, pubSigningKeys1);
- 799 auto const sequence5 = 5;
- 800 auto const blob5 = makeList(
- 801 lists.at(5), sequence5, validUntil.time_since_epoch().count());
- 802 auto const badSig = signList(blob5, pubSigningKeys1);
-
- 804 trustedKeys->applyLists(
- 805 manifest1, version, {{blob5, badSig, {}}}, siteUri),
-
- 807 ListDisposition::invalid,
- 808 ListDisposition::invalid);
+
+ 800 trustedKeys->applyLists(
+ 801 manifest1, version, {{blob3, sig3, {}}}, siteUri),
+
+ 803 ListDisposition::accepted,
+ 804 ListDisposition::accepted);
+
+ 806 expectUntrusted(lists.at(1));
+ 807 expectUntrusted(lists.at(2));
+ 808 expectTrusted(lists.at(3));
- 810 expectUntrusted(lists.at(2));
- 811 expectUntrusted(lists.at(3));
- 812 expectTrusted(lists.at(4));
- 813 expectUntrusted(lists.at(5));
-
-
-
- 817 trustedKeys->applyLists(
-
-
- 820 {{blob7, sig7, {}}, {blob8, sig8, {}}},
-
-
- 823 ListDisposition::invalid,
- 824 ListDisposition::invalid);
-
- 826 expectTrusted(lists.at(4));
- 827 expectUntrusted(lists.at(7));
- 828 expectUntrusted(lists.at(8));
+
+
+
+
+
+
+
+ 817 {{blob3, sig3}, {blob6, sig6}, {blob7, sig7}, {blob8, sig8}});
+
+
+
+ 821 trustedKeys->applyLists(
+
+
+ 824 {{blob2, sig2, {}}, {blob3, sig3, {}}},
+
+
+ 827 ListDisposition::stale,
+ 828 ListDisposition::same_sequence);
-
-
-
- 833 trustedKeys->updateTrusted(
-
-
-
-
- 838 env.app().getHashRouter());
+
+
+ 832 auto const pubSigningKeys2 =
randomKeyPair(KeyType::secp256k1);
+
+
+
+ 836 pubSigningKeys2.first,
+ 837 pubSigningKeys2.second,
+
- 840 expectUntrusted(lists.at(3));
- 841 expectTrusted(lists.at(6));
-
-
-
-
-
-
- 848 {{blob6, sig6}, {blob7, sig7}, {blob8, sig8}});
-
-
-
-
-
- 854 env.timeKeeper().set(effective8);
- 855 trustedKeys->updateTrusted(
-
-
-
-
- 860 env.app().getHashRouter());
-
- 862 expectUntrusted(lists.at(6));
- 863 expectUntrusted(lists.at(7));
- 864 expectTrusted(lists.at(8));
-
- 866 checkAvailable(trustedKeys, hexPublic, manifest2, 2, {{blob8, sig8}});
+ 840 auto const sequence4 = 4;
+ 841 auto const blob4 = makeList(
+ 842 lists.at(4), sequence4, validUntil.time_since_epoch().count());
+ 843 auto const sig4 = signList(blob4, pubSigningKeys2);
+
+
+ 846 trustedKeys->applyLists(
+
+
+ 849 {{blob2, sig2, manifest1},
+ 850 {blob3, sig3, manifest1},
+
+
+
+ 854 ListDisposition::stale,
+ 855 ListDisposition::accepted);
+
+ 857 expectUntrusted(lists.at(2));
+ 858 expectUntrusted(lists.at(3));
+ 859 expectTrusted(lists.at(4));
+
+
+
+
+
+
+ 866 {{blob4, sig4}, {blob6, sig6}, {blob7, sig7}, {blob8, sig8}});
-
-
-
-
- 872 auto const sig8_2 = signList(blob8, pubSigningKeys2);
-
-
- 875 trustedKeys->applyLists(
-
-
- 878 {{blob8, sig8, manifest1}, {blob8, sig8_2, {}}},
-
-
- 881 ListDisposition::invalid,
- 882 ListDisposition::same_sequence);
+ 868 auto const sequence5 = 5;
+ 869 auto const blob5 = makeList(
+ 870 lists.at(5), sequence5, validUntil.time_since_epoch().count());
+ 871 auto const badSig = signList(blob5, pubSigningKeys1);
+
+ 873 trustedKeys->applyLists(
+ 874 manifest1, version, {{blob5, badSig, {}}}, siteUri),
+
+ 876 ListDisposition::invalid,
+ 877 ListDisposition::invalid);
+
+ 879 expectUntrusted(lists.at(2));
+ 880 expectUntrusted(lists.at(3));
+ 881 expectTrusted(lists.at(4));
+ 882 expectUntrusted(lists.at(5));
- 884 expectTrusted(lists.at(8));
-
- 886 checkAvailable(trustedKeys, hexPublic, manifest2, 2, {{blob8, sig8}});
-
-
-
- 890 auto const signingKeysMax =
randomKeyPair(KeyType::secp256k1);
-
- 892 makeRevocationString(publisherPublic, publisherSecret));
-
- 894 auto const sequence9 = 9;
- 895 auto const blob9 = makeList(
- 896 lists.at(9), sequence9, validUntil.time_since_epoch().count());
- 897 auto const sig9 = signList(blob9, signingKeysMax);
+
+
+ 886 trustedKeys->applyLists(
+
+
+ 889 {{blob7, sig7, {}}, {blob8, sig8, {}}},
+
+
+ 892 ListDisposition::invalid,
+ 893 ListDisposition::invalid);
+
+ 895 expectTrusted(lists.at(4));
+ 896 expectUntrusted(lists.at(7));
+ 897 expectUntrusted(lists.at(8));
-
- 900 trustedKeys->applyLists(
- 901 maxManifest, version, {{blob9, sig9, {}}}, siteUri),
-
- 903 ListDisposition::untrusted,
- 904 ListDisposition::untrusted);
-
- 906 BEAST_EXPECT(!trustedKeys->trustedPublisher(publisherPublic));
- 907 for (
auto const& [num, list] : lists)
-
-
- 910 expectUntrusted(list);
-
-
- 913 checkAvailable(trustedKeys, hexPublic, manifest2, 0, {});
-
-
-
-
-
- 919 testcase(
"GetAvailable");
- 920 using namespace std::chrono_literals;
-
-
-
-
-
- 926 auto& app = env.
app();
- 927 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 931 app.config().legacy(
"database_path"),
-
-
-
- 935 auto const publisherPublic =
-
- 937 const auto hexPublic =
- 938 strHex(publisherPublic.begin(), publisherPublic.end());
- 939 auto const pubSigningKeys1 =
randomKeyPair(KeyType::secp256k1);
-
-
-
- 943 pubSigningKeys1.first,
- 944 pubSigningKeys1.second,
-
-
-
-
-
- 950 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgKeys1));
-
-
- 953 auto constexpr listSize = 20;
-
-
- 956 while (list.
size() < listSize)
-
-
-
-
-
-
-
-
-
- 966 auto const sig = signList(blob, pubSigningKeys1);
+
+
+
+ 902 trustedKeys->updateTrusted(
+
+
+
+
+ 907 env.app().getHashRouter());
+
+ 909 expectUntrusted(lists.at(3));
+ 910 expectTrusted(lists.at(6));
+
+
+
+
+
+
+ 917 {{blob6, sig6}, {blob7, sig7}, {blob8, sig8}});
+
+
+
+
+
+ 923 env.timeKeeper().set(effective8);
+ 924 trustedKeys->updateTrusted(
+
+
+
+
+ 929 env.app().getHashRouter());
+
+ 931 expectUntrusted(lists.at(6));
+ 932 expectUntrusted(lists.at(7));
+ 933 expectTrusted(lists.at(8));
+
+ 935 checkAvailable(trustedKeys, hexPublic, manifest2, 2, {{blob8, sig8}});
+
+
+
+
+
+ 941 auto const sig8_2 = signList(blob8, pubSigningKeys2);
+
+
+ 944 trustedKeys->applyLists(
+
+
+ 947 {{blob8, sig8, manifest1}, {blob8, sig8_2, {}}},
+
+
+ 950 ListDisposition::invalid,
+ 951 ListDisposition::same_sequence);
+
+ 953 expectTrusted(lists.at(8));
+
+ 955 checkAvailable(trustedKeys, hexPublic, manifest2, 2, {{blob8, sig8}});
+
+
+
+ 959 auto const signingKeysMax =
randomKeyPair(KeyType::secp256k1);
+
+ 961 makeRevocationString(publisherPublic, publisherSecret));
+
+ 963 auto const sequence9 = 9;
+ 964 auto const blob9 = makeList(
+ 965 lists.at(9), sequence9, validUntil.time_since_epoch().count());
+ 966 auto const sig9 = signList(blob9, signingKeysMax);
-
-
- 970 auto const available = trustedKeys->getAvailable(hexPublic);
-
-
-
-
- 975 trustedKeys->applyLists(
manifest, 1, {{blob, sig, {}}}, siteUri)
- 976 .bestDisposition() == ListDisposition::accepted);
-
-
-
-
- 981 trustedKeys->getAvailable(hexPublic +
"invalid", 1);
- 982 BEAST_EXPECT(!available);
-
+
+ 969 trustedKeys->applyLists(
+ 970 maxManifest, version, {{blob9, sig9, {}}}, siteUri),
+
+ 972 ListDisposition::untrusted,
+ 973 ListDisposition::untrusted);
+
+ 975 BEAST_EXPECT(!trustedKeys->trustedPublisher(publisherPublic));
+ 976 for (
auto const& [num, list] : lists)
+
+
+ 979 expectUntrusted(list);
+
+
+ 982 checkAvailable(trustedKeys, hexPublic, manifest2, 0, {});
+
-
-
-
-
- 989 const auto hexBad =
strHex(badPublic.begin(), badPublic.end());
+
+
+
+ 988 testcase(
"GetAvailable");
+ 989 using namespace std::chrono_literals;
- 991 auto const available = trustedKeys->getAvailable(hexBad, 1);
- 992 BEAST_EXPECT(!available);
-
-
-
- 996 auto const available = trustedKeys->getAvailable(hexPublic, 0);
- 997 if (BEAST_EXPECT(available))
-
- 999 auto const& a = *available;
-
-
-
-
-
- 1005 auto const available = trustedKeys->getAvailable(hexPublic, 3);
- 1006 if (BEAST_EXPECT(available))
-
-
-
-
-
-
-
- 1014 auto const available = trustedKeys->getAvailable(hexPublic, 1);
- 1015 if (BEAST_EXPECT(available))
-
-
- 1018 BEAST_EXPECT(a[jss::public_key] == hexPublic);
- 1019 BEAST_EXPECT(a[jss::manifest] == manifest);
- 1020 BEAST_EXPECT(a[jss::version] == 1);
-
- 1022 BEAST_EXPECT(a[jss::blob] == blob);
- 1023 BEAST_EXPECT(a[jss::signature] == sig);
- 1024 BEAST_EXPECT(!a.isMember(jss::blobs_v2));
-
-
-
-
-
- 1030 auto const available = trustedKeys->getAvailable(hexPublic, 2);
- 1031 if (BEAST_EXPECT(available))
-
-
- 1034 BEAST_EXPECT(a[jss::public_key] == hexPublic);
- 1035 BEAST_EXPECT(a[jss::manifest] == manifest);
- 1036 BEAST_EXPECT(a[jss::version] == 2);
-
- 1038 if (BEAST_EXPECT(a.isMember(jss::blobs_v2)))
-
- 1040 BEAST_EXPECT(!a.isMember(jss::blob));
- 1041 BEAST_EXPECT(!a.isMember(jss::signature));
- 1042 auto const& blobs_v2 = a[jss::blobs_v2];
- 1043 BEAST_EXPECT(blobs_v2.isArray() && blobs_v2.size() == 1);
-
- 1045 BEAST_EXPECT(blobs_v2[0u][jss::blob] == blob);
- 1046 BEAST_EXPECT(blobs_v2[0u][jss::signature] == sig);
-
-
-
-
-
-
-
-
- 1055 testcase(
"Update trusted");
-
- 1057 std::string const siteUri =
"testUpdateTrusted.test";
-
-
-
- 1061 auto& app = env.
app();
- 1062 auto trustedKeysOuter = std::make_unique<ValidatorList>(
-
-
-
- 1066 app.config().legacy(
"database_path"),
-
-
-
-
-
-
-
-
-
-
-
- 1078 while (cfgKeys.
size() != maxKeys)
-
- 1080 auto const valKey = randomNode();
-
- 1082 if (cfgKeys.
size() <= maxKeys - 5)
-
-
-
-
-
-
- 1089 trustedKeysOuter->load({}, cfgKeys, cfgPublishersOuter));
+
+
+
+
+ 995 auto& app = env.
app();
+ 996 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1000 app.config().legacy(
"database_path"),
+
+
+
+ 1004 auto const publisherPublic =
+
+ 1006 const auto hexPublic =
+ 1007 strHex(publisherPublic.begin(), publisherPublic.end());
+ 1008 auto const pubSigningKeys1 =
randomKeyPair(KeyType::secp256k1);
+
+
+
+ 1012 pubSigningKeys1.first,
+ 1013 pubSigningKeys1.second,
+
+
+
+
+
+ 1019 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgKeys1));
+
+
+ 1022 auto constexpr listSize = 20;
+
+
+ 1025 while (list.
size() < listSize)
+
+
+
+
+
+
+
+
+
+ 1035 auto const sig = signList(blob, pubSigningKeys1);
+
+
+
+ 1039 auto const available = trustedKeys->getAvailable(hexPublic);
+
+
+
+
+ 1044 trustedKeys->applyLists(
manifest, 1, {{blob, sig, {}}}, siteUri)
+ 1045 .bestDisposition() == ListDisposition::accepted);
+
+
+
+
+ 1050 trustedKeys->getAvailable(hexPublic +
"invalid", 1);
+ 1051 BEAST_EXPECT(!available);
+
+
+
+
+
+
+ 1058 const auto hexBad =
strHex(badPublic.begin(), badPublic.end());
+
+ 1060 auto const available = trustedKeys->getAvailable(hexBad, 1);
+ 1061 BEAST_EXPECT(!available);
+
+
+
+ 1065 auto const available = trustedKeys->getAvailable(hexPublic, 0);
+ 1066 if (BEAST_EXPECT(available))
+
+ 1068 auto const& a = *available;
+
+
+
+
+
+ 1074 auto const available = trustedKeys->getAvailable(hexPublic, 3);
+ 1075 if (BEAST_EXPECT(available))
+
+
+
+
+
+
+
+ 1083 auto const available = trustedKeys->getAvailable(hexPublic, 1);
+ 1084 if (BEAST_EXPECT(available))
+
+
+ 1087 BEAST_EXPECT(a[jss::public_key] == hexPublic);
+ 1088 BEAST_EXPECT(a[jss::manifest] == manifest);
+ 1089 BEAST_EXPECT(a[jss::version] == 1);
-
-
- 1093 TrustChanges changes = trustedKeysOuter->updateTrusted(
- 1094 activeValidatorsOuter,
-
-
-
-
-
- 1100 for (
auto const& val : unseenValidators)
- 1101 activeValidatorsOuter.
emplace(val);
-
- 1103 BEAST_EXPECT(changes.
added == activeValidatorsOuter);
- 1104 BEAST_EXPECT(changes.
removed.empty());
-
- 1106 trustedKeysOuter->quorum() ==
std::ceil(cfgKeys.
size() * 0.8f));
- 1107 for (
auto const& val : cfgKeys)
-
- 1109 if (
auto const valKey =
- 1110 parseBase58<PublicKey>(TokenType::NodePublic, val))
-
- 1112 BEAST_EXPECT(trustedKeysOuter->listed(*valKey));
- 1113 BEAST_EXPECT(trustedKeysOuter->trusted(*valKey));
-
-
-
+ 1091 BEAST_EXPECT(a[jss::blob] == blob);
+ 1092 BEAST_EXPECT(a[jss::signature] == sig);
+ 1093 BEAST_EXPECT(!a.isMember(jss::blobs_v2));
+
+
+
+
+
+ 1099 auto const available = trustedKeys->getAvailable(hexPublic, 2);
+ 1100 if (BEAST_EXPECT(available))
+
+
+ 1103 BEAST_EXPECT(a[jss::public_key] == hexPublic);
+ 1104 BEAST_EXPECT(a[jss::manifest] == manifest);
+ 1105 BEAST_EXPECT(a[jss::version] == 2);
+
+ 1107 if (BEAST_EXPECT(a.isMember(jss::blobs_v2)))
+
+ 1109 BEAST_EXPECT(!a.isMember(jss::blob));
+ 1110 BEAST_EXPECT(!a.isMember(jss::signature));
+ 1111 auto const& blobs_v2 = a[jss::blobs_v2];
+ 1112 BEAST_EXPECT(blobs_v2.isArray() && blobs_v2.size() == 1);
+
+ 1114 BEAST_EXPECT(blobs_v2[0u][jss::blob] == blob);
+ 1115 BEAST_EXPECT(blobs_v2[0u][jss::signature] == sig);
+
-
- 1119 changes = trustedKeysOuter->updateTrusted(
- 1120 activeValidatorsOuter,
-
-
-
-
- 1125 BEAST_EXPECT(changes.
added.empty());
- 1126 BEAST_EXPECT(changes.
removed.empty());
-
- 1128 trustedKeysOuter->quorum() ==
std::ceil(cfgKeys.
size() * 0.8f));
-
-
-
-
- 1133 auto const masterPublic =
-
-
-
- 1137 {
toBase58(TokenType::NodePublic, masterPublic)});
-
-
- 1140 trustedKeysOuter->load({}, cfgKeys, cfgPublishersOuter));
-
- 1142 auto const signingKeys1 =
randomKeyPair(KeyType::secp256k1);
- 1143 auto const signingPublic1 = signingKeys1.first;
-
-
-
- 1147 TrustChanges changes = trustedKeysOuter->updateTrusted(
- 1148 activeValidatorsOuter,
-
-
-
-
- 1153 BEAST_EXPECT(changes.
added == asNodeIDs({masterPublic}));
- 1154 BEAST_EXPECT(changes.
removed.empty());
-
- 1156 trustedKeysOuter->quorum() ==
std::ceil((maxKeys + 1) * 0.8f));
- 1157 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
- 1158 BEAST_EXPECT(trustedKeysOuter->trusted(masterPublic));
- 1159 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublic1));
- 1160 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublic1));
-
-
-
-
-
-
- 1167 signingKeys1.second,
-
-
-
-
- 1172 ManifestDisposition::accepted);
- 1173 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
- 1174 BEAST_EXPECT(trustedKeysOuter->trusted(masterPublic));
- 1175 BEAST_EXPECT(trustedKeysOuter->listed(signingPublic1));
- 1176 BEAST_EXPECT(trustedKeysOuter->trusted(signingPublic1));
-
-
-
- 1180 auto const signingKeys2 =
randomKeyPair(KeyType::secp256k1);
- 1181 auto const signingPublic2 = signingKeys2.first;
-
-
-
-
- 1186 signingKeys2.second,
-
-
-
- 1190 ManifestDisposition::accepted);
- 1191 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
- 1192 BEAST_EXPECT(trustedKeysOuter->trusted(masterPublic));
- 1193 BEAST_EXPECT(trustedKeysOuter->listed(signingPublic2));
- 1194 BEAST_EXPECT(trustedKeysOuter->trusted(signingPublic2));
- 1195 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublic1));
- 1196 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublic1));
-
-
- 1199 auto const signingKeysMax =
randomKeyPair(KeyType::secp256k1);
- 1200 auto const signingPublicMax = signingKeysMax.first;
-
-
- 1203 makeRevocationString(masterPublic, masterPrivate));
+
+
+
+
+
+
+ 1124 testcase(
"Update trusted");
+
+ 1126 std::string const siteUri =
"testUpdateTrusted.test";
+
+
+
+ 1130 auto& app = env.
app();
+ 1131 auto trustedKeysOuter = std::make_unique<ValidatorList>(
+
+
+
+ 1135 app.config().legacy(
"database_path"),
+
+
+
+
+
+
+
+
+
+
+
+ 1147 while (cfgKeys.
size() != maxKeys)
+
+ 1149 auto const valKey = randomNode();
+
+ 1151 if (cfgKeys.
size() <= maxKeys - 5)
+
+
+
+
+
+
+ 1158 trustedKeysOuter->load({}, cfgKeys, cfgPublishersOuter));
+
+
+
+ 1162 TrustChanges changes = trustedKeysOuter->updateTrusted(
+ 1163 activeValidatorsOuter,
+
+
+
+
+
+ 1169 for (
auto const& val : unseenValidators)
+ 1170 activeValidatorsOuter.
emplace(val);
+
+ 1172 BEAST_EXPECT(changes.
added == activeValidatorsOuter);
+ 1173 BEAST_EXPECT(changes.
removed.empty());
+
+ 1175 trustedKeysOuter->quorum() ==
std::ceil(cfgKeys.
size() * 0.8f));
+ 1176 for (
auto const& val : cfgKeys)
+
+ 1178 if (
auto const valKey =
+ 1179 parseBase58<PublicKey>(TokenType::NodePublic, val))
+
+ 1181 BEAST_EXPECT(trustedKeysOuter->listed(*valKey));
+ 1182 BEAST_EXPECT(trustedKeysOuter->trusted(*valKey));
+
+
+
+
+
+ 1188 changes = trustedKeysOuter->updateTrusted(
+ 1189 activeValidatorsOuter,
+
+
+
+
+ 1194 BEAST_EXPECT(changes.
added.empty());
+ 1195 BEAST_EXPECT(changes.
removed.empty());
+
+ 1197 trustedKeysOuter->quorum() ==
std::ceil(cfgKeys.
size() * 0.8f));
+
+
+
+
+ 1202 auto const masterPublic =
+
- 1205 BEAST_EXPECT(mMax->revoked());
-
-
- 1208 ManifestDisposition::accepted);
-
- 1210 manifestsOuter.
getSigningKey(masterPublic) == masterPublic);
- 1211 BEAST_EXPECT(manifestsOuter.
revoked(masterPublic));
-
-
- 1214 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
- 1215 BEAST_EXPECT(trustedKeysOuter->trusted(masterPublic));
-
- 1217 changes = trustedKeysOuter->updateTrusted(
- 1218 activeValidatorsOuter,
-
-
-
-
- 1223 BEAST_EXPECT(changes.
removed == asNodeIDs({masterPublic}));
- 1224 BEAST_EXPECT(changes.
added.empty());
-
- 1226 trustedKeysOuter->quorum() ==
std::ceil(maxKeys * 0.8f));
- 1227 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
- 1228 BEAST_EXPECT(!trustedKeysOuter->trusted(masterPublic));
- 1229 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublicMax));
- 1230 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublicMax));
- 1231 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublic2));
- 1232 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublic2));
- 1233 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublic1));
- 1234 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublic1));
-
-
-
-
- 1239 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 1243 app.config().legacy(
"database_path"),
-
-
- 1246 auto const publisherPublic =
-
-
-
-
-
- 1252 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
-
-
- 1255 activeValidatorsOuter,
-
-
-
-
- 1260 BEAST_EXPECT(changes.
removed.empty());
- 1261 BEAST_EXPECT(changes.
added.empty());
-
- 1263 trustedKeys->quorum() ==
-
-
-
-
-
-
- 1270 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 1274 app.config().legacy(
"database_path"),
-
-
-
-
-
-
-
-
-
-
- 1285 while (cfgKeys.
size() < n)
-
- 1287 auto const valKey = randomNode();
-
-
-
-
-
-
-
-
- 1296 BEAST_EXPECT(trustedKeys->load({}, cfgKeys, cfgPublishersOuter));
-
-
-
-
-
-
-
- 1304 BEAST_EXPECT(changes.
removed.empty());
- 1305 BEAST_EXPECT(changes.
added == expectedTrusted);
- 1306 BEAST_EXPECT(trustedKeys->quorum() == minQuorum);
-
-
- 1309 activeValidators.
emplace(toBeSeen);
- 1310 changes = trustedKeys->updateTrusted(
-
-
-
-
-
- 1316 BEAST_EXPECT(changes.
removed.empty());
- 1317 BEAST_EXPECT(changes.
added.empty());
- 1318 BEAST_EXPECT(trustedKeys->quorum() == minQuorum);
-
-
-
- 1322 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 1326 app.config().legacy(
"database_path"),
-
-
-
- 1330 auto const publisherKeys =
randomKeyPair(KeyType::secp256k1);
- 1331 auto const pubSigningKeys =
randomKeyPair(KeyType::secp256k1);
-
- 1333 publisherKeys.first,
- 1334 publisherKeys.second,
- 1335 pubSigningKeys.first,
- 1336 pubSigningKeys.second,
-
-
-
-
- 1341 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgKeys));
-
-
-
- 1345 asNodeIDs({list[0].masterPublic, list[1].masterPublic}));
-
-
- 1348 auto const version = 1;
- 1349 auto const sequence = 1;
- 1350 using namespace std::chrono_literals;
-
-
-
-
- 1355 auto const sig = signList(blob, pubSigningKeys);
-
-
- 1358 ListDisposition::accepted ==
-
- 1360 ->applyLists(
manifest, version, {{blob,
sig, {}}}, siteUri)
- 1361 .bestDisposition());
-
-
-
-
-
-
-
- 1369 BEAST_EXPECT(changes.
removed.empty());
- 1370 BEAST_EXPECT(changes.
added == activeValidators);
-
-
- 1373 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
- 1374 BEAST_EXPECT(trustedKeys->trusted(val.signingPublic));
-
- 1376 BEAST_EXPECT(trustedKeys->quorum() == 2);
-
-
- 1379 changes = trustedKeys->updateTrusted(
-
-
-
-
-
- 1385 BEAST_EXPECT(changes.
removed == activeValidators);
- 1386 BEAST_EXPECT(changes.
added.empty());
- 1387 BEAST_EXPECT(!trustedKeys->trusted(list[0].masterPublic));
- 1388 BEAST_EXPECT(!trustedKeys->trusted(list[1].masterPublic));
-
- 1390 trustedKeys->quorum() ==
-
-
-
-
-
- 1396 auto const sequence2 = 2;
-
-
- 1399 auto const blob2 = makeList(
-
- 1401 auto const sig2 = signList(blob2, pubSigningKeys);
+
+ 1206 {
toBase58(TokenType::NodePublic, masterPublic)});
+
+
+ 1209 trustedKeysOuter->load({}, cfgKeys, cfgPublishersOuter));
+
+ 1211 auto const signingKeys1 =
randomKeyPair(KeyType::secp256k1);
+ 1212 auto const signingPublic1 = signingKeys1.first;
+
+
+
+ 1216 TrustChanges changes = trustedKeysOuter->updateTrusted(
+ 1217 activeValidatorsOuter,
+
+
+
+
+ 1222 BEAST_EXPECT(changes.
added == asNodeIDs({masterPublic}));
+ 1223 BEAST_EXPECT(changes.
removed.empty());
+
+ 1225 trustedKeysOuter->quorum() ==
std::ceil((maxKeys + 1) * 0.8f));
+ 1226 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
+ 1227 BEAST_EXPECT(trustedKeysOuter->trusted(masterPublic));
+ 1228 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublic1));
+ 1229 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublic1));
+
+
+
+
+
+
+ 1236 signingKeys1.second,
+
+
+
+
+ 1241 ManifestDisposition::accepted);
+ 1242 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
+ 1243 BEAST_EXPECT(trustedKeysOuter->trusted(masterPublic));
+ 1244 BEAST_EXPECT(trustedKeysOuter->listed(signingPublic1));
+ 1245 BEAST_EXPECT(trustedKeysOuter->trusted(signingPublic1));
+
+
+
+ 1249 auto const signingKeys2 =
randomKeyPair(KeyType::secp256k1);
+ 1250 auto const signingPublic2 = signingKeys2.first;
+
+
+
+
+ 1255 signingKeys2.second,
+
+
+
+ 1259 ManifestDisposition::accepted);
+ 1260 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
+ 1261 BEAST_EXPECT(trustedKeysOuter->trusted(masterPublic));
+ 1262 BEAST_EXPECT(trustedKeysOuter->listed(signingPublic2));
+ 1263 BEAST_EXPECT(trustedKeysOuter->trusted(signingPublic2));
+ 1264 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublic1));
+ 1265 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublic1));
+
+
+ 1268 auto const signingKeysMax =
randomKeyPair(KeyType::secp256k1);
+ 1269 auto const signingPublicMax = signingKeysMax.first;
+
+
+ 1272 makeRevocationString(masterPublic, masterPrivate));
+
+ 1274 BEAST_EXPECT(mMax->revoked());
+
+
+ 1277 ManifestDisposition::accepted);
+
+ 1279 manifestsOuter.
getSigningKey(masterPublic) == masterPublic);
+ 1280 BEAST_EXPECT(manifestsOuter.
revoked(masterPublic));
+
+
+ 1283 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
+ 1284 BEAST_EXPECT(trustedKeysOuter->trusted(masterPublic));
+
+ 1286 changes = trustedKeysOuter->updateTrusted(
+ 1287 activeValidatorsOuter,
+
+
+
+
+ 1292 BEAST_EXPECT(changes.
removed == asNodeIDs({masterPublic}));
+ 1293 BEAST_EXPECT(changes.
added.empty());
+
+ 1295 trustedKeysOuter->quorum() ==
std::ceil(maxKeys * 0.8f));
+ 1296 BEAST_EXPECT(trustedKeysOuter->listed(masterPublic));
+ 1297 BEAST_EXPECT(!trustedKeysOuter->trusted(masterPublic));
+ 1298 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublicMax));
+ 1299 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublicMax));
+ 1300 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublic2));
+ 1301 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublic2));
+ 1302 BEAST_EXPECT(!trustedKeysOuter->listed(signingPublic1));
+ 1303 BEAST_EXPECT(!trustedKeysOuter->trusted(signingPublic1));
+
+
+
+
+ 1308 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1312 app.config().legacy(
"database_path"),
+
+
+ 1315 auto const publisherPublic =
+
+
+
+
+
+ 1321 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
+
+
+ 1324 activeValidatorsOuter,
+
+
+
+
+ 1329 BEAST_EXPECT(changes.
removed.empty());
+ 1330 BEAST_EXPECT(changes.
added.empty());
+
+ 1332 trustedKeys->quorum() ==
+
+
+
+
+
+ 1338 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1342 app.config().legacy(
"database_path"),
+
+
+ 1345 auto const masterPublic =
+
+
+ 1348 {
toBase58(TokenType::NodePublic, masterPublic)});
+
+
+ 1351 auto const publisher1Public =
+
+
+ 1354 auto const publisher2Public =
+
+
+
+
+
+ 1360 trustedKeys->load({}, cfgKeys, cfgPublishers,
std::size_t(2)));
+
+
+ 1363 activeValidatorsOuter,
+
+
+
+
+ 1368 BEAST_EXPECT(changes.
removed.empty());
+ 1369 BEAST_EXPECT(changes.
added.size() == 1);
+ 1370 BEAST_EXPECT(trustedKeys->listed(masterPublic));
+ 1371 BEAST_EXPECT(trustedKeys->trusted(masterPublic));
+
+
+
+
+
+ 1377 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1381 app.config().legacy(
"database_path"),
+
+
+
+
+
+
+
+
+
+
+ 1392 while (cfgKeys.
size() < n)
+
+ 1394 auto const valKey = randomNode();
+
+
+
+
+
+
+
-
- 1404 ListDisposition::accepted ==
-
-
- 1407 manifest, version, {{blob2, sig2, {}}}, siteUri)
- 1408 .bestDisposition());
-
- 1410 changes = trustedKeys->updateTrusted(
-
-
-
-
-
- 1416 BEAST_EXPECT(changes.
removed.empty());
-
-
- 1419 asNodeIDs({list2[0].masterPublic, list2[1].masterPublic}));
-
-
- 1422 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
- 1423 BEAST_EXPECT(trustedKeys->trusted(val.signingPublic));
-
- 1425 BEAST_EXPECT(!trustedKeys->trusted(list[1].masterPublic));
- 1426 BEAST_EXPECT(!trustedKeys->trusted(list[1].signingPublic));
- 1427 BEAST_EXPECT(trustedKeys->quorum() == 2);
-
-
-
- 1431 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 1435 app.config().legacy(
"database_path"),
-
-
-
-
-
-
-
-
-
-
-
- 1447 auto const valKey = randomNode();
-
-
-
- 1451 BEAST_EXPECT(trustedKeys->load({}, cfgKeys, cfgPublishers));
-
-
-
-
-
-
- 1458 BEAST_EXPECT(changes.
removed.empty());
- 1459 BEAST_EXPECT(changes.
added == asNodeIDs({valKey}));
-
-
- 1462 for (
auto const& key : activeKeys)
- 1463 BEAST_EXPECT(trustedKeys->trusted(key));
-
-
-
-
- 1468 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 1472 app.config().legacy(
"database_path"),
-
-
- 1475 auto const localKey = randomNode();
-
-
-
-
- 1480 toBase58(TokenType::NodePublic, localKey)};
-
-
- 1483 while (cfgKeys.size() < cfgKeys.capacity())
-
- 1485 auto const valKey = randomNode();
- 1486 cfgKeys.push_back(
toBase58(TokenType::NodePublic, valKey));
-
-
-
-
- 1491 trustedKeys->load(localKey, cfgKeys, cfgPublishers));
-
-
-
-
-
-
- 1498 BEAST_EXPECT(changes.
removed.empty());
- 1499 if (cfgKeys.size() > 2)
- 1500 BEAST_EXPECT(changes.
added == asNodeIDs({valKey}));
-
-
- 1503 changes.
added == asNodeIDs({localKey, valKey}));
-
-
- 1506 trustedKeys->quorum() ==
std::ceil(cfgKeys.size() * 0.8f));
-
- 1508 for (
auto const& key : activeKeys)
- 1509 BEAST_EXPECT(trustedKeys->trusted(key));
-
-
-
-
-
- 1515 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 1519 app.config().legacy(
"database_path"),
-
-
-
-
-
-
- 1526 while (valKeys.
size() != maxKeys)
-
-
-
-
+ 1403 BEAST_EXPECT(trustedKeys->load({}, cfgKeys, cfgPublishersOuter));
+
+
+
+
+
+
+
+ 1411 BEAST_EXPECT(changes.
removed.empty());
+ 1412 BEAST_EXPECT(changes.
added == expectedTrusted);
+ 1413 BEAST_EXPECT(trustedKeys->quorum() == minQuorum);
+
+
+ 1416 activeValidators.
emplace(toBeSeen);
+ 1417 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 1423 BEAST_EXPECT(changes.
removed.empty());
+ 1424 BEAST_EXPECT(changes.
added.empty());
+ 1425 BEAST_EXPECT(trustedKeys->quorum() == minQuorum);
+
+
+
+ 1429 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1433 app.config().legacy(
"database_path"),
+
+
+
+ 1437 auto const publisherKeys =
randomKeyPair(KeyType::secp256k1);
+ 1438 auto const pubSigningKeys =
randomKeyPair(KeyType::secp256k1);
+
+ 1440 publisherKeys.first,
+ 1441 publisherKeys.second,
+ 1442 pubSigningKeys.first,
+ 1443 pubSigningKeys.second,
+
+
+
+
+ 1448 BEAST_EXPECT(trustedKeys->load({}, emptyCfgKeys, cfgKeys));
+
+
+
+ 1452 asNodeIDs({list[0].masterPublic, list[1].masterPublic}));
+
+
+ 1455 auto const version = 1;
+ 1456 auto const sequence = 1;
+ 1457 using namespace std::chrono_literals;
+
+
+
+
+ 1462 auto const sig = signList(blob, pubSigningKeys);
+
+
+ 1465 ListDisposition::accepted ==
+
+ 1467 ->applyLists(
manifest, version, {{blob,
sig, {}}}, siteUri)
+ 1468 .bestDisposition());
+
+
+
+
+
+
+
+ 1476 BEAST_EXPECT(changes.
removed.empty());
+ 1477 BEAST_EXPECT(changes.
added == activeValidators);
+
+
+ 1480 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+ 1481 BEAST_EXPECT(trustedKeys->trusted(val.signingPublic));
+
+ 1483 BEAST_EXPECT(trustedKeys->quorum() == 2);
+
+
+ 1486 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 1492 BEAST_EXPECT(changes.
removed == activeValidators);
+ 1493 BEAST_EXPECT(changes.
added.empty());
+ 1494 BEAST_EXPECT(!trustedKeys->trusted(list[0].masterPublic));
+ 1495 BEAST_EXPECT(!trustedKeys->trusted(list[1].masterPublic));
+
+ 1497 trustedKeys->quorum() ==
+
+
+
+
+
+ 1503 auto const sequence2 = 2;
+
+
+ 1506 auto const blob2 = makeList(
+
+ 1508 auto const sig2 = signList(blob2, pubSigningKeys);
+
+
+ 1511 ListDisposition::accepted ==
+
+
+ 1514 manifest, version, {{blob2, sig2, {}}}, siteUri)
+ 1515 .bestDisposition());
+
+ 1517 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 1523 BEAST_EXPECT(changes.
removed.empty());
+
+
+ 1526 asNodeIDs({list2[0].masterPublic, list2[1].masterPublic}));
+
+
+ 1529 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+ 1530 BEAST_EXPECT(trustedKeys->trusted(val.signingPublic));
-
- 1533 auto addPublishedList = [
this,
-
-
-
-
-
- 1539 auto const publisherPublic =
-
- 1541 auto const pubSigningKeys =
randomKeyPair(KeyType::secp256k1);
-
-
-
- 1545 pubSigningKeys.first,
- 1546 pubSigningKeys.second,
-
+ 1532 BEAST_EXPECT(!trustedKeys->trusted(list[1].masterPublic));
+ 1533 BEAST_EXPECT(!trustedKeys->trusted(list[1].signingPublic));
+ 1534 BEAST_EXPECT(trustedKeys->quorum() == 2);
+
+
+
+ 1538 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1542 app.config().legacy(
"database_path"),
+
+
+
+
+
-
- 1550 {
strHex(publisherPublic)});
-
-
-
- 1554 trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
-
- 1556 auto const version = 1;
- 1557 auto const sequence = 1;
- 1558 using namespace std::chrono_literals;
-
-
- 1561 auto const blob = makeList(
-
- 1563 auto const sig = signList(blob, pubSigningKeys);
-
-
- 1566 ListDisposition::accepted ==
-
-
-
- 1570 .bestDisposition());
-
-
-
- 1574 for (
auto i = 0; i < 3; ++i)
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1588 for (
auto const& val : valKeys)
-
- 1590 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
-
-
- 1593 BEAST_EXPECT(changes.
added == added);
- 1594 BEAST_EXPECT(changes.
removed.empty());
-
-
-
-
-
-
- 1601 testcase(
"Expires");
-
-
-
-
- 1606 auto& app = env.
app();
-
- 1608 auto toStr = [](
PublicKey const& publicKey) {
- 1609 return toBase58(TokenType::NodePublic, publicKey);
-
+
+
+
+
+
+ 1554 auto const valKey = randomNode();
+
+
+
+ 1558 BEAST_EXPECT(trustedKeys->load({}, cfgKeys, cfgPublishers));
+
+
+
+
+
+
+ 1565 BEAST_EXPECT(changes.
removed.empty());
+ 1566 BEAST_EXPECT(changes.
added == asNodeIDs({valKey}));
+
+
+ 1569 for (
auto const& key : activeKeys)
+ 1570 BEAST_EXPECT(trustedKeys->trusted(key));
+
+
+
+
+ 1575 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1579 app.config().legacy(
"database_path"),
+
+
+ 1582 auto const localKey = randomNode();
+
+
+
+
+ 1587 toBase58(TokenType::NodePublic, localKey)};
+
+
+ 1590 while (cfgKeys.size() < cfgKeys.capacity())
+
+ 1592 auto const valKey = randomNode();
+ 1593 cfgKeys.push_back(
toBase58(TokenType::NodePublic, valKey));
+
+
+
+
+ 1598 trustedKeys->load(localKey, cfgKeys, cfgPublishers));
+
+
+
+
+
+
+ 1605 BEAST_EXPECT(changes.
removed.empty());
+ 1606 if (cfgKeys.size() > 2)
+ 1607 BEAST_EXPECT(changes.
added == asNodeIDs({valKey}));
+
+
+ 1610 changes.
added == asNodeIDs({localKey, valKey}));
-
-
-
- 1615 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 1619 app.config().legacy(
"database_path"),
-
-
-
- 1623 BEAST_EXPECT(trustedKeys->expires() == std::nullopt);
-
-
- 1626 PublicKey localCfgListed = randomNode();
- 1627 trustedKeys->load({}, {toStr(localCfgListed)}, {});
-
- 1629 trustedKeys->expires() &&
- 1630 trustedKeys->expires().value() == NetClock::time_point::max());
- 1631 BEAST_EXPECT(trustedKeys->listed(localCfgListed));
-
-
-
-
-
- 1637 auto trustedKeys = std::make_unique<ValidatorList>(
-
-
-
- 1641 app.config().legacy(
"database_path"),
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1658 using namespace std::chrono_literals;
- 1659 auto addPublishedList = [
this, &env, &trustedKeys, &validators]() {
-
- 1661 auto const publisherPublic =
-
- 1663 auto const pubSigningKeys =
randomKeyPair(KeyType::secp256k1);
-
-
-
- 1667 pubSigningKeys.first,
- 1668 pubSigningKeys.second,
-
+
+ 1613 trustedKeys->quorum() ==
std::ceil(cfgKeys.size() * 0.8f));
+
+ 1615 for (
auto const& key : activeKeys)
+ 1616 BEAST_EXPECT(trustedKeys->trusted(key));
+
+
+
+
+
+ 1622 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1626 app.config().legacy(
"database_path"),
+
+
+
+
+
+
+ 1633 while (valKeys.
size() != maxKeys)
+
+
+
+
+
+
+
+
+
+ 1643 constexpr static int publishers = 3;
+
+
+ 1646 decltype(valKeys)::const_iterator,
+
+
+
+
+
+
+
+
+ 1655 auto addPublishedList = [&,
this](
int i) {
+
+ 1657 auto const publisherPublic =
+
+ 1659 auto const pubSigningKeys =
randomKeyPair(KeyType::secp256k1);
+
+
+
+ 1663 pubSigningKeys.first,
+ 1664 pubSigningKeys.second,
+
+
+
+ 1668 {
strHex(publisherPublic)});
+
-
- 1672 {
strHex(publisherPublic)});
-
+
+ 1672 BEAST_EXPECT(trustedKeys->load(
+ 1673 {}, emptyCfgKeys, cfgPublishers,
std::size_t(1)));
-
- 1676 trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
-
- 1678 auto const version = 2;
- 1679 auto const sequence1 = 1;
-
-
- 1682 auto const blob1 = makeList(
-
-
-
- 1686 auto const sig1 = signList(blob1, pubSigningKeys);
-
-
-
- 1690 auto const sequence2 = 2;
- 1691 auto const blob2 = makeList(
-
-
-
-
- 1696 auto const sig2 = signList(blob2, pubSigningKeys);
-
- 1698 return PreparedList{
-
-
- 1701 {{blob1, sig1, {}}, {blob2, sig2, {}}},
-
- 1703 {expiration1, expiration2}};
-
+ 1675 auto const version = 1;
+ 1676 auto const sequence = 1;
+ 1677 using namespace std::chrono_literals;
+
+
+
+ 1681 locals[i].first, locals[i].second};
+ 1682 auto const blob = makeList(
+
+ 1684 auto const sig = signList(blob, pubSigningKeys);
+
+
+ 1687 ListDisposition::accepted ==
+
+
+
+ 1691 .bestDisposition());
+
+
+
+ 1695 for (
auto i = 0; i < publishers; ++i)
+ 1696 addPublishedList(i);
+ 1697 BEAST_EXPECT(trustedKeys->getListThreshold() == 1);
+
+
+
+
+
+
+
-
- 1707 PreparedList prep1 = addPublishedList();
-
- 1709 PreparedList prep2 = addPublishedList();
-
-
- 1712 BEAST_EXPECT(trustedKeys->expires() == std::nullopt);
-
-
-
- 1716 trustedKeys->applyLists(
- 1717 prep1.manifest, prep1.version, prep1.blobs, siteUri),
- 1718 prep1.publisherPublic,
- 1719 ListDisposition::pending,
- 1720 ListDisposition::accepted);
-
-
-
- 1724 BEAST_EXPECT(trustedKeys->expires() == std::nullopt);
-
-
-
- 1728 trustedKeys->applyLists(
- 1729 prep2.manifest, prep2.version, prep2.blobs, siteUri),
- 1730 prep2.publisherPublic,
- 1731 ListDisposition::pending,
- 1732 ListDisposition::accepted);
-
-
- 1735 trustedKeys->expires() &&
- 1736 trustedKeys->expires().value() == prep1.expirations.back());
-
-
-
-
-
- 1742 auto changes = trustedKeys->updateTrusted(
-
-
-
-
-
-
- 1749 trustedKeys->expires() &&
- 1750 trustedKeys->expires().value() == prep1.expirations.back());
- 1751 BEAST_EXPECT(!changes.added.empty());
- 1752 BEAST_EXPECT(changes.removed.empty());
-
-
-
-
-
-
- 1759 auto changes = trustedKeys->updateTrusted(
-
-
-
-
-
-
- 1766 trustedKeys->expires() &&
- 1767 trustedKeys->expires().value() == prep1.expirations.back());
- 1768 BEAST_EXPECT(changes.added.empty());
- 1769 BEAST_EXPECT(changes.removed.empty());
-
-
-
-
-
-
-
- 1777 testcase(
"NegativeUNL");
-
-
-
- 1781 auto createValidatorList =
-
-
-
- 1785 auto trustedKeys = std::make_shared<ValidatorList>(
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1799 auto const valKey = randomNode();
-
-
-
- 1803 if (trustedKeys->load({}, cfgKeys, cfgPublishers))
-
- 1805 trustedKeys->updateTrusted(
-
-
-
-
-
- 1811 if (minimumQuorum == trustedKeys->quorum() ||
-
-
-
-
-
+
+
+
+
+ 1710 for (
auto const& val : valKeys)
+
+ 1712 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 1715 BEAST_EXPECT(changes.
added == added);
+ 1716 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+
+ 1721 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1725 app.config().legacy(
"database_path"),
+
+
+
+
+
+
+ 1732 while (valKeys.
size() != maxKeys)
+
+
+
+
+
+
+
+
+
+
+
+ 1744 constexpr static int publishers = 3;
+
+
+ 1747 decltype(valKeys)::const_iterator,
+
+
+
+
+
+
+
+
+ 1756 auto addPublishedList = [&,
this](
+
+
+
+
+ 1761 auto const publisherPublic =
+
+ 1763 auto const pubSigningKeys =
randomKeyPair(KeyType::secp256k1);
+
+
+
+ 1767 pubSigningKeys.first,
+ 1768 pubSigningKeys.second,
+
+
+
+ 1772 {
strHex(publisherPublic)});
+
+
+
+ 1776 trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
+
+ 1778 auto const version = 1;
+ 1779 auto const sequence = 1;
+ 1780 using namespace std::chrono_literals;
+
+
+
+
+
+
+ 1787 validUntil1 = validUntil;
+
+ 1789 validUntil2 = validUntil;
+
+ 1791 locals[i].first, locals[i].second};
+ 1792 auto const blob = makeList(
+
+ 1794 auto const sig = signList(blob, pubSigningKeys);
+
+
+ 1797 ListDisposition::accepted ==
+
+
+
+ 1801 .bestDisposition());
+
+
+
+
+
+ 1807 for (
auto i = 0; i < publishers; ++i)
+ 1808 addPublishedList(i, validUntil1, validUntil2);
+ 1809 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1837 for (
auto us : unlSizes)
-
- 1839 for (
auto np : nUnlPercent)
-
- 1841 auto validators = createValidatorList(us);
- 1842 BEAST_EXPECT(validators);
-
-
-
- 1846 auto unl = validators->getTrustedMasterKeys();
-
- 1848 auto it = unl.
begin();
-
-
-
-
-
- 1854 validators->setNegativeUNL(nUnl);
- 1855 validators->updateTrusted(
-
-
-
-
-
-
- 1862 validators->quorum() ==
-
- 1864 std::max((us - nUnlSize) * 0.8f, us * 0.6f))));
-
-
-
-
+
+ 1819 trustedKeys->quorum() ==
+
+
+ 1822 for (
auto const& val : valKeys)
+ 1823 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+
+
+
+
+ 1828 auto const& val = valKeys[i];
+ 1829 if (i >= 1 && i < maxKeys - 2)
+
+ 1831 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+
+ 1835 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+ 1837 BEAST_EXPECT(changes.
added == added);
+ 1838 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 1842 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+
+
+ 1850 trustedKeys->quorum() ==
+
+
+ 1853 for (
auto const& val : valKeys)
+ 1854 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+
+
+
+
+ 1859 auto const& val = valKeys[i];
+ 1860 if (i >= 2 && i < maxKeys - 4)
+ 1861 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 1864 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+ 1865 if (i >= 1 && i < maxKeys - 2)
+
+
+
-
-
- 1872 auto validators = createValidatorList(60);
- 1873 BEAST_EXPECT(validators);
-
-
-
- 1877 auto unl = validators->getTrustedMasterKeys();
- 1878 BEAST_EXPECT(unl.size() == 60);
-
-
-
-
-
-
- 1885 auto it = unl.
begin();
-
-
-
-
-
- 1891 validators->setNegativeUNL(nUnl);
- 1892 auto nUnl_temp = validators->getNegativeUNL();
- 1893 if (nUnl_temp.size() == nUnl.
size())
-
- 1895 for (
auto& n : nUnl_temp)
-
- 1897 if (nUnl.
find(n) == nUnl.
end())
-
-
- 1900 validators->updateTrusted(
-
-
-
-
-
- 1906 return validators->quorum() == quorum;
-
-
-
- 1910 BEAST_EXPECT(nUnlChange(0, 48));
- 1911 BEAST_EXPECT(nUnlChange(30, 36));
- 1912 BEAST_EXPECT(nUnlChange(18, 36));
- 1913 BEAST_EXPECT(nUnlChange(12, 39));
-
-
-
-
-
- 1919 auto nUnl = validators->getNegativeUNL();
- 1920 BEAST_EXPECT(nUnl.size() == 12);
-
-
-
- 1924 for (
int i = 0; i < 6; ++i)
-
- 1926 Slice s(data.data(), ss);
-
-
-
- 1930 validators->setNegativeUNL(nUnl);
- 1931 validators->updateTrusted(
-
-
-
-
-
- 1937 BEAST_EXPECT(validators->quorum() == 39);
-
-
-
-
+ 1870 BEAST_EXPECT(changes.
added.empty());
+ 1871 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+ 1875 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+
+
+ 1883 trustedKeys->quorum() ==
+
+
+
+
+
+ 1889 auto const& val = valKeys[i];
+ 1890 if (i < maxKeys - 4)
+ 1891 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+
+ 1893 BEAST_EXPECT(!trustedKeys->listed(val.masterPublic));
+
+ 1895 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+ 1896 if (i >= 2 && i < maxKeys - 4)
+
+
+
+ 1900 BEAST_EXPECT(changes.
added.empty());
+ 1901 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+ 1908 testcase(
"Expires");
+
+
+
+
+ 1913 auto& app = env.
app();
+
+ 1915 auto toStr = [](
PublicKey const& publicKey) {
+ 1916 return toBase58(TokenType::NodePublic, publicKey);
+
+
+
+
+
+ 1922 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1926 app.config().legacy(
"database_path"),
+
+
+
+ 1930 BEAST_EXPECT(trustedKeys->expires() == std::nullopt);
+
+
+ 1933 PublicKey localCfgListed = randomNode();
+ 1934 trustedKeys->load({}, {toStr(localCfgListed)}, {});
+
+ 1936 trustedKeys->expires() &&
+ 1937 trustedKeys->expires().value() == NetClock::time_point::max());
+ 1938 BEAST_EXPECT(trustedKeys->listed(localCfgListed));
+
+
+
-
-
-
- 1946 auto validators = createValidatorList(60, 30);
- 1947 BEAST_EXPECT(validators);
-
-
-
-
- 1952 auto it = unl.
begin();
-
-
-
-
-
- 1958 validators->updateTrusted(
-
-
-
-
-
- 1964 BEAST_EXPECT(validators->quorum() == 30);
-
-
-
-
-
-
-
- 1972 validators->setNegativeUNL(nUnl);
- 1973 validators->updateTrusted(
-
-
-
-
-
- 1979 BEAST_EXPECT(validators->quorum() == 30);
-
-
-
-
-
-
-
- 1987 testcase(
"Sha512 hashing");
-
-
-
-
- 1992 std::string const blob =
"This is not really a blob";
- 1993 std::string const signature =
"This is not really a signature";
-
-
-
- 1997 BEAST_EXPECT(!!global);
-
-
- 2000 blobVector[0].blob = blob;
- 2001 blobVector[0].signature = signature;
-
- 2003 BEAST_EXPECT(global !=
sha512Half(signature, blobVector, version));
+
+ 1944 auto trustedKeys = std::make_unique<ValidatorList>(
+
+
+
+ 1948 app.config().legacy(
"database_path"),
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1965 using namespace std::chrono_literals;
+ 1966 auto addPublishedList = [
this, &env, &trustedKeys, &validators]() {
+
+ 1968 auto const publisherPublic =
+
+ 1970 auto const pubSigningKeys =
randomKeyPair(KeyType::secp256k1);
+
+
+
+ 1974 pubSigningKeys.first,
+ 1975 pubSigningKeys.second,
+
+
+
+ 1979 {
strHex(publisherPublic)});
+
+
+
+ 1983 trustedKeys->load({}, emptyCfgKeys, cfgPublishers));
+
+ 1985 auto const version = 2;
+ 1986 auto const sequence1 = 1;
+
+
+ 1989 auto const blob1 = makeList(
+
+
+
+ 1993 auto const sig1 = signList(blob1, pubSigningKeys);
+
+
+
+ 1997 auto const sequence2 = 2;
+ 1998 auto const blob2 = makeList(
+
+
+
+
+ 2003 auto const sig2 = signList(blob2, pubSigningKeys);
-
-
- 2007 {99, blobVector[0]}};
-
- 2009 BEAST_EXPECT(global !=
sha512Half(blob, blobMap, version));
-
-
-
- 2013 protocol::TMValidatorList msg1;
-
- 2015 msg1.set_blob(blob);
- 2016 msg1.set_signature(signature);
- 2017 msg1.set_version(version);
-
- 2019 msg1.set_signature(blob);
-
-
-
-
- 2024 protocol::TMValidatorListCollection msg2;
-
- 2026 msg2.set_version(version);
- 2027 auto& bi = *msg2.add_blobs();
-
- 2029 bi.set_signature(signature);
-
-
-
-
-
-
-
-
-
- 2039 testcase(
"Build and split messages");
-
-
- 2042 auto extractHeader = [
this](
Message& message) {
- 2043 auto const& buffer =
- 2044 message.getBuffer(compression::Compressed::Off);
-
- 2046 boost::beast::multi_buffer buffers;
-
-
- 2049 auto start = buffer.begin();
- 2050 auto end = buffer.end();
-
- 2052 buffers.commit(boost::asio::buffer_copy(
- 2053 buffers.prepare(slice.
size()), boost::asio::buffer(slice)));
-
- 2055 boost::system::error_code ec;
-
- 2057 detail::parseMessageHeader(ec, buffers.data(), buffers.size());
-
-
-
- 2061 auto extractProtocolMessage1 = [
this,
- 2062 &extractHeader](
Message& message) {
- 2063 auto [header, buffers] = extractHeader(message);
- 2064 if (BEAST_EXPECT(header) &&
- 2065 BEAST_EXPECT(header->message_type == protocol::mtVALIDATORLIST))
-
-
- 2068 detail::parseMessageContent<protocol::TMValidatorList>(
- 2069 *header, buffers.data());
-
-
-
-
-
- 2075 auto extractProtocolMessage2 = [
this,
- 2076 &extractHeader](
Message& message) {
- 2077 auto [header, buffers] = extractHeader(message);
- 2078 if (BEAST_EXPECT(header) &&
-
- 2080 header->message_type ==
- 2081 protocol::mtVALIDATORLISTCOLLECTION))
-
- 2083 auto const msg = detail::parseMessageContent<
- 2084 protocol::TMValidatorListCollection>(
- 2085 *header, buffers.data());
-
-
-
-
-
- 2091 auto verifyMessage =
-
-
- 2094 &extractProtocolMessage1,
- 2095 &extractProtocolMessage2](
-
-
- 2098 auto const& blobInfos,
- 2099 auto const& messages,
-
-
- 2102 BEAST_EXPECT(messages.size() == expectedInfo.size());
- 2103 auto msgIter = expectedInfo.begin();
- 2104 for (
auto const& messageWithHash : messages)
-
- 2106 if (!BEAST_EXPECT(msgIter != expectedInfo.end()))
-
- 2108 if (!BEAST_EXPECT(messageWithHash.message))
-
- 2110 auto const& expectedSeqs = msgIter->second;
- 2111 auto seqIter = expectedSeqs.begin();
-
- 2113 messageWithHash.message
- 2114 ->getBuffer(compression::Compressed::Off)
-
-
- 2117 BEAST_EXPECT(size == msgIter->first);
- 2118 if (expectedSeqs.size() == 1)
-
-
- 2121 extractProtocolMessage1(*messageWithHash.message);
- 2122 auto const expectedVersion = 1;
- 2123 if (BEAST_EXPECT(msg))
-
- 2125 BEAST_EXPECT(msg->version() == expectedVersion);
- 2126 if (!BEAST_EXPECT(seqIter != expectedSeqs.end()))
-
- 2128 auto const& expectedBlob = blobInfos.at(*seqIter);
-
- 2130 (*seqIter < manifestCutoff) ==
- 2131 !!expectedBlob.manifest);
- 2132 auto const expectedManifest =
- 2133 *seqIter < manifestCutoff &&
- 2134 expectedBlob.manifest
- 2135 ? *expectedBlob.manifest
-
- 2137 BEAST_EXPECT(msg->manifest() == expectedManifest);
- 2138 BEAST_EXPECT(msg->blob() == expectedBlob.blob);
-
- 2140 msg->signature() == expectedBlob.signature);
-
- 2142 BEAST_EXPECT(seqIter == expectedSeqs.end());
-
-
- 2145 messageWithHash.hash ==
-
-
-
- 2149 expectedBlob.signature,
-
-
-
-
-
-
- 2156 hashingBlobs.
reserve(msgIter->second.size());
-
-
- 2159 extractProtocolMessage2(*messageWithHash.message);
- 2160 if (BEAST_EXPECT(msg))
-
- 2162 BEAST_EXPECT(msg->version() == version);
- 2163 BEAST_EXPECT(msg->manifest() ==
manifest);
- 2164 for (
auto const& blobInfo : msg->blobs())
-
-
- 2167 seqIter != expectedSeqs.end()))
-
- 2169 auto const& expectedBlob =
- 2170 blobInfos.at(*seqIter);
-
-
- 2173 blobInfo.has_manifest() ==
- 2174 !!expectedBlob.manifest);
-
- 2176 blobInfo.has_manifest() ==
- 2177 (*seqIter < manifestCutoff));
-
- 2179 if (*seqIter < manifestCutoff)
-
- 2181 blobInfo.manifest() ==
- 2182 *expectedBlob.manifest);
-
- 2184 blobInfo.blob() == expectedBlob.blob);
-
- 2186 blobInfo.signature() ==
- 2187 expectedBlob.signature);
-
-
- 2190 BEAST_EXPECT(seqIter == expectedSeqs.end());
-
-
- 2193 messageWithHash.hash ==
-
-
-
-
- 2198 BEAST_EXPECT(msgIter == expectedInfo.end());
-
- 2200 auto verifyBuildMessages =
-
-
-
-
- 2205 BEAST_EXPECT(result.
first == expectedSequence);
- 2206 BEAST_EXPECT(result.
second == expectedSize);
-
-
-
-
-
- 2212 auto const blobInfos = [manifestCutoff = manifestCutoff]() {
-
-
- 2215 for (
auto seq : {5, 6, 7, 10, 12})
-
-
-
- 2219 s <<
"This is not a blob with sequence " <<
seq;
-
-
- 2222 s <<
"This is not a signature for sequence " <<
seq;
- 2223 b.signature = s.
str();
- 2224 if (
seq < manifestCutoff)
-
-
-
- 2228 s <<
"This is not manifest " <<
seq;
- 2229 b.manifest = s.
str();
-
-
-
-
- 2234 auto const maxSequence = blobInfos.
rbegin()->first;
- 2235 BEAST_EXPECT(maxSequence == 12);
-
-
-
-
-
-
- 2242 verifyBuildMessages(
- 2243 ValidatorList::buildValidatorListMessages(
- 2244 1, 8, maxSequence, version,
manifest, blobInfos, messages),
-
-
- 2247 BEAST_EXPECT(messages.size() == 0);
+ 2005 return PreparedList{
+
+
+ 2008 {{blob1, sig1, {}}, {blob2, sig2, {}}},
+
+ 2010 {expiration1, expiration2}};
+
+
+
+ 2014 PreparedList prep1 = addPublishedList();
+
+ 2016 PreparedList prep2 = addPublishedList();
+
+
+ 2019 BEAST_EXPECT(trustedKeys->expires() == std::nullopt);
+
+
+
+ 2023 trustedKeys->applyLists(
+ 2024 prep1.manifest, prep1.version, prep1.blobs, siteUri),
+ 2025 prep1.publisherPublic,
+ 2026 ListDisposition::pending,
+ 2027 ListDisposition::accepted);
+
+
+
+ 2031 BEAST_EXPECT(trustedKeys->expires() == std::nullopt);
+
+
+
+ 2035 trustedKeys->applyLists(
+ 2036 prep2.manifest, prep2.version, prep2.blobs, siteUri),
+ 2037 prep2.publisherPublic,
+ 2038 ListDisposition::pending,
+ 2039 ListDisposition::accepted);
+
+
+ 2042 trustedKeys->expires() &&
+ 2043 trustedKeys->expires().value() == prep1.expirations.back());
+
+
+
+
+
+ 2049 auto changes = trustedKeys->updateTrusted(
+
+
+
+
+
+
+ 2056 trustedKeys->expires() &&
+ 2057 trustedKeys->expires().value() == prep1.expirations.back());
+ 2058 BEAST_EXPECT(!changes.added.empty());
+ 2059 BEAST_EXPECT(changes.removed.empty());
+
+
+
+
+
+
+ 2066 auto changes = trustedKeys->updateTrusted(
+
+
+
+
+
+
+ 2073 trustedKeys->expires() &&
+ 2074 trustedKeys->expires().value() == prep1.expirations.back());
+ 2075 BEAST_EXPECT(changes.added.empty());
+ 2076 BEAST_EXPECT(changes.removed.empty());
+
+
+
+
+
+
+
+ 2084 testcase(
"NegativeUNL");
+
+
+
+ 2088 auto createValidatorList =
+
+
+
+ 2092 auto trustedKeys = std::make_shared<ValidatorList>(
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2106 auto const valKey = randomNode();
+
+
+
+ 2110 if (trustedKeys->load({}, cfgKeys, cfgPublishers))
+
+ 2112 trustedKeys->updateTrusted(
+
+
+
+
+
+ 2118 if (minimumQuorum == trustedKeys->quorum() ||
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2144 for (
auto us : unlSizes)
+
+ 2146 for (
auto np : nUnlPercent)
+
+ 2148 auto validators = createValidatorList(us);
+ 2149 BEAST_EXPECT(validators);
+
+
+
+ 2153 auto unl = validators->getTrustedMasterKeys();
+
+ 2155 auto it = unl.
begin();
+
+
+
+
+
+ 2161 validators->setNegativeUNL(nUnl);
+ 2162 validators->updateTrusted(
+
+
+
+
+
+
+ 2169 validators->quorum() ==
+
+ 2171 std::max((us - nUnlSize) * 0.8f, us * 0.6f))));
+
+
+
+
+
+
+
+ 2179 auto validators = createValidatorList(60);
+ 2180 BEAST_EXPECT(validators);
+
+
+
+ 2184 auto unl = validators->getTrustedMasterKeys();
+ 2185 BEAST_EXPECT(unl.size() == 60);
+
+
+
+
+
+
+ 2192 auto it = unl.
begin();
+
+
+
+
+
+ 2198 validators->setNegativeUNL(nUnl);
+ 2199 auto nUnl_temp = validators->getNegativeUNL();
+ 2200 if (nUnl_temp.size() == nUnl.
size())
+
+ 2202 for (
auto& n : nUnl_temp)
+
+ 2204 if (nUnl.
find(n) == nUnl.
end())
+
+
+ 2207 validators->updateTrusted(
+
+
+
+
+
+ 2213 return validators->quorum() == quorum;
+
+
+
+ 2217 BEAST_EXPECT(nUnlChange(0, 48));
+ 2218 BEAST_EXPECT(nUnlChange(30, 36));
+ 2219 BEAST_EXPECT(nUnlChange(18, 36));
+ 2220 BEAST_EXPECT(nUnlChange(12, 39));
+
+
+
+
+
+ 2226 auto nUnl = validators->getNegativeUNL();
+ 2227 BEAST_EXPECT(nUnl.size() == 12);
+
+
+
+ 2231 for (
int i = 0; i < 6; ++i)
+
+ 2233 Slice s(data.data(), ss);
+
+
+
+ 2237 validators->setNegativeUNL(nUnl);
+ 2238 validators->updateTrusted(
+
+
+
+
+
+ 2244 BEAST_EXPECT(validators->quorum() == 39);
+
+
+
-
-
-
-
- 2253 messages.emplace_back();
- 2254 verifyBuildMessages(
- 2255 ValidatorList::buildValidatorListMessages(
- 2256 1, 3, maxSequence, version,
manifest, blobInfos, messages),
-
-
- 2259 BEAST_EXPECT(messages.size() == 1 && !messages.front().message);
-
-
-
- 2263 verifyBuildMessages(
- 2264 ValidatorList::buildValidatorListMessages(
- 2265 1, 3, maxSequence, version,
manifest, blobInfos, messages),
-
-
- 2268 if (BEAST_EXPECT(messages.size() == 1) &&
- 2269 BEAST_EXPECT(messages.front().message))
-
- 2271 auto const& messageWithHash = messages.front();
- 2272 auto const msg = extractProtocolMessage1(*messageWithHash.message);
-
- 2274 messageWithHash.message->getBuffer(compression::Compressed::Off)
-
-
- 2277 BEAST_EXPECT(size == 108);
- 2278 auto const& expected = blobInfos.at(5);
- 2279 if (BEAST_EXPECT(msg))
-
- 2281 BEAST_EXPECT(msg->version() == 1);
- 2282 BEAST_EXPECT(msg->manifest() == *expected.manifest);
- 2283 BEAST_EXPECT(msg->blob() == expected.blob);
- 2284 BEAST_EXPECT(msg->signature() == expected.signature);
-
-
- 2287 messageWithHash.hash ==
-
- 2289 *expected.manifest, expected.blob, expected.signature, 1));
-
-
-
-
-
-
-
- 2297 verifyBuildMessages(
- 2298 ValidatorList::buildValidatorListMessages(
-
-
-
-
-
-
-
-
-
- 2308 BEAST_EXPECT(messages.size() == 0);
-
-
-
-
-
- 2314 messages.emplace_back();
- 2315 verifyBuildMessages(
- 2316 ValidatorList::buildValidatorListMessages(
- 2317 2, 3, maxSequence, version,
manifest, blobInfos, messages),
-
-
- 2320 BEAST_EXPECT(messages.size() == 1 && !messages.front().message);
-
-
-
- 2324 verifyBuildMessages(
- 2325 ValidatorList::buildValidatorListMessages(
- 2326 2, 5, maxSequence, version,
manifest, blobInfos, messages),
-
-
-
- 2330 version,
manifest, blobInfos, messages, {{372, {6, 7, 10, 12}}});
-
-
-
-
-
- 2336 verifyBuildMessages(
- 2337 ValidatorList::buildValidatorListMessages(
- 2338 2, 5, maxSequence, version,
manifest, blobInfos, messages, 300),
-
-
-
-
-
-
-
- 2346 {{212, {6, 7}}, {192, {10, 12}}});
+
+
+
+
+ 2253 auto validators = createValidatorList(60, 30);
+ 2254 BEAST_EXPECT(validators);
+
+
+
+
+ 2259 auto it = unl.
begin();
+
+
+
+
+
+ 2265 validators->updateTrusted(
+
+
+
+
+
+ 2271 BEAST_EXPECT(validators->quorum() == 30);
+
+
+
+
+
+
+
+ 2279 validators->setNegativeUNL(nUnl);
+ 2280 validators->updateTrusted(
+
+
+
+
+
+ 2286 BEAST_EXPECT(validators->quorum() == 30);
+
+
+
+
+
+
+
+ 2294 testcase(
"Sha512 hashing");
+
+
+
+
+ 2299 std::string const blob =
"This is not really a blob";
+ 2300 std::string const signature =
"This is not really a signature";
+
+
+
+ 2304 BEAST_EXPECT(!!global);
+
+
+ 2307 blobVector[0].blob = blob;
+ 2308 blobVector[0].signature = signature;
+
+ 2310 BEAST_EXPECT(global !=
sha512Half(signature, blobVector, version));
+
+
+
+ 2314 {99, blobVector[0]}};
+
+ 2316 BEAST_EXPECT(global !=
sha512Half(blob, blobMap, version));
+
+
+
+ 2320 protocol::TMValidatorList msg1;
+
+ 2322 msg1.set_blob(blob);
+ 2323 msg1.set_signature(signature);
+ 2324 msg1.set_version(version);
+
+ 2326 msg1.set_signature(blob);
+
+
+
+
+ 2331 protocol::TMValidatorListCollection msg2;
+
+ 2333 msg2.set_version(version);
+ 2334 auto& bi = *msg2.add_blobs();
+
+ 2336 bi.set_signature(signature);
+
+
+
+
+
+
+
+
+
+ 2346 testcase(
"Build and split messages");
-
-
-
- 2351 verifyBuildMessages(
- 2352 ValidatorList::buildValidatorListMessages(
- 2353 2, 5, maxSequence, version,
manifest, blobInfos, messages, 200),
-
-
-
-
-
-
-
- 2361 {{108, {6}}, {108, {7}}, {192, {10, 12}}});
-
-
-
- 2365 verifyBuildMessages(
- 2366 ValidatorList::buildValidatorListMessages(
- 2367 2, 5, maxSequence, version,
manifest, blobInfos, messages, 150),
-
-
-
-
-
-
-
- 2375 {{108, {6}}, {108, {7}}, {110, {10}}, {110, {12}}});
-
-
-
-
- 2380 verifyBuildMessages(
- 2381 ValidatorList::buildValidatorListMessages(
- 2382 2, 5, maxSequence, version,
manifest, blobInfos, messages, 108),
-
-
-
-
-
-
-
- 2390 {{108, {6}}, {108, {7}}, {110, {10}}, {110, {12}}});
-
-
-
-
-
-
- 2397 testGenesisQuorum();
-
-
-
- 2401 testUpdateTrusted();
-
-
-
- 2405 testBuildMessages();
-
-
-
-
-
-
-
+
+ 2349 auto extractHeader = [
this](
Message& message) {
+ 2350 auto const& buffer =
+ 2351 message.getBuffer(compression::Compressed::Off);
+
+ 2353 boost::beast::multi_buffer buffers;
+
+
+ 2356 auto start = buffer.begin();
+ 2357 auto end = buffer.end();
+
+ 2359 buffers.commit(boost::asio::buffer_copy(
+ 2360 buffers.prepare(slice.
size()), boost::asio::buffer(slice)));
+
+ 2362 boost::system::error_code ec;
+
+ 2364 detail::parseMessageHeader(ec, buffers.data(), buffers.size());
+
+
+
+ 2368 auto extractProtocolMessage1 = [
this,
+ 2369 &extractHeader](
Message& message) {
+ 2370 auto [header, buffers] = extractHeader(message);
+ 2371 if (BEAST_EXPECT(header) &&
+ 2372 BEAST_EXPECT(header->message_type == protocol::mtVALIDATORLIST))
+
+
+ 2375 detail::parseMessageContent<protocol::TMValidatorList>(
+ 2376 *header, buffers.data());
+
+
+
+
+
+ 2382 auto extractProtocolMessage2 = [
this,
+ 2383 &extractHeader](
Message& message) {
+ 2384 auto [header, buffers] = extractHeader(message);
+ 2385 if (BEAST_EXPECT(header) &&
+
+ 2387 header->message_type ==
+ 2388 protocol::mtVALIDATORLISTCOLLECTION))
+
+ 2390 auto const msg = detail::parseMessageContent<
+ 2391 protocol::TMValidatorListCollection>(
+ 2392 *header, buffers.data());
+
+
+
+
+
+ 2398 auto verifyMessage =
+
+
+ 2401 &extractProtocolMessage1,
+ 2402 &extractProtocolMessage2](
+
+
+ 2405 auto const& blobInfos,
+ 2406 auto const& messages,
+
+
+ 2409 BEAST_EXPECT(messages.size() == expectedInfo.size());
+ 2410 auto msgIter = expectedInfo.begin();
+ 2411 for (
auto const& messageWithHash : messages)
+
+ 2413 if (!BEAST_EXPECT(msgIter != expectedInfo.end()))
+
+ 2415 if (!BEAST_EXPECT(messageWithHash.message))
+
+ 2417 auto const& expectedSeqs = msgIter->second;
+ 2418 auto seqIter = expectedSeqs.begin();
+
+ 2420 messageWithHash.message
+ 2421 ->getBuffer(compression::Compressed::Off)
+
+
+ 2424 BEAST_EXPECT(size == msgIter->first);
+ 2425 if (expectedSeqs.size() == 1)
+
+
+ 2428 extractProtocolMessage1(*messageWithHash.message);
+ 2429 auto const expectedVersion = 1;
+ 2430 if (BEAST_EXPECT(msg))
+
+ 2432 BEAST_EXPECT(msg->version() == expectedVersion);
+ 2433 if (!BEAST_EXPECT(seqIter != expectedSeqs.end()))
+
+ 2435 auto const& expectedBlob = blobInfos.at(*seqIter);
+
+ 2437 (*seqIter < manifestCutoff) ==
+ 2438 !!expectedBlob.manifest);
+ 2439 auto const expectedManifest =
+ 2440 *seqIter < manifestCutoff &&
+ 2441 expectedBlob.manifest
+ 2442 ? *expectedBlob.manifest
+
+ 2444 BEAST_EXPECT(msg->manifest() == expectedManifest);
+ 2445 BEAST_EXPECT(msg->blob() == expectedBlob.blob);
+
+ 2447 msg->signature() == expectedBlob.signature);
+
+ 2449 BEAST_EXPECT(seqIter == expectedSeqs.end());
+
+
+ 2452 messageWithHash.hash ==
+
+
+
+ 2456 expectedBlob.signature,
+
+
+
+
+
+
+ 2463 hashingBlobs.
reserve(msgIter->second.size());
+
+
+ 2466 extractProtocolMessage2(*messageWithHash.message);
+ 2467 if (BEAST_EXPECT(msg))
+
+ 2469 BEAST_EXPECT(msg->version() == version);
+ 2470 BEAST_EXPECT(msg->manifest() ==
manifest);
+ 2471 for (
auto const& blobInfo : msg->blobs())
+
+
+ 2474 seqIter != expectedSeqs.end()))
+
+ 2476 auto const& expectedBlob =
+ 2477 blobInfos.at(*seqIter);
+
+
+ 2480 blobInfo.has_manifest() ==
+ 2481 !!expectedBlob.manifest);
+
+ 2483 blobInfo.has_manifest() ==
+ 2484 (*seqIter < manifestCutoff));
+
+ 2486 if (*seqIter < manifestCutoff)
+
+ 2488 blobInfo.manifest() ==
+ 2489 *expectedBlob.manifest);
+
+ 2491 blobInfo.blob() == expectedBlob.blob);
+
+ 2493 blobInfo.signature() ==
+ 2494 expectedBlob.signature);
+
+
+ 2497 BEAST_EXPECT(seqIter == expectedSeqs.end());
+
+
+ 2500 messageWithHash.hash ==
+
+
+
+
+ 2505 BEAST_EXPECT(msgIter == expectedInfo.end());
+
+ 2507 auto verifyBuildMessages =
+
+
+
+
+ 2512 BEAST_EXPECT(result.
first == expectedSequence);
+ 2513 BEAST_EXPECT(result.
second == expectedSize);
+
+
+
+
+
+ 2519 auto const blobInfos = [manifestCutoff = manifestCutoff]() {
+
+
+ 2522 for (
auto seq : {5, 6, 7, 10, 12})
+
+
+
+ 2526 s <<
"This is not a blob with sequence " <<
seq;
+
+
+ 2529 s <<
"This is not a signature for sequence " <<
seq;
+ 2530 b.signature = s.
str();
+ 2531 if (
seq < manifestCutoff)
+
+
+
+ 2535 s <<
"This is not manifest " <<
seq;
+ 2536 b.manifest = s.
str();
+
+
+
+
+ 2541 auto const maxSequence = blobInfos.
rbegin()->first;
+ 2542 BEAST_EXPECT(maxSequence == 12);
+
+
+
+
+
+
+ 2549 verifyBuildMessages(
+ 2550 ValidatorList::buildValidatorListMessages(
+ 2551 1, 8, maxSequence, version,
manifest, blobInfos, messages),
+
+
+ 2554 BEAST_EXPECT(messages.size() == 0);
+
+
+
+
+
+ 2560 messages.emplace_back();
+ 2561 verifyBuildMessages(
+ 2562 ValidatorList::buildValidatorListMessages(
+ 2563 1, 3, maxSequence, version,
manifest, blobInfos, messages),
+
+
+ 2566 BEAST_EXPECT(messages.size() == 1 && !messages.front().message);
+
+
+
+ 2570 verifyBuildMessages(
+ 2571 ValidatorList::buildValidatorListMessages(
+ 2572 1, 3, maxSequence, version,
manifest, blobInfos, messages),
+
+
+ 2575 if (BEAST_EXPECT(messages.size() == 1) &&
+ 2576 BEAST_EXPECT(messages.front().message))
+
+ 2578 auto const& messageWithHash = messages.front();
+ 2579 auto const msg = extractProtocolMessage1(*messageWithHash.message);
+
+ 2581 messageWithHash.message->getBuffer(compression::Compressed::Off)
+
+
+ 2584 BEAST_EXPECT(size == 108);
+ 2585 auto const& expected = blobInfos.at(5);
+ 2586 if (BEAST_EXPECT(msg))
+
+ 2588 BEAST_EXPECT(msg->version() == 1);
+ 2589 BEAST_EXPECT(msg->manifest() == *expected.manifest);
+ 2590 BEAST_EXPECT(msg->blob() == expected.blob);
+ 2591 BEAST_EXPECT(msg->signature() == expected.signature);
+
+
+ 2594 messageWithHash.hash ==
+
+ 2596 *expected.manifest, expected.blob, expected.signature, 1));
+
+
+
+
+
+
+
+ 2604 verifyBuildMessages(
+ 2605 ValidatorList::buildValidatorListMessages(
+
+
+
+
+
+
+
+
+
+ 2615 BEAST_EXPECT(messages.size() == 0);
+
+
+
+
+
+ 2621 messages.emplace_back();
+ 2622 verifyBuildMessages(
+ 2623 ValidatorList::buildValidatorListMessages(
+ 2624 2, 3, maxSequence, version,
manifest, blobInfos, messages),
+
+
+ 2627 BEAST_EXPECT(messages.size() == 1 && !messages.front().message);
+
+
+
+ 2631 verifyBuildMessages(
+ 2632 ValidatorList::buildValidatorListMessages(
+ 2633 2, 5, maxSequence, version,
manifest, blobInfos, messages),
+
+
+
+ 2637 version,
manifest, blobInfos, messages, {{372, {6, 7, 10, 12}}});
+
+
+
+
+
+ 2643 verifyBuildMessages(
+ 2644 ValidatorList::buildValidatorListMessages(
+ 2645 2, 5, maxSequence, version,
manifest, blobInfos, messages, 300),
+
+
+
+
+
+
+
+ 2653 {{212, {6, 7}}, {192, {10, 12}}});
+
+
+
+
+ 2658 verifyBuildMessages(
+ 2659 ValidatorList::buildValidatorListMessages(
+ 2660 2, 5, maxSequence, version,
manifest, blobInfos, messages, 200),
+
+
+
+
+
+
+
+ 2668 {{108, {6}}, {108, {7}}, {192, {10, 12}}});
+
+
+
+ 2672 verifyBuildMessages(
+ 2673 ValidatorList::buildValidatorListMessages(
+ 2674 2, 5, maxSequence, version,
manifest, blobInfos, messages, 150),
+
+
+
+
+
+
+
+ 2682 {{108, {6}}, {108, {7}}, {110, {10}}, {110, {12}}});
+
+
+
+
+ 2687 verifyBuildMessages(
+ 2688 ValidatorList::buildValidatorListMessages(
+ 2689 2, 5, maxSequence, version,
manifest, blobInfos, messages, 108),
+
+
+
+
+
+
+
+ 2697 {{108, {6}}, {108, {7}}, {110, {10}}, {110, {12}}});
+
+
+
+
+
+ 2703 testcase(
"Test quorum disabled");
+
+ 2705 std::string const siteUri =
"testQuorumDisabled.test";
+
+ 2707 auto& app = env.
app();
+
+
+
+
+ 2712 while (valKeys.
size() != maxKeys)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2729 auto makeValidatorList = [&,
this](
+
+
+
+
+
+
+
+
+ 2738 auto result = std::make_unique<ValidatorList>(
+
+
+
+ 2742 app.config().legacy(
"database_path"),
+
+
+
+
+
+
+ 2749 auto const publisherPublic =
+
+ 2751 auto const pubSigningKeys =
randomKeyPair(KeyType::secp256k1);
+
+
+
+
+
+
+
+ 2759 pubSigningKeys.first,
+ 2760 pubSigningKeys.second,
+ 2761 i < countRevoked ?
revoked : 1));
+ 2762 publishers.push_back(Publisher{
+
+
+
+
+
+
+
+
+ 2771 listThreshold > 0 ?
std::optional(listThreshold) : std::nullopt;
+
+
+ 2774 valManifests.applyManifest(
+
+ 2776 BEAST_EXPECT(result->load(
+ 2777 self->signingPublic,
+
+
+
+
+
+
+
+ 2785 result->load({}, emptyCfgKeys, cfgPublishers, threshold));
+
+
+
+
+ 2790 using namespace std::chrono_literals;
+
+ 2792 (i == countTotal - 1 ? 60s : 3600s);
+ 2793 auto const blob = makeList(
+
+
+ 2796 publishers[i].expiry.time_since_epoch().count());
+ 2797 auto const sig = signList(blob, publishers[i].signingKeys);
+
+
+
+
+
+
+
+
+ 2806 .bestDisposition() ==
+ 2807 (publishers[i].
revoked ? ListDisposition::untrusted
+ 2808 : ListDisposition::accepted));
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2822 auto const self = randomValidator();
+ 2823 auto const keysTotal = valKeys.
size() + 1;
+ 2824 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 2832 BEAST_EXPECT(trustedKeys->getListThreshold() == 5);
+ 2833 for (
auto const& p : publishers)
+ 2834 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 2842 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 2844 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 2848 for (
auto const& val : valKeys)
+
+ 2850 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 2853 BEAST_EXPECT(changes.
added == added);
+ 2854 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 2858 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 2864 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 2865 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 2868 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 2869 for (
auto const& val : valKeys)
+
+ 2871 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 2872 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 2875 BEAST_EXPECT(changes.
added.empty());
+ 2876 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+ 2883 auto const keysTotal = valKeys.
size();
+ 2884 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 2892 BEAST_EXPECT(trustedKeys->getListThreshold() == 5);
+ 2893 for (
auto const& p : publishers)
+ 2894 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 2902 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 2904 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 2907 for (
auto const& val : valKeys)
+
+ 2909 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 2912 BEAST_EXPECT(changes.
added == added);
+ 2913 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 2917 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 2923 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 2924 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 0);
+
+
+ 2927 for (
auto const& val : valKeys)
+
+ 2929 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 2930 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 2933 BEAST_EXPECT(changes.
added.empty());
+ 2934 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+ 2942 auto const self = valKeys[1];
+ 2943 auto const keysTotal = valKeys.
size();
+ 2944 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 2952 BEAST_EXPECT(trustedKeys->getListThreshold() == 4);
+ 2953 int untrustedCount = 0;
+ 2954 for (
auto const& p : publishers)
+
+ 2956 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 2957 BEAST_EXPECT(p.revoked ^ trusted);
+ 2958 untrustedCount += trusted ? 0 : 1;
+
+ 2960 BEAST_EXPECT(untrustedCount == 1);
+
+
+
+
+
+
+
+ 2968 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 2970 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 2973 for (
auto const& val : valKeys)
+
+ 2975 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 2978 BEAST_EXPECT(changes.
added == added);
+ 2979 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 2983 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 2989 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 2990 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 2993 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 2994 for (
auto const& val : valKeys)
+
+ 2996 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 2997 if (val.masterPublic != self.masterPublic)
+
+ 2999 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+
+ 3003 BEAST_EXPECT(changes.
added.empty());
+ 3004 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+ 3012 auto const self = randomValidator();
+ 3013 auto const keysTotal = valKeys.
size() + 1;
+ 3014 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3022 BEAST_EXPECT(trustedKeys->getListThreshold() == 3);
+ 3023 int untrustedCount = 0;
+ 3024 for (
auto const& p : publishers)
+
+ 3026 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 3027 BEAST_EXPECT(p.revoked ^ trusted);
+ 3028 untrustedCount += trusted ? 0 : 1;
+
+ 3030 BEAST_EXPECT(untrustedCount == 2);
+
+
+
+
+
+
+
+ 3038 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3040 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 3044 for (
auto const& val : valKeys)
+
+ 3046 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3049 BEAST_EXPECT(changes.
added == added);
+ 3050 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3054 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3060 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3061 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 3064 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3065 for (
auto const& val : valKeys)
+
+ 3067 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3068 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 3071 BEAST_EXPECT(changes.
added.empty());
+ 3072 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+ 3080 auto const self = valKeys[5];
+ 3081 auto const keysTotal = valKeys.
size();
+ 3082 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3090 BEAST_EXPECT(trustedKeys->getListThreshold() == 3);
+ 3091 int untrustedCount = 0;
+ 3092 for (
auto const& p : publishers)
+
+ 3094 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 3095 BEAST_EXPECT(p.revoked ^ trusted);
+ 3096 untrustedCount += trusted ? 0 : 1;
+
+ 3098 BEAST_EXPECT(untrustedCount == 2);
+
+
+
+
+
+
+
+ 3106 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3108 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3111 for (
auto const& val : valKeys)
+
+ 3113 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3116 BEAST_EXPECT(changes.
added == added);
+ 3117 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3121 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3127 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3128 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 3131 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3132 for (
auto const& val : valKeys)
+
+ 3134 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3135 if (val.masterPublic != self.masterPublic)
+
+ 3137 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+
+ 3141 BEAST_EXPECT(changes.
added.empty());
+ 3142 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+ 3149 auto const keysTotal = valKeys.
size();
+ 3150 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3158 BEAST_EXPECT(trustedKeys->getListThreshold() == 3);
+ 3159 int untrustedCount = 0;
+ 3160 for (
auto const& p : publishers)
+
+ 3162 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 3163 BEAST_EXPECT(p.revoked ^ trusted);
+ 3164 untrustedCount += trusted ? 0 : 1;
+
+ 3166 BEAST_EXPECT(untrustedCount == 2);
+
+
+
+
+
+
+
+ 3174 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3176 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3179 for (
auto const& val : valKeys)
+
+ 3181 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3184 BEAST_EXPECT(changes.
added == added);
+ 3185 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3189 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3195 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3196 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 0);
+
+
+ 3199 for (
auto const& val : valKeys)
+
+ 3201 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3202 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 3205 BEAST_EXPECT(changes.
added.empty());
+ 3206 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+ 3214 auto const self = randomValidator();
+ 3215 auto const keysTotal = valKeys.
size() + 1;
+ 3216 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3224 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+ 3225 int untrustedCount = 0;
+ 3226 for (
auto const& p : publishers)
+
+ 3228 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 3229 BEAST_EXPECT(p.revoked ^ trusted);
+ 3230 untrustedCount += trusted ? 0 : 1;
+
+ 3232 BEAST_EXPECT(untrustedCount == 1);
+
+
+
+
+
+
+
+ 3240 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3242 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 3246 for (
auto const& val : valKeys)
+
+ 3248 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3251 BEAST_EXPECT(changes.
added == added);
+ 3252 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3256 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3262 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+
+ 3264 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+ 3266 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3267 for (
auto const& val : valKeys)
+
+ 3269 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3270 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+ 3272 BEAST_EXPECT(changes.
added.empty());
+ 3273 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+
+
+
+
+ 3281 auto const self = randomValidator();
+ 3282 auto const keysTotal = valKeys.
size() + 1;
+ 3283 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3291 BEAST_EXPECT(trustedKeys->getListThreshold() == 1);
+ 3292 for (
auto const& p : publishers)
+ 3293 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3301 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3303 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 3307 for (
auto const& val : valKeys)
+
+ 3309 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3312 BEAST_EXPECT(changes.
added == added);
+ 3313 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3317 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3323 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+
+ 3325 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+ 3327 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3328 for (
auto const& val : valKeys)
+
+ 3330 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3331 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+ 3333 BEAST_EXPECT(changes.
added.empty());
+ 3334 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+
+
+
+
+ 3342 auto const self = valKeys[7];
+ 3343 auto const keysTotal = valKeys.
size();
+ 3344 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3352 BEAST_EXPECT(trustedKeys->getListThreshold() == 1);
+ 3353 for (
auto const& p : publishers)
+ 3354 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3362 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3364 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3367 for (
auto const& val : valKeys)
+
+ 3369 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3372 BEAST_EXPECT(changes.
added == added);
+ 3373 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3377 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3383 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+
+ 3385 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+ 3387 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3388 for (
auto const& val : valKeys)
+
+ 3390 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3391 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+ 3393 BEAST_EXPECT(changes.
added.empty());
+ 3394 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+
+
+
+ 3401 auto const keysTotal = valKeys.
size();
+ 3402 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3410 BEAST_EXPECT(trustedKeys->getListThreshold() == 1);
+ 3411 for (
auto const& p : publishers)
+ 3412 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3420 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3422 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3425 for (
auto const& val : valKeys)
+
+ 3427 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3430 BEAST_EXPECT(changes.
added == added);
+ 3431 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3435 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3441 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+
+ 3443 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+ 3445 for (
auto const& val : valKeys)
+
+ 3447 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3448 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+ 3450 BEAST_EXPECT(changes.
added.empty());
+ 3451 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+
+
+
+
+
+
+ 3461 auto const self = randomValidator();
+ 3462 auto const keysTotal = valKeys.
size() + 1;
+ 3463 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3471 BEAST_EXPECT(trustedKeys->getListThreshold() == 1);
+ 3472 int untrustedCount = 0;
+ 3473 for (
auto const& p : publishers)
+
+ 3475 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 3476 BEAST_EXPECT(p.revoked ^ trusted);
+ 3477 untrustedCount += trusted ? 0 : 1;
+
+ 3479 BEAST_EXPECT(untrustedCount == 1);
+
+
+
+
+
+
+
+ 3487 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+
+ 3489 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 3493 for (
auto const& val : valKeys)
+
+ 3495 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3498 BEAST_EXPECT(changes.
added == added);
+ 3499 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3503 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3509 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3510 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 3513 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3514 for (
auto const& val : valKeys)
+
+ 3516 BEAST_EXPECT(!trustedKeys->listed(val.masterPublic));
+ 3517 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 3520 BEAST_EXPECT(changes.
added.empty());
+ 3521 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+ 3529 auto const self = valKeys[5];
+ 3530 auto const keysTotal = valKeys.
size();
+ 3531 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3539 BEAST_EXPECT(trustedKeys->getListThreshold() == 1);
+ 3540 int untrustedCount = 0;
+ 3541 for (
auto const& p : publishers)
+
+ 3543 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 3544 BEAST_EXPECT(p.revoked ^ trusted);
+ 3545 untrustedCount += trusted ? 0 : 1;
+
+ 3547 BEAST_EXPECT(untrustedCount == 1);
+
+
+
+
+
+
+
+ 3555 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+
+ 3557 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3560 for (
auto const& val : valKeys)
+
+ 3562 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3565 BEAST_EXPECT(changes.
added == added);
+ 3566 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3570 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3576 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3577 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 3580 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3581 for (
auto const& val : valKeys)
+
+ 3583 if (val.masterPublic != self.masterPublic)
+
+ 3585 BEAST_EXPECT(!trustedKeys->listed(val.masterPublic));
+ 3586 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+
+ 3590 BEAST_EXPECT(changes.
added.empty());
+ 3591 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+ 3598 auto const keysTotal = valKeys.
size();
+ 3599 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3607 BEAST_EXPECT(trustedKeys->getListThreshold() == 1);
+ 3608 int untrustedCount = 0;
+ 3609 for (
auto const& p : publishers)
+
+ 3611 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 3612 BEAST_EXPECT(p.revoked ^ trusted);
+ 3613 untrustedCount += trusted ? 0 : 1;
+
+ 3615 BEAST_EXPECT(untrustedCount == 1);
+
+
+
+
+
+
+
+ 3623 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+
+ 3625 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3628 for (
auto const& val : valKeys)
+
+ 3630 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3633 BEAST_EXPECT(changes.
added == added);
+ 3634 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3638 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3644 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3645 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 0);
+
+
+ 3648 for (
auto const& val : valKeys)
+
+ 3650 BEAST_EXPECT(!trustedKeys->listed(val.masterPublic));
+ 3651 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 3654 BEAST_EXPECT(changes.
added.empty());
+ 3655 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+ 3663 auto const self = randomValidator();
+ 3664 auto const keysTotal = valKeys.
size() + 1;
+ 3665 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3673 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+ 3674 for (
auto const& p : publishers)
+ 3675 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3683 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3685 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 3689 for (
auto const& val : valKeys)
+
+ 3691 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3694 BEAST_EXPECT(changes.
added == added);
+ 3695 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3699 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3705 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3706 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 3709 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3710 for (
auto const& val : valKeys)
+
+ 3712 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3713 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 3716 BEAST_EXPECT(changes.
added.empty());
+ 3717 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+ 3725 auto const self = valKeys[5];
+ 3726 auto const keysTotal = valKeys.
size();
+ 3727 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3735 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+ 3736 for (
auto const& p : publishers)
+ 3737 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3745 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3747 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 3751 for (
auto const& val : valKeys)
+
+ 3753 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3756 BEAST_EXPECT(changes.
added == added);
+ 3757 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3761 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3767 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3768 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 3771 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3772 for (
auto const& val : valKeys)
+
+ 3774 if (val.masterPublic != self.masterPublic)
+
+ 3776 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3777 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+
+ 3781 BEAST_EXPECT(changes.
added.empty());
+ 3782 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+ 3789 auto const keysTotal = valKeys.
size();
+ 3790 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3798 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+ 3799 for (
auto const& p : publishers)
+ 3800 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3808 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3810 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3813 for (
auto const& val : valKeys)
+
+ 3815 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3818 BEAST_EXPECT(changes.
added == added);
+ 3819 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3823 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3829 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3830 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 0);
+
+
+ 3833 for (
auto const& val : valKeys)
+
+ 3835 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 3836 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 3839 BEAST_EXPECT(changes.
added.empty());
+ 3840 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+
+
+ 3850 auto const self = randomValidator();
+ 3851 auto const keysTotal = valKeys.
size() + 1;
+ 3852 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3860 BEAST_EXPECT(trustedKeys->getListThreshold() == 1);
+ 3861 for (
auto const& p : publishers)
+ 3862 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3870 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3872 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 3876 for (
auto const& val : valKeys)
+
+ 3878 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3881 BEAST_EXPECT(changes.
added == added);
+ 3882 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 3886 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 3892 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 3893 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 3896 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 3897 for (
auto const& val : valKeys)
+
+ 3899 BEAST_EXPECT(!trustedKeys->listed(val.masterPublic));
+ 3900 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 3903 BEAST_EXPECT(changes.
added.empty());
+ 3904 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+
+
+ 3914 auto const self = valKeys[2];
+ 3915 auto const keysTotal = valKeys.
size();
+ 3916 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3924 BEAST_EXPECT(trustedKeys->getListThreshold() == 2);
+ 3925 for (
auto const& p : publishers)
+ 3926 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3934 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3936 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3939 for (
auto const& val : valKeys)
+
+ 3941 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3944 BEAST_EXPECT(changes.
added == added);
+ 3945 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+
+
+
+
+
+ 3954 auto const keysTotal = valKeys.
size();
+ 3955 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 3963 BEAST_EXPECT(trustedKeys->getListThreshold() == 3);
+ 3964 for (
auto const& p : publishers)
+ 3965 BEAST_EXPECT(trustedKeys->trustedPublisher(p.pubKey));
+
+
+
+
+
+
+
+ 3973 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 3975 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 3978 for (
auto const& val : valKeys)
+
+ 3980 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 3983 BEAST_EXPECT(changes.
added == added);
+ 3984 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+
+
+
+
+
+
+ 3994 auto const self = randomValidator();
+ 3995 auto const keysTotal = valKeys.
size() + 1;
+ 3996 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 4004 BEAST_EXPECT(trustedKeys->getListThreshold() == 4);
+ 4005 int untrustedCount = 0;
+ 4006 for (
auto const& p : publishers)
+
+ 4008 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 4009 BEAST_EXPECT(p.revoked ^ trusted);
+ 4010 untrustedCount += trusted ? 0 : 1;
+
+ 4012 BEAST_EXPECT(untrustedCount == 2);
+
+
+
+
+
+
+
+ 4020 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 4022 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+
+ 4026 for (
auto const& val : valKeys)
+
+ 4028 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 4031 BEAST_EXPECT(changes.
added == added);
+ 4032 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 4036 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 4042 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 4043 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 4046 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 4047 for (
auto const& val : valKeys)
+
+ 4049 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 4050 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+ 4053 BEAST_EXPECT(changes.
added.empty());
+ 4054 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+
+
+ 4064 auto const self = valKeys[2];
+ 4065 auto const keysTotal = valKeys.
size();
+ 4066 auto trustedKeys = makeValidatorList(
+
+
+
+
+
+
+
+ 4074 BEAST_EXPECT(trustedKeys->getListThreshold() == 4);
+ 4075 int untrustedCount = 0;
+ 4076 for (
auto const& p : publishers)
+
+ 4078 bool const trusted = trustedKeys->trustedPublisher(p.pubKey);
+ 4079 BEAST_EXPECT(p.revoked ^ trusted);
+ 4080 untrustedCount += trusted ? 0 : 1;
+
+ 4082 BEAST_EXPECT(untrustedCount == 3);
+
+
+
+
+
+
+
+ 4090 BEAST_EXPECT(trustedKeys->quorum() ==
std::ceil(keysTotal * 0.8f));
+
+ 4092 trustedKeys->getTrustedMasterKeys().size() == keysTotal);
+
+
+ 4095 for (
auto const& val : valKeys)
+
+ 4097 BEAST_EXPECT(trustedKeys->trusted(val.masterPublic));
+
+
+ 4100 BEAST_EXPECT(changes.
added == added);
+ 4101 BEAST_EXPECT(changes.
removed.empty());
+
+
+
+ 4105 changes = trustedKeys->updateTrusted(
+
+
+
+
+
+ 4111 BEAST_EXPECT(trustedKeys->quorum() == quorumDisabled);
+ 4112 BEAST_EXPECT(trustedKeys->getTrustedMasterKeys().size() == 1);
+
+
+ 4115 BEAST_EXPECT(trustedKeys->trusted(self.masterPublic));
+ 4116 for (
auto const& val : valKeys)
+
+ 4118 if (val.masterPublic != self.masterPublic)
+
+ 4120 BEAST_EXPECT(trustedKeys->listed(val.masterPublic));
+ 4121 BEAST_EXPECT(!trustedKeys->trusted(val.masterPublic));
+
+
+
+ 4125 BEAST_EXPECT(changes.
added.empty());
+ 4126 BEAST_EXPECT(changes.
removed == removed);
+
+
+
+
+
+
+
+ 4134 testGenesisQuorum();
+
+
+
+ 4138 testUpdateTrusted();
+
+
+
+ 4142 testBuildMessages();
+ 4143 testQuorumDisabled();
+
+
+
+
+
+
+
-
+
@@ -2504,6 +4242,7 @@ $(function() {
virtual NetworkOPs & getOPs()=0
virtual HashRouter & getHashRouter()=0
void legacy(std::string const §ion, std::string value)
Set a value that is not a key/value pair.
+
Remembers manifests with the highest sequence number.
std::optional< PublicKey > getSigningKey(PublicKey const &pk) const
Returns master key's current signing key.
bool revoked(PublicKey const &pk) const
Returns true if master key has been revoked in a manifest.
@@ -2522,16 +4261,17 @@ $(function() {
time_point now() const override
Returns the current time.
-
-
-void run() override
Runs the suite.
-
+
+
+void run() override
Runs the suite.
+
static PublicKey randomMasterKey()
-
+void testQuorumDisabled()
+
static hash_set< NodeID > asNodeIDs(std::initializer_list< PublicKey > const &pks)
-
+
void checkResult(ValidatorList::PublisherListStats const &result, PublicKey pubKey, ListDisposition expectedWorst, ListDisposition expectedBest)
-
+
static std::string makeRevocationString(PublicKey const &pk, SecretKey const &sk)
std::string makeList(std::vector< Validator > const &validators, std::size_t sequence, std::size_t validUntil, std::optional< std::size_t > validFrom={})
@@ -2539,7 +4279,7 @@ $(function() {
static std::string makeManifestString(PublicKey const &pk, SecretKey const &sk, PublicKey const &spk, SecretKey const &ssk, int seq)
static PublicKey randomNode()
std::string signList(std::string const &blob, std::pair< PublicKey, SecretKey > const &keys)
-
+
static Validator randomValidator()
A transaction testing environment.
@@ -2549,7 +4289,7 @@ $(function() {
Set the regular signature on a JTx.
-
+
@@ -2579,6 +4319,7 @@ $(function() {
std::string base64_encode(std::uint8_t const *data, std::size_t len)
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
+
std::pair< PublicKey, SecretKey > randomKeyPair(KeyType type)
Create a key pair using secure random numbers.
@@ -2596,10 +4337,10 @@ $(function() {
Changes in trusted nodes after updating validator list.
hash_set< NodeID > removed
-Describes the result of processing a Validator List (UNL), including some of the information from the...
+Describes the result of processing a Validator List (UNL), including some of the information from the...
ListDisposition bestDisposition() const
ListDisposition worstDisposition() const
-std::optional< PublicKey > publisherKey
+std::optional< PublicKey > publisherKey
@@ -2608,6 +4349,7 @@ $(function() {
T time_since_epoch(T... args)
+
diff --git a/ValidatorSite_8cpp_source.html b/ValidatorSite_8cpp_source.html
index 575400b201..2032e09c3e 100644
--- a/ValidatorSite_8cpp_source.html
+++ b/ValidatorSite_8cpp_source.html
@@ -808,9 +808,9 @@ $(function() {
virtual ValidatorList & validators()=0
virtual boost::asio::io_service & getIOService()=0
virtual HashRouter & getHashRouter()=0
-std::vector< std::string > loadLists()
-PublisherListStats applyListsAndBroadcast(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, NetworkOPs &networkOPs)
Apply multiple published lists of public keys, then broadcast it to all peers that have not seen it o...
-static std::vector< ValidatorBlobInfo > parseBlobs(std::uint32_t version, Json::Value const &body)
Pull the blob/signature/manifest information out of the appropriate Json body fields depending on the...
+std::vector< std::string > loadLists()
+PublisherListStats applyListsAndBroadcast(std::string const &manifest, std::uint32_t version, std::vector< ValidatorBlobInfo > const &blobs, std::string siteUri, uint256 const &hash, Overlay &overlay, HashRouter &hashRouter, NetworkOPs &networkOPs)
Apply multiple published lists of public keys, then broadcast it to all peers that have not seen it o...
+static std::vector< ValidatorBlobInfo > parseBlobs(std::uint32_t version, Json::Value const &body)
Pull the blob/signature/manifest information out of the appropriate Json body fields depending on the...
void start()
Start fetching lists from sites.
std::condition_variable cv_
diff --git a/Validators_8cpp_source.html b/Validators_8cpp_source.html
index 573f0d4c2e..0c9a9727e6 100644
--- a/Validators_8cpp_source.html
+++ b/Validators_8cpp_source.html
@@ -112,7 +112,7 @@ $(function() {
virtual ValidatorList & validators()=0
-Json::Value getJson() const
Return a JSON representation of the state of the validator list.
+Json::Value getJson() const
Return a JSON representation of the state of the validator list.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Json::Value doValidators(RPC::JsonContext &)
diff --git a/classripple_1_1Application.html b/classripple_1_1Application.html
index 8d42d4d689..671f985002 100644
--- a/classripple_1_1Application.html
+++ b/classripple_1_1Application.html
@@ -341,7 +341,7 @@ Private Attributes
diff --git a/classripple_1_1ApplicationImp.html b/classripple_1_1ApplicationImp.html
index 25029352f4..117ca867f3 100644
--- a/classripple_1_1ApplicationImp.html
+++ b/classripple_1_1ApplicationImp.html
@@ -655,7 +655,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 1523 of file Application.cpp.
+Definition at line 1524 of file Application.cpp.
@@ -684,7 +684,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 1546 of file Application.cpp.
+Definition at line 1547 of file Application.cpp.
@@ -714,7 +714,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 1641 of file Application.cpp.
+Definition at line 1642 of file Application.cpp.
@@ -743,7 +743,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 1655 of file Application.cpp.
+Definition at line 1656 of file Application.cpp.
@@ -773,7 +773,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 1661 of file Application.cpp.
+Definition at line 1662 of file Application.cpp.
@@ -802,7 +802,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 1667 of file Application.cpp.
+Definition at line 1668 of file Application.cpp.
@@ -831,7 +831,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 1673 of file Application.cpp.
+Definition at line 1674 of file Application.cpp.
@@ -2258,7 +2258,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 2109 of file Application.cpp.
+Definition at line 2110 of file Application.cpp.
@@ -2288,7 +2288,7 @@ Private Attributes
Implements ripple::Application.
-Definition at line 2157 of file Application.cpp.
+Definition at line 2158 of file Application.cpp.
@@ -2503,7 +2503,7 @@ Private Attributes
@@ -2530,7 +2530,7 @@ Private Attributes
@@ -2558,7 +2558,7 @@ Private Attributes
@@ -2608,7 +2608,7 @@ Private Attributes
@@ -2635,7 +2635,7 @@ Private Attributes
diff --git a/classripple_1_1Config-members.html b/classripple_1_1Config-members.html
index 669085a0e6..833434cd39 100644
--- a/classripple_1_1Config-members.html
+++ b/classripple_1_1Config-members.html
@@ -141,8 +141,8 @@ $(function() {
| PEERS_MAX | ripple::Config | |
| PEERS_OUT_MAX | ripple::Config | |
| PREFETCH_WORKERS | ripple::Config | |
- | QUIET | ripple::Config | private |
- | quiet() const | ripple::Config | |
+ | quiet() const | ripple::Config | |
+ | QUIET | ripple::Config | private |
| ramSize_ | ripple::Config | private |
| RELAY_UNTRUSTED_PROPOSALS | ripple::Config | |
| RELAY_UNTRUSTED_VALIDATIONS | ripple::Config | |
@@ -155,8 +155,8 @@ $(function() {
| setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone) | ripple::Config | |
| setupControl(bool bQuiet, bool bSilent, bool bStandalone) | ripple::Config | |
| signingEnabled_ | ripple::Config | private |
- | silent() const | ripple::Config | |
- | SILENT | ripple::Config | private |
+ | SILENT | ripple::Config | private |
+ | silent() const | ripple::Config | |
| SSL_VERIFY | ripple::Config | |
| SSL_VERIFY_DIR | ripple::Config | |
| SSL_VERIFY_FILE | ripple::Config | |
@@ -174,10 +174,11 @@ $(function() {
| USE_TX_TABLES | ripple::Config | private |
| useTxTables() const | ripple::Config | |
| VALIDATION_QUORUM | ripple::Config | |
- | validatorsFileName | ripple::Config | static |
- | VP_REDUCE_RELAY_ENABLE | ripple::Config | |
- | VP_REDUCE_RELAY_SQUELCH | ripple::Config | |
- | WORKERS | ripple::Config | |
+ | VALIDATOR_LIST_THRESHOLD | ripple::Config | |
+ | validatorsFileName | ripple::Config | static |
+ | VP_REDUCE_RELAY_ENABLE | ripple::Config | |
+ | VP_REDUCE_RELAY_SQUELCH | ripple::Config | |
+ | WORKERS | ripple::Config | |