20 #include <ripple/app/consensus/RCLConsensus.h>
21 #include <ripple/app/consensus/RCLValidations.h>
22 #include <ripple/app/ledger/AcceptedLedger.h>
23 #include <ripple/app/ledger/InboundLedgers.h>
24 #include <ripple/app/ledger/LedgerMaster.h>
25 #include <ripple/app/ledger/LedgerToJson.h>
26 #include <ripple/app/ledger/LocalTxs.h>
27 #include <ripple/app/ledger/OpenLedger.h>
28 #include <ripple/app/ledger/OrderBookDB.h>
29 #include <ripple/app/ledger/TransactionMaster.h>
30 #include <ripple/app/main/LoadManager.h>
31 #include <ripple/app/misc/AmendmentTable.h>
32 #include <ripple/app/misc/DeliverMax.h>
33 #include <ripple/app/misc/HashRouter.h>
34 #include <ripple/app/misc/LoadFeeTrack.h>
35 #include <ripple/app/misc/NetworkOPs.h>
36 #include <ripple/app/misc/Transaction.h>
37 #include <ripple/app/misc/TxQ.h>
38 #include <ripple/app/misc/ValidatorKeys.h>
39 #include <ripple/app/misc/ValidatorList.h>
40 #include <ripple/app/misc/impl/AccountTxPaging.h>
41 #include <ripple/app/rdb/backend/PostgresDatabase.h>
42 #include <ripple/app/rdb/backend/SQLiteDatabase.h>
43 #include <ripple/app/reporting/ReportingETL.h>
44 #include <ripple/app/tx/apply.h>
45 #include <ripple/basics/PerfLog.h>
46 #include <ripple/basics/SubmitSync.h>
47 #include <ripple/basics/UptimeClock.h>
48 #include <ripple/basics/mulDiv.h>
49 #include <ripple/basics/safe_cast.h>
50 #include <ripple/beast/rfc2616.h>
51 #include <ripple/beast/utility/rngfill.h>
52 #include <ripple/consensus/Consensus.h>
53 #include <ripple/consensus/ConsensusParms.h>
54 #include <ripple/crypto/RFC1751.h>
55 #include <ripple/crypto/csprng.h>
56 #include <ripple/json/MultivarJson.h>
57 #include <ripple/json/to_string.h>
58 #include <ripple/net/RPCErr.h>
59 #include <ripple/nodestore/DatabaseShard.h>
60 #include <ripple/overlay/Cluster.h>
61 #include <ripple/overlay/Overlay.h>
62 #include <ripple/overlay/predicates.h>
63 #include <ripple/protocol/BuildInfo.h>
64 #include <ripple/protocol/Feature.h>
65 #include <ripple/protocol/STParsedJSON.h>
66 #include <ripple/protocol/jss.h>
67 #include <ripple/resource/Fees.h>
68 #include <ripple/resource/ResourceManager.h>
69 #include <ripple/rpc/BookChanges.h>
70 #include <ripple/rpc/DeliveredAmount.h>
71 #include <ripple/rpc/ServerHandler.h>
72 #include <ripple/rpc/impl/RPCHelpers.h>
73 #include <boost/asio/ip/host_name.hpp>
74 #include <boost/asio/steady_timer.hpp>
151 std::chrono::steady_clock::time_point
start_ =
212 return !(*
this != b);
231 boost::asio::io_service& io_svc,
246 app_.logs().journal(
"FeeVote")),
249 app.getInboundTransactions(),
250 beast::get_abstract_clock<
std::chrono::steady_clock>(),
252 app_.logs().journal(
"LedgerConsensus"))
400 getServerInfo(
bool human,
bool admin,
bool counters)
override;
427 TER result)
override;
470 bool historyOnly)
override;
476 bool historyOnly)
override;
544 boost::system::error_code ec;
549 <<
"NetworkOPs: heartbeatTimer cancel error: "
558 <<
"NetworkOPs: clusterTimer cancel error: "
567 <<
"NetworkOPs: accountHistoryTxTimer cancel error: "
576 <<
"NetworkOPs: batchApplyTimer cancel error: "
581 using namespace std::chrono_literals;
591 boost::asio::steady_timer& timer,
773 template <
class Handler>
775 Handler
const& handler,
777 :
hook(collector->make_hook(handler))
780 "Disconnected_duration"))
783 "Connected_duration"))
785 collector->make_gauge(
"State_Accounting",
"Syncing_duration"))
788 "Tracking_duration"))
790 collector->make_gauge(
"State_Accounting",
"Full_duration"))
793 "Disconnected_transitions"))
796 "Connected_transitions"))
799 "Syncing_transitions"))
802 "Tracking_transitions"))
804 collector->make_gauge(
"State_Accounting",
"Full_transitions"))
833 {
"disconnected",
"connected",
"syncing",
"tracking",
"full"}};
895 static std::string const hostname = boost::asio::ip::host_name();
902 static std::string const shroudedHostId = [
this]() {
908 return shroudedHostId;
923 boost::asio::steady_timer& timer,
930 [
this, onExpire, onError](boost::system::error_code
const& e) {
931 if ((e.value() == boost::system::errc::success) &&
932 (!m_job_queue.isStopped()))
937 if (e.value() != boost::system::errc::success &&
938 e.value() != boost::asio::error::operation_aborted)
941 JLOG(m_journal.error())
942 <<
"Timer got error '" << e.message()
943 <<
"'. Restarting timer.";
948 timer.expires_from_now(expiry_time);
949 timer.async_wait(std::move(*optionalCountedHandler));
985 using namespace std::chrono_literals;
1001 JLOG(
m_journal.
debug()) <<
"Scheduling AccountHistory job for account "
1003 using namespace std::chrono_literals;
1014 using namespace std::chrono_literals;
1019 auto constexpr batchInterval = 100ms;
1033 jtBATCH,
"transactionBatch", [
this]() {
1034 transactionBatch(false);
1066 <<
"Node count (" << numPeers <<
") has fallen "
1082 <<
"Node count (" << numPeers <<
") is sufficient.";
1111 using namespace std::chrono_literals;
1128 protocol::TMCluster cluster;
1130 protocol::TMClusterNode& n = *cluster.add_clusternodes();
1135 n.set_nodename(node.
name());
1139 for (
auto& item : gossip.
items)
1141 protocol::TMLoadSource& node = *cluster.add_loadsources();
1143 node.set_cost(item.balance);
1146 std::make_shared<Message>(cluster, protocol::mtCLUSTER),
1166 return "validating";
1185 auto const txid = trans->getTransactionID();
1188 if ((flags & SF_BAD) != 0)
1190 JLOG(
m_journal.
warn()) <<
"Submitted transaction cached bad";
1205 <<
"Submitted transaction invalid: " << reason;
1212 <<
"Exception checking transaction " << txid <<
": " << ex.
what();
1219 auto tx = std::make_shared<Transaction>(trans, reason,
app_);
1239 if ((newFlags & SF_BAD) != 0)
1242 JLOG(
m_journal.
warn()) << transaction->getID() <<
": cached bad!\n";
1243 transaction->setStatus(
INVALID);
1254 *transaction->getSTransaction(),
1262 JLOG(
m_journal.
trace()) <<
"Transaction has bad signature: " << reason;
1263 transaction->setStatus(
INVALID);
1273 if (!transaction->getApplying())
1275 transaction->setApplying();
1291 }
while (transaction->getApplying());
1300 transaction = std::make_shared<Transaction>(*transaction);
1306 lock, [&transaction] {
return !transaction->getApplying(); });
1344 bool changed =
false;
1362 app_, view, e.transaction->getSTransaction(), flags, j);
1363 e.result = result.first;
1364 e.applied = result.second;
1365 changed = changed || result.second;
1375 validatedLedgerIndex = l->info().seq;
1380 e.transaction->clearSubmitResult();
1385 newOL, e.transaction->getSTransaction(), e.result);
1386 e.transaction->setApplied();
1389 e.transaction->setResult(e.result);
1402 <<
"TransactionResult: " << token <<
": " << human;
1407 bool addLocal = e.local;
1412 <<
"Transaction is now included in open ledger";
1413 e.transaction->setStatus(
INCLUDED);
1415 auto const& txCur = e.transaction->getSTransaction();
1421 auto t = std::make_shared<Transaction>(trans, reason,
app_);
1430 e.transaction->setStatus(
OBSOLETE);
1435 <<
"Transaction is likely to claim a"
1436 <<
" fee, but is queued until fee drops";
1438 e.transaction->setStatus(
HELD);
1443 e.transaction->setQueued();
1444 e.transaction->setKept();
1452 <<
"Transaction should be held: " << e.result;
1453 e.transaction->setStatus(
HELD);
1455 e.transaction->setKept();
1461 <<
"Status other than success " << e.result;
1462 e.transaction->setStatus(
INVALID);
1465 auto const enforceFailHard =
1468 if (addLocal && !enforceFailHard)
1472 e.transaction->getSTransaction());
1473 e.transaction->setKept();
1487 protocol::TMTransaction tx;
1490 e.transaction->getSTransaction()->add(s);
1491 tx.set_rawtransaction(s.
data(), s.
size());
1492 tx.set_status(protocol::tsCURRENT);
1493 tx.set_receivetimestamp(
1498 e.transaction->setBroadcast();
1502 if (validatedLedgerIndex)
1504 auto [fee, accountSeq, availableSeq] =
1506 *newOL, e.transaction->getSTransaction());
1507 e.transaction->setCurrentLedgerState(
1508 *validatedLedgerIndex, fee, accountSeq, availableSeq);
1516 e.transaction->clearApplying();
1518 if (!submit_held.
empty())
1523 for (
auto& e : submit_held)
1550 for (
auto const& uDirEntry : sleNode->getFieldV256(
sfIndexes))
1555 switch (sleCur->getType())
1558 if (!jvObjects.
isMember(jss::offers))
1559 jvObjects[jss::offers] =
1562 jvObjects[jss::offers].
append(
1567 if (!jvObjects.
isMember(jss::ripple_lines))
1569 jvObjects[jss::ripple_lines] =
1573 jvObjects[jss::ripple_lines].
append(
1668 JLOG(
m_journal.
trace()) <<
"NetworkOPsImp::checkLastClosedLedger";
1675 uint256 closedLedger = ourClosed->info().hash;
1676 uint256 prevClosedLedger = ourClosed->info().parentHash;
1685 <<
"ValidationTrie " <<
Json::Compact(validations.getJsonTrie());
1689 peerCounts[closedLedger] = 0;
1691 peerCounts[closedLedger]++;
1693 for (
auto& peer : peerList)
1695 uint256 peerLedger = peer->getClosedLedgerHash();
1698 ++peerCounts[peerLedger];
1701 for (
auto const& it : peerCounts)
1702 JLOG(
m_journal.
debug()) <<
"L: " << it.first <<
" n=" << it.second;
1704 uint256 preferredLCL = validations.getPreferredLCL(
1709 bool switchLedgers = preferredLCL != closedLedger;
1711 closedLedger = preferredLCL;
1713 if (switchLedgers && (closedLedger == prevClosedLedger))
1716 JLOG(
m_journal.
info()) <<
"We won't switch to our own previous ledger";
1717 networkClosed = ourClosed->info().hash;
1718 switchLedgers =
false;
1722 networkClosed = closedLedger;
1741 networkClosed = ourClosed->info().hash;
1745 JLOG(
m_journal.
warn()) <<
"We are not running on the consensus ledger";
1771 <<
"JUMP last closed ledger to " << newLCL->info().hash;
1807 protocol::TMStatusChange s;
1808 s.set_newevent(protocol::neSWITCHED_LEDGER);
1809 s.set_ledgerseq(newLCL->info().seq);
1811 s.set_ledgerhashprevious(
1812 newLCL->info().parentHash.begin(), newLCL->info().parentHash.size());
1813 s.set_ledgerhash(newLCL->info().hash.begin(), newLCL->info().hash.size());
1816 send_always(std::make_shared<Message>(s, protocol::mtSTATUS_CHANGE)));
1826 JLOG(
m_journal.
info()) <<
"Consensus time for #" << closingInfo.seq
1827 <<
" with LCL " << closingInfo.parentHash;
1836 JLOG(
m_journal.
warn()) <<
"Don't have LCL, going to tracking";
1843 assert(prevLedger->info().hash == closingInfo.parentHash);
1845 closingInfo.parentHash ==
1852 closingInfo.parentCloseTime,
1857 if (!changes.
added.empty() || !changes.
removed.empty())
1897 protocol::TMHaveTransactionSet msg;
1898 msg.set_hash(map->getHash().as_uint256().begin(), 256 / 8);
1899 msg.set_status(protocol::tsHAVE);
1901 send_always(std::make_shared<Message>(msg, protocol::mtHAVE_SET)));
1915 if (it && (it->getClosedLedgerHash() == deadLedger))
1926 if (networkClosed.
isZero())
1955 2 *
current->info().closeTimeResolution))
1983 jvObj[jss::type] =
"manifestReceived";
1986 jvObj[jss::signing_key] =
1990 jvObj[jss::signature] =
strHex(*sig);
1993 jvObj[jss::domain] = mo.
domain;
1999 if (
auto p = i->second.lock())
2001 p->send(jvObj,
true);
2017 , loadBaseServer{loadFeeTrack.getLoadBase()}
2019 , em{std::move(escalationMetrics)}
2029 em.has_value() != b.
em.has_value())
2035 em->minProcessingFeeLevel != b.
em->minProcessingFeeLevel ||
2036 em->openLedgerFeeLevel != b.
em->openLedgerFeeLevel ||
2037 em->referenceFeeLevel != b.
em->referenceFeeLevel);
2070 jvObj[jss::type] =
"serverStatus";
2072 jvObj[jss::load_base] = f.loadBaseServer;
2073 jvObj[jss::load_factor_server] = f.loadFactorServer;
2074 jvObj[jss::base_fee] = f.baseFee.jsonClipped();
2079 safe_cast<std::uint64_t>(f.loadFactorServer),
2081 f.em->openLedgerFeeLevel,
2083 f.em->referenceFeeLevel)
2086 jvObj[jss::load_factor] =
trunc32(loadFactor);
2087 jvObj[jss::load_factor_fee_escalation] =
2088 f.em->openLedgerFeeLevel.jsonClipped();
2089 jvObj[jss::load_factor_fee_queue] =
2090 f.em->minProcessingFeeLevel.jsonClipped();
2091 jvObj[jss::load_factor_fee_reference] =
2092 f.em->referenceFeeLevel.jsonClipped();
2095 jvObj[jss::load_factor] = f.loadFactorServer;
2109 p->send(jvObj,
true);
2126 if (!streamMap.empty())
2129 jvObj[jss::type] =
"consensusPhase";
2130 jvObj[jss::consensus] =
to_string(phase);
2132 for (
auto i = streamMap.begin(); i != streamMap.end();)
2134 if (
auto p = i->second.lock())
2136 p->send(jvObj,
true);
2141 i = streamMap.erase(i);
2157 auto const signerPublic = val->getSignerPublic();
2159 jvObj[jss::type] =
"validationReceived";
2160 jvObj[jss::validation_public_key] =
2162 jvObj[jss::ledger_hash] =
to_string(val->getLedgerHash());
2163 jvObj[jss::signature] =
strHex(val->getSignature());
2164 jvObj[jss::full] = val->isFull();
2165 jvObj[jss::flags] = val->getFlags();
2167 jvObj[jss::data] =
strHex(val->getSerializer().slice());
2172 if (
auto cookie = (*val)[~
sfCookie])
2176 jvObj[jss::validated_hash] =
strHex(*hash);
2178 auto const masterKey =
2181 if (masterKey != signerPublic)
2187 jvObj[jss::ledger_index] = *seq;
2192 for (
auto const& amendment : val->getFieldV256(
sfAmendments))
2197 jvObj[jss::close_time] = *closeTime;
2199 if (
auto const loadFee = (*val)[~
sfLoadFee])
2200 jvObj[jss::load_fee] = *loadFee;
2202 if (
auto const baseFee = val->at(~
sfBaseFee))
2203 jvObj[jss::base_fee] =
static_cast<double>(*baseFee);
2206 jvObj[jss::reserve_base] = *reserveBase;
2209 jvObj[jss::reserve_inc] = *reserveInc;
2214 baseFeeXRP && baseFeeXRP->native())
2215 jvObj[jss::base_fee] = baseFeeXRP->xrp().jsonClipped();
2218 reserveBaseXRP && reserveBaseXRP->native())
2219 jvObj[jss::reserve_base] = reserveBaseXRP->xrp().jsonClipped();
2222 reserveIncXRP && reserveIncXRP->native())
2223 jvObj[jss::reserve_inc] = reserveIncXRP->xrp().jsonClipped();
2228 visit<RPC::apiMinimumSupportedVersion, RPC::apiMaximumValidVersion>(
2232 if (jvTx.
isMember(jss::ledger_index) && apiVersion < 2)
2234 jvTx[jss::ledger_index] =
2235 std::to_string(jvTx[jss::ledger_index].asUInt());
2242 if (
auto p = i->second.lock())
2266 jvObj[jss::type] =
"peerStatusChange";
2275 p->send(jvObj,
true);
2289 using namespace std::chrono_literals;
2321 <<
"recvValidation " << val->getLedgerHash() <<
" from " << source;
2351 "This server is amendment blocked, and must be updated to be "
2352 "able to stay in sync with the network.";
2359 "This server has an expired validator list. validators.txt "
2360 "may be incorrectly configured or some [validator_list_sites] "
2361 "may be unreachable.";
2368 "One or more unsupported amendments have reached majority. "
2369 "Upgrade to the latest version before they are activated "
2370 "to avoid being amendment blocked.";
2371 if (
auto const expected =
2375 d[jss::expected_date] = expected->time_since_epoch().count();
2376 d[jss::expected_date_UTC] =
to_string(*expected);
2380 if (warnings.size())
2381 info[jss::warnings] = std::move(warnings);
2396 info[jss::time] =
to_string(std::chrono::floor<std::chrono::microseconds>(
2400 info[jss::network_ledger] =
"waiting";
2402 info[jss::validation_quorum] =
2410 info[jss::node_size] =
"tiny";
2413 info[jss::node_size] =
"small";
2416 info[jss::node_size] =
"medium";
2419 info[jss::node_size] =
"large";
2422 info[jss::node_size] =
"huge";
2431 info[jss::validator_list_expires] =
2432 safe_cast<Json::UInt>(when->time_since_epoch().count());
2434 info[jss::validator_list_expires] = 0;
2444 if (*when == TimeKeeper::time_point::max())
2446 x[jss::expiration] =
"never";
2447 x[jss::status] =
"active";
2454 x[jss::status] =
"active";
2456 x[jss::status] =
"expired";
2461 x[jss::status] =
"unknown";
2462 x[jss::expiration] =
"unknown";
2466 info[jss::io_latency_ms] =
2473 info[jss::pubkey_validator] =
toBase58(
2478 info[jss::pubkey_validator] =
"none";
2491 info[jss::counters][jss::nodestore] = nodestore;
2495 info[jss::pubkey_node] =
2501 info[jss::amendment_blocked] =
true;
2516 lastClose[jss::converge_time_s] =
2521 lastClose[jss::converge_time] =
2525 info[jss::last_close] = lastClose;
2535 info[jss::network_id] =
static_cast<Json::UInt>(*netid);
2537 auto const escalationMetrics =
2545 auto const loadFactorFeeEscalation =
2547 escalationMetrics.openLedgerFeeLevel,
2549 escalationMetrics.referenceFeeLevel)
2553 safe_cast<std::uint64_t>(loadFactorServer),
2554 loadFactorFeeEscalation);
2558 info[jss::load_base] = loadBaseServer;
2559 info[jss::load_factor] =
trunc32(loadFactor);
2560 info[jss::load_factor_server] = loadFactorServer;
2567 info[jss::load_factor_fee_escalation] =
2568 escalationMetrics.openLedgerFeeLevel.jsonClipped();
2569 info[jss::load_factor_fee_queue] =
2570 escalationMetrics.minProcessingFeeLevel.jsonClipped();
2571 info[jss::load_factor_fee_reference] =
2572 escalationMetrics.referenceFeeLevel.jsonClipped();
2576 info[jss::load_factor] =
2577 static_cast<double>(loadFactor) / loadBaseServer;
2579 if (loadFactorServer != loadFactor)
2580 info[jss::load_factor_server] =
2581 static_cast<double>(loadFactorServer) / loadBaseServer;
2586 if (fee != loadBaseServer)
2587 info[jss::load_factor_local] =
2588 static_cast<double>(fee) / loadBaseServer;
2590 if (fee != loadBaseServer)
2591 info[jss::load_factor_net] =
2592 static_cast<double>(fee) / loadBaseServer;
2594 if (fee != loadBaseServer)
2595 info[jss::load_factor_cluster] =
2596 static_cast<double>(fee) / loadBaseServer;
2598 if (escalationMetrics.openLedgerFeeLevel !=
2599 escalationMetrics.referenceFeeLevel &&
2600 (admin || loadFactorFeeEscalation != loadFactor))
2601 info[jss::load_factor_fee_escalation] =
2602 escalationMetrics.openLedgerFeeLevel.decimalFromReference(
2603 escalationMetrics.referenceFeeLevel);
2604 if (escalationMetrics.minProcessingFeeLevel !=
2605 escalationMetrics.referenceFeeLevel)
2606 info[jss::load_factor_fee_queue] =
2607 escalationMetrics.minProcessingFeeLevel
2608 .decimalFromReference(
2609 escalationMetrics.referenceFeeLevel);
2623 XRPAmount const baseFee = lpClosed->fees().base;
2625 l[jss::seq] =
Json::UInt(lpClosed->info().seq);
2626 l[jss::hash] =
to_string(lpClosed->info().hash);
2631 l[jss::reserve_base] =
2632 lpClosed->fees().accountReserve(0).jsonClipped();
2633 l[jss::reserve_inc] = lpClosed->fees().increment.jsonClipped();
2635 lpClosed->info().closeTime.time_since_epoch().count());
2640 l[jss::reserve_base_xrp] =
2641 lpClosed->fees().accountReserve(0).decimalXRP();
2642 l[jss::reserve_inc_xrp] = lpClosed->fees().increment.decimalXRP();
2645 std::abs(closeOffset.count()) >= 60)
2646 l[jss::close_time_offset] =
2649 #if RIPPLED_REPORTING
2659 Json::UInt(age < highAgeThreshold ? age.count() : 0);
2663 auto lCloseTime = lpClosed->info().closeTime;
2665 if (lCloseTime <= closeTime)
2667 using namespace std::chrono_literals;
2668 auto age = closeTime - lCloseTime;
2670 Json::UInt(age < highAgeThreshold ? age.count() : 0);
2677 info[jss::validated_ledger] = l;
2679 info[jss::closed_ledger] = l;
2683 info[jss::published_ledger] =
"none";
2684 else if (lpPublished->info().seq != lpClosed->info().seq)
2685 info[jss::published_ledger] = lpPublished->info().seq;
2692 info[jss::jq_trans_overflow] =
2694 info[jss::peer_disconnects] =
2696 info[jss::peer_disconnects_resources] =
2706 "http",
"https",
"peer",
"ws",
"ws2",
"wss",
"wss2"};
2714 !(port.admin_nets_v4.empty() && port.admin_nets_v6.empty() &&
2715 port.admin_user.empty() && port.admin_password.empty()))
2729 for (
auto const& p : proto)
2730 jv[jss::protocol].append(p);
2737 auto const optPort = grpcSection.
get(
"port");
2738 if (optPort && grpcSection.get(
"ip"))
2741 jv[jss::port] = *optPort;
2743 jv[jss::protocol].append(
"grpc");
2746 info[jss::ports] = std::move(ports);
2771 transJson(transaction, result,
false, ledger, std::nullopt);
2803 if (jvObj[jss::validated].asBool())
2815 p->send(jvObj,
true);
2836 if (
auto p = i->second.lock())
2838 p->send(jvObj,
true);
2856 if (
auto p = i->second.lock())
2858 p->send(jvObj,
true);
2871 for (
auto& jv : jvObj)
2877 else if (jv.isString())
2901 if (jvObj.
isMember(jss::transaction))
2910 << __func__ <<
" : "
2911 <<
"error parsing json for accounts affected";
2920 for (
auto const& affectedAccount : accounts)
2925 auto it = simiIt->second.begin();
2927 while (it != simiIt->second.end())
2938 it = simiIt->second.erase(it);
2945 <<
" iProposed=" << iProposed;
2947 if (!notify.
empty())
2950 isrListener->send(jvObj,
true);
2964 alpAccepted = std::make_shared<AcceptedLedger>(lpAccepted,
app_);
2966 lpAccepted->info().hash, alpAccepted);
2969 assert(alpAccepted->getLedger().
get() == lpAccepted.
get());
2973 <<
"Publishing ledger " << lpAccepted->info().seq <<
" "
2974 << lpAccepted->info().hash;
2982 jvObj[jss::type] =
"ledgerClosed";
2983 jvObj[jss::ledger_index] = lpAccepted->info().seq;
2984 jvObj[jss::ledger_hash] =
to_string(lpAccepted->info().hash);
2986 lpAccepted->info().closeTime.time_since_epoch().count());
2990 jvObj[jss::fee_base] = lpAccepted->fees().base.jsonClipped();
2991 jvObj[jss::reserve_base] =
2992 lpAccepted->fees().accountReserve(0).jsonClipped();
2993 jvObj[jss::reserve_inc] =
2994 lpAccepted->fees().increment.jsonClipped();
2996 jvObj[jss::txn_count] =
Json::UInt(alpAccepted->size());
3000 jvObj[jss::validated_ledgers] =
3010 p->send(jvObj,
true);
3028 p->send(jvObj,
true);
3037 static bool firstTime =
true;
3044 for (
auto& inner : outer.second)
3046 auto& subInfo = inner.second;
3047 if (subInfo.index_->separationLedgerSeq_ == 0)
3050 alpAccepted->getLedger(), subInfo);
3059 for (
auto const& accTx : *alpAccepted)
3063 lpAccepted, *accTx, accTx == *(--alpAccepted->end()));
3092 "reportConsensusStateChange->pubConsensus",
3123 jvObj[jss::type] =
"transaction";
3127 jvObj[jss::transaction] =
3134 jvObj[jss::meta], *ledger, transaction, meta->
get());
3137 if (!ledger->open())
3138 jvObj[jss::ledger_hash] =
to_string(ledger->info().hash);
3142 jvObj[jss::ledger_index] = ledger->info().seq;
3143 jvObj[jss::transaction][jss::date] =
3144 ledger->info().closeTime.time_since_epoch().count();
3145 jvObj[jss::validated] =
true;
3146 jvObj[jss::close_time_iso] =
to_string_iso(ledger->info().closeTime);
3152 jvObj[jss::validated] =
false;
3153 jvObj[jss::ledger_current_index] = ledger->info().seq;
3156 jvObj[jss::status] = validated ?
"closed" :
"proposed";
3157 jvObj[jss::engine_result] = sToken;
3158 jvObj[jss::engine_result_code] = result;
3159 jvObj[jss::engine_result_message] = sHuman;
3163 auto const account = transaction->getAccountID(
sfAccount);
3164 auto const amount = transaction->getFieldAmount(
sfTakerGets);
3167 if (account != amount.issue().account)
3175 jvObj[jss::transaction][jss::owner_funds] = ownerFunds.getText();
3181 visit<RPC::apiMinimumSupportedVersion, RPC::apiMaximumValidVersion>(
3185 jvTx[jss::transaction], transaction->getTxnType(), apiVersion);
3189 jvTx[jss::tx_json] = jvTx.
removeMember(jss::transaction);
3190 jvTx[jss::hash] = hash;
3194 jvTx[jss::transaction][jss::hash] = hash;
3207 auto const& stTxn = transaction.
getTxn();
3211 auto const trResult = transaction.
getResult();
3266 auto const currLedgerSeq = ledger->seq();
3273 for (
auto const& affectedAccount : transaction.
getAffected())
3278 auto it = simiIt->second.begin();
3280 while (it != simiIt->second.end())
3291 it = simiIt->second.erase(it);
3298 auto it = simiIt->second.begin();
3299 while (it != simiIt->second.end())
3310 it = simiIt->second.erase(it);
3317 auto& subs = histoIt->second;
3318 auto it = subs.begin();
3319 while (it != subs.end())
3322 if (currLedgerSeq <= info.index_->separationLedgerSeq_)
3336 it = subs.erase(it);
3347 <<
"pubAccountTransaction: "
3348 <<
"proposed=" << iProposed <<
", accepted=" << iAccepted;
3350 if (!notify.
empty() || !accountHistoryNotify.
empty())
3352 auto const& stTxn = transaction.
getTxn();
3356 auto const trResult = transaction.
getResult();
3367 jvObj.set(jss::account_history_boundary,
true);
3370 jvObj.
isMember(jss::account_history_tx_stream) ==
3371 MultiApiJson::none);
3372 for (
auto& info : accountHistoryNotify)
3374 auto& index = info.index_;
3375 if (index->forwardTxIndex_ == 0 && !index->haveHistorical_)
3376 jvObj.set(jss::account_history_tx_first,
true);
3378 jvObj.set(jss::account_history_tx_index, index->forwardTxIndex_++);
3407 for (
auto const& affectedAccount : tx->getMentionedAccounts())
3412 auto it = simiIt->second.begin();
3414 while (it != simiIt->second.end())
3425 it = simiIt->second.erase(it);
3432 JLOG(
m_journal.
trace()) <<
"pubProposedAccountTransaction: " << iProposed;
3434 if (!notify.
empty() || !accountHistoryNotify.
empty())
3445 jvObj.
isMember(jss::account_history_tx_stream) ==
3446 MultiApiJson::none);
3447 for (
auto& info : accountHistoryNotify)
3449 auto& index = info.index_;
3450 if (index->forwardTxIndex_ == 0 && !index->haveHistorical_)
3451 jvObj.set(jss::account_history_tx_first,
true);
3452 jvObj.set(jss::account_history_tx_index, index->forwardTxIndex_++);
3472 for (
auto const& naAccountID : vnaAccountIDs)
3475 <<
"subAccount: account: " <<
toBase58(naAccountID);
3477 isrListener->insertSubAccountInfo(naAccountID, rt);
3482 for (
auto const& naAccountID : vnaAccountIDs)
3484 auto simIterator = subMap.
find(naAccountID);
3485 if (simIterator == subMap.
end())
3489 usisElement[isrListener->getSeq()] = isrListener;
3491 subMap.
insert(simIterator, make_pair(naAccountID, usisElement));
3496 simIterator->second[isrListener->getSeq()] = isrListener;
3507 for (
auto const& naAccountID : vnaAccountIDs)
3510 isrListener->deleteSubAccountInfo(naAccountID, rt);
3527 for (
auto const& naAccountID : vnaAccountIDs)
3529 auto simIterator = subMap.
find(naAccountID);
3531 if (simIterator != subMap.
end())
3534 simIterator->second.erase(uSeq);
3536 if (simIterator->second.empty())
3539 subMap.
erase(simIterator);
3548 enum DatabaseType { Postgres, Sqlite, None };
3549 static const auto databaseType = [&]() -> DatabaseType {
3550 #ifdef RIPPLED_REPORTING
3557 return DatabaseType::Postgres;
3559 return DatabaseType::None;
3567 return DatabaseType::Sqlite;
3569 return DatabaseType::None;
3576 return DatabaseType::Sqlite;
3578 return DatabaseType::None;
3582 if (databaseType == DatabaseType::None)
3585 <<
"AccountHistory job for account "
3597 "AccountHistoryTxStream",
3598 [
this, dbType = databaseType, subInfo]() {
3599 auto const& accountId = subInfo.
index_->accountId_;
3600 auto& lastLedgerSeq = subInfo.
index_->historyLastLedgerSeq_;
3601 auto& txHistoryIndex = subInfo.
index_->historyTxIndex_;
3604 <<
"AccountHistory job for account " <<
toBase58(accountId)
3605 <<
" started. lastLedgerSeq=" << lastLedgerSeq;
3615 auto stx = tx->getSTransaction();
3616 if (stx->getAccountID(
sfAccount) == accountId &&
3617 stx->getSeqProxy().value() == 1)
3621 for (
auto& node : meta->getNodes())
3628 if (
auto inner =
dynamic_cast<const STObject*
>(
3633 inner->getAccountID(
sfAccount) == accountId)
3645 bool unsubscribe) ->
bool {
3648 sptr->send(jvObj,
true);
3658 bool unsubscribe) ->
bool {
3690 auto [txResult, status] = db->getAccountTx(args);
3694 <<
"AccountHistory job for account "
3696 <<
" getAccountTx failed";
3701 std::get_if<RelationalDatabase::AccountTxs>(
3702 &txResult.transactions);
3710 <<
"AccountHistory job for account "
3712 <<
" getAccountTx wrong data";
3720 accountId, minLedger, maxLedger, marker, 0,
true};
3721 return db->newestAccountTxPage(options);
3733 while (lastLedgerSeq >= 2 && !subInfo.
index_->stopHistorical_)
3735 int feeChargeCount = 0;
3744 <<
"AccountHistory job for account "
3745 <<
toBase58(accountId) <<
" no InfoSub. Fee charged "
3746 << feeChargeCount <<
" times.";
3751 auto startLedgerSeq =
3752 (lastLedgerSeq > 1024 + 2 ? lastLedgerSeq - 1024 : 2);
3754 <<
"AccountHistory job for account " <<
toBase58(accountId)
3755 <<
", working on ledger range [" << startLedgerSeq <<
","
3756 << lastLedgerSeq <<
"]";
3758 auto haveRange = [&]() ->
bool {
3761 auto haveSomeValidatedLedgers =
3763 validatedMin, validatedMax);
3765 return haveSomeValidatedLedgers &&
3766 validatedMin <= startLedgerSeq &&
3767 lastLedgerSeq <= validatedMax;
3773 <<
"AccountHistory reschedule job for account "
3774 <<
toBase58(accountId) <<
", incomplete ledger range ["
3775 << startLedgerSeq <<
"," << lastLedgerSeq <<
"]";
3781 while (!subInfo.
index_->stopHistorical_)
3784 getMoreTxns(startLedgerSeq, lastLedgerSeq, marker);
3788 <<
"AccountHistory job for account "
3789 <<
toBase58(accountId) <<
" getMoreTxns failed.";
3794 auto const& txns = dbResult->first;
3795 marker = dbResult->second;
3796 size_t num_txns = txns.size();
3797 for (
size_t i = 0; i < num_txns; ++i)
3799 auto const& [tx, meta] = txns[i];
3804 <<
"AccountHistory job for account "
3805 <<
toBase58(accountId) <<
" empty tx or meta.";
3815 <<
"AccountHistory job for account "
3816 <<
toBase58(accountId) <<
" no ledger.";
3821 tx->getSTransaction();
3825 <<
"AccountHistory job for account "
3827 <<
" getSTransaction failed.";
3833 auto const trR = meta->getResultTER();
3835 transJson(stTxn, trR,
true, curTxLedger, mRef);
3838 jss::account_history_tx_index, txHistoryIndex--);
3839 if (i + 1 == num_txns ||
3840 txns[i + 1].first->getLedger() != tx->getLedger())
3841 jvTx.set(jss::account_history_boundary,
true);
3843 if (isFirstTx(tx, meta))
3845 jvTx.set(jss::account_history_tx_first,
true);
3846 sendMultiApiJson(jvTx,
false);
3849 <<
"AccountHistory job for account "
3851 <<
" done, found last tx.";
3856 sendMultiApiJson(jvTx,
false);
3863 <<
"AccountHistory job for account "
3865 <<
" paging, marker=" << marker->ledgerSeq <<
":"
3874 if (!subInfo.
index_->stopHistorical_)
3876 lastLedgerSeq = startLedgerSeq - 1;
3877 if (lastLedgerSeq <= 1)
3880 <<
"AccountHistory job for account "
3882 <<
" done, reached genesis ledger.";
3895 subInfo.
index_->separationLedgerSeq_ = ledger->seq();
3896 auto const& accountId = subInfo.
index_->accountId_;
3898 if (!ledger->exists(accountKeylet))
3901 <<
"subAccountHistoryStart, no account " <<
toBase58(accountId)
3902 <<
", no need to add AccountHistory job.";
3907 if (
auto const sleAcct = ledger->read(accountKeylet); sleAcct)
3912 <<
"subAccountHistoryStart, genesis account "
3914 <<
" does not have tx, no need to add AccountHistory job.";
3924 subInfo.
index_->historyLastLedgerSeq_ = ledger->seq();
3925 subInfo.
index_->haveHistorical_ =
true;
3928 <<
"subAccountHistoryStart, add AccountHistory job: accountId="
3929 <<
toBase58(accountId) <<
", currentLedgerSeq=" << ledger->seq();
3939 if (!isrListener->insertSubAccountHistory(accountId))
3942 <<
"subAccountHistory, already subscribed to account "
3949 isrListener, std::make_shared<SubAccountHistoryIndex>(accountId)};
3954 inner.
emplace(isrListener->getSeq(), ahi);
3960 simIterator->second.emplace(isrListener->getSeq(), ahi);
3974 <<
"subAccountHistory, no validated ledger yet, delay start";
3987 isrListener->deleteSubAccountHistory(account);
4001 auto& subInfoMap = simIterator->second;
4002 auto subInfoIter = subInfoMap.find(seq);
4003 if (subInfoIter != subInfoMap.end())
4005 subInfoIter->second.index_->stopHistorical_ =
true;
4010 simIterator->second.erase(seq);
4011 if (simIterator->second.empty())
4017 <<
"unsubAccountHistory, account " <<
toBase58(account)
4018 <<
", historyOnly = " << (historyOnly ?
"true" :
"false");
4026 listeners->addSubscriber(isrListener);
4036 listeners->removeSubscriber(uSeq);
4050 Throw<std::runtime_error>(
4051 "Operation only possible in STANDALONE mode.");
4066 jvResult[jss::ledger_index] = lpClosed->info().seq;
4067 jvResult[jss::ledger_hash] =
to_string(lpClosed->info().hash);
4069 lpClosed->info().closeTime.time_since_epoch().count());
4072 jvResult[jss::fee_base] = lpClosed->fees().base.jsonClipped();
4073 jvResult[jss::reserve_base] =
4074 lpClosed->fees().accountReserve(0).jsonClipped();
4075 jvResult[jss::reserve_inc] = lpClosed->fees().increment.jsonClipped();
4080 jvResult[jss::validated_ledgers] =
4086 .emplace(isrListener->getSeq(), isrListener)
4096 .emplace(isrListener->getSeq(), isrListener)
4122 .emplace(isrListener->getSeq(), isrListener)
4150 jvResult[jss::random] =
to_string(uRandom);
4152 jvResult[jss::load_base] = feeTrack.getLoadBase();
4153 jvResult[jss::load_factor] = feeTrack.getLoadFactor();
4154 jvResult[jss::hostid] =
getHostId(admin);
4155 jvResult[jss::pubkey_node] =
4160 .emplace(isrListener->getSeq(), isrListener)
4178 .emplace(isrListener->getSeq(), isrListener)
4196 .emplace(isrListener->getSeq(), isrListener)
4214 .emplace(isrListener->getSeq(), isrListener)
4238 .emplace(isrListener->getSeq(), isrListener)
4256 .emplace(isrListener->getSeq(), isrListener)
4304 if (map.find(pInfo->getSeq()) != map.end())
4311 #ifndef USE_NEW_BOOK_PAGE
4322 unsigned int iLimit,
4332 uint256 uTipIndex = uBookBase;
4336 stream <<
"getBookPage:" << book;
4337 stream <<
"getBookPage: uBookBase=" << uBookBase;
4338 stream <<
"getBookPage: uBookEnd=" << uBookEnd;
4339 stream <<
"getBookPage: uTipIndex=" << uTipIndex;
4348 bool bDirectAdvance =
true;
4352 unsigned int uBookEntry;
4358 while (!bDone && iLimit-- > 0)
4362 bDirectAdvance =
false;
4366 auto const ledgerIndex = view.
succ(uTipIndex, uBookEnd);
4370 sleOfferDir.
reset();
4379 uTipIndex = sleOfferDir->key();
4382 cdirFirst(view, uTipIndex, sleOfferDir, uBookEntry, offerIndex);
4385 <<
"getBookPage: uTipIndex=" << uTipIndex;
4387 <<
"getBookPage: offerIndex=" << offerIndex;
4397 auto const uOfferOwnerID = sleOffer->getAccountID(
sfAccount);
4398 auto const& saTakerGets = sleOffer->getFieldAmount(
sfTakerGets);
4399 auto const& saTakerPays = sleOffer->getFieldAmount(
sfTakerPays);
4401 bool firstOwnerOffer(
true);
4407 saOwnerFunds = saTakerGets;
4409 else if (bGlobalFreeze)
4417 auto umBalanceEntry = umBalance.
find(uOfferOwnerID);
4418 if (umBalanceEntry != umBalance.
end())
4422 saOwnerFunds = umBalanceEntry->second;
4423 firstOwnerOffer =
false;
4437 if (saOwnerFunds < beast::zero)
4441 saOwnerFunds.
clear();
4449 STAmount saOwnerFundsLimit = saOwnerFunds;
4461 saOwnerFundsLimit =
divide(saOwnerFunds, offerRate);
4464 if (saOwnerFundsLimit >= saTakerGets)
4467 saTakerGetsFunded = saTakerGets;
4473 saTakerGetsFunded = saOwnerFundsLimit;
4475 saTakerGetsFunded.
setJson(jvOffer[jss::taker_gets_funded]);
4479 saTakerGetsFunded, saDirRate, saTakerPays.
issue()))
4480 .setJson(jvOffer[jss::taker_pays_funded]);
4486 saOwnerFunds,
multiply(saTakerGetsFunded, offerRate));
4488 umBalance[uOfferOwnerID] = saOwnerFunds - saOwnerPays;
4492 jvOf[jss::quality] = saDirRate.
getText();
4494 if (firstOwnerOffer)
4495 jvOf[jss::owner_funds] = saOwnerFunds.
getText();
4502 if (!
cdirNext(view, uTipIndex, sleOfferDir, uBookEntry, offerIndex))
4504 bDirectAdvance =
true;
4509 <<
"getBookPage: offerIndex=" << offerIndex;
4529 unsigned int iLimit,
4537 MetaView lesActive(lpLedger,
tapNONE,
true);
4538 OrderBookIterator obIterator(lesActive, book);
4542 const bool bGlobalFreeze = lesActive.isGlobalFrozen(book.
out.
account) ||
4543 lesActive.isGlobalFrozen(book.
in.
account);
4545 while (iLimit-- > 0 && obIterator.nextOffer())
4550 auto const uOfferOwnerID = sleOffer->getAccountID(
sfAccount);
4551 auto const& saTakerGets = sleOffer->getFieldAmount(
sfTakerGets);
4552 auto const& saTakerPays = sleOffer->getFieldAmount(
sfTakerPays);
4553 STAmount saDirRate = obIterator.getCurrentRate();
4559 saOwnerFunds = saTakerGets;
4561 else if (bGlobalFreeze)
4569 auto umBalanceEntry = umBalance.
find(uOfferOwnerID);
4571 if (umBalanceEntry != umBalance.
end())
4575 saOwnerFunds = umBalanceEntry->second;
4581 saOwnerFunds = lesActive.accountHolds(
4587 if (saOwnerFunds.isNegative())
4591 saOwnerFunds.zero();
4598 STAmount saTakerGetsFunded;
4599 STAmount saOwnerFundsLimit = saOwnerFunds;
4611 saOwnerFundsLimit =
divide(saOwnerFunds, offerRate);
4614 if (saOwnerFundsLimit >= saTakerGets)
4617 saTakerGetsFunded = saTakerGets;
4622 saTakerGetsFunded = saOwnerFundsLimit;
4624 saTakerGetsFunded.setJson(jvOffer[jss::taker_gets_funded]);
4630 multiply(saTakerGetsFunded, saDirRate, saTakerPays.issue()))
4631 .setJson(jvOffer[jss::taker_pays_funded]);
4634 STAmount saOwnerPays = (
parityRate == offerRate)
4637 saOwnerFunds,
multiply(saTakerGetsFunded, offerRate));
4639 umBalance[uOfferOwnerID] = saOwnerFunds - saOwnerPays;
4641 if (!saOwnerFunds.isZero() || uOfferOwnerID == uTakerID)
4645 jvOf[jss::quality] = saDirRate.
getText();
4660 auto const current = std::chrono::duration_cast<std::chrono::microseconds>(
4700 ++counters_[
static_cast<std::size_t>(om)].transitions;
4702 counters_[
static_cast<std::size_t>(om)].transitions == 1)
4704 initialSyncUs_ = std::chrono::duration_cast<std::chrono::microseconds>(
4705 now - processStart_)
4709 std::chrono::duration_cast<std::chrono::microseconds>(now - start_);
4718 auto [counters, mode, start, initialSync] = getCounterData();
4719 auto const current = std::chrono::duration_cast<std::chrono::microseconds>(
4729 auto& state = obj[jss::state_accounting][
states_[i]];
4730 state[jss::transitions] =
std::to_string(counters[i].transitions);
4731 state[jss::duration_us] =
std::to_string(counters[i].dur.count());
4735 obj[jss::initial_sync_duration_us] =
std::to_string(initialSync);
4750 boost::asio::io_service& io_svc,
4754 return std::make_unique<NetworkOPsImp>(
void forwardManifest(Json::Value const &jvObj) override
bool unsubValidations(std::uint64_t uListener) override
beast::insight::Hook hook
bool subValidations(InfoSub::ref ispListener) override
void processHeartbeatTimer()
Provides server functionality for clients.
const SF_UINT64 sfIndexNext
std::uint32_t historyLastLedgerSeq_
bool getValidatedRange(std::uint32_t &minVal, std::uint32_t &maxVal)
ConsensusPhase phase() const
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
void mapComplete(std::shared_ptr< SHAMap > const &map, bool fromAcquire) override
Rate transferRate(ReadView const &view, AccountID const &issuer)
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
bool unsubConsensus(std::uint64_t uListener) override
std::string domain
The domain, if one was specified in the manifest; empty otherwise.
virtual OrderBookDB & getOrderBookDB()=0
void setTimerDelay(std::optional< std::chrono::milliseconds > td=std::nullopt)
A peer's signed, proposed position for use in RCLConsensus.
@ ledgerMaster
ledger master data for signing
bool processTrustedProposal(RCLCxPeerPos proposal) override
void setAccountHistoryJobTimer(SubAccountHistoryInfoWeak subInfo)
const SF_AMOUNT sfBaseFeeDrops
virtual Json::Value getInfo()=0
void stateAccounting(Json::Value &obj) override
SubmitSync
Possible values for defining synchronous behavior of the transaction submission API.
const SF_UINT32 sfReserveBase
virtual Cluster & cluster()=0
Json::Value const &select(auto &&selector) const requires std IsMemberResult isMember(const char *key) const
std::shared_ptr< ReadView const > getPublishedLedger()
std::optional< Dest > mulDiv(Source1 value, Dest mul, Source2 div)
const uint256 featureXRPFees
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
std::shared_ptr< OpenView const > current() const
Returns a view to the current open ledger.
ServerFeeSummary mLastFeeSummary
PublicKey localPublicKey() const
Returns local validator public key.
const std::chrono::steady_clock::time_point processStart_
@ proposing
We are normal participant in consensus and propose our position.
boost::asio::steady_timer heartbeatTimer_
PublicKey getMasterKey(PublicKey const &pk) const
Returns ephemeral signing key's master public key.
Json::Value getJson(bool full) const
const std::size_t minPeerCount_
Json::Value rpcError(int iError)
Represents a transfer rate.
void setStateTimer() override
Called to initially start our timers.
void insertDeliverMax(Json::Value &tx_json, TxType txnType, unsigned int apiVersion)
Copy Amount field to DeliverMax field in transaction output JSON.
void startRound(NetClock::time_point const &now, RCLCxLedger::ID const &prevLgrId, RCLCxLedger const &prevLgr, hash_set< NodeID > const &nowUntrusted, hash_set< NodeID > const &nowTrusted)
Adjust the set of trusted validators and kick-off the next round of consensus.
void json(Json::Value &obj) const
Output state counters in JSON format.
Stream trace() const
Severity stream access functions.
const SF_UINT32 sfLedgerSequence
std::shared_ptr< STTx const > const & getTxn() const
void pubAccountTransaction(std::shared_ptr< ReadView const > const &ledger, AcceptedLedgerTx const &transaction, bool last)
Issue const & issue() const
int getFlags(uint256 const &key)
const Charge feeMediumBurdenRPC
Changes in trusted nodes after updating validator list.
Data format for exchanging consumption information across peers.
void setAmendmentWarned() override
void pubManifest(Manifest const &) override
bool subPeerStatus(InfoSub::ref ispListener) override
DispatchState mDispatchState
@ arrayValue
array value (ordered list)
void setBatchApplyTimer() override
std::pair< TER, bool > apply(Application &app, OpenView &view, std::shared_ptr< STTx const > const &tx, ApplyFlags flags, beast::Journal j)
Add a new transaction to the open ledger, hold it in the queue, or reject it.
virtual std::uint64_t getJqTransOverflow() const =0
SubInfoMapType mSubRTAccount
std::atomic< bool > amendmentWarned_
static const std::array< char const *, 5 > states_
const SF_UINT32 sfSequence
@ wrongLedger
We have the wrong ledger and are attempting to acquire it.
LedgerIndex getValidLedgerIndex()
virtual AmendmentTable & getAmendmentTable()=0
void setMode(OperatingMode om) override
std::string const & name() const
Writable ledger view that accumulates state and tx changes.
Value get(UInt index, const Value &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
Decorator for streaming out compact json.
uint256 getBookBase(Book const &book)
std::chrono::microseconds dur
PublicKey signingKey
The ephemeral key associated with this manifest.
void pubProposedAccountTransaction(std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &transaction, TER result)
bool isUNLBlocked() override
std::string serialized
The manifest in serialized form.
void trustChanged(hash_set< NodeID > const &added, hash_set< NodeID > const &removed)
Update trust status of validations.
void setNeedNetworkLedger() override
bool tryRemoveRpcSub(std::string const &strUrl) override
PublicKey masterKey
The master key associated with this manifest.
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
bool empty() const noexcept
std::string getText() const override
bool recvValidation(std::shared_ptr< STValidation > const &val, std::string const &source) override
T back_inserter(T... args)
void setNegativeUNL(hash_set< PublicKey > const &negUnl)
set the Negative UNL with validators' master public keys
std::string getHostId(bool forAdmin)
void gotTxSet(NetClock::time_point const &now, RCLTxSet const &txSet)
void forwardProposedTransaction(Json::Value const &jvObj) override
QuorumKeys getQuorumKeys() const
Get the quorum and all of the trusted keys.
boost::asio::steady_timer batchApplyTimer_
This timer is for applying transaction batches.
virtual void trustChanged(hash_set< PublicKey > const &allTrusted)=0
csprng_engine & crypto_prng()
The default cryptographically secure PRNG.
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
Rules getValidatedRules()
Json::Value getJson(int c=0)
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
beast::insight::Gauge disconnected_duration
constexpr auto muldiv_max
void switchLCL(std::shared_ptr< Ledger const > const &lastClosed)
Keylet child(uint256 const &key) noexcept
Any item that can be in an owner dir.
void consensusViewChange() override
Json::Value computeBookChanges(std::shared_ptr< L const > const &lpAccepted)
std::chrono::seconds closeOffset() const
StateAccounting accounting_
std::chrono::milliseconds ledgerGRANULARITY
How often we check state or change positions.
void unsubAccountHistoryInternal(std::uint64_t seq, AccountID const &account, bool historyOnly) override
virtual NodeStore::DatabaseShard * getShardStore()=0
std::string to_string_iso(date::sys_time< Duration > tp)
const SF_UINT32 sfCloseTime
std::shared_ptr< SubAccountHistoryIndex > index_
std::shared_ptr< Ledger const > getLedgerByHash(uint256 const &hash)
void timerEntry(NetClock::time_point const &now)
virtual std::size_t size() const =0
Returns the number of active peers.
MultiApiJson transJson(std::shared_ptr< STTx const > const &transaction, TER result, bool validated, std::shared_ptr< ReadView const > const &ledger, std::optional< std::reference_wrapper< TxMeta const >> meta)
void apply(std::unique_lock< std::mutex > &batchLock)
Attempt to apply transactions and post-process based on the results.
bool addJob(JobType type, std::string const &name, JobHandler &&jobHandler)
Adds a job to the JobQueue.
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)
beast::insight::Gauge syncing_transitions
std::uint32_t getLoadBase() const
std::atomic< bool > unlBlocked_
SubAccountHistoryIndex(AccountID const &accountId)
uint256 getQualityNext(uint256 const &uBase)
virtual TimeKeeper & timeKeeper()=0
virtual MutexType & getMasterMutex()=0
void forwardProposedAccountTransaction(Json::Value const &jvObj) override
virtual OpenLedger & openLedger()=0
void pubLedger(std::shared_ptr< ReadView const > const &lpAccepted) override
bool update(PublicKey const &identity, std::string name, std::uint32_t loadFee=0, NetClock::time_point reportTime=NetClock::time_point{})
Store information about the state of a cluster node.
void switchLastClosedLedger(std::shared_ptr< Ledger const > const &newLCL)
void setUNLBlocked() override
Structure returned by TxQ::getMetrics, expressed in reference fee level units.
Wraps a ledger instance for use in generic Validations LedgerTrie.
void accept(Application &app, Rules const &rules, std::shared_ptr< Ledger const > const &ledger, OrderedTxs const &locals, bool retriesFirst, OrderedTxs &retries, ApplyFlags flags, std::string const &suffix="", modify_type const &f={})
Accept a new ledger.
time_point closeTime() const
Returns the predicted close time, in network time.
const Rate parityRate(QUALITY_ONE)
A transfer rate signifying a 1:1 exchange.
std::pair< PublicKey, SecretKey > generateKeyPair(KeyType type, Seed const &seed)
Generate a key pair deterministically.
Validator keys and manifest as set in configuration file.
virtual InboundLedgers & getInboundLedgers()=0
virtual LoadFeeTrack & getFeeTrack()=0
constexpr static std::size_t size()
std::string getCompleteLedgers()
@ ltDIR_NODE
A ledger object which contains a list of object identifiers.
Sends a message to all peers.
@ SYNCING
fallen slightly behind
void processClusterTimer()
bool unsubTransactions(std::uint64_t uListener) override
void const * data() const noexcept
const SF_VECTOR256 sfIndexes
void simulate(NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
virtual Gossip exportConsumers()=0
Extract packaged consumer information for export.
std::recursive_mutex & peekMutex()
std::uint32_t loadFactorServer
STAmount divide(STAmount const &amount, Rate const &rate)
~NetworkOPsImp() override
std::uint32_t getRemoteFee() const
const SF_UINT256 sfValidatedHash
std::optional< std::chrono::milliseconds > getTimerDelay() const
Integers of any length that is a multiple of 32-bits.
const SF_AMOUNT sfTakerPays
static void getAccounts(Json::Value const &jvObj, std::vector< AccountID > &accounts)
Manages the generic consensus algorithm for use by the RCL.
@ warnRPC_AMENDMENT_BLOCKED
T time_since_epoch(T... args)
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
beast::insight::Gauge syncing_duration
bool isAmendmentBlocked() override
InfoSub::pointer addRpcSub(std::string const &strUrl, InfoSub::ref) override
void forwardValidation(Json::Value const &jvObj) override
@ ltOFFER
A ledger object which describes an offer on the DEX.
Value & append(const Value &value)
Append value to array at the end.
virtual ReportingETL & getReportingETL()=0
@ DISCONNECTED
not ready to process requests
void clearAmendmentWarned() override
void setJson(Json::Value &) const
void subAccountHistoryStart(std::shared_ptr< ReadView const > const &ledger, SubAccountHistoryInfoWeak &subInfo)
virtual std::chrono::milliseconds getIOLatency()=0
Json::Value getOwnerInfo(std::shared_ptr< ReadView const > lpLedger, AccountID const &account) override
const SF_UINT64 sfServerVersion
std::pair< Validity, std::string > checkValidity(HashRouter &router, STTx const &tx, Rules const &rules, Config const &config)
Checks transaction signature and local checks.
void reportFeeChange() override
std::uint32_t getLocalFee() const
@ CONNECTED
convinced we are talking to the network
std::uint64_t transitions
virtual LoadManager & getLoadManager()=0
std::shared_ptr< InfoSub > pointer
@ objectValue
object value (collection of name/value pairs).
constexpr double decimalXRP() const
const SF_UINT32 sfLoadFee
virtual LedgerMaster & getLedgerMaster()=0
void addAccountHistoryJob(SubAccountHistoryInfoWeak subInfo)
bool isBlocked() override
virtual std::shared_ptr< Ledger const > acquire(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason)=0
Keylet account(AccountID const &id) noexcept
AccountID root.
bool peerProposal(NetClock::time_point const &now, RCLCxPeerPos const &newProposal)
@ TRACKING
convinced we agree with the network
std::uint32_t separationLedgerSeq_
const SF_UINT32 sfReserveIncrement
void setTimer(boost::asio::steady_timer &timer, std::chrono::milliseconds const &expiry_time, std::function< void()> onExpire, std::function< void()> onError)
DispatchState
Synchronization states for transaction batches.
virtual Config & config()=0
Select all peers (except optional excluded) that are in our cluster.
std::chrono::steady_clock::time_point start_
hash_set< NodeID > removed
Represents a set of transactions in RCLConsensus.
Keylet page(uint256 const &key, std::uint64_t index) noexcept
A page in a directory.
void endConsensus() override
std::optional< AccountTxMarker > marker
TrustChanges updateTrusted(hash_set< NodeID > const &seenValidators, NetClock::time_point closeTime, NetworkOPs &ops, Overlay &overlay, HashRouter &hashRouter)
Update trusted nodes.
AccountID calcAccountID(PublicKey const &pk)
void unsubAccount(InfoSub::ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
virtual RelationalDatabase & getRelationalDatabase()=0
virtual std::pair< PublicKey, SecretKey > const & nodeIdentity()=0
bool canBeCurrent(std::shared_ptr< Ledger const > const &ledger)
Check the sequence number and parent close time of a ledger against our clock and last validated ledg...
bool unsubRTTransactions(std::uint64_t uListener) override
Manages the current fee schedule.
std::optional< Blob > getSignature() const
Returns manifest signature.
virtual JobQueue & getJobQueue()=0
bool subManifests(InfoSub::ref ispListener) override
A transaction that is in a closed ledger.
virtual std::optional< NetClock::time_point > firstUnsupportedExpected() const =0
std::vector< Item > items
const std::shared_ptr< Transaction > transaction
void clearUNLBlocked() override
FeeAndSeq getTxRequiredFeeAndSeq(OpenView const &view, std::shared_ptr< STTx const > const &tx) const
Returns minimum required fee for tx and two sequences: first vaild sequence for this account in curre...
Server fees published on server subscription.
std::unique_ptr< LocalTxs > m_localTX
NetworkOPsImp(Application &app, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool start_valid, JobQueue &job_queue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_service &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
ConsensusPhase
Phases of consensus for a single ledger round.
@ warnRPC_EXPIRED_VALIDATOR_LIST
bool isCompatible(ReadView const &, beast::Journal::Stream, char const *reason)
std::string const & getVersionString()
Server version.
const SF_AMOUNT sfTakerGets
bool subBookChanges(InfoSub::ref ispListener) override
FeeSetup setup_FeeVote(Section const §ion)
std::shared_ptr< Ledger const > getLedgerBySeq(std::uint32_t index)
ConsensusMode mode() const
boost::container::flat_set< AccountID > const & getAffected() const
virtual PeerSequence getActivePeers() const =0
Returns a sequence representing the current list of peers.
decltype(counters_) counters
beast::insight::Gauge tracking_duration
constexpr auto apiVersionSelector(unsigned int apiVersion) noexcept
@ warnRPC_UNSUPPORTED_MAJORITY
bool subTransactions(InfoSub::ref ispListener) override
@ current
This was a new validation and was added.
The role of a ClosureCounter is to assist in shutdown by letting callers wait for the completion of c...
std::array< Counters, 5 > counters_
bool isMember(const char *key) const
Return true if the object has a member named key.
bool unsubLedger(std::uint64_t uListener) override
A generic endpoint for log messages.
bool isAmendmentWarned() override
virtual RCLValidations & getValidations()=0
virtual std::set< Peer::id_t > relay(protocol::TMProposeSet &m, uint256 const &uid, PublicKey const &validator)=0
Relay a proposal.
std::atomic< bool > needNetworkLedger_
virtual std::optional< key_type > succ(key_type const &key, std::optional< key_type > const &last=std::nullopt) const =0
Return the key of the next state item.
std::optional< std::set< PeerShortID > > shouldRelay(uint256 const &key)
Determines whether the hashed item should be relayed.
void addHeldTransaction(std::shared_ptr< Transaction > const &trans)
Blob getMasterSignature() const
Returns manifest master key signature.
void foreach(Function f) const
Visit every active peer.
ServerFeeSummary()=default
std::uint32_t getClusterFee() const
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
virtual PublicKey const & getValidationPublicKey() const =0
void pubValidation(std::shared_ptr< STValidation > const &val) override
STAmount amountFromQuality(std::uint64_t rate)
BookListeners::pointer makeBookListeners(Book const &)
void processClosedLedger(Application &app, ReadView const &view, bool timeLeap)
Update fee metrics and clean up the queue in preparation for the next ledger.
const SF_AMOUNT sfReserveIncrementDrops
void subAccount(InfoSub::ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
std::shared_ptr< ReadView const > getCurrentLedger()
time_point now() const override
Returns the current time, using the server's clock.
ConsensusParms const & parms() const
std::size_t size() const
The number of nodes in the cluster list.
decltype(initialSyncUs_) initialSyncUs
const SF_AMOUNT sfReserveBaseDrops
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
@ ttOFFER_CREATE
This transaction type creates an offer to trade one asset for another.
std::int32_t historyTxIndex_
Transaction with input flags and results to be applied in batches.
virtual ValidatorList & validators()=0
A metric for measuring an integral value.
bool isNeedNetworkLedger() override
void resetDeadlockDetector()
Reset the deadlock detection timer.
bool operator!=(ServerFeeSummary const &b) const
std::array< SubMapType, SubTypes::sLastEntry > mStreamMaps
TransactionStatus(std::shared_ptr< Transaction > t, bool a, bool l, FailHard f)
void setStandAlone() override
A pool of threads to perform work.
std::recursive_mutex mSubLock
std::optional< TimeKeeper::time_point > expires() const
Return the time when the validator list will expire.
bool operator==(ServerFeeSummary const &b) const
STAmount multiply(STAmount const &amount, Rate const &rate)
BookListeners::pointer getBookListeners(Book const &)
std::uint32_t forwardTxIndex_
std::uint32_t sequence
The sequence number of this manifest.
virtual Resource::Manager & getResourceManager()=0
std::size_t getFetchPackCacheSize() const
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
const SF_UINT64 sfBaseFee
beast::insight::Gauge tracking_transitions
bool haveValidated()
Whether we have ever fully validated a ledger.
std::chrono::seconds getValidatedLedgerAge()
Seed generateSeed(std::string const &passPhrase)
Generate a seed deterministically.
std::shared_ptr< Ledger const > getClosedLedger()
beast::insight::Gauge connected_transitions
boost::asio::steady_timer clusterTimer_
virtual Json::Value countersJson() const =0
Render performance counters in Json.
std::vector< TransactionStatus > mTransactions
void reportConsensusStateChange(ConsensusPhase phase)
T emplace_back(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool transResultInfo(TER code, std::string &token, std::string &text)
bool unsubServer(std::uint64_t uListener) override
std::chrono::milliseconds prevRoundTime() const
Get duration of the previous round.
void processTransaction(std::shared_ptr< Transaction > &transaction, bool bUnlimited, RPC::SubmitSync sync, bool bLocal, FailHard failType) override
Process a transaction.
std::shared_ptr< STTx const > sterilize(STTx const &stx)
Sterilize a transaction.
std::unordered_set< uint256, beast::uhash<> > features
Stats(Handler const &handler, beast::insight::Collector::ptr const &collector)
bool unsubBookChanges(std::uint64_t uListener) override
virtual NodeStore::Database & getNodeStore()=0
virtual beast::Journal journal(std::string const &name)=0
virtual ManifestCache & validatorManifests()=0
virtual ServerHandler & getServerHandler()=0
std::size_t getLocalTxCount() override
std::uint64_t initialSyncUs_
Value removeMember(const char *key)
Remove and return the named member.
std::size_t size() const noexcept
std::uint32_t getLoadFactor() const
Json::Value getLedgerFetchInfo() override
const SF_UINT16 sfLedgerEntryType
@ Valid
Signature and local checks are good / passed.
bool unsubBook(std::uint64_t uListener, Book const &) override
void canonicalize(std::shared_ptr< Transaction > *pTransaction)
void processTxn(std::shared_ptr< ReadView const > const &ledger, const AcceptedLedgerTx &alTx, MultiApiJson const &jvObj)
std::uint32_t acceptLedger(std::optional< std::chrono::milliseconds > consensusDelay) override
Accepts the current transaction tree, return the new ledger's sequence.
SubInfoMapType mSubAccount
std::string SERVER_DOMAIN
void pubValidatedTransaction(std::shared_ptr< ReadView const > const &ledger, AcceptedLedgerTx const &transaction, bool last)
TxMeta const & getMeta() const
void clearNeedNetworkLedger() override
void rngfill(void *buffer, std::size_t bytes, Generator &g)
Lightweight wrapper to tag static string.
const uint256 featureNegativeUNL
@ ltACCOUNT_ROOT
A ledger object which describes an account.
bool checkLastClosedLedger(const Overlay::PeerSequence &, uint256 &networkClosed)
std::string strOperatingMode(OperatingMode const mode, bool const admin) const override
void getBookPage(std::shared_ptr< ReadView const > &lpLedger, Book const &, AccountID const &uTakerID, const bool bProof, unsigned int iLimit, Json::Value const &jvMarker, Json::Value &jvResult) override
void insertDeliveredAmount(Json::Value &meta, ReadView const &, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &)
Add a delivered_amount field to the meta input/output parameter.
void pubPeerStatus(std::function< Json::Value(void)> const &) override
std::condition_variable mCond
void getCountsJson(Json::Value &obj)
LedgerIndex getCurrentLedgerIndex()
bool subLedger(InfoSub::ref ispListener, Json::Value &jvResult) override
beast::insight::Gauge full_transitions
int RELAY_UNTRUSTED_VALIDATIONS
static const std::array< char const *, 5 > stateNames
error_code_i subAccountHistory(InfoSub::ref ispListener, AccountID const &account) override
subscribe an account's new transactions and retrieve the account's historical transactions
std::size_t prevProposers() const
Get the number of proposing peers that participated in the previous round.
virtual Overlay & overlay()=0
std::atomic< OperatingMode > mMode
std::shared_ptr< Ledger const > getValidatedLedger()
bool unsubManifests(std::uint64_t uListener) override
std::optional< T > get(std::string const &name) const
Rules makeRulesGivenLedger(DigestAwareReadView const &ledger, Rules const ¤t)
std::atomic< bool > amendmentBlocked_
void submitTransaction(std::shared_ptr< STTx const > const &) override
OperatingMode
Specifies the mode under which the server believes it's operating.
virtual std::optional< std::uint32_t > networkID() const =0
Returns the ID of the network this server is configured for, if any.
virtual void clearFailures()=0
void join(char const *name, std::chrono::milliseconds wait, beast::Journal j)
Returns once all counted in-flight closures are destroyed.
ConsensusPhase mLastConsensusPhase
void updateLocalTx(ReadView const &view) override
void pubConsensus(ConsensusPhase phase)
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
void for_each(std::function< void(ClusterNode const &)> func) const
Invokes the callback once for every cluster node.
bool subRTTransactions(InfoSub::ref ispListener) override
NetClock::time_point getReportTime() const
beast::insight::Gauge disconnected_transitions
static const auto genesisAccountId
const SF_ACCOUNT sfAccount
void pubProposedTransaction(std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &transaction, TER result) override
@ ltRIPPLE_STATE
A ledger object which describes a bidirectional trust line.
std::string strHex(FwdIt begin, FwdIt end)
Json::Value getServerInfo(bool human, bool admin, bool counters) override
virtual Json::Value currentJson() const =0
Render currently executing jobs and RPC calls and durations in Json.
LedgerMaster & m_ledgerMaster
bool subServer(InfoSub::ref ispListener, Json::Value &jvResult, bool admin) override
auto getCurrentNodeIDs() -> hash_set< NodeID >
Get the set of node ids associated with current validations.
std::shared_ptr< SubAccountHistoryIndex > index_
std::optional< LedgerSpecifier > ledger
boost::asio::steady_timer accountHistoryTxTimer_
@ SigBad
Signature is bad. Didn't do local checks.
bool validating() const
Whether we are validating consensus ledgers.
std::unique_ptr< LocalTxs > make_LocalTxs()
Metrics getMetrics(OpenView const &view) const
Returns fee metrics in reference fee level units.
void setup(Setup const &setup, beast::Journal journal)
CounterData getCounterData() const
std::unique_ptr< LoadEvent > makeLoadEvent(JobType t, std::string const &name)
Return a scoped LoadEvent.
T set_intersection(T... args)
beast::insight::Gauge full_duration
virtual perf::PerfLog & getPerfLog()=0
send_if_pred< Predicate > send_if(std::shared_ptr< Message > const &m, Predicate const &f)
Helper function to aid in type deduction.
virtual std::uint64_t getPeerDisconnect() const =0
CanonicalTXSet OrderedTxs
bool subBook(InfoSub::ref ispListener, Book const &) override
bool subConsensus(InfoSub::ref ispListener) override
Json::Value getConsensusInfo() override
beast::insight::Gauge connected_duration
std::size_t count() const
Return the number of configured validator list sites.
ClosureCounter< void, boost::system::error_code const & > waitHandlerCounter_
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
std::atomic< bool > stopHistorical_
SubAccountHistoryMapType mSubAccountHistory
void mode(OperatingMode om)
Record state transition.
std::optional< AccountID > accountFromStringStrict(std::string const &account)
Get an AccountID from an account ID or public key.
static const std::array< Json::StaticString const, 5 > states_
static std::string getWordFromBlob(void const *blob, size_t bytes)
Chooses a single dictionary word from the data.
void unsubAccountInternal(std::uint64_t seq, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
const SF_UINT32 sfSigningTime
std::shared_ptr< STTx const > popAcctTransaction(std::shared_ptr< STTx const > const &tx)
Get the next transaction held for a particular account if any.
void unsubAccountHistory(InfoSub::ref ispListener, AccountID const &account, bool historyOnly) override
unsubscribe an account's transactions
State accounting records two attributes for each possible server state: 1) Amount of time spent in ea...
A reference to a handler for performing polled collection.
std::uint64_t getQuality(uint256 const &uBase)
virtual std::uint64_t getPeerDisconnectCharges() const =0
virtual HashRouter & getHashRouter()=0
bool modify(modify_type const &f)
Modify the open ledger.
bool unsubPeerStatus(std::uint64_t uListener) override
bool transactionBatch(bool drain) override
Apply transactions in batches.
bool setFlags(uint256 const &key, int flags)
Set the flags on a hash.
void handleNewValidation(Application &app, std::shared_ptr< STValidation > const &val, std::string const &source)
Handle a new validation.
const AccountID accountId_
bool isTemMalformed(TER x)
static std::uint32_t trunc32(std::uint64_t v)
std::unique_ptr< FeeVote > make_FeeVote(FeeSetup const &setup, beast::Journal journal)
Create an instance of the FeeVote logic.
Json::Value jsonClipped() const
OperatingMode getOperatingMode() const override
PublicKey const & identity() const
std::optional< TxQ::Metrics > em
std::size_t quorum() const
Get quorum value for current trusted key set.
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
const SF_VECTOR256 sfAmendments
InfoSub::pointer findRpcSub(std::string const &strUrl) override
void set(value_type value) const
Set the value on the gauge.
std::uint32_t loadBaseServer
Section & section(std::string const &name)
Returns the section with the given name.
void clearLedgerFetch() override
std::uint32_t getLoadFee() const
std::optional< Substitute< Closure > > wrap(Closure &&closure)
Wrap the passed closure with a reference counter.
Json::Value rate(Account const &account, double multiplier)
Set a transfer rate.
virtual TransactionMaster & getMasterTransaction()=0
Number root(Number f, unsigned d)
bool beginConsensus(uint256 const &networkClosed) override
void setAmendmentBlocked() override
@ FULL
we have the ledger and can even validate