From 5266f049707e4b5d0eecb8f0e397d2cae417f9f7 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 2 Sep 2025 18:26:01 -0400 Subject: [PATCH] chore: rollback unrelated changes (#5737) --- .../consensus/ByzantineFailureSim_test.cpp | 4 +- src/test/overlay/reduce_relay_test.cpp | 5 +- .../app/ledger/detail/TimeoutCounter.cpp | 4 +- src/xrpld/app/main/GRPCServer.cpp | 4 +- src/xrpld/app/misc/AMMHelpers.h | 6 +- src/xrpld/app/misc/detail/AMMUtils.cpp | 4 +- src/xrpld/app/misc/detail/TxQ.cpp | 10 +-- src/xrpld/app/paths/Pathfinder.cpp | 3 +- src/xrpld/app/paths/detail/BookStep.cpp | 3 +- src/xrpld/app/paths/detail/DirectStep.cpp | 3 +- .../app/paths/detail/XRPEndpointStep.cpp | 3 +- src/xrpld/app/rdb/RelationalDatabase.h | 4 +- src/xrpld/app/tx/detail/Batch.cpp | 87 +++++++++---------- src/xrpld/app/tx/detail/CancelOffer.cpp | 8 +- src/xrpld/consensus/Consensus.h | 14 +-- src/xrpld/ledger/detail/View.cpp | 6 +- src/xrpld/overlay/detail/PeerImp.cpp | 4 +- src/xrpld/peerfinder/detail/Logic.h | 6 +- 18 files changed, 92 insertions(+), 86 deletions(-) diff --git a/src/test/consensus/ByzantineFailureSim_test.cpp b/src/test/consensus/ByzantineFailureSim_test.cpp index b979943477..887a060a5b 100644 --- a/src/test/consensus/ByzantineFailureSim_test.cpp +++ b/src/test/consensus/ByzantineFailureSim_test.cpp @@ -68,8 +68,8 @@ class ByzantineFailureSim_test : public beast::unit_test::suite for (TrustGraph::ForkInfo const& fi : sim.trustGraph.forkablePairs(0.8)) { - std::cout << "Can fork " << PeerGroup{fi.unlA} << " " << " " - << PeerGroup{fi.unlB} << " overlap " << fi.overlap + std::cout << "Can fork " << PeerGroup{fi.unlA} << " " + << " " << PeerGroup{fi.unlB} << " overlap " << fi.overlap << " required " << fi.required << "\n"; }; diff --git a/src/test/overlay/reduce_relay_test.cpp b/src/test/overlay/reduce_relay_test.cpp index b7c55eafd3..e53f53f2db 100644 --- a/src/test/overlay/reduce_relay_test.cpp +++ b/src/test/overlay/reduce_relay_test.cpp @@ -897,8 +897,9 @@ protected: printPeers(std::string const& msg, std::uint16_t validator = 0) { auto peers = network_.overlay().getPeers(network_.validator(validator)); - std::cout << msg << " " << "num peers " - << (int)network_.overlay().getNumPeers() << std::endl; + std::cout << msg << " " + << "num peers " << (int)network_.overlay().getNumPeers() + << std::endl; for (auto& [k, v] : peers) std::cout << k << ":" << (int)std::get(v) << " "; diff --git a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp index cdf659f5aa..774b70e4d1 100644 --- a/src/xrpld/app/ledger/detail/TimeoutCounter.cpp +++ b/src/xrpld/app/ledger/detail/TimeoutCounter.cpp @@ -100,8 +100,8 @@ TimeoutCounter::invokeOnTimer() if (!progress_) { ++timeouts_; - JLOG(journal_.debug()) - << "Timeout(" << timeouts_ << ") " << " acquiring " << hash_; + JLOG(journal_.debug()) << "Timeout(" << timeouts_ << ") " + << " acquiring " << hash_; onTimer(false, sl); } else diff --git a/src/xrpld/app/main/GRPCServer.cpp b/src/xrpld/app/main/GRPCServer.cpp index 2ee811dc19..a4bbcda0a5 100644 --- a/src/xrpld/app/main/GRPCServer.cpp +++ b/src/xrpld/app/main/GRPCServer.cpp @@ -447,8 +447,8 @@ GRPCServerImpl::handleRpcs() if (!ok) { - JLOG(journal_.debug()) - << "Request listener cancelled. " << "Destroying object"; + JLOG(journal_.debug()) << "Request listener cancelled. " + << "Destroying object"; erase(ptr); } else diff --git a/src/xrpld/app/misc/AMMHelpers.h b/src/xrpld/app/misc/AMMHelpers.h index 0693973fe5..8cc39468b1 100644 --- a/src/xrpld/app/misc/AMMHelpers.h +++ b/src/xrpld/app/misc/AMMHelpers.h @@ -384,9 +384,9 @@ changeSpotPriceQuality( { JLOG(j.error()) << "changeSpotPriceQuality failed: " << to_string(pool.in) - << " " << to_string(pool.out) << " " << " " << quality - << " " << tfee << " " << to_string(amounts.in) << " " - << to_string(amounts.out); + << " " << to_string(pool.out) << " " + << " " << quality << " " << tfee << " " + << to_string(amounts.in) << " " << to_string(amounts.out); Throw("changeSpotPriceQuality failed"); } else diff --git a/src/xrpld/app/misc/detail/AMMUtils.cpp b/src/xrpld/app/misc/detail/AMMUtils.cpp index 659219bb8e..b56ce2748e 100644 --- a/src/xrpld/app/misc/detail/AMMUtils.cpp +++ b/src/xrpld/app/misc/detail/AMMUtils.cpp @@ -151,8 +151,8 @@ ammLPHolds( } amount.setIssuer(ammAccount); - JLOG(j.trace()) << "ammLPHolds:" << " lpAccount=" - << to_string(lpAccount) + JLOG(j.trace()) << "ammLPHolds:" + << " lpAccount=" << to_string(lpAccount) << " amount=" << amount.getFullText(); } diff --git a/src/xrpld/app/misc/detail/TxQ.cpp b/src/xrpld/app/misc/detail/TxQ.cpp index caa4cba8be..6924dae6c8 100644 --- a/src/xrpld/app/misc/detail/TxQ.cpp +++ b/src/xrpld/app/misc/detail/TxQ.cpp @@ -1504,11 +1504,11 @@ TxQ::accept(Application& app, OpenView& view) } else { - JLOG(j_.debug()) - << "Queued transaction " << candidateIter->txID - << " failed with " << transToken(txnResult) - << ". Leave in queue." << " Applied: " << didApply - << ". Flags: " << candidateIter->flags; + JLOG(j_.debug()) << "Queued transaction " << candidateIter->txID + << " failed with " << transToken(txnResult) + << ". Leave in queue." + << " Applied: " << didApply + << ". Flags: " << candidateIter->flags; if (account.retryPenalty && candidateIter->retriesRemaining > 2) candidateIter->retriesRemaining = 1; else diff --git a/src/xrpld/app/paths/Pathfinder.cpp b/src/xrpld/app/paths/Pathfinder.cpp index e8cef72d2b..74a33ec917 100644 --- a/src/xrpld/app/paths/Pathfinder.cpp +++ b/src/xrpld/app/paths/Pathfinder.cpp @@ -238,7 +238,8 @@ Pathfinder::findPaths( mSource = STPathElement(account, mSrcCurrency, issuer); auto issuerString = mSrcIssuer ? to_string(*mSrcIssuer) : std::string("none"); - JLOG(j_.trace()) << "findPaths>" << " mSrcAccount=" << mSrcAccount + JLOG(j_.trace()) << "findPaths>" + << " mSrcAccount=" << mSrcAccount << " mDstAccount=" << mDstAccount << " mDstAmount=" << mDstAmount.getFullText() << " mSrcCurrency=" << mSrcCurrency diff --git a/src/xrpld/app/paths/detail/BookStep.cpp b/src/xrpld/app/paths/detail/BookStep.cpp index 26d93629c9..554d2525f5 100644 --- a/src/xrpld/app/paths/detail/BookStep.cpp +++ b/src/xrpld/app/paths/detail/BookStep.cpp @@ -190,7 +190,8 @@ protected: logStringImpl(char const* name) const { std::ostringstream ostr; - ostr << name << ": " << "\ninIss: " << book_.in.account + ostr << name << ": " + << "\ninIss: " << book_.in.account << "\noutIss: " << book_.out.account << "\ninCur: " << book_.in.currency << "\noutCur: " << book_.out.currency; diff --git a/src/xrpld/app/paths/detail/DirectStep.cpp b/src/xrpld/app/paths/detail/DirectStep.cpp index 1ff77c1501..5e62a289a3 100644 --- a/src/xrpld/app/paths/detail/DirectStep.cpp +++ b/src/xrpld/app/paths/detail/DirectStep.cpp @@ -205,7 +205,8 @@ protected: logStringImpl(char const* name) const { std::ostringstream ostr; - ostr << name << ": " << "\nSrc: " << src_ << "\nDst: " << dst_; + ostr << name << ": " + << "\nSrc: " << src_ << "\nDst: " << dst_; return ostr.str(); } diff --git a/src/xrpld/app/paths/detail/XRPEndpointStep.cpp b/src/xrpld/app/paths/detail/XRPEndpointStep.cpp index 4f38a7b422..7fdfb3749d 100644 --- a/src/xrpld/app/paths/detail/XRPEndpointStep.cpp +++ b/src/xrpld/app/paths/detail/XRPEndpointStep.cpp @@ -132,7 +132,8 @@ protected: logStringImpl(char const* name) const { std::ostringstream ostr; - ostr << name << ": " << "\nAcc: " << acc_; + ostr << name << ": " + << "\nAcc: " << acc_; return ostr.str(); } diff --git a/src/xrpld/app/rdb/RelationalDatabase.h b/src/xrpld/app/rdb/RelationalDatabase.h index 927b08d385..25b16f04a1 100644 --- a/src/xrpld/app/rdb/RelationalDatabase.h +++ b/src/xrpld/app/rdb/RelationalDatabase.h @@ -238,8 +238,8 @@ rangeCheckedCast(C c) /* This should never happen */ UNREACHABLE("ripple::rangeCheckedCast : domain error"); JLOG(debugLog().error()) - << "rangeCheckedCast domain error:" << " value = " << c - << " min = " << std::numeric_limits::lowest() + << "rangeCheckedCast domain error:" + << " value = " << c << " min = " << std::numeric_limits::lowest() << " max: " << std::numeric_limits::max(); } diff --git a/src/xrpld/app/tx/detail/Batch.cpp b/src/xrpld/app/tx/detail/Batch.cpp index 40e506566b..40991ea99a 100644 --- a/src/xrpld/app/tx/detail/Batch.cpp +++ b/src/xrpld/app/tx/detail/Batch.cpp @@ -212,8 +212,8 @@ Batch::preflight(PreflightContext const& ctx) if (flags & tfBatchMask) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId << "]:" << "invalid flags."; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]:" + << "invalid flags."; return temINVALID_FLAG; } @@ -221,24 +221,23 @@ Batch::preflight(PreflightContext const& ctx) flags & (tfAllOrNothing | tfOnlyOne | tfUntilFailure | tfIndependent)) != 1) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId << "]:" << "too many flags."; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]:" + << "too many flags."; return temINVALID_FLAG; } auto const& rawTxns = ctx.tx.getFieldArray(sfRawTransactions); if (rawTxns.size() <= 1) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]:" << "txns array must have at least 2 entries."; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]:" + << "txns array must have at least 2 entries."; return temARRAY_EMPTY; } if (rawTxns.size() > maxBatchTxCount) { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId - << "]:" << "txns array exceeds 8 entries."; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]:" + << "txns array exceeds 8 entries."; return temARRAY_TOO_LARGE; } @@ -253,53 +252,50 @@ Batch::preflight(PreflightContext const& ctx) auto const hash = stx.getTransactionID(); if (!uniqueHashes.emplace(hash).second) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]: " << "duplicate Txn found. " << "txID: " << hash; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "duplicate Txn found. " + << "txID: " << hash; return temREDUNDANT; } if (stx.getFieldU16(sfTransactionType) == ttBATCH) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]: " << "batch cannot have an inner batch txn. " - << "txID: " << hash; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "batch cannot have an inner batch txn. " + << "txID: " << hash; return temINVALID; } if (!(stx.getFlags() & tfInnerBatchTxn)) { JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]: " << "inner txn must have the tfInnerBatchTxn flag. " + << "BatchTrace[" << parentBatchId << "]: " + << "inner txn must have the tfInnerBatchTxn flag. " << "txID: " << hash; return temINVALID_FLAG; } if (stx.isFieldPresent(sfTxnSignature)) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]: " << "inner txn cannot include TxnSignature. " - << "txID: " << hash; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "inner txn cannot include TxnSignature. " + << "txID: " << hash; return temBAD_SIGNATURE; } if (stx.isFieldPresent(sfSigners)) { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId - << "]: " << "inner txn cannot include Signers. " + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "inner txn cannot include Signers. " << "txID: " << hash; return temBAD_SIGNER; } if (!stx.getSigningPubKey().empty()) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]: " << "inner txn SigningPubKey must be empty. " - << "txID: " << hash; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "inner txn SigningPubKey must be empty. " + << "txID: " << hash; return temBAD_REGKEY; } @@ -308,10 +304,10 @@ Batch::preflight(PreflightContext const& ctx) ctx.app, ctx.rules, parentBatchId, stx, tapBATCH, ctx.j); preflightResult.ter != tesSUCCESS) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]: " << "inner txn preflight failed: " - << transHuman(preflightResult.ter) << " " << "txID: " << hash; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "inner txn preflight failed: " + << transHuman(preflightResult.ter) << " " + << "txID: " << hash; return temINVALID_INNER_BATCH; } @@ -319,8 +315,8 @@ Batch::preflight(PreflightContext const& ctx) if (auto const fee = stx.getFieldAmount(sfFee); !fee.native() || fee.xrp() != beast::zero) { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId - << "]: " << "inner txn must have a fee of 0. " + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "inner txn must have a fee of 0. " << "txID: " << hash; return temBAD_FEE; } @@ -357,7 +353,8 @@ Batch::preflight(PreflightContext const& ctx) { JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " - << "duplicate sequence found: " << "txID: " << hash; + << "duplicate sequence found: " + << "txID: " << hash; return temREDUNDANT; } } @@ -369,7 +366,8 @@ Batch::preflight(PreflightContext const& ctx) { JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " - << "duplicate ticket found: " << "txID: " << hash; + << "duplicate ticket found: " + << "txID: " << hash; return temREDUNDANT; } } @@ -395,8 +393,8 @@ Batch::preflight(PreflightContext const& ctx) // Check that the batch signers array is not too large. if (signers.size() > maxBatchTxCount) { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId - << "]: " << "signers array exceeds 8 entries."; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "signers array exceeds 8 entries."; return temARRAY_TOO_LARGE; } @@ -419,8 +417,8 @@ Batch::preflight(PreflightContext const& ctx) if (!batchSigners.insert(signerAccount).second) { JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]: " << "duplicate signer found: " << signerAccount; + << "BatchTrace[" << parentBatchId << "]: " + << "duplicate signer found: " << signerAccount; return temREDUNDANT; } @@ -428,9 +426,8 @@ Batch::preflight(PreflightContext const& ctx) // Remove it if it does, as it can be crossed off the list. if (requiredSigners.erase(signerAccount) == 0) { - JLOG(ctx.j.debug()) - << "BatchTrace[" << parentBatchId - << "]: " << "no account signature for inner txn."; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "no account signature for inner txn."; return temBAD_SIGNER; } } @@ -450,8 +447,8 @@ Batch::preflight(PreflightContext const& ctx) if (!requiredSigners.empty()) { - JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId - << "]: " << "invalid batch signers."; + JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: " + << "invalid batch signers."; return temBAD_SIGNER; } return tesSUCCESS; diff --git a/src/xrpld/app/tx/detail/CancelOffer.cpp b/src/xrpld/app/tx/detail/CancelOffer.cpp index 6d8c077a62..004ae1e8b9 100644 --- a/src/xrpld/app/tx/detail/CancelOffer.cpp +++ b/src/xrpld/app/tx/detail/CancelOffer.cpp @@ -35,8 +35,8 @@ CancelOffer::preflight(PreflightContext const& ctx) if (uTxFlags & tfUniversalMask) { - JLOG(ctx.j.trace()) - << "Malformed transaction: " << "Invalid flags set."; + JLOG(ctx.j.trace()) << "Malformed transaction: " + << "Invalid flags set."; return temINVALID_FLAG; } @@ -63,8 +63,8 @@ CancelOffer::preclaim(PreclaimContext const& ctx) if ((*sle)[sfSequence] <= offerSequence) { - JLOG(ctx.j.trace()) << "Malformed transaction: " << "Sequence " - << offerSequence << " is invalid."; + JLOG(ctx.j.trace()) << "Malformed transaction: " + << "Sequence " << offerSequence << " is invalid."; return temBAD_SEQUENCE; } diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index b548b45cc2..df6cedccff 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -1121,8 +1121,8 @@ Consensus::checkLedger(std::unique_ptr const& clog) auto netLgr = adaptor_.getPrevLedger(prevLedgerID_, previousLedger_, mode_.get()); - CLOG(clog) << "network ledgerid " << netLgr << ", " << "previous ledger " - << prevLedgerID_ << ". "; + CLOG(clog) << "network ledgerid " << netLgr << ", " + << "previous ledger " << prevLedgerID_ << ". "; if (netLgr != prevLedgerID_) { @@ -1213,7 +1213,8 @@ Consensus::phaseOpen(std::unique_ptr const& clog) adaptor_.parms().ledgerIDLE_INTERVAL, 2 * previousLedger_.closeTimeResolution()); CLOG(clog) << "idle interval set to " << idleInterval.count() - << "ms based on " << "ledgerIDLE_INTERVAL: " + << "ms based on " + << "ledgerIDLE_INTERVAL: " << adaptor_.parms().ledgerIDLE_INTERVAL.count() << ", previous ledger close time resolution: " << previousLedger_.closeTimeResolution().count() << "ms. "; @@ -1261,7 +1262,8 @@ Consensus::shouldPause( << "roundTime: " << result_->roundTime.read().count() << ", " << "max consensus time: " << parms.ledgerMAX_CONSENSUS.count() << ", " << "validators: " << totalValidators << ", " - << "laggards: " << laggards << ", " << "offline: " << offline << ", " + << "laggards: " << laggards << ", " + << "offline: " << offline << ", " << "quorum: " << quorum << ")"; if (!ahead || !laggards || !totalValidators || !adaptor_.validator() || @@ -1622,8 +1624,8 @@ Consensus::updateOurPositions( if (!haveCloseTimeConsensus_) { JLOG(j_.debug()) - << "No CT consensus:" << " Proposers:" - << currPeerPositions_.size() + << "No CT consensus:" + << " Proposers:" << currPeerPositions_.size() << " Mode:" << to_string(mode_.get()) << " Thresh:" << threshConsensus << " Pos:" << consensusCloseTime.time_since_epoch().count(); diff --git a/src/xrpld/ledger/detail/View.cpp b/src/xrpld/ledger/detail/View.cpp index 2ef40eeebd..4f8a29d15c 100644 --- a/src/xrpld/ledger/detail/View.cpp +++ b/src/xrpld/ledger/detail/View.cpp @@ -457,7 +457,8 @@ accountHolds( amount.clear(Issue{currency, issuer}); } - JLOG(j.trace()) << "accountHolds:" << " account=" << to_string(account) + JLOG(j.trace()) << "accountHolds:" + << " account=" << to_string(account) << " amount=" << amount.getFullText(); return view.balanceHook(account, issuer, amount); @@ -638,7 +639,8 @@ xrpLiquid( STAmount const amount = (balance < reserve) ? STAmount{0} : balance - reserve; - JLOG(j.trace()) << "accountHolds:" << " account=" << to_string(id) + JLOG(j.trace()) << "accountHolds:" + << " account=" << to_string(id) << " amount=" << amount.getFullText() << " fullBalance=" << fullBalance.getFullText() << " balance=" << balance.getFullText() diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 7c2499b97d..69f25e1eb4 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -1286,8 +1286,8 @@ PeerImp::handleTransaction( { // If we've never been in synch, there's nothing we can do // with a transaction - JLOG(p_journal_.debug()) - << "Ignoring incoming transaction: " << "Need network ledger"; + JLOG(p_journal_.debug()) << "Ignoring incoming transaction: " + << "Need network ledger"; return; } diff --git a/src/xrpld/peerfinder/detail/Logic.h b/src/xrpld/peerfinder/detail/Logic.h index 9da2e55726..4b92a1d143 100644 --- a/src/xrpld/peerfinder/detail/Logic.h +++ b/src/xrpld/peerfinder/detail/Logic.h @@ -1132,9 +1132,9 @@ public: } else { - JLOG(m_journal.error()) - << beast::leftw(18) << "Logic failed " << "'" << source->name() - << "' fetch, " << results.error.message(); + JLOG(m_journal.error()) << beast::leftw(18) << "Logic failed " + << "'" << source->name() << "' fetch, " + << results.error.message(); } }