From 8e05416211f3fc3998d4745da856e40fce382d5b Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 3 Apr 2026 11:16:50 -0400 Subject: [PATCH 1/9] fix: Change variable signedness and correctly handle `std::optional` (#6657) --- src/libxrpl/tx/transactors/account/AccountDelete.cpp | 2 +- src/xrpld/app/misc/detail/ValidatorList.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libxrpl/tx/transactors/account/AccountDelete.cpp b/src/libxrpl/tx/transactors/account/AccountDelete.cpp index 8c2f23b754..815b314f9f 100644 --- a/src/libxrpl/tx/transactors/account/AccountDelete.cpp +++ b/src/libxrpl/tx/transactors/account/AccountDelete.cpp @@ -292,7 +292,7 @@ AccountDelete::preclaim(PreclaimContext const& ctx) if (!cdirFirst(ctx.view, ownerDirKeylet.key, sleDirNode, uDirEntry, dirEntry)) return tesSUCCESS; - std::int32_t deletableDirEntryCount{0}; + std::uint32_t deletableDirEntryCount{0}; do { // Make sure any directory node types that we find are the kind diff --git a/src/xrpld/app/misc/detail/ValidatorList.cpp b/src/xrpld/app/misc/detail/ValidatorList.cpp index bed91afc44..0b203114b3 100644 --- a/src/xrpld/app/misc/detail/ValidatorList.cpp +++ b/src/xrpld/app/misc/detail/ValidatorList.cpp @@ -1710,7 +1710,7 @@ ValidatorList::for_each_available( if (plCollection.status != PublisherStatus::available) continue; XRPL_ASSERT( - plCollection.maxSequence != 0, + plCollection.maxSequence.value_or(0) != 0, "xrpl::ValidatorList::for_each_available : nonzero maxSequence"); func( plCollection.rawManifest, From c0ee81366674cd7ca395139d3bc2ea2cc0f943b2 Mon Sep 17 00:00:00 2001 From: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Date: Fri, 3 Apr 2026 19:41:45 +0200 Subject: [PATCH 2/9] fix: Add assorted Lending Protocol fixes (#6678) Co-authored-by: Shawn Xie <35279399+shawnxie999@users.noreply.github.com> --- .../tx/invariants/LoanBrokerInvariant.cpp | 28 +++-- .../tx/transactors/lending/LoanManage.cpp | 34 +++--- .../tx/transactors/lending/LoanPay.cpp | 2 +- src/test/app/Invariants_test.cpp | 104 +++++++++++++----- src/test/app/Loan_test.cpp | 14 ++- 5 files changed, 133 insertions(+), 49 deletions(-) diff --git a/src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp b/src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp index 2bc9e622ad..8ee0a0deb8 100644 --- a/src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp +++ b/src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp @@ -175,18 +175,32 @@ ValidLoanBroker::finalize( return false; } auto const& vaultAsset = vault->at(sfAsset); - if (after->at(sfCoverAvailable) < accountHolds( - view, - after->at(sfAccount), - vaultAsset, - FreezeHandling::fhIGNORE_FREEZE, - AuthHandling::ahIGNORE_AUTH, - j)) + auto const pseudoBalance = accountHolds( + view, + after->at(sfAccount), + vaultAsset, + FreezeHandling::fhIGNORE_FREEZE, + AuthHandling::ahIGNORE_AUTH, + j); + if (after->at(sfCoverAvailable) < pseudoBalance) { JLOG(j.fatal()) << "Invariant failed: Loan Broker cover available " "is less than pseudo-account asset balance"; return false; } + + if (view.rules().enabled(fixSecurity3_1_3)) + { + // Don't check the balance when LoanBroker is deleted, + // sfCoverAvailable is not zeroed + if (tx.getTxnType() != ttLOAN_BROKER_DELETE && + after->at(sfCoverAvailable) > pseudoBalance) + { + JLOG(j.fatal()) << "Invariant failed: Loan Broker cover available is greater " + "than pseudo-account asset balance"; + return false; + } + } } return true; } diff --git a/src/libxrpl/tx/transactors/lending/LoanManage.cpp b/src/libxrpl/tx/transactors/lending/LoanManage.cpp index adef5374b9..8c3e625963 100644 --- a/src/libxrpl/tx/transactors/lending/LoanManage.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanManage.cpp @@ -386,21 +386,29 @@ LoanManage::doApply() return tefBAD_LEDGER; // LCOV_EXCL_LINE auto const vaultAsset = vaultSle->at(sfAsset); - // Valid flag combinations are checked in preflight. No flags is valid - - // just a noop. - if (tx.isFlag(tfLoanDefault)) - return defaultLoan(view, loanSle, brokerSle, vaultSle, vaultAsset, j_); - if (tx.isFlag(tfLoanImpair)) - return impairLoan(view, loanSle, vaultSle, vaultAsset, j_); - if (tx.isFlag(tfLoanUnimpair)) - return unimpairLoan(view, loanSle, vaultSle, vaultAsset, j_); - // Noop, as described above. + auto const result = [&]() -> TER { + // Valid flag combinations are checked in preflight. No flags is valid - + // just a noop. + if (tx.isFlag(tfLoanDefault)) + return defaultLoan(view, loanSle, brokerSle, vaultSle, vaultAsset, j_); + if (tx.isFlag(tfLoanImpair)) + return impairLoan(view, loanSle, vaultSle, vaultAsset, j_); + if (tx.isFlag(tfLoanUnimpair)) + return unimpairLoan(view, loanSle, vaultSle, vaultAsset, j_); + // Noop, as described above. + return tesSUCCESS; + }(); - associateAsset(*loanSle, vaultAsset); - associateAsset(*brokerSle, vaultAsset); - associateAsset(*vaultSle, vaultAsset); + // Pre-amendment, associateAsset was only called on the noop (no flags) + // path. Post-amendment, we call associateAsset on all successful paths. + if (view.rules().enabled(fixSecurity3_1_3) && isTesSuccess(result)) + { + associateAsset(*loanSle, vaultAsset); + associateAsset(*brokerSle, vaultAsset); + associateAsset(*vaultSle, vaultAsset); + } - return tesSUCCESS; + return result; } //------------------------------------------------------------------------------ diff --git a/src/libxrpl/tx/transactors/lending/LoanPay.cpp b/src/libxrpl/tx/transactors/lending/LoanPay.cpp index f748a670fd..d400fb3630 100644 --- a/src/libxrpl/tx/transactors/lending/LoanPay.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanPay.cpp @@ -155,7 +155,7 @@ LoanPay::preclaim(PreclaimContext const& ctx) if (tx.isFlag(tfLoanOverpayment) && !loanSle->isFlag(lsfLoanOverpayment)) { JLOG(ctx.j.warn()) << "Requested overpayment on a loan that doesn't allow it"; - return temINVALID_FLAG; + return ctx.view.rules().enabled(fixSecurity3_1_3) ? TER{tecNO_PERMISSION} : temINVALID_FLAG; } auto const principalOutstanding = loanSle->at(sfPrincipalOutstanding); diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index ef0624b481..72ed7ba57b 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -2046,36 +2046,36 @@ class Invariants_test : public beast::unit_test::suite { // Initialize with a placeholder value because there's no default // ctor + auto const setupAsset = + [&](Account const& alice, Account const& issuer, Env& env) -> PrettyAsset { + switch (assetType) + { + case Asset::IOU: { + PrettyAsset const iouAsset = issuer["IOU"]; + env(trust(alice, iouAsset(1000))); + env(pay(issuer, alice, iouAsset(1000))); + env.close(); + return iouAsset; + } + case Asset::MPT: { + MPTTester mptt{env, issuer, mptInitNoFund}; + mptt.create({.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock}); + PrettyAsset const mptAsset = mptt.issuanceID(); + mptt.authorize({.account = alice}); + env(pay(issuer, alice, mptAsset(1000))); + env.close(); + return mptAsset; + } + case Asset::XRP: + default: + return PrettyAsset{xrpIssue(), 1'000'000}; + } + }; + Keylet loanBrokerKeylet = keylet::amendments(); Preclose const createLoanBroker = [&, this](Account const& alice, Account const& issuer, Env& env) { - PrettyAsset const asset = [&]() { - switch (assetType) - { - case Asset::IOU: { - PrettyAsset const iouAsset = issuer["IOU"]; - env(trust(alice, iouAsset(1000))); - env(pay(issuer, alice, iouAsset(1000))); - env.close(); - return iouAsset; - } - - case Asset::MPT: { - MPTTester mptt{env, issuer, mptInitNoFund}; - mptt.create( - {.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock}); - PrettyAsset const mptAsset = mptt.issuanceID(); - mptt.authorize({.account = alice}); - env(pay(issuer, alice, mptAsset(1000))); - env.close(); - return mptAsset; - } - - case Asset::XRP: - default: - return PrettyAsset{xrpIssue(), 1'000'000}; - } - }(); + auto const asset = setupAsset(alice, issuer, env); loanBrokerKeylet = this->createLoanBroker(alice, env, asset); return BEAST_EXPECT(env.le(loanBrokerKeylet)); }; @@ -2249,6 +2249,56 @@ class Invariants_test : public beast::unit_test::suite STTx{ttLOAN_BROKER_SET, [](STObject& tx) {}}, {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, createLoanBroker); + + // Test: cover available less than pseudo-account asset balance + { + Keylet brokerKeylet = keylet::amendments(); + Preclose const createBrokerWithCover = + [&, this](Account const& alice, Account const& issuer, Env& env) { + auto const asset = setupAsset(alice, issuer, env); + brokerKeylet = this->createLoanBroker(alice, env, asset); + if (!BEAST_EXPECT(env.le(brokerKeylet))) + return false; + env(loanBroker::coverDeposit(alice, brokerKeylet.key, asset(10))); + env.close(); + return BEAST_EXPECT(env.le(brokerKeylet)); + }; + + doInvariantCheck( + {{"Loan Broker cover available is less than pseudo-account asset balance"}}, + [&](Account const&, Account const&, ApplyContext& ac) { + auto sle = ac.view().peek(brokerKeylet); + if (!BEAST_EXPECT(sle)) + return false; + // Pseudo-account holds 10 units, set cover to 5 + sle->at(sfCoverAvailable) = Number(5); + ac.view().update(sle); + return true; + }, + XRPAmount{}, + STTx{ttLOAN_BROKER_SET, [](STObject& tx) {}}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, + createBrokerWithCover); + } + + // Test: cover available greater than pseudo-account asset balance + // (requires fixSecurity3_1_3) + doInvariantCheck( + {{"Loan Broker cover available is greater than pseudo-account asset balance"}}, + [&](Account const&, Account const&, ApplyContext& ac) { + auto sle = ac.view().peek(loanBrokerKeylet); + if (!BEAST_EXPECT(sle)) + return false; + // Pseudo-account has no cover deposited; set cover + // higher than any incidental balance + sle->at(sfCoverAvailable) = Number(1'000'000); + ac.view().update(sle); + return true; + }, + XRPAmount{}, + STTx{ttLOAN_BROKER_SET, [](STObject& tx) {}}, + {tecINVARIANT_FAILED, tefINVARIANT_FAILED}, + createLoanBroker); } } diff --git a/src/test/app/Loan_test.cpp b/src/test/app/Loan_test.cpp index a63d31f030..05123c11c0 100644 --- a/src/test/app/Loan_test.cpp +++ b/src/test/app/Loan_test.cpp @@ -2071,7 +2071,19 @@ protected: STAmount{broker.asset, state.periodicPayment * Number{15, -1}}, tfLoanOverpayment), fee(XRPAmount{baseFee * (Number{15, -1} / loanPaymentsPerFeeIncrement + 1)}), - ter(temINVALID_FLAG)); + ter(tecNO_PERMISSION)); + + { + env.disableFeature(fixSecurity3_1_3); + env(pay(borrower, + loanKeylet.key, + STAmount{broker.asset, state.periodicPayment * Number{15, -1}}, + tfLoanOverpayment), + fee(XRPAmount{ + baseFee * (Number{15, -1} / loanPaymentsPerFeeIncrement + 1)}), + ter(temINVALID_FLAG)); + env.enableFeature(fixSecurity3_1_3); + } } // Try to send a payment marked as multiple mutually exclusive // payment types. Do not include `txFlags`, so we don't duplicate From 7d524a03b83af2eaff36e86a79a91fbb6df71ab0 Mon Sep 17 00:00:00 2001 From: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Date: Mon, 6 Apr 2026 17:13:03 +0200 Subject: [PATCH 3/9] fix: Clamp VaultClawback to assetsAvailable for zero-amount clawback (#6646) --- .../tx/transactors/vault/VaultClawback.cpp | 41 +- src/test/app/Vault_test.cpp | 677 +++++++++++++++++- 2 files changed, 693 insertions(+), 25 deletions(-) diff --git a/src/libxrpl/tx/transactors/vault/VaultClawback.cpp b/src/libxrpl/tx/transactors/vault/VaultClawback.cpp index 6a4d6a579e..9904c4183d 100644 --- a/src/libxrpl/tx/transactors/vault/VaultClawback.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultClawback.cpp @@ -13,6 +13,7 @@ #include #include +#include namespace xrpl { NotTEC @@ -226,7 +227,11 @@ VaultClawback::assetsToClawback( auto const mptIssuanceID = *vault->at(sfShareMPTID); MPTIssue const share{mptIssuanceID}; - if (clawbackAmount == beast::zero) + // Pre-fixSecurity3_1_3: zero-amount clawback returned early without + // clamping to assetsAvailable, allowing more assets to be recovered + // than available when there was an outstanding loan. Retained for + // ledger replay compatibility. + if (!ctx_.view().rules().enabled(fixSecurity3_1_3) && clawbackAmount == beast::zero) { auto const sharesDestroyed = accountHolds( view(), @@ -243,22 +248,40 @@ VaultClawback::assetsToClawback( } STAmount sharesDestroyed; - STAmount assetsRecovered = clawbackAmount; + STAmount assetsRecovered; + try { + if (clawbackAmount == beast::zero) + { + sharesDestroyed = accountHolds( + view(), + holder, + share, + FreezeHandling::fhIGNORE_FREEZE, + AuthHandling::ahIGNORE_AUTH, + j_); + auto const maybeAssets = + sharesToAssetsWithdraw(vault, sleShareIssuance, sharesDestroyed); + if (!maybeAssets) + return Unexpected(tecINTERNAL); // LCOV_EXCL_LINE + + assetsRecovered = *maybeAssets; + } + else { auto const maybeShares = - assetsToSharesWithdraw(vault, sleShareIssuance, assetsRecovered); + assetsToSharesWithdraw(vault, sleShareIssuance, clawbackAmount); if (!maybeShares) return Unexpected(tecINTERNAL); // LCOV_EXCL_LINE sharesDestroyed = *maybeShares; + + auto const maybeAssets = + sharesToAssetsWithdraw(vault, sleShareIssuance, sharesDestroyed); + if (!maybeAssets) + return Unexpected(tecINTERNAL); // LCOV_EXCL_LINE + assetsRecovered = *maybeAssets; } - - auto const maybeAssets = sharesToAssetsWithdraw(vault, sleShareIssuance, sharesDestroyed); - if (!maybeAssets) - return Unexpected(tecINTERNAL); // LCOV_EXCL_LINE - assetsRecovered = *maybeAssets; - // Clamp to maximum. if (assetsRecovered > *assetsAvailable) { diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index 823cf7aafd..63341e7ea3 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -3370,10 +3371,10 @@ class Vault_test : public beast::unit_test::suite [&](OpenView& view, beast::Journal j) -> bool { Sandbox sb(&view, tapNONE); auto vault = sb.peek(keylet::vault(keylet.key)); - if (!BEAST_EXPECT(vault != nullptr)) + if (!BEAST_EXPECT(vault)) return false; auto shares = sb.peek(keylet::mptIssuance(vault->at(sfShareMPTID))); - if (!BEAST_EXPECT(shares != nullptr)) + if (!BEAST_EXPECT(shares)) return false; if (fn(*vault, *shares)) { @@ -4102,6 +4103,66 @@ class Vault_test : public beast::unit_test::suite BEAST_EXPECT(env.balance(d.vaultAccount, d.shares).number() == 0); } }); + + // Non-1:1 ratio (scale=1, 10:1 shares:assets) with an outstanding loan. + // Deposit 100 IOU → 1000 shares. Borrow 40 → assetsAvailable=60. + // Clawback 80 IOU → clamped to 60, then share math uses truncation. + testCase(1, [&, this](Env& env, Data d) { + using namespace loanBroker; + using namespace loan; + + testcase("Scale clawback clamped with outstanding loan"); + + auto tx = d.vault.deposit( + {.depositor = d.depositor, + .id = d.keylet.key, + .amount = STAmount(d.asset, Number(100, 0))}); + env(tx); + env.close(); + BEAST_EXPECT(env.balance(d.depositor, d.shares) == d.share(1000)); + + // Create a loan broker backed by this vault + auto const brokerKeylet = keylet::loanbroker(d.owner.id(), env.seq(d.owner)); + env(set(d.owner, d.keylet.key)); + env.close(); + + // Borrow 40: assetsAvailable=60, assetsTotal=100 + env(set(d.depositor, brokerKeylet.key, STAmount(d.asset, Number(40, 0))), + loan::interestRate(TenthBips32(0)), + gracePeriod(60), + paymentInterval(120), + paymentTotal(10), + sig(sfCounterpartySignature, d.owner), + fee(env.current()->fees().base * 2), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(d.keylet); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == STAmount(d.asset, Number(60, 0))); + BEAST_EXPECT(sle->at(sfAssetsTotal) == STAmount(d.asset, Number(100, 0))); + } + + // Request 80 IOU clawback — clamped to assetsAvailable (60) + // With scale=1 (10:1), 60 assets = 600 shares destroyed + tx = d.vault.clawback( + {.issuer = d.issuer, + .id = d.keylet.key, + .holder = d.depositor, + .amount = STAmount(d.asset, Number(80, 0))}); + env(tx, ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(d.keylet); + BEAST_EXPECT(sle != nullptr); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == STAmount(d.asset, Number(0, 0))); + BEAST_EXPECT(sle->at(sfAssetsTotal) == STAmount(d.asset, Number(40, 0))); + + // 600 of 1000 shares destroyed, 400 remain + BEAST_EXPECT(env.balance(d.depositor, d.shares) == d.share(400)); + } + }); } void @@ -4648,8 +4709,7 @@ class Vault_test : public beast::unit_test::suite "VaultClawback (share) - " + prefix + " owner incomplete share clawback fails"); auto [vault, vaultKeylet] = setupVault(asset, owner, depositor); auto const& vaultSle = env.le(vaultKeylet); - BEAST_EXPECT(vaultSle != nullptr); - if (!vaultSle) + if (!BEAST_EXPECT(vaultSle)) return; Asset const share = vaultSle->at(sfShareMPTID); env(vault.clawback({ @@ -4684,8 +4744,7 @@ class Vault_test : public beast::unit_test::suite " owner explicit complete share clawback succeeds"); auto [vault, vaultKeylet] = setupVault(asset, owner, depositor); auto const& vaultSle = env.le(vaultKeylet); - BEAST_EXPECT(vaultSle != nullptr); - if (!vaultSle) + if (!BEAST_EXPECT(vaultSle)) return; Asset const share = vaultSle->at(sfShareMPTID); env(vault.clawback({ @@ -4701,8 +4760,7 @@ class Vault_test : public beast::unit_test::suite testcase("VaultClawback (share) - " + prefix + " owner can clawback own shares"); auto [vault, vaultKeylet] = setupVault(asset, owner, owner); auto const& vaultSle = env.le(vaultKeylet); - BEAST_EXPECT(vaultSle != nullptr); - if (!vaultSle) + if (!BEAST_EXPECT(vaultSle)) return; Asset const share = vaultSle->at(sfShareMPTID); env(vault.clawback({ @@ -4719,7 +4777,7 @@ class Vault_test : public beast::unit_test::suite testcase("VaultClawback (share) - " + prefix + " empty vault share clawback fails"); auto [vault, vaultKeylet] = setupVault(asset, owner, owner); auto const& vaultSle = env.le(vaultKeylet); - if (BEAST_EXPECT(vaultSle != nullptr)) + if (!BEAST_EXPECT(vaultSle)) return; Asset const share = vaultSle->at(sfShareMPTID); env(vault.clawback({ @@ -4735,6 +4793,7 @@ class Vault_test : public beast::unit_test::suite .issuer = owner, .id = vaultKeylet.key, .holder = owner, + .amount = share(vaultShareBalance(vaultKeylet)).value(), }), ter(tecNO_PERMISSION)); env.close(); @@ -4786,6 +4845,7 @@ class Vault_test : public beast::unit_test::suite using namespace loanBroker; using namespace loan; Env env(*this); + env.enableFeature(fixSecurity3_1_3); auto const setupVault = [&](PrettyAsset const& asset, Account const& owner, @@ -4799,6 +4859,7 @@ class Vault_test : public beast::unit_test::suite auto const& vaultSle = env.le(vaultKeylet); BEAST_EXPECT(vaultSle != nullptr); + env.memoize(Account("vault", vaultSle->at(sfAccount))); env(vault.deposit( {.depositor = depositor, .id = vaultKeylet.key, .amount = asset(100)}), ter(tesSUCCESS)); @@ -4899,8 +4960,7 @@ class Vault_test : public beast::unit_test::suite testcase("VaultClawback (asset) - " + prefix + " issuer share clawback fails"); auto [vault, vaultKeylet] = setupVault(asset, owner, depositor, issuer); auto const& vaultSle = env.le(vaultKeylet); - BEAST_EXPECT(vaultSle != nullptr); - if (!vaultSle) + if (!BEAST_EXPECT(vaultSle)) return; Asset const share = vaultSle->at(sfShareMPTID); @@ -4955,6 +5015,288 @@ class Vault_test : public beast::unit_test::suite }), ter(tesSUCCESS)); } + + { + testcase( + "VaultClawback (asset) - " + prefix + + " zero-amount clawback clamped with outstanding loan"); + auto [vault, vaultKeylet] = setupVault(asset, owner, depositor, issuer); + + auto const vaultSle = env.le(vaultKeylet); + if (!BEAST_EXPECT(vaultSle)) + return; + + PrettyAsset const shares = MPTIssue(vaultSle->at(sfShareMPTID)); + + // Create a loan broker backed by this vault + auto const brokerKeylet = keylet::loanbroker(owner.id(), env.seq(owner)); + env(set(owner, vaultKeylet.key)); + env.close(); + + // Depositor borrows 40 units, reducing assetsAvailable to 60 + // while assetsTotal stays at 100 + env(set(depositor, brokerKeylet.key, asset(40).value()), + loan::interestRate(TenthBips32(0)), + gracePeriod(60), + paymentInterval(120), + paymentTotal(10), + sig(sfCounterpartySignature, owner), + fee(env.current()->fees().base * 2), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(60).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(100).value()); + } + + // Zero-amount clawback (= "clawback all") should succeed, + // clamped to assetsAvailable (60) rather than the full + // share value (100). + env(vault.clawback({ + .issuer = issuer, + .id = vaultKeylet.key, + .holder = depositor, + }), + ter(tesSUCCESS)); + env.close(); + + // Only 60 assets clawed back; loan's 40 still outstanding + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle != nullptr); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(0).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(40).value()); + + // 60 of 100 shares destroyed (1:1 ratio), 40 remain + auto const sharesAfter = env.balance(depositor, shares); + BEAST_EXPECT(sharesAfter == shares(Number{4, sle->at(sfScale) + 1})); + } + } + + { + testcase( + "VaultClawback (asset) - " + prefix + + " non-zero clawback clamped with outstanding loan"); + auto [vault, vaultKeylet] = setupVault(asset, owner, depositor, issuer); + + auto const vaultSle = env.le(vaultKeylet); + if (!BEAST_EXPECT(vaultSle)) + return; + PrettyAsset const shares = MPTIssue(vaultSle->at(sfShareMPTID)); + + // Create a loan broker backed by this vault + auto const brokerKeylet = keylet::loanbroker(owner.id(), env.seq(owner)); + env(set(owner, vaultKeylet.key)); + env.close(); + + // Depositor borrows 40 units + env(set(depositor, brokerKeylet.key, asset(40).value()), + loan::interestRate(TenthBips32(0)), + gracePeriod(60), + paymentInterval(120), + paymentTotal(10), + sig(sfCounterpartySignature, owner), + fee(env.current()->fees().base * 2), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(60).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(100).value()); + } + + // Request 100 but only 60 available — clamped to 60 + env(vault.clawback({ + .issuer = issuer, + .id = vaultKeylet.key, + .holder = depositor, + .amount = asset(100).value(), + }), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle != nullptr); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(0).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(40).value()); + + // 60 of 100 shares destroyed (1:1 ratio), 40 remain + auto const sharesAfter = env.balance(depositor, shares); + BEAST_EXPECT(sharesAfter == shares(Number{4, sle->at(sfScale) + 1})); + } + } + + { + testcase( + "VaultClawback (asset) - " + prefix + + " partial clawback below available with outstanding loan"); + auto [vault, vaultKeylet] = setupVault(asset, owner, depositor, issuer); + + auto const vaultSle = env.le(vaultKeylet); + if (!BEAST_EXPECT(vaultSle)) + return; + PrettyAsset const shares = MPTIssue(vaultSle->at(sfShareMPTID)); + + // Create a loan broker backed by this vault + auto const brokerKeylet = keylet::loanbroker(owner.id(), env.seq(owner)); + env(set(owner, vaultKeylet.key)); + env.close(); + + // Depositor borrows 40 units: assetsAvailable=60, assetsTotal=100 + env(set(depositor, brokerKeylet.key, asset(40).value()), + loan::interestRate(TenthBips32(0)), + gracePeriod(60), + paymentInterval(120), + paymentTotal(10), + sig(sfCounterpartySignature, owner), + fee(env.current()->fees().base * 2), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(60).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(100).value()); + } + + // Clawback 30 — well under available (60), no clamping needed + env(vault.clawback({ + .issuer = issuer, + .id = vaultKeylet.key, + .holder = depositor, + .amount = asset(30).value(), + }), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle != nullptr); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(30).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(70).value()); + + // 30 of 100 shares destroyed (1:1 ratio), 70 remain + auto const sharesAfter = env.balance(depositor, shares); + BEAST_EXPECT(sharesAfter == shares(Number{7, sle->at(sfScale) + 1})); + } + } + + { + testcase( + "VaultClawback (asset) - " + prefix + + " clawback exactly equal to available with outstanding loan"); + auto [vault, vaultKeylet] = setupVault(asset, owner, depositor, issuer); + + auto const vaultSle = env.le(vaultKeylet); + if (!BEAST_EXPECT(vaultSle)) + return; + PrettyAsset const shares = MPTIssue(vaultSle->at(sfShareMPTID)); + + auto const brokerKeylet = keylet::loanbroker(owner.id(), env.seq(owner)); + env(set(owner, vaultKeylet.key)); + env.close(); + + // Depositor borrows 40 units: assetsAvailable=60, assetsTotal=100 + env(set(depositor, brokerKeylet.key, asset(40).value()), + loan::interestRate(TenthBips32(0)), + gracePeriod(60), + paymentInterval(120), + paymentTotal(10), + sig(sfCounterpartySignature, owner), + fee(env.current()->fees().base * 2), + ter(tesSUCCESS)); + env.close(); + + // Clawback exactly 60 — at the boundary, no clamping needed + env(vault.clawback({ + .issuer = issuer, + .id = vaultKeylet.key, + .holder = depositor, + .amount = asset(60).value(), + }), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle != nullptr); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(0).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(40).value()); + + // 60 of 100 shares destroyed (1:1 ratio), 40 remain + auto const sharesAfter = env.balance(depositor, shares); + BEAST_EXPECT(sharesAfter == shares(Number{4, sle->at(sfScale) + 1})); + } + } + + { + testcase( + "VaultClawback (asset) - " + prefix + + " clawback with zero available (fully borrowed)"); + auto [vault, vaultKeylet] = setupVault(asset, owner, depositor, issuer); + + auto const vaultSle = env.le(vaultKeylet); + if (!BEAST_EXPECT(vaultSle)) + return; + PrettyAsset const shares = MPTIssue(vaultSle->at(sfShareMPTID)); + + auto const brokerKeylet = keylet::loanbroker(owner.id(), env.seq(owner)); + env(set(owner, vaultKeylet.key)); + env.close(); + + // Depositor borrows all 100 units: assetsAvailable=0, assetsTotal=100 + env(set(depositor, brokerKeylet.key, asset(100).value()), + loan::interestRate(TenthBips32(0)), + gracePeriod(60), + paymentInterval(120), + paymentTotal(10), + sig(sfCounterpartySignature, owner), + fee(env.current()->fees().base * 2), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(0).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(100).value()); + } + + auto const sharesBefore = env.balance(depositor, shares); + + // Zero-amount clawback — nothing available, clamped to 0, + // resulting in zero shares destroyed → tecPRECISION_LOSS + env(vault.clawback({ + .issuer = issuer, + .id = vaultKeylet.key, + .holder = depositor, + }), + ter(tecPRECISION_LOSS)); + env.close(); + + // Explicit amount clawback — also nothing available + env(vault.clawback({ + .issuer = issuer, + .id = vaultKeylet.key, + .holder = depositor, + .amount = asset(50).value(), + }), + ter(tecPRECISION_LOSS)); + env.close(); + + { + // Nothing changed — vault and shares unchanged + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle != nullptr); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(0).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(100).value()); + auto const sharesAfter = env.balance(depositor, shares); + BEAST_EXPECT(sharesAfter == sharesBefore); + } + } }; Account owner{"alice"}; @@ -4972,10 +5314,10 @@ class Vault_test : public beast::unit_test::suite PrettyAsset const IOU = issuer["IOU"]; env(fset(issuer, asfAllowTrustLineClawback)); env.close(); - env.trust(IOU(1000), owner); - env.trust(IOU(1000), depositor); - env(pay(issuer, owner, IOU(1000))); - env(pay(issuer, depositor, IOU(1000))); + env.trust(IOU(2000), owner); + env.trust(IOU(2000), depositor); + env(pay(issuer, owner, IOU(2000))); + env(pay(issuer, depositor, IOU(2000))); env.close(); testCase(IOU, "IOU", owner, depositor, issuer); @@ -4985,9 +5327,77 @@ class Vault_test : public beast::unit_test::suite PrettyAsset const MPT = mptt.issuanceID(); mptt.authorize({.account = owner}); mptt.authorize({.account = depositor}); - env(pay(issuer, depositor, MPT(1000))); + env(pay(issuer, depositor, MPT(2000))); env.close(); testCase(MPT, "MPT", owner, depositor, issuer); + + // Test pre-fixSecurity3_1_3 legacy path: zero-amount clawback + // returns early without clamping to assetsAvailable. + { + testcase( + "VaultClawback (asset) - IOU pre-fixSecurity3_1_3" + " zero-amount clawback unclamped with outstanding loan"); + + env.disableFeature(fixSecurity3_1_3); + + auto [vault, vaultKeylet] = setupVault(IOU, owner, depositor, issuer); + + auto const vaultSle = env.le(vaultKeylet); + BEAST_EXPECT(vaultSle != nullptr); + if (!vaultSle) + return; + + PrettyAsset const shares = MPTIssue(vaultSle->at(sfShareMPTID)); + + // Create a loan broker backed by this vault + auto const brokerKeylet = keylet::loanbroker(owner.id(), env.seq(owner)); + env(set(owner, vaultKeylet.key)); + env.close(); + + // Depositor borrows 40 units, reducing assetsAvailable to 60 + // while assetsTotal stays at 100 + env(set(depositor, brokerKeylet.key, IOU(40).value()), + loan::interestRate(TenthBips32(0)), + gracePeriod(60), + paymentInterval(120), + paymentTotal(10), + sig(sfCounterpartySignature, owner), + fee(env.current()->fees().base * 2), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == IOU(60).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == IOU(100).value()); + } + + auto const sharesBefore = env.balance(depositor, shares); + + // Legacy: zero-amount clawback tries to recover the full + // share value (100) without clamping to assetsAvailable (60). + // This causes the vault balance to go negative, triggering + // the sanity check in doApply → tefINTERNAL. + env(vault.clawback({ + .issuer = issuer, + .id = vaultKeylet.key, + .holder = depositor, + }), + ter(tefINTERNAL)); + env.close(); + + { + // Transaction rolled back — vault and shares unchanged + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle != nullptr); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == IOU(60).value()); + BEAST_EXPECT(sle->at(sfAssetsTotal) == IOU(100).value()); + auto const sharesAfter = env.balance(depositor, shares); + BEAST_EXPECT(sharesAfter == sharesBefore); + } + + env.enableFeature(fixSecurity3_1_3); + } } void @@ -5231,6 +5641,240 @@ class Vault_test : public beast::unit_test::suite } } + void + testVaultEscrowedMPT() + { + using namespace test::jtx; + using namespace std::literals; + + // Verify vault deposit/withdraw/clawback respect sfLockedAmount. + // When MPT tokens are escrowed, sfMPTAmount is reduced and + // sfLockedAmount is increased. Vault operations go through + // accountSend/accountHolds which read sfMPTAmount, so escrowed + // tokens are naturally excluded. + + { + testcase("Vault deposit fails when MPT asset is escrowed"); + + Env env{*this, testable_amendments()}; + auto const baseFee = env.current()->fees().base; + Account const owner{"owner"}; + Account const depositor{"depositor"}; + Account const issuer{"issuer"}; + Account const bob{"bob"}; + + env.fund(XRP(10000), issuer, owner, depositor, bob); + env.close(); + + MPTTester mptt{env, issuer, mptInitNoFund}; + mptt.create( + {.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock | tfMPTCanEscrow}); + mptt.authorize({.account = owner}); + mptt.authorize({.account = depositor}); + mptt.authorize({.account = bob}); + PrettyAsset const asset = mptt.issuanceID(); + env(pay(issuer, depositor, asset(100))); + env.close(); + + // Escrow 60 of 100 MPT tokens: sfMPTAmount drops to 40 + auto const escrowSeq = env.seq(depositor); + env(escrow::create(depositor, bob, asset(60)), + escrow::condition(escrow::cb1), + escrow::finish_time(env.now() + 1s), + fee(baseFee * 150), + ter(tesSUCCESS)); + env.close(); + + Vault const vault{env}; + auto [tx, vaultKeylet] = vault.create({.owner = owner, .asset = asset}); + env(tx, ter(tesSUCCESS)); + env.close(); + + // Deposit 100 should fail — only 40 spendable + env(vault.deposit( + {.depositor = depositor, .id = vaultKeylet.key, .amount = asset(100)}), + ter(tecINSUFFICIENT_FUNDS)); + env.close(); + + // Deposit 40 (the unlocked balance) should succeed + env(vault.deposit({.depositor = depositor, .id = vaultKeylet.key, .amount = asset(40)}), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(40).value()); + } + + // Clean up escrow + env(escrow::finish(bob, depositor, escrowSeq), + escrow::condition(escrow::cb1), + escrow::fulfillment(escrow::fb1), + fee(baseFee * 150), + ter(tesSUCCESS)); + env.close(); + } + + { + testcase("Vault withdraw respects escrowed shares"); + + Env env{*this, testable_amendments()}; + auto const baseFee = env.current()->fees().base; + Account const owner{"owner"}; + Account const depositor{"depositor"}; + Account const issuer{"issuer"}; + Account const bob{"bob"}; + + env.fund(XRP(10000), issuer, owner, depositor, bob); + env.close(); + + MPTTester mptt{env, issuer, mptInitNoFund}; + mptt.create( + {.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock | tfMPTCanEscrow}); + mptt.authorize({.account = owner}); + mptt.authorize({.account = depositor}); + PrettyAsset const asset = mptt.issuanceID(); + env(pay(issuer, depositor, asset(100))); + env.close(); + + Vault const vault{env}; + auto [tx, vaultKeylet] = vault.create({.owner = owner, .asset = asset}); + env(tx, ter(tesSUCCESS)); + env.close(); + + // Deposit 100 → get shares + env(vault.deposit( + {.depositor = depositor, .id = vaultKeylet.key, .amount = asset(100)}), + ter(tesSUCCESS)); + env.close(); + + auto const vaultSle = env.le(vaultKeylet); + if (!BEAST_EXPECT(vaultSle)) + return; + env.memoize(Account("vault", vaultSle->at(sfAccount))); + PrettyAsset const shares = MPTIssue(vaultSle->at(sfShareMPTID)); + + // Authorize bob for share MPT so he can receive escrowed shares + auto const shareMPTID = vaultSle->at(sfShareMPTID); + { + Json::Value jv; + jv[jss::Account] = bob.human(); + jv[sfMPTokenIssuanceID] = to_string(shareMPTID); + jv[jss::TransactionType] = jss::MPTokenAuthorize; + env(jv, ter(tesSUCCESS)); + env.close(); + } + + // Escrow 60% of shares + auto const escrowAmount = shares(Number{6, vaultSle->at(sfScale) + 1}); + env(escrow::create(depositor, bob, escrowAmount), + escrow::condition(escrow::cb1), + escrow::finish_time(env.now() + 1s), + fee(baseFee * 150), + ter(tesSUCCESS)); + env.close(); + + // Withdraw all 100 should fail — only 40% of shares are unlocked + env(vault.withdraw( + {.depositor = depositor, .id = vaultKeylet.key, .amount = asset(100)}), + ter(tecINSUFFICIENT_FUNDS)); + env.close(); + + // Withdraw 40 (matching unlocked shares) should succeed + env(vault.withdraw( + {.depositor = depositor, .id = vaultKeylet.key, .amount = asset(40)}), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(60).value()); + } + } + + { + testcase("Vault clawback only recovers unlocked shares"); + + Env env{*this, testable_amendments() | fixSecurity3_1_3}; + auto const baseFee = env.current()->fees().base; + Account const owner{"owner"}; + Account const depositor{"depositor"}; + Account const issuer{"issuer"}; + Account const bob{"bob"}; + + env.fund(XRP(10000), issuer, owner, depositor, bob); + env.close(); + + MPTTester mptt{env, issuer, mptInitNoFund}; + mptt.create( + {.flags = tfMPTCanClawback | tfMPTCanTransfer | tfMPTCanLock | tfMPTCanEscrow}); + mptt.authorize({.account = owner}); + mptt.authorize({.account = depositor}); + PrettyAsset const asset = mptt.issuanceID(); + env(pay(issuer, depositor, asset(100))); + env.close(); + + Vault const vault{env}; + auto [tx, vaultKeylet] = vault.create({.owner = owner, .asset = asset}); + env(tx, ter(tesSUCCESS)); + env.close(); + + // Deposit 100 → get shares + env(vault.deposit( + {.depositor = depositor, .id = vaultKeylet.key, .amount = asset(100)}), + ter(tesSUCCESS)); + env.close(); + + auto const vaultSle = env.le(vaultKeylet); + if (!BEAST_EXPECT(vaultSle)) + return; + env.memoize(Account("vault", vaultSle->at(sfAccount))); + PrettyAsset const shares = MPTIssue(vaultSle->at(sfShareMPTID)); + + // Authorize bob for share MPT so he can receive escrowed shares + auto const shareMPTID = vaultSle->at(sfShareMPTID); + { + Json::Value jv; + jv[jss::Account] = bob.human(); + jv[sfMPTokenIssuanceID] = to_string(shareMPTID); + jv[jss::TransactionType] = jss::MPTokenAuthorize; + env(jv, ter(tesSUCCESS)); + env.close(); + } + + // Escrow 60% of shares + auto const escrowAmount = shares(Number{6, vaultSle->at(sfScale) + 1}); + env(escrow::create(depositor, bob, escrowAmount), + escrow::condition(escrow::cb1), + escrow::finish_time(env.now() + 1s), + fee(baseFee * 150), + ter(tesSUCCESS)); + env.close(); + + // Zero-amount clawback ("all") — should only recover assets + // corresponding to unlocked shares (40%) + env(vault.clawback({ + .issuer = issuer, + .id = vaultKeylet.key, + .holder = depositor, + }), + ter(tesSUCCESS)); + env.close(); + + { + auto const sle = env.le(vaultKeylet); + BEAST_EXPECT(sle != nullptr); + // Only 40 of 100 assets recovered (matching 40% unlocked shares) + BEAST_EXPECT(sle->at(sfAssetsTotal) == asset(60).value()); + BEAST_EXPECT(sle->at(sfAssetsAvailable) == asset(60).value()); + + // Depositor's unlocked shares are now 0 + auto const sharesAfter = env.balance(depositor, shares); + BEAST_EXPECT(sharesAfter == shares(0)); + } + } + } + // Reproduction: canWithdraw IOU limit check bypassed when // withdrawal amount is specified in shares (MPT) rather than in assets. void @@ -5346,6 +5990,7 @@ public: testRPC(); testVaultClawbackBurnShares(); testVaultClawbackAssets(); + testVaultEscrowedMPT(); testAssetsMaximum(); testBug6_LimitBypassWithShares(); } From 077e03ff333de43a30b89f7c57af8d4f00ecd8db Mon Sep 17 00:00:00 2001 From: Zhiyuan Wang <96991820+Kassaking7@users.noreply.github.com> Date: Mon, 6 Apr 2026 13:51:46 -0400 Subject: [PATCH 4/9] fix: Prevent deletion of MPTokens with active escrow (#6635) Co-authored-by: Bart --- src/libxrpl/ledger/helpers/MPTokenHelpers.cpp | 7 +- src/test/app/Vault_test.cpp | 99 +++++++++++++++++++ 2 files changed, 104 insertions(+), 2 deletions(-) diff --git a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp index 31c1d543f5..eb688187d9 100644 --- a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp @@ -139,7 +139,9 @@ authorizeMPToken( { auto const mptokenKey = keylet::mptoken(mptIssuanceID, account); auto const sleMpt = view.peek(mptokenKey); - if (!sleMpt || (*sleMpt)[sfMPTAmount] != 0) + if (!sleMpt || (*sleMpt)[sfMPTAmount] != 0 || + (view.rules().enabled(fixSecurity3_1_3) && + (*sleMpt)[~sfLockedAmount].value_or(0) != 0)) return tecINTERNAL; // LCOV_EXCL_LINE if (!view.dirRemove( @@ -252,7 +254,8 @@ removeEmptyHolding( // balance, it can not just be deleted, because that will throw the issuance // accounting out of balance, so fail. Since this should be impossible // anyway, I'm not going to put any effort into it. - if (mptoken->at(sfMPTAmount) != 0) + if (mptoken->at(sfMPTAmount) != 0 || + (view.rules().enabled(fixSecurity3_1_3) && (*mptoken)[~sfLockedAmount].value_or(0) != 0)) return tecHAS_OBLIGATIONS; return authorizeMPToken( diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index 63341e7ea3..fd4cbd5334 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -5971,6 +5971,104 @@ class Vault_test : public beast::unit_test::suite } } + void + testRemoveEmptyHoldingLockedAmount() + { + testcase("removeEmptyHolding deletes MPToken with sfLockedAmount"); + using namespace test::jtx; + using namespace std::literals; + + auto const amendments = testable_amendments(); + auto runTest = [&](FeatureBitset f) { + Env env{*this, f}; + auto const baseFee = env.current()->fees().base; + + Account const issuer{"issuer"}; + Account const owner{"owner"}; + Account const depositor{"depositor"}; + Account const bob{"bob"}; + + env.fund(XRP(100000), issuer, owner, depositor, bob); + env.close(); + + Vault const vault{env}; + + // Create an MPT asset for the vault + MPTTester mptt{env, issuer, mptInitNoFund}; + mptt.create({.flags = tfMPTCanTransfer | tfMPTCanLock}); + PrettyAsset const asset = mptt.issuanceID(); + mptt.authorize({.account = owner}); + mptt.authorize({.account = depositor}); + env(pay(issuer, depositor, asset(1000))); + env.close(); + + // Create vault + auto [tx, keylet] = vault.create({.owner = owner, .asset = asset}); + env(tx); + env.close(); + + auto const vaultSle = env.le(keylet); + BEAST_EXPECT(vaultSle != nullptr); + auto const shareMptID = vaultSle->at(sfShareMPTID); + MPTIssue const shareIssue{shareMptID}; + + // Depositor deposits 1000 asset units into vault, receiving shares + env(vault.deposit({.depositor = depositor, .id = keylet.key, .amount = asset(1000)})); + env.close(); + + // Check depositor has shares + { + auto const sleMpt = env.le(keylet::mptoken(shareMptID, depositor)); + BEAST_EXPECT(sleMpt != nullptr); + BEAST_EXPECT(sleMpt->at(sfMPTAmount) == 1000); + } + + // Escrow 500 of those shares + env(escrow::create(depositor, bob, STAmount{shareIssue, 500}), + escrow::condition(escrow::cb1), + escrow::finish_time(env.now() + 1s), + fee(baseFee * 150), + ter(tesSUCCESS)); + env.close(); + + // Verify: sfMPTAmount=500, sfLockedAmount=500 + { + auto const sleMpt = env.le(keylet::mptoken(shareMptID, depositor)); + BEAST_EXPECT(sleMpt != nullptr); + BEAST_EXPECT(sleMpt->at(sfLockedAmount) == 500); + BEAST_EXPECT(sleMpt->at(sfMPTAmount) == 500); + } + + // Withdraw remaining spendable shares — triggers removeEmptyHolding + env(vault.withdraw({.depositor = depositor, .id = keylet.key, .amount = asset(500)}), + ter(tesSUCCESS)); + env.close(); + + auto const sleMptAfter = env.le(keylet::mptoken(shareMptID, depositor)); + if (!f[fixSecurity3_1_3]) + { + // Without the fix, removeEmptyHolding deletes the MPToken + // even though sfLockedAmount > 0, leaving the escrow's locked + // amount untracked. + BEAST_EXPECT(sleMptAfter == nullptr); + } + else + { + // With the fix, MPToken must still exist with sfLockedAmount > 0 + // and sfMPTAmount == 0 (all spendable shares withdrawn). + BEAST_EXPECT(sleMptAfter != nullptr); + if (sleMptAfter) + { + BEAST_EXPECT(sleMptAfter->at(sfLockedAmount) == 500); + BEAST_EXPECT(sleMptAfter->at(sfMPTAmount) == 0); + } + } + }; + + runTest(amendments - fixSecurity3_1_3); + runTest(amendments); + } + public: void run() override @@ -5993,6 +6091,7 @@ public: testVaultEscrowedMPT(); testAssetsMaximum(); testBug6_LimitBypassWithShares(); + testRemoveEmptyHoldingLockedAmount(); } }; From 00761dbb674e091732bcce7e431a3048f7f6d8e7 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 6 Apr 2026 18:15:16 -0400 Subject: [PATCH 5/9] fix: Minor RPC fixes (#6730) --- API-CHANGELOG.md | 2 ++ src/test/rpc/Roles_test.cpp | 1 + src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp | 2 +- src/xrpld/rpc/handlers/utility/Ping.cpp | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/API-CHANGELOG.md b/API-CHANGELOG.md index 64b61c2024..8e7fb2e4d4 100644 --- a/API-CHANGELOG.md +++ b/API-CHANGELOG.md @@ -38,6 +38,8 @@ This section contains changes targeting a future version. ### Bugfixes - Peer Crawler: The `port` field in `overlay.active[]` now consistently returns an integer instead of a string for outbound peers. [#6318](https://github.com/XRPLF/rippled/pull/6318) +- `ping`: The `ip` field is no longer returned as an empty string for proxied connections without a forwarded-for header. It is now omitted, consistent with the behavior for identified connections. [#6730](https://github.com/XRPLF/rippled/pull/6730) +- gRPC `GetLedgerDiff`: Fixed error message that incorrectly said "base ledger not validated" when the desired ledger was not validated. [#6730](https://github.com/XRPLF/rippled/pull/6730) ## XRP Ledger server version 3.1.0 diff --git a/src/test/rpc/Roles_test.cpp b/src/test/rpc/Roles_test.cpp index e3d90a9c56..314d0972d2 100644 --- a/src/test/rpc/Roles_test.cpp +++ b/src/test/rpc/Roles_test.cpp @@ -43,6 +43,7 @@ class Roles_test : public beast::unit_test::suite Env env{*this, envconfig(secure_gateway)}; BEAST_EXPECT(env.rpc("ping")["result"]["role"] == "proxied"); + BEAST_EXPECT(!env.rpc("ping")["result"].isMember("ip")); auto wsRes = makeWSClient(env.app().config())->invoke("ping")["result"]; BEAST_EXPECT(!wsRes.isMember("unlimited") || !wsRes["unlimited"].asBool()); diff --git a/src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp b/src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp index 56a4d97b94..97c4efcc7a 100644 --- a/src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp +++ b/src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp @@ -36,7 +36,7 @@ doLedgerDiffGrpc(RPC::GRPCContext& con std::dynamic_pointer_cast(desiredLedgerRv); if (!desiredLedger) { - grpc::Status const errorStatus{grpc::StatusCode::NOT_FOUND, "base ledger not validated"}; + grpc::Status const errorStatus{grpc::StatusCode::NOT_FOUND, "desired ledger not validated"}; return {response, errorStatus}; } diff --git a/src/xrpld/rpc/handlers/utility/Ping.cpp b/src/xrpld/rpc/handlers/utility/Ping.cpp index 4e9b18c4c9..695d90b964 100644 --- a/src/xrpld/rpc/handlers/utility/Ping.cpp +++ b/src/xrpld/rpc/handlers/utility/Ping.cpp @@ -27,7 +27,9 @@ doPing(RPC::JsonContext& context) break; case Role::PROXY: ret[jss::role] = "proxied"; - ret[jss::ip] = std::string{context.headers.forwardedFor}; + if (!context.headers.forwardedFor.empty()) + ret[jss::ip] = std::string{context.headers.forwardedFor}; + break; default:; } From f239256d870afbda5789c263d2ef93378e85454c Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 6 Apr 2026 18:36:32 -0400 Subject: [PATCH 6/9] refactor: Move more helper files into `libxrpl/ledger/helpers` (#6731) Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com> --- .../dex => ledger/helpers}/AMMHelpers.h | 0 .../dex => ledger/helpers}/AMMUtils.h | 0 .../helpers/DelegateHelpers.h} | 0 .../xrpl/ledger/helpers}/EscrowHelpers.h | 4 +-- include/xrpl/ledger/helpers/MPTokenHelpers.h | 7 +++++ .../helpers/NFTokenHelpers.h} | 2 +- .../ledger/helpers}/PaymentChannelHelpers.h | 0 .../helpers}/PermissionedDEXHelpers.h | 0 include/xrpl/tx/paths/AMMLiquidity.h | 4 +-- include/xrpl/tx/paths/detail/StrandFlow.h | 2 +- include/xrpl/tx/transactors/nft/NFTokenMint.h | 2 +- .../tx/transactors/token/MPTokenAuthorize.h | 7 ----- .../dex => ledger/helpers}/AMMHelpers.cpp | 2 +- .../dex => ledger/helpers}/AMMUtils.cpp | 4 +-- src/libxrpl/ledger/helpers/MPTokenHelpers.cpp | 26 +++++++++++++++++++ .../helpers/NFTokenHelpers.cpp} | 3 ++- .../helpers}/PaymentChannelHelpers.cpp | 3 +-- .../helpers}/PermissionedDEXHelpers.cpp | 2 +- src/libxrpl/tx/Transactor.cpp | 4 +-- src/libxrpl/tx/invariants/AMMInvariant.cpp | 4 +-- src/libxrpl/tx/invariants/NFTInvariant.cpp | 3 ++- src/libxrpl/tx/paths/BookStep.cpp | 2 +- src/libxrpl/tx/paths/OfferStream.cpp | 2 +- .../tx/transactors/account/AccountDelete.cpp | 2 +- .../tx/transactors/account/AccountSet.cpp | 2 +- .../tx/transactors/delegate/DelegateUtils.cpp | 2 +- src/libxrpl/tx/transactors/dex/AMMBid.cpp | 4 +-- .../tx/transactors/dex/AMMClawback.cpp | 4 +-- src/libxrpl/tx/transactors/dex/AMMCreate.cpp | 4 +-- src/libxrpl/tx/transactors/dex/AMMDelete.cpp | 2 +- src/libxrpl/tx/transactors/dex/AMMDeposit.cpp | 4 +-- src/libxrpl/tx/transactors/dex/AMMVote.cpp | 2 +- .../tx/transactors/dex/AMMWithdraw.cpp | 4 +-- .../tx/transactors/dex/OfferCreate.cpp | 2 +- .../tx/transactors/escrow/EscrowCancel.cpp | 3 +-- .../tx/transactors/escrow/EscrowFinish.cpp | 3 +-- .../tx/transactors/nft/NFTokenAcceptOffer.cpp | 2 +- .../tx/transactors/nft/NFTokenBurn.cpp | 2 +- .../tx/transactors/nft/NFTokenCancelOffer.cpp | 2 +- .../tx/transactors/nft/NFTokenCreateOffer.cpp | 2 +- .../tx/transactors/nft/NFTokenModify.cpp | 2 +- .../tx/transactors/payment/Payment.cpp | 4 +-- .../payment_channel/PaymentChannelClaim.cpp | 3 +-- .../payment_channel/PaymentChannelFund.cpp | 3 +-- .../tx/transactors/system/LedgerStateFix.cpp | 2 +- .../tx/transactors/token/MPTokenAuthorize.cpp | 26 ------------------- .../transactors/token/MPTokenIssuanceSet.cpp | 2 +- src/libxrpl/tx/transactors/token/TrustSet.cpp | 2 +- src/test/app/AMMCalc_test.cpp | 2 +- src/test/app/AMMClawback_test.cpp | 2 +- src/test/app/AMMExtended_test.cpp | 2 +- src/test/app/AMM_test.cpp | 4 +-- src/test/app/FixNFTokenPageLinks_test.cpp | 2 +- src/test/app/NFTokenAuth_test.cpp | 2 +- src/test/app/NFTokenBurn_test.cpp | 3 ++- src/test/app/NFTokenDir_test.cpp | 2 +- src/test/app/NFToken_test.cpp | 2 +- src/test/jtx/impl/AMM.cpp | 4 +-- src/xrpld/app/ledger/OrderBookDBImpl.cpp | 2 +- src/xrpld/rpc/detail/RPCHelpers.cpp | 2 +- .../rpc/handlers/account/AccountNFTs.cpp | 2 +- .../rpc/handlers/account/AccountObjects.cpp | 1 + src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp | 2 +- 63 files changed, 102 insertions(+), 105 deletions(-) rename include/xrpl/{tx/transactors/dex => ledger/helpers}/AMMHelpers.h (100%) rename include/xrpl/{tx/transactors/dex => ledger/helpers}/AMMUtils.h (100%) rename include/xrpl/{tx/transactors/delegate/DelegateUtils.h => ledger/helpers/DelegateHelpers.h} (100%) rename {src/libxrpl/tx/transactors/escrow => include/xrpl/ledger/helpers}/EscrowHelpers.h (97%) rename include/xrpl/{tx/transactors/nft/NFTokenUtils.h => ledger/helpers/NFTokenHelpers.h} (99%) rename {src/libxrpl/tx/transactors/payment_channel => include/xrpl/ledger/helpers}/PaymentChannelHelpers.h (100%) rename include/xrpl/{tx/transactors/dex => ledger/helpers}/PermissionedDEXHelpers.h (100%) rename src/libxrpl/{tx/transactors/dex => ledger/helpers}/AMMHelpers.cpp (99%) rename src/libxrpl/{tx/transactors/dex => ledger/helpers}/AMMUtils.cpp (99%) rename src/libxrpl/{tx/transactors/nft/NFTokenUtils.cpp => ledger/helpers/NFTokenHelpers.cpp} (99%) rename src/libxrpl/{tx/transactors/payment_channel => ledger/helpers}/PaymentChannelHelpers.cpp (95%) rename src/libxrpl/{tx/transactors/dex => ledger/helpers}/PermissionedDEXHelpers.cpp (97%) diff --git a/include/xrpl/tx/transactors/dex/AMMHelpers.h b/include/xrpl/ledger/helpers/AMMHelpers.h similarity index 100% rename from include/xrpl/tx/transactors/dex/AMMHelpers.h rename to include/xrpl/ledger/helpers/AMMHelpers.h diff --git a/include/xrpl/tx/transactors/dex/AMMUtils.h b/include/xrpl/ledger/helpers/AMMUtils.h similarity index 100% rename from include/xrpl/tx/transactors/dex/AMMUtils.h rename to include/xrpl/ledger/helpers/AMMUtils.h diff --git a/include/xrpl/tx/transactors/delegate/DelegateUtils.h b/include/xrpl/ledger/helpers/DelegateHelpers.h similarity index 100% rename from include/xrpl/tx/transactors/delegate/DelegateUtils.h rename to include/xrpl/ledger/helpers/DelegateHelpers.h diff --git a/src/libxrpl/tx/transactors/escrow/EscrowHelpers.h b/include/xrpl/ledger/helpers/EscrowHelpers.h similarity index 97% rename from src/libxrpl/tx/transactors/escrow/EscrowHelpers.h rename to include/xrpl/ledger/helpers/EscrowHelpers.h index 8991fb06cc..70d780da3b 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowHelpers.h +++ b/include/xrpl/ledger/helpers/EscrowHelpers.h @@ -10,7 +10,6 @@ #include #include #include -#include namespace xrpl { @@ -183,8 +182,7 @@ escrowUnlockApplyHelper( return tecINSUFFICIENT_RESERVE; } - if (auto const ter = MPTokenAuthorize::createMPToken(view, mptID, receiver, 0); - !isTesSuccess(ter)) + if (auto const ter = createMPToken(view, mptID, receiver, 0); !isTesSuccess(ter)) { return ter; // LCOV_EXCL_LINE } diff --git a/include/xrpl/ledger/helpers/MPTokenHelpers.h b/include/xrpl/ledger/helpers/MPTokenHelpers.h index ab487280b9..9f7d639285 100644 --- a/include/xrpl/ledger/helpers/MPTokenHelpers.h +++ b/include/xrpl/ledger/helpers/MPTokenHelpers.h @@ -157,4 +157,11 @@ rippleUnlockEscrowMPT( STAmount const& grossAmount, beast::Journal j); +TER +createMPToken( + ApplyView& view, + MPTID const& mptIssuanceID, + AccountID const& account, + std::uint32_t const flags); + } // namespace xrpl diff --git a/include/xrpl/tx/transactors/nft/NFTokenUtils.h b/include/xrpl/ledger/helpers/NFTokenHelpers.h similarity index 99% rename from include/xrpl/tx/transactors/nft/NFTokenUtils.h rename to include/xrpl/ledger/helpers/NFTokenHelpers.h index 33aab068c6..d8dac4caaf 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenUtils.h +++ b/include/xrpl/ledger/helpers/NFTokenHelpers.h @@ -1,12 +1,12 @@ #pragma once +#include #include #include #include #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelHelpers.h b/include/xrpl/ledger/helpers/PaymentChannelHelpers.h similarity index 100% rename from src/libxrpl/tx/transactors/payment_channel/PaymentChannelHelpers.h rename to include/xrpl/ledger/helpers/PaymentChannelHelpers.h diff --git a/include/xrpl/tx/transactors/dex/PermissionedDEXHelpers.h b/include/xrpl/ledger/helpers/PermissionedDEXHelpers.h similarity index 100% rename from include/xrpl/tx/transactors/dex/PermissionedDEXHelpers.h rename to include/xrpl/ledger/helpers/PermissionedDEXHelpers.h diff --git a/include/xrpl/tx/paths/AMMLiquidity.h b/include/xrpl/tx/paths/AMMLiquidity.h index 71b8dbb12a..87d6ffe32f 100644 --- a/include/xrpl/tx/paths/AMMLiquidity.h +++ b/include/xrpl/tx/paths/AMMLiquidity.h @@ -3,10 +3,10 @@ #include #include #include +#include +#include #include #include -#include -#include namespace xrpl { diff --git a/include/xrpl/tx/paths/detail/StrandFlow.h b/include/xrpl/tx/paths/detail/StrandFlow.h index fba631c695..21cf04dc07 100644 --- a/include/xrpl/tx/paths/detail/StrandFlow.h +++ b/include/xrpl/tx/paths/detail/StrandFlow.h @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include #include diff --git a/include/xrpl/tx/transactors/nft/NFTokenMint.h b/include/xrpl/tx/transactors/nft/NFTokenMint.h index d4eeba2bf0..d04f88ed3b 100644 --- a/include/xrpl/tx/transactors/nft/NFTokenMint.h +++ b/include/xrpl/tx/transactors/nft/NFTokenMint.h @@ -1,8 +1,8 @@ #pragma once +#include #include #include -#include namespace xrpl { diff --git a/include/xrpl/tx/transactors/token/MPTokenAuthorize.h b/include/xrpl/tx/transactors/token/MPTokenAuthorize.h index b6a34d4f14..3210608e73 100644 --- a/include/xrpl/tx/transactors/token/MPTokenAuthorize.h +++ b/include/xrpl/tx/transactors/token/MPTokenAuthorize.h @@ -31,13 +31,6 @@ public: static TER preclaim(PreclaimContext const& ctx); - static TER - createMPToken( - ApplyView& view, - MPTID const& mptIssuanceID, - AccountID const& account, - std::uint32_t const flags); - TER doApply() override; }; diff --git a/src/libxrpl/tx/transactors/dex/AMMHelpers.cpp b/src/libxrpl/ledger/helpers/AMMHelpers.cpp similarity index 99% rename from src/libxrpl/tx/transactors/dex/AMMHelpers.cpp rename to src/libxrpl/ledger/helpers/AMMHelpers.cpp index 386608229b..c65bb1ff11 100644 --- a/src/libxrpl/tx/transactors/dex/AMMHelpers.cpp +++ b/src/libxrpl/ledger/helpers/AMMHelpers.cpp @@ -1,4 +1,4 @@ -#include +#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/dex/AMMUtils.cpp b/src/libxrpl/ledger/helpers/AMMUtils.cpp similarity index 99% rename from src/libxrpl/tx/transactors/dex/AMMUtils.cpp rename to src/libxrpl/ledger/helpers/AMMUtils.cpp index 91891ce86f..4b71a2e438 100644 --- a/src/libxrpl/tx/transactors/dex/AMMUtils.cpp +++ b/src/libxrpl/ledger/helpers/AMMUtils.cpp @@ -1,10 +1,10 @@ #include #include #include +#include +#include #include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp index eb688187d9..90165e3d16 100644 --- a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp @@ -752,4 +752,30 @@ rippleUnlockEscrowMPT( return tesSUCCESS; } +TER +createMPToken( + ApplyView& view, + MPTID const& mptIssuanceID, + AccountID const& account, + std::uint32_t const flags) +{ + auto const mptokenKey = keylet::mptoken(mptIssuanceID, account); + + auto const ownerNode = + view.dirInsert(keylet::ownerDir(account), mptokenKey, describeOwnerDir(account)); + + if (!ownerNode) + return tecDIR_FULL; // LCOV_EXCL_LINE + + auto mptoken = std::make_shared(mptokenKey); + (*mptoken)[sfAccount] = account; + (*mptoken)[sfMPTokenIssuanceID] = mptIssuanceID; + (*mptoken)[sfFlags] = flags; + (*mptoken)[sfOwnerNode] = *ownerNode; + + view.insert(mptoken); + + return tesSUCCESS; +} + } // namespace xrpl diff --git a/src/libxrpl/tx/transactors/nft/NFTokenUtils.cpp b/src/libxrpl/ledger/helpers/NFTokenHelpers.cpp similarity index 99% rename from src/libxrpl/tx/transactors/nft/NFTokenUtils.cpp rename to src/libxrpl/ledger/helpers/NFTokenHelpers.cpp index 3368887d94..d6921b5c88 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenUtils.cpp +++ b/src/libxrpl/ledger/helpers/NFTokenHelpers.cpp @@ -1,15 +1,16 @@ +#include #include #include #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelHelpers.cpp b/src/libxrpl/ledger/helpers/PaymentChannelHelpers.cpp similarity index 95% rename from src/libxrpl/tx/transactors/payment_channel/PaymentChannelHelpers.cpp rename to src/libxrpl/ledger/helpers/PaymentChannelHelpers.cpp index 176b920e6b..a9fab07194 100644 --- a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelHelpers.cpp +++ b/src/libxrpl/ledger/helpers/PaymentChannelHelpers.cpp @@ -1,10 +1,9 @@ #include #include #include +#include #include -#include - namespace xrpl { TER diff --git a/src/libxrpl/tx/transactors/dex/PermissionedDEXHelpers.cpp b/src/libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp similarity index 97% rename from src/libxrpl/tx/transactors/dex/PermissionedDEXHelpers.cpp rename to src/libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp index d857795e39..4b2bde19f8 100644 --- a/src/libxrpl/tx/transactors/dex/PermissionedDEXHelpers.cpp +++ b/src/libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace xrpl { namespace permissioned_dex { diff --git a/src/libxrpl/tx/Transactor.cpp b/src/libxrpl/tx/Transactor.cpp index 8847174122..57d2207336 100644 --- a/src/libxrpl/tx/Transactor.cpp +++ b/src/libxrpl/tx/Transactor.cpp @@ -4,6 +4,8 @@ #include #include #include +#include +#include #include #include #include @@ -16,8 +18,6 @@ #include #include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/invariants/AMMInvariant.cpp b/src/libxrpl/tx/invariants/AMMInvariant.cpp index 96df97016f..0be4bedc07 100644 --- a/src/libxrpl/tx/invariants/AMMInvariant.cpp +++ b/src/libxrpl/tx/invariants/AMMInvariant.cpp @@ -2,9 +2,9 @@ // #include #include +#include +#include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/invariants/NFTInvariant.cpp b/src/libxrpl/tx/invariants/NFTInvariant.cpp index cf00dc9290..e37e55e709 100644 --- a/src/libxrpl/tx/invariants/NFTInvariant.cpp +++ b/src/libxrpl/tx/invariants/NFTInvariant.cpp @@ -2,11 +2,12 @@ // #include #include +#include #include #include #include +#include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/paths/BookStep.cpp b/src/libxrpl/tx/paths/BookStep.cpp index ddba0c1ae9..b17ccf1ea5 100644 --- a/src/libxrpl/tx/paths/BookStep.cpp +++ b/src/libxrpl/tx/paths/BookStep.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include #include diff --git a/src/libxrpl/tx/paths/OfferStream.cpp b/src/libxrpl/tx/paths/OfferStream.cpp index acb2df1429..411b5cb05b 100644 --- a/src/libxrpl/tx/paths/OfferStream.cpp +++ b/src/libxrpl/tx/paths/OfferStream.cpp @@ -1,11 +1,11 @@ #include #include #include +#include #include #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/account/AccountDelete.cpp b/src/libxrpl/tx/transactors/account/AccountDelete.cpp index 815b314f9f..c7f71a6cf4 100644 --- a/src/libxrpl/tx/transactors/account/AccountDelete.cpp +++ b/src/libxrpl/tx/transactors/account/AccountDelete.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include #include #include diff --git a/src/libxrpl/tx/transactors/account/AccountSet.cpp b/src/libxrpl/tx/transactors/account/AccountSet.cpp index af3edb5768..093019766c 100644 --- a/src/libxrpl/tx/transactors/account/AccountSet.cpp +++ b/src/libxrpl/tx/transactors/account/AccountSet.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -7,7 +8,6 @@ #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/delegate/DelegateUtils.cpp b/src/libxrpl/tx/transactors/delegate/DelegateUtils.cpp index d9d74a1212..862fcf280c 100644 --- a/src/libxrpl/tx/transactors/delegate/DelegateUtils.cpp +++ b/src/libxrpl/tx/transactors/delegate/DelegateUtils.cpp @@ -1,5 +1,5 @@ +#include #include -#include namespace xrpl { NotTEC diff --git a/src/libxrpl/tx/transactors/dex/AMMBid.cpp b/src/libxrpl/tx/transactors/dex/AMMBid.cpp index f5b9445ead..805b5073e4 100644 --- a/src/libxrpl/tx/transactors/dex/AMMBid.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMBid.cpp @@ -1,12 +1,12 @@ #include #include +#include +#include #include #include #include #include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/dex/AMMClawback.cpp b/src/libxrpl/tx/transactors/dex/AMMClawback.cpp index b8f4fe4b1b..5291a1b25b 100644 --- a/src/libxrpl/tx/transactors/dex/AMMClawback.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMClawback.cpp @@ -1,12 +1,12 @@ #include #include +#include +#include #include #include #include #include #include -#include -#include #include #include diff --git a/src/libxrpl/tx/transactors/dex/AMMCreate.cpp b/src/libxrpl/tx/transactors/dex/AMMCreate.cpp index 069fadf103..6dee6dfd2a 100644 --- a/src/libxrpl/tx/transactors/dex/AMMCreate.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMCreate.cpp @@ -1,14 +1,14 @@ #include #include #include +#include +#include #include #include #include #include #include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/dex/AMMDelete.cpp b/src/libxrpl/tx/transactors/dex/AMMDelete.cpp index 0fbaa4e23e..41e88e6a07 100644 --- a/src/libxrpl/tx/transactors/dex/AMMDelete.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMDelete.cpp @@ -1,9 +1,9 @@ #include +#include #include #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/dex/AMMDeposit.cpp b/src/libxrpl/tx/transactors/dex/AMMDeposit.cpp index eb3e61e80b..9a2955901b 100644 --- a/src/libxrpl/tx/transactors/dex/AMMDeposit.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMDeposit.cpp @@ -1,12 +1,12 @@ #include #include +#include +#include #include #include #include #include #include -#include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/dex/AMMVote.cpp b/src/libxrpl/tx/transactors/dex/AMMVote.cpp index 2096eca0f0..e1b3afcd08 100644 --- a/src/libxrpl/tx/transactors/dex/AMMVote.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMVote.cpp @@ -1,8 +1,8 @@ #include +#include #include #include #include -#include #include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp b/src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp index 7c87d53ea0..0c6419f842 100644 --- a/src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp @@ -1,9 +1,9 @@ #include #include +#include +#include #include #include -#include -#include #include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/dex/OfferCreate.cpp b/src/libxrpl/tx/transactors/dex/OfferCreate.cpp index 20524f73ae..5d98e3625e 100644 --- a/src/libxrpl/tx/transactors/dex/OfferCreate.cpp +++ b/src/libxrpl/tx/transactors/dex/OfferCreate.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include namespace xrpl { TxConsequences diff --git a/src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp b/src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp index e47f008357..cd024a076d 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp +++ b/src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -9,8 +10,6 @@ #include #include -#include - namespace xrpl { NotTEC diff --git a/src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp b/src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp index e05ba87bbb..5c28fa5dd3 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp +++ b/src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -15,8 +16,6 @@ #include #include -#include - namespace xrpl { // During an EscrowFinish, the transaction must specify both diff --git a/src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp b/src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp index e061dbe7ec..fda79c93b6 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp @@ -1,10 +1,10 @@ #include +#include #include #include #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/nft/NFTokenBurn.cpp b/src/libxrpl/tx/transactors/nft/NFTokenBurn.cpp index 5a31e35470..1653da3ea4 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenBurn.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenBurn.cpp @@ -1,8 +1,8 @@ +#include #include #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/nft/NFTokenCancelOffer.cpp b/src/libxrpl/tx/transactors/nft/NFTokenCancelOffer.cpp index df0561e076..699714e0ac 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenCancelOffer.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenCancelOffer.cpp @@ -1,8 +1,8 @@ #include +#include #include #include #include -#include #include diff --git a/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp b/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp index f5fdc89550..19bf34c560 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenCreateOffer.cpp @@ -1,8 +1,8 @@ #include +#include #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/nft/NFTokenModify.cpp b/src/libxrpl/tx/transactors/nft/NFTokenModify.cpp index 8ccd4e9552..79c019de96 100644 --- a/src/libxrpl/tx/transactors/nft/NFTokenModify.cpp +++ b/src/libxrpl/tx/transactors/nft/NFTokenModify.cpp @@ -1,7 +1,7 @@ +#include #include #include #include -#include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/payment/Payment.cpp b/src/libxrpl/tx/transactors/payment/Payment.cpp index bf8a0caa4b..c9e2da0d25 100644 --- a/src/libxrpl/tx/transactors/payment/Payment.cpp +++ b/src/libxrpl/tx/transactors/payment/Payment.cpp @@ -1,7 +1,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -9,8 +11,6 @@ #include #include #include -#include -#include #include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelClaim.cpp b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelClaim.cpp index 91de511883..e53e32c844 100644 --- a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelClaim.cpp +++ b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelClaim.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -8,8 +9,6 @@ #include #include -#include - namespace xrpl { bool diff --git a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp index c42e8545f5..f8e2399bb1 100644 --- a/src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp +++ b/src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp @@ -1,10 +1,9 @@ #include #include +#include #include #include -#include - namespace xrpl { TxConsequences diff --git a/src/libxrpl/tx/transactors/system/LedgerStateFix.cpp b/src/libxrpl/tx/transactors/system/LedgerStateFix.cpp index 0ce0720ba0..321e472aa5 100644 --- a/src/libxrpl/tx/transactors/system/LedgerStateFix.cpp +++ b/src/libxrpl/tx/transactors/system/LedgerStateFix.cpp @@ -1,8 +1,8 @@ #include +#include #include #include #include -#include #include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp b/src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp index 3ddc6d2c05..3519ad0db1 100644 --- a/src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp +++ b/src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp @@ -132,32 +132,6 @@ MPTokenAuthorize::preclaim(PreclaimContext const& ctx) return tesSUCCESS; } -TER -MPTokenAuthorize::createMPToken( - ApplyView& view, - MPTID const& mptIssuanceID, - AccountID const& account, - std::uint32_t const flags) -{ - auto const mptokenKey = keylet::mptoken(mptIssuanceID, account); - - auto const ownerNode = - view.dirInsert(keylet::ownerDir(account), mptokenKey, describeOwnerDir(account)); - - if (!ownerNode) - return tecDIR_FULL; // LCOV_EXCL_LINE - - auto mptoken = std::make_shared(mptokenKey); - (*mptoken)[sfAccount] = account; - (*mptoken)[sfMPTokenIssuanceID] = mptIssuanceID; - (*mptoken)[sfFlags] = flags; - (*mptoken)[sfOwnerNode] = *ownerNode; - - view.insert(mptoken); - - return tesSUCCESS; -} - TER MPTokenAuthorize::doApply() { diff --git a/src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp b/src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp index fc09a53ae1..67e0d9077d 100644 --- a/src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp +++ b/src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp @@ -1,7 +1,7 @@ +#include #include #include #include -#include #include namespace xrpl { diff --git a/src/libxrpl/tx/transactors/token/TrustSet.cpp b/src/libxrpl/tx/transactors/token/TrustSet.cpp index feefa6a7ac..7c208c5855 100644 --- a/src/libxrpl/tx/transactors/token/TrustSet.cpp +++ b/src/libxrpl/tx/transactors/token/TrustSet.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -7,7 +8,6 @@ #include #include #include -#include #include namespace { diff --git a/src/test/app/AMMCalc_test.cpp b/src/test/app/AMMCalc_test.cpp index c3091a166d..021cf4bf46 100644 --- a/src/test/app/AMMCalc_test.cpp +++ b/src/test/app/AMMCalc_test.cpp @@ -1,7 +1,7 @@ #include +#include #include -#include #include diff --git a/src/test/app/AMMClawback_test.cpp b/src/test/app/AMMClawback_test.cpp index 245ee38ac2..a0def59c92 100644 --- a/src/test/app/AMMClawback_test.cpp +++ b/src/test/app/AMMClawback_test.cpp @@ -2,8 +2,8 @@ #include #include +#include #include -#include namespace xrpl { namespace test { diff --git a/src/test/app/AMMExtended_test.cpp b/src/test/app/AMMExtended_test.cpp index cc63f3d124..281ceafd19 100644 --- a/src/test/app/AMMExtended_test.cpp +++ b/src/test/app/AMMExtended_test.cpp @@ -6,13 +6,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index c19eb971a7..75b29fb79d 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -7,14 +7,14 @@ #include #include +#include +#include #include #include #include #include #include #include -#include -#include #include diff --git a/src/test/app/FixNFTokenPageLinks_test.cpp b/src/test/app/FixNFTokenPageLinks_test.cpp index 25366534cd..e5ecdf2639 100644 --- a/src/test/app/FixNFTokenPageLinks_test.cpp +++ b/src/test/app/FixNFTokenPageLinks_test.cpp @@ -1,9 +1,9 @@ #include +#include #include #include #include -#include namespace xrpl { diff --git a/src/test/app/NFTokenAuth_test.cpp b/src/test/app/NFTokenAuth_test.cpp index 0e3fb24305..0c044fc009 100644 --- a/src/test/app/NFTokenAuth_test.cpp +++ b/src/test/app/NFTokenAuth_test.cpp @@ -1,6 +1,6 @@ #include -#include +#include namespace xrpl { diff --git a/src/test/app/NFTokenBurn_test.cpp b/src/test/app/NFTokenBurn_test.cpp index cd0df42c03..99b1832466 100644 --- a/src/test/app/NFTokenBurn_test.cpp +++ b/src/test/app/NFTokenBurn_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -#include +#include #include diff --git a/src/test/app/NFTokenDir_test.cpp b/src/test/app/NFTokenDir_test.cpp index 78765cb6c0..6ed5912034 100644 --- a/src/test/app/NFTokenDir_test.cpp +++ b/src/test/app/NFTokenDir_test.cpp @@ -1,9 +1,9 @@ #include +#include #include #include #include -#include #include diff --git a/src/test/app/NFToken_test.cpp b/src/test/app/NFToken_test.cpp index 0d391147a8..abbd5ba8e1 100644 --- a/src/test/app/NFToken_test.cpp +++ b/src/test/app/NFToken_test.cpp @@ -1,9 +1,9 @@ #include #include +#include #include #include -#include #include diff --git a/src/test/jtx/impl/AMM.cpp b/src/test/jtx/impl/AMM.cpp index fe8fb8c443..b06353a30d 100644 --- a/src/test/jtx/impl/AMM.cpp +++ b/src/test/jtx/impl/AMM.cpp @@ -2,12 +2,12 @@ #include #include +#include +#include #include #include #include #include -#include -#include namespace xrpl { namespace test { diff --git a/src/xrpld/app/ledger/OrderBookDBImpl.cpp b/src/xrpld/app/ledger/OrderBookDBImpl.cpp index ffd8499aba..add9c7eea9 100644 --- a/src/xrpld/app/ledger/OrderBookDBImpl.cpp +++ b/src/xrpld/app/ledger/OrderBookDBImpl.cpp @@ -2,9 +2,9 @@ #include #include +#include #include #include -#include namespace xrpl { diff --git a/src/xrpld/rpc/detail/RPCHelpers.cpp b/src/xrpld/rpc/detail/RPCHelpers.cpp index b4a0685bd6..120479ded8 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCHelpers.cpp @@ -5,12 +5,12 @@ #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/src/xrpld/rpc/handlers/account/AccountNFTs.cpp b/src/xrpld/rpc/handlers/account/AccountNFTs.cpp index b879968e4e..e1ead76e85 100644 --- a/src/xrpld/rpc/handlers/account/AccountNFTs.cpp +++ b/src/xrpld/rpc/handlers/account/AccountNFTs.cpp @@ -4,13 +4,13 @@ #include #include +#include #include #include #include #include #include #include -#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/account/AccountObjects.cpp b/src/xrpld/rpc/handlers/account/AccountObjects.cpp index c09920f4a6..2e8462de2d 100644 --- a/src/xrpld/rpc/handlers/account/AccountObjects.cpp +++ b/src/xrpld/rpc/handlers/account/AccountObjects.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include diff --git a/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp b/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp index 9204f48907..cdd70a5cd8 100644 --- a/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp +++ b/src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp @@ -5,9 +5,9 @@ #include #include #include +#include #include #include -#include #include From c00ed673a81c5595ef29b7f69423098d0c899eaf Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 7 Apr 2026 09:00:17 -0400 Subject: [PATCH 7/9] refactor: Rename non-functional uses of `ripple(d)` to `xrpl(d)` (#6676) Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/feature_request.md | 4 +- .github/scripts/levelization/README.md | 12 +-- .github/scripts/rename/README.md | 3 + .github/scripts/rename/binary.sh | 3 +- .github/scripts/rename/cmake.sh | 2 +- .github/scripts/rename/config.sh | 5 +- .github/scripts/rename/copyright.sh | 2 +- .github/scripts/rename/docs.sh | 96 ++++++++++++++++++ .github/scripts/rename/namespace.sh | 5 +- .github/scripts/strategy-matrix/generate.py | 2 +- .github/workflows/reusable-check-rename.yml | 2 + API-CHANGELOG.md | 10 +- API-VERSION-2.md | 2 +- API-VERSION-3.md | 2 +- BUILD.md | 4 +- CONTRIBUTING.md | 2 +- README.md | 22 ++--- SECURITY.md | 6 +- cfg/validators-example.txt | 8 +- cfg/xrpld-example.cfg | 18 ++-- docs/0001-negative-unl/README.md | 6 +- .../negativeUNLSqDiagram.puml | 2 +- docs/Docker.md | 6 +- docs/Doxyfile | 2 +- docs/HeapProfiling.md | 14 +-- docs/README.md | 61 ------------ docs/build/depend.md | 8 +- docs/build/environment.md | 2 +- docs/build/install.md | 58 +++++------ docs/build/sanitizers.md | 6 +- docs/consensus.md | 16 +-- external/README.md | 2 +- external/antithesis-sdk/CMakeLists.txt | 4 +- include/xrpl/basics/CountedObject.h | 2 +- include/xrpl/basics/IntrusivePointer.h | 2 +- include/xrpl/basics/IntrusiveRefCounts.h | 2 +- include/xrpl/basics/README.md | 4 +- include/xrpl/basics/UptimeClock.h | 2 +- include/xrpl/basics/random.h | 4 +- include/xrpl/ledger/LedgerTiming.h | 6 +- include/xrpl/ledger/View.h | 4 +- include/xrpl/ledger/helpers/EscrowHelpers.h | 4 +- include/xrpl/ledger/helpers/MPTokenHelpers.h | 4 +- include/xrpl/ledger/helpers/TokenHelpers.h | 6 +- include/xrpl/nodestore/README.md | 8 +- include/xrpl/proto/org/xrpl/rpc/v1/README.md | 6 +- include/xrpl/proto/xrpl.proto | 2 +- include/xrpl/protocol/AccountID.h | 2 +- include/xrpl/protocol/BuildInfo.h | 14 +-- include/xrpl/protocol/ErrorCodes.h | 2 +- include/xrpl/protocol/Feature.h | 4 +- include/xrpl/protocol/PublicKey.h | 2 +- include/xrpl/protocol/Quality.h | 2 +- include/xrpl/protocol/README.md | 4 +- include/xrpl/protocol/STAccount.h | 2 +- include/xrpl/protocol/SecretKey.h | 2 +- include/xrpl/protocol/Seed.h | 2 +- include/xrpl/protocol/Units.h | 2 +- .../xrpl/protocol/detail/ledger_entries.macro | 2 +- include/xrpl/protocol/digest.h | 2 +- include/xrpl/protocol/jss.h | 2 +- include/xrpl/resource/README.md | 4 +- include/xrpl/server/Manifest.h | 8 +- include/xrpl/server/NetworkOPs.h | 4 +- include/xrpl/shamap/README.md | 2 +- include/xrpl/tx/paths/detail/StrandFlow.h | 2 +- sanitizers/suppressions/tsan.supp | 6 +- sanitizers/suppressions/ubsan.supp | 4 +- src/libxrpl/basics/UptimeClock.cpp | 8 +- src/libxrpl/ledger/helpers/MPTokenHelpers.cpp | 56 +++++------ src/libxrpl/ledger/helpers/TokenHelpers.cpp | 97 ++++++++++--------- src/libxrpl/protocol/BuildInfo.cpp | 4 +- src/libxrpl/protocol/NFTokenID.cpp | 2 +- src/libxrpl/server/Vacuum.cpp | 4 +- src/libxrpl/tx/applySteps.cpp | 1 - src/libxrpl/tx/invariants/FreezeInvariant.cpp | 2 +- src/libxrpl/tx/paths/DirectStep.cpp | 8 +- .../tx/transactors/dex/AMMClawback.cpp | 4 +- .../tx/transactors/dex/OfferCreate.cpp | 2 +- .../tx/transactors/escrow/EscrowCreate.cpp | 5 +- .../tx/transactors/payment/Payment.cpp | 2 +- src/libxrpl/tx/transactors/token/Clawback.cpp | 4 +- src/libxrpl/tx/transactors/token/TrustSet.cpp | 2 +- src/test/README.md | 4 +- src/test/app/Credentials_test.cpp | 4 +- src/test/app/DepositAuth_test.cpp | 2 +- src/test/app/LedgerReplay_test.cpp | 8 +- src/test/app/MPToken_test.cpp | 2 +- src/test/app/Offer_test.cpp | 3 +- src/test/app/ValidatorSite_test.cpp | 2 +- src/test/core/Config_test.cpp | 4 +- src/test/csf/README.md | 2 +- src/test/csf/Validation.h | 2 +- src/test/jtx/AbstractClient.h | 4 +- src/test/jtx/Oracle.h | 2 +- src/test/jtx/TrustedPublisherServer.h | 4 +- src/test/jtx/impl/Oracle.cpp | 2 +- src/test/jtx/utility.h | 2 +- src/test/ledger/PaymentSandbox_test.cpp | 10 +- src/test/nodestore/Timing_test.cpp | 2 +- src/test/overlay/reduce_relay_test.cpp | 36 +++---- src/test/peerfinder/PeerFinder_test.cpp | 20 ++-- src/test/protocol/BuildInfo_test.cpp | 12 +-- src/test/protocol/Hooks_test.cpp | 2 +- src/test/protocol/Seed_test.cpp | 4 +- src/test/rpc/Handler_test.cpp | 2 +- src/test/rpc/KeyGeneration_test.cpp | 6 +- src/test/rpc/ServerInfo_test.cpp | 4 +- src/test/unit_test/multi_runner.h | 4 +- src/xrpld/README.md | 2 +- src/xrpld/app/consensus/README.md | 4 +- src/xrpld/app/ledger/README.md | 6 +- src/xrpld/app/ledger/detail/LedgerMaster.cpp | 14 +-- src/xrpld/app/main/Application.cpp | 4 +- src/xrpld/app/main/GRPCServer.cpp | 2 +- src/xrpld/app/main/GRPCServer.h | 6 +- src/xrpld/app/main/Main.cpp | 14 +-- src/xrpld/app/misc/FeeEscalation.md | 10 +- src/xrpld/app/misc/README.md | 10 +- src/xrpld/app/misc/SHAMapStoreImp.h | 2 +- src/xrpld/app/misc/TxQ.h | 4 +- src/xrpld/app/misc/ValidatorList.h | 8 +- src/xrpld/app/misc/ValidatorSite.h | 2 +- src/xrpld/app/misc/detail/ValidatorList.cpp | 2 +- src/xrpld/app/rdb/README.md | 2 +- src/xrpld/app/rdb/backend/detail/Node.cpp | 2 +- src/xrpld/core/Config.h | 4 +- src/xrpld/core/TimeKeeper.h | 2 +- src/xrpld/overlay/README.md | 14 +-- src/xrpld/overlay/detail/Handshake.cpp | 2 +- src/xrpld/overlay/detail/OverlayImpl.cpp | 2 +- src/xrpld/overlay/detail/PeerImp.h | 2 +- .../overlay/detail/PeerReservationTable.cpp | 2 +- src/xrpld/peerfinder/README.md | 8 +- src/xrpld/peerfinder/detail/Bootcache.cpp | 4 +- src/xrpld/rpc/README.md | 2 +- src/xrpld/rpc/RPCCall.h | 4 +- src/xrpld/rpc/detail/RPCCall.cpp | 4 +- src/xrpld/rpc/detail/RPCHelpers.cpp | 10 +- src/xrpld/rpc/detail/RPCHelpers.h | 6 +- .../handlers/admin/keygen/WalletPropose.cpp | 12 +-- .../rpc/handlers/orderbook/RipplePathFind.cpp | 2 +- .../rpc/handlers/transaction/Simulate.cpp | 2 +- tests/README.md | 2 +- 144 files changed, 544 insertions(+), 511 deletions(-) create mode 100755 .github/scripts/rename/docs.sh delete mode 100644 docs/README.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 967b3c1817..05e87d16e0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,7 +1,7 @@ --- name: Feature Request -about: Suggest a new feature for the rippled project -title: "[Title with short description] (Version: [rippled version])" +about: Suggest a new feature for the xrpld project +title: "[Title with short description] (Version: [xrpld version])" labels: Feature Request assignees: "" --- diff --git a/.github/scripts/levelization/README.md b/.github/scripts/levelization/README.md index 25eb52f079..f657344827 100644 --- a/.github/scripts/levelization/README.md +++ b/.github/scripts/levelization/README.md @@ -1,14 +1,14 @@ # Levelization -Levelization is the term used to describe efforts to prevent rippled from +Levelization is the term used to describe efforts to prevent xrpld from having or creating cyclic dependencies. -rippled code is organized into directories under `src/xrpld`, `src/libxrpl` (and +xrpld code is organized into directories under `src/xrpld`, `src/libxrpl` (and `src/test`) representing modules. The modules are intended to be organized into "tiers" or "levels" such that a module from one level can only include code from lower levels. Additionally, a module in one level should never include code in an `impl` or `detail` folder of any level -other than it's own. +other than its own. The codebase is split into two main areas: @@ -22,7 +22,7 @@ levelization violations they find (by moving files or individual classes). At the very least, don't make things worse. The table below summarizes the _desired_ division of modules, based on the current -state of the rippled code. The levels are numbered from +state of the xrpld code. The levels are numbered from the bottom up with the lower level, lower numbered, more independent modules listed first, and the higher level, higher numbered modules with more dependencies listed later. @@ -72,10 +72,10 @@ that `test` code should _never_ be included in `xrpl` or `xrpld` code.) The [levelization](generate.py) script takes no parameters, reads no environment variables, and can be run from any directory, -as long as it is in the expected location in the rippled repo. +as long as it is in the expected location in the xrpld repo. It can be run at any time from within a checked out repo, and will do an analysis of all the `#include`s in -the rippled source. The only caveat is that it runs much slower +the xrpld source. The only caveat is that it runs much slower under Windows than in Linux. It hasn't yet been tested under MacOS. It generates many files of [results](results): diff --git a/.github/scripts/rename/README.md b/.github/scripts/rename/README.md index cc004a335f..ab685bb0c3 100644 --- a/.github/scripts/rename/README.md +++ b/.github/scripts/rename/README.md @@ -34,6 +34,8 @@ run from the repository root. 6. `.github/scripts/rename/config.sh`: This script will rename the config from `rippled.cfg` to `xrpld.cfg`, and updating the code accordingly. The old filename will still be accepted. +7. `.github/scripts/rename/docs.sh`: This script will rename any lingering + references of `ripple(d)` to `xrpl(d)` in code, comments, and documentation. You can run all these scripts from the repository root as follows: @@ -44,4 +46,5 @@ You can run all these scripts from the repository root as follows: ./.github/scripts/rename/binary.sh . ./.github/scripts/rename/namespace.sh . ./.github/scripts/rename/config.sh . +./.github/scripts/rename/docs.sh . ``` diff --git a/.github/scripts/rename/binary.sh b/.github/scripts/rename/binary.sh index deb4dd5fb4..81d48ce94b 100755 --- a/.github/scripts/rename/binary.sh +++ b/.github/scripts/rename/binary.sh @@ -29,7 +29,7 @@ if [ ! -d "${DIRECTORY}" ]; then echo "Error: Directory '${DIRECTORY}' does not exist." exit 1 fi -pushd ${DIRECTORY} +pushd "${DIRECTORY}" # Remove the binary name override added by the cmake.sh script. ${SED_COMMAND} -z -i -E 's@\s+# For the time being.+"rippled"\)@@' cmake/XrplCore.cmake @@ -49,6 +49,7 @@ ${SED_COMMAND} -i -E 's@ripple/xrpld@XRPLF/rippled@g' BUILD.md ${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' BUILD.md ${SED_COMMAND} -i -E 's@xrpld \(`xrpld`\)@xrpld@g' BUILD.md ${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' CONTRIBUTING.md +${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' docs/build/install.md popd echo "Processing complete." diff --git a/.github/scripts/rename/cmake.sh b/.github/scripts/rename/cmake.sh index 0f88fa5de2..6c3d30e948 100755 --- a/.github/scripts/rename/cmake.sh +++ b/.github/scripts/rename/cmake.sh @@ -38,7 +38,7 @@ if [ ! -d "${DIRECTORY}" ]; then echo "Error: Directory '${DIRECTORY}' does not exist." exit 1 fi -pushd ${DIRECTORY} +pushd "${DIRECTORY}" # Rename the files. find cmake -type f -name 'Rippled*.cmake' -exec bash -c 'mv "${1}" "${1/Rippled/Xrpl}"' - {} \; diff --git a/.github/scripts/rename/config.sh b/.github/scripts/rename/config.sh index f6e914f502..9a521e8a51 100755 --- a/.github/scripts/rename/config.sh +++ b/.github/scripts/rename/config.sh @@ -28,7 +28,7 @@ if [ ! -d "${DIRECTORY}" ]; then echo "Error: Directory '${DIRECTORY}' does not exist." exit 1 fi -pushd ${DIRECTORY} +pushd "${DIRECTORY}" # Add the xrpld.cfg to the .gitignore. if ! grep -q 'xrpld.cfg' .gitignore; then @@ -52,16 +52,15 @@ for DIRECTORY in "${DIRECTORIES[@]}"; do find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.cmake" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" \) | while read -r FILE; do echo "Processing file: ${FILE}" ${SED_COMMAND} -i -E 's/rippled(-example)?[ .]cfg/xrpld\1.cfg/g' "${FILE}" + ${SED_COMMAND} -i 's/rippleConfig/xrpldConfig/g' "${FILE}" done done ${SED_COMMAND} -i 's/rippled/xrpld/g' cfg/xrpld-example.cfg ${SED_COMMAND} -i 's/rippled/xrpld/g' src/test/core/Config_test.cpp ${SED_COMMAND} -i 's/ripplevalidators/xrplvalidators/g' src/test/core/Config_test.cpp # cspell: disable-line -${SED_COMMAND} -i 's/rippleConfig/xrpldConfig/g' src/test/core/Config_test.cpp ${SED_COMMAND} -i 's@ripple/@xrpld/@g' src/test/core/Config_test.cpp ${SED_COMMAND} -i 's/Rippled/File/g' src/test/core/Config_test.cpp - # Restore the old config file name in the code that maintains support for now. ${SED_COMMAND} -i 's/configLegacyName = "xrpld.cfg"/configLegacyName = "rippled.cfg"/g' src/xrpld/core/detail/Config.cpp diff --git a/.github/scripts/rename/copyright.sh b/.github/scripts/rename/copyright.sh index 3d690321b9..f212fe5fc7 100755 --- a/.github/scripts/rename/copyright.sh +++ b/.github/scripts/rename/copyright.sh @@ -31,7 +31,7 @@ if [ ! -d "${DIRECTORY}" ]; then echo "Error: Directory '${DIRECTORY}' does not exist." exit 1 fi -pushd ${DIRECTORY} +pushd "${DIRECTORY}" # Prevent sed and echo from removing newlines and tabs in string literals by # temporarily replacing them with placeholders. This only affects one file. diff --git a/.github/scripts/rename/docs.sh b/.github/scripts/rename/docs.sh new file mode 100755 index 0000000000..22d5e242d1 --- /dev/null +++ b/.github/scripts/rename/docs.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# Exit the script as soon as an error occurs. +set -e + +# On MacOS, ensure that GNU sed is installed and available as `gsed`. +SED_COMMAND=sed +if [[ "${OSTYPE}" == 'darwin'* ]]; then + if ! command -v gsed &> /dev/null; then + echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'." + exit 1 + fi + SED_COMMAND=gsed +fi + +# This script renames all remaining references to `ripple` and `rippled` to +# `xrpl` and `xrpld`, respectively, in code, comments, and documentation. +# Usage: .github/scripts/rename/docs.sh + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +DIRECTORY=$1 +echo "Processing directory: ${DIRECTORY}" +if [ ! -d "${DIRECTORY}" ]; then + echo "Error: Directory '${DIRECTORY}' does not exist." + exit 1 +fi +pushd "${DIRECTORY}" + +find . -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" -o -name "*.proto" \) -not -path "./.github/scripts/*" | while read -r FILE; do + echo "Processing file: ${FILE}" + ${SED_COMMAND} -i 's/rippleLockEscrowMPT/lockEscrowMPT/g' "${FILE}" + ${SED_COMMAND} -i 's/rippleUnlockEscrowMPT/unlockEscrowMPT/g' "${FILE}" + ${SED_COMMAND} -i 's/rippleCredit/directSendNoFee/g' "${FILE}" + ${SED_COMMAND} -i 's/rippleSend/directSendNoLimit/g' "${FILE}" + ${SED_COMMAND} -i -E 's@([^/+-])rippled@\1xrpld@g' "${FILE}" + ${SED_COMMAND} -i -E 's@([^/+-])Rippled@\1Xrpld@g' "${FILE}" + ${SED_COMMAND} -i -E 's/^rippled/xrpld/g' "${FILE}" + ${SED_COMMAND} -i -E 's/^Rippled/Xrpld/g' "${FILE}" + # cspell: disable + ${SED_COMMAND} -i -E 's/(r|R)ipple (a|A)ddress/XRPL address/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (a|A)ccount/XRPL account/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (a|A)lgorithm/XRPL algorithm/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (c|C)lient/XRPL client/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (c|C)luster/XRPL cluster/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (c|C)onsensus/XRPL consensus/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (d|D)efault/XRPL default/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (e|E)poch/XRPL epoch/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (f|F)eature/XRPL feature/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (n|N)etwork/XRPL network/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (p|P)ayment/XRPL payment/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (p|P)rotocol/XRPL protocol/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (r|R)epository/XRPL repository/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple RPC/XRPL RPC/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (s|S)erialization/XRPL serialization/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (s|S)erver/XRPL server/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (s|S)pecific/XRPL specific/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple Source/XRPL Source/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (t|T)imestamp/XRPL timestamp/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple uses the consensus/XRPL uses the consensus/g' "${FILE}" + ${SED_COMMAND} -i -E 's/(r|R)ipple (v|V)alidator/XRPL validator/g' "${FILE}" + # cspell: enable + ${SED_COMMAND} -i 's/RippleLib/XrplLib/g' "${FILE}" + ${SED_COMMAND} -i 's/ripple-lib/XrplLib/g' "${FILE}" + ${SED_COMMAND} -i 's@opt/ripple/@opt/xrpld/@g' "${FILE}" + ${SED_COMMAND} -i 's@src/ripple/@src/xrpld/@g' "${FILE}" + ${SED_COMMAND} -i 's@ripple/app/@xrpld/app/@g' "${FILE}" + ${SED_COMMAND} -i 's@github.com/ripple/rippled@github.com/XRPLF/rippled@g' "${FILE}" + ${SED_COMMAND} -i 's/\ba xrpl/an xrpl/g' "${FILE}" + ${SED_COMMAND} -i 's/\ba XRPL/an XRPL/g' "${FILE}" +done +${SED_COMMAND} -i 's/ripple_libs/xrpl_libs/' BUILD.md +${SED_COMMAND} -i 's/Ripple integrators/XRPL developers/' README.md +${SED_COMMAND} -i 's/sanitizer-configuration-for-rippled/sanitizer-configuration-for-xrpld/' docs/build/sanitizers.md +${SED_COMMAND} -i 's/rippled/xrpld/g' .github/scripts/levelization/README.md +${SED_COMMAND} -i 's/rippled/xrpld/g' .github/scripts/strategy-matrix/generate.py +${SED_COMMAND} -i 's@/rippled@/xrpld@g' docs/build/install.md +${SED_COMMAND} -i 's@github.com/XRPLF/xrpld@github.com/XRPLF/rippled@g' docs/build/install.md +${SED_COMMAND} -i 's/rippled/xrpld/g' docs/Doxyfile +${SED_COMMAND} -i 's/ripple_basics/basics/' include/xrpl/basics/CountedObject.h +${SED_COMMAND} -i 's/ list: # so that they are easier to identify in the GitHub Actions UI, as long # names get truncated. # Add Address and Thread (both coupled with UB) sanitizers for specific bookworm distros. - # GCC-Asan rippled-embedded tests are failing because of https://github.com/google/sanitizers/issues/856 + # GCC-Asan xrpld-embedded tests are failing because of https://github.com/google/sanitizers/issues/856 if ( os["distro_version"] == "bookworm" and f"{os['compiler_name']}-{os['compiler_version']}" == "clang-20" diff --git a/.github/workflows/reusable-check-rename.yml b/.github/workflows/reusable-check-rename.yml index 0e335ab9ca..56a1a3e637 100644 --- a/.github/workflows/reusable-check-rename.yml +++ b/.github/workflows/reusable-check-rename.yml @@ -33,6 +33,8 @@ jobs: run: .github/scripts/rename/config.sh . - name: Check include guards run: .github/scripts/rename/include.sh . + - name: Check documentation + run: .github/scripts/rename/docs.sh . - name: Check for differences env: MESSAGE: | diff --git a/API-CHANGELOG.md b/API-CHANGELOG.md index 8e7fb2e4d4..d5faaf70af 100644 --- a/API-CHANGELOG.md +++ b/API-CHANGELOG.md @@ -4,23 +4,23 @@ This changelog is intended to list all updates to the [public API methods](https For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior. -The API version controls the API behavior you see. This includes what properties you see in responses, what parameters you're permitted to send in requests, and so on. You specify the API version in each of your requests. When a breaking change is introduced to the `rippled` API, a new version is released. To avoid breaking your code, you should set (or increase) your version when you're ready to upgrade. +The API version controls the API behavior you see. This includes what properties you see in responses, what parameters you're permitted to send in requests, and so on. You specify the API version in each of your requests. When a breaking change is introduced to the `xrpld` API, a new version is released. To avoid breaking your code, you should set (or increase) your version when you're ready to upgrade. The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#commandline-format) always uses the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code. -For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release. +For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`xrpld`) release. ## API Version 3 (Beta) -API version 3 is currently a beta API. It requires enabling `[beta_rpc_api]` in the rippled configuration to use. See [API-VERSION-3.md](API-VERSION-3.md) for the full list of changes in API version 3. +API version 3 is currently a beta API. It requires enabling `[beta_rpc_api]` in the xrpld configuration to use. See [API-VERSION-3.md](API-VERSION-3.md) for the full list of changes in API version 3. ## API Version 2 -API version 2 is available in `rippled` version 2.0.0 and later. See [API-VERSION-2.md](API-VERSION-2.md) for the full list of changes in API version 2. +API version 2 is available in `xrpld` version 2.0.0 and later. See [API-VERSION-2.md](API-VERSION-2.md) for the full list of changes in API version 2. ## API Version 1 -This version is supported by all `rippled` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified. +This version is supported by all `xrpld` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified. ## Unreleased diff --git a/API-VERSION-2.md b/API-VERSION-2.md index 2296795271..eaf626099c 100644 --- a/API-VERSION-2.md +++ b/API-VERSION-2.md @@ -1,6 +1,6 @@ # API Version 2 -API version 2 is available in `rippled` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request. +API version 2 is available in `xrpld` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request. For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior. diff --git a/API-VERSION-3.md b/API-VERSION-3.md index 46dc3f504d..57d42ce200 100644 --- a/API-VERSION-3.md +++ b/API-VERSION-3.md @@ -1,6 +1,6 @@ # API Version 3 -API version 3 is currently a **beta API**. It requires enabling `[beta_rpc_api]` in the rippled configuration to use. To use this API, clients specify `"api_version" : 3` in each request. +API version 3 is currently a **beta API**. It requires enabling `[beta_rpc_api]` in the xrpld configuration to use. To use this API, clients specify `"api_version" : 3` in each request. For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior. diff --git a/BUILD.md b/BUILD.md index 757f76a716..7406d60949 100644 --- a/BUILD.md +++ b/BUILD.md @@ -603,8 +603,8 @@ If you want to experiment with a new package, follow these steps: `default_options` property (with syntax `'$package:$option': $value`). 3. Modify [`CMakeLists.txt`](./CMakeLists.txt): - Add a call to `find_package($package REQUIRED)`. - - Link a library from the package to the target `ripple_libs` - (search for the existing call to `target_link_libraries(ripple_libs INTERFACE ...)`). + - Link a library from the package to the target `xrpl_libs` + (search for the existing call to `target_link_libraries(xrpl_libs INTERFACE ...)`). 4. Start coding! Don't forget to include whatever headers you need from the package. [1]: https://github.com/conan-io/conan-center-index/issues/13168 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d19222dbf0..0589081055 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -533,7 +533,7 @@ All releases, including release candidates and betas, are handled differently from typical PRs. Most importantly, never use the Github UI to merge a release. -Rippled uses a linear workflow model that can be summarized as: +Xrpld uses a linear workflow model that can be summarized as: 1. In between releases, developers work against the `develop` branch. 2. Periodically, a maintainer will build and tag a beta version from diff --git a/README.md b/README.md index dbc5ab078e..88c7943ebb 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ The [XRP Ledger](https://xrpl.org/) is a decentralized cryptographic ledger powe [XRP](https://xrpl.org/xrp.html) is a public, counterparty-free crypto-asset native to the XRP Ledger, and is designed as a gas token for network services and to bridge different currencies. XRP is traded on the open-market and is available for anyone to access. The XRP Ledger was created in 2012 with a finite supply of 100 billion units of XRP. -## rippled +## xrpld -The server software that powers the XRP Ledger is called `rippled` and is available in this repository under the permissive [ISC open-source license](LICENSE.md). The `rippled` server software is written primarily in C++ and runs on a variety of platforms. The `rippled` server software can run in several modes depending on its [configuration](https://xrpl.org/rippled-server-modes.html). +The server software that powers the XRP Ledger is called `xrpld` and is available in this repository under the permissive [ISC open-source license](LICENSE.md). The `xrpld` server software is written primarily in C++ and runs on a variety of platforms. The `xrpld` server software can run in several modes depending on its [configuration](https://xrpl.org/rippled-server-modes.html). -If you are interested in running an **API Server** (including a **Full History Server**), take a look at [Clio](https://github.com/XRPLF/clio). (rippled Reporting Mode has been replaced by Clio.) +If you are interested in running an **API Server** (including a **Full History Server**), take a look at [Clio](https://github.com/XRPLF/clio). (xrpld Reporting Mode has been replaced by Clio.) ### Build from Source @@ -41,19 +41,19 @@ If you are interested in running an **API Server** (including a **Full History S Here are some good places to start learning the source code: -- Read the markdown files in the source tree: `src/ripple/**/*.md`. +- Read the markdown files in the source tree: `src/xrpld/**/*.md`. - Read [the levelization document](.github/scripts/levelization) to get an idea of the internal dependency graph. - In the big picture, the `main` function constructs an `ApplicationImp` object, which implements the `Application` virtual interface. Almost every component in the application takes an `Application&` parameter in its constructor, typically named `app` and stored as a member variable `app_`. This allows most components to depend on any other component. ### Repository Contents -| Folder | Contents | -| :--------- | :----------------------------------------------- | -| `./bin` | Scripts and data files for Ripple integrators. | -| `./Builds` | Platform-specific guides for building `rippled`. | -| `./docs` | Source documentation files and doxygen config. | -| `./cfg` | Example configuration files. | -| `./src` | Source code. | +| Folder | Contents | +| :--------- | :--------------------------------------------- | +| `./bin` | Scripts and data files for XRPL developers. | +| `./Builds` | Platform-specific guides for building `xrpld`. | +| `./docs` | Source documentation files and doxygen config. | +| `./cfg` | Example configuration files. | +| `./src` | Source code. | Some of the directories under `src` are external repositories included using git-subtree. See those directories' README files for more details. diff --git a/SECURITY.md b/SECURITY.md index 1be412ae2a..2e0c43a134 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,7 +6,7 @@ For more details on operating an XRP Ledger server securely, please visit https: ## Supported Versions -Software constantly evolves. In order to focus resources, we only generally only accept vulnerability reports that affect recent and current versions of the software. We always accept reports for issues present in the **master**, **release** or **develop** branches, and with proposed, [open pull requests](https://github.com/ripple/rippled/pulls). +Software constantly evolves. In order to focus resources, we generally only accept vulnerability reports that affect recent and current versions of the software. We always accept reports for issues present in the **master**, **release** or **develop** branches, and with proposed, [open pull requests](https://github.com/XRPLF/rippled/pulls). ## Identifying and Reporting Vulnerabilities @@ -59,11 +59,11 @@ While we commit to responding with 24 hours of your initial report with our tria ## Bug Bounty Program -[Ripple](https://ripple.com) is generously sponsoring a bug bounty program for vulnerabilities in [`rippled`](https://github.com/XRPLF/rippled) (and other related projects, like [`xrpl.js`](https://github.com/XRPLF/xrpl.js), [`xrpl-py`](https://github.com/XRPLF/xrpl-py), [`xrpl4j`](https://github.com/XRPLF/xrpl4j)). +[Ripple](https://ripple.com) is generously sponsoring a bug bounty program for vulnerabilities in [`xrpld`](https://github.com/XRPLF/rippled) (and other related projects, like [`xrpl.js`](https://github.com/XRPLF/xrpl.js), [`xrpl-py`](https://github.com/XRPLF/xrpl-py), [`xrpl4j`](https://github.com/XRPLF/xrpl4j)). This program allows us to recognize and reward individuals or groups that identify and report bugs. In summary, in order to qualify for a bounty, the bug must be: -1. **In scope**. Only bugs in software under the scope of the program qualify. Currently, that means `rippled`, `xrpl.js`, `xrpl-py`, `xrpl4j`. +1. **In scope**. Only bugs in software under the scope of the program qualify. Currently, that means `xrpld`, `xrpl.js`, `xrpl-py`, `xrpl4j`. 2. **Relevant**. A security issue, posing a danger to user funds, privacy, or the operation of the XRP Ledger. 3. **Original and previously unknown**. Bugs that are already known and discussed in public do not qualify. Previously reported bugs, even if publicly unknown, are not eligible. 4. **Specific**. We welcome general security advice or recommendations, but we cannot pay bounties for that. diff --git a/cfg/validators-example.txt b/cfg/validators-example.txt index 6eb49da697..384db924f4 100644 --- a/cfg/validators-example.txt +++ b/cfg/validators-example.txt @@ -28,7 +28,7 @@ # https://vl.ripple.com # https://unl.xrplf.org # http://127.0.0.1:8000 -# file:///etc/opt/ripple/vl.txt +# file:///etc/opt/xrpld/vl.txt # # [validator_list_keys] # @@ -43,11 +43,11 @@ # ED307A760EE34F2D0CAA103377B1969117C38B8AA0AA1E2A24DAC1F32FC97087ED # -# The default validator list publishers that the rippled instance +# The default validator list publishers that the xrpld instance # trusts. # -# WARNING: Changing these values can cause your rippled instance to see a -# validated ledger that contradicts other rippled instances' +# WARNING: Changing these values can cause your xrpld instance to see a +# validated ledger that contradicts other xrpld instances' # validated ledgers (aka a ledger fork) if your validator list(s) # do not sufficiently overlap with the list(s) used by others. # See: https://arxiv.org/pdf/1802.07242.pdf diff --git a/cfg/xrpld-example.cfg b/cfg/xrpld-example.cfg index 995d4e65ff..6d65824fb9 100644 --- a/cfg/xrpld-example.cfg +++ b/cfg/xrpld-example.cfg @@ -9,7 +9,7 @@ # # 2. Peer Protocol # -# 3. Ripple Protocol +# 3. XRPL protocol # # 4. HTTPS Client # @@ -383,7 +383,7 @@ # # These settings control security and access attributes of the Peer to Peer # server section of the xrpld process. Peer Protocol implements the -# Ripple Payment protocol. It is over peer connections that transactions +# XRPL payment protocol. It is over peer connections that transactions # and validations are passed from to machine to machine, to determine the # contents of validated ledgers. # @@ -406,7 +406,7 @@ # # [ips] # -# List of hostnames or ips where the Ripple protocol is served. A default +# List of hostnames or ips where the XRPL protocol is served. A default # starter list is included in the code and used if no other hostnames are # available. # @@ -435,7 +435,7 @@ # List of IP addresses or hostnames to which xrpld should always attempt to # maintain peer connections with. This is useful for manually forming private # networks, for example to configure a validation server that connects to the -# Ripple network through a public-facing server, or for building a set +# XRPL network through a public-facing server, or for building a set # of cluster peers. # # One address or domain names per line is allowed. A port must be specified @@ -748,8 +748,8 @@ # the folder in which the xrpld.cfg file is located. # # Examples: -# /home/ripple/validators.txt -# C:/home/ripple/validators.txt +# /home/username/validators.txt +# C:/home/username/validators.txt # # Example content: # [validators] @@ -840,7 +840,7 @@ # # 0: Disable the ledger replay feature [default] # 1: Enable the ledger replay feature. With this feature enabled, when -# acquiring a ledger from the network, a xrpld node only downloads +# acquiring a ledger from the network, an xrpld node only downloads # the ledger header and the transactions instead of the whole ledger. # And the ledger is built by applying the transactions to the parent # ledger. @@ -853,7 +853,7 @@ # # The xrpld server instance uses HTTPS GET requests in a variety of # circumstances, including but not limited to contacting trusted domains to -# fetch information such as mapping an email address to a Ripple Payment +# fetch information such as mapping an email address to an XRPL payment # Network address. # # [ssl_verify] @@ -1227,7 +1227,7 @@ # #---------- # -# The vote settings configure settings for the entire Ripple network. +# The vote settings configure settings for the entire XRPL network. # While a single instance of xrpld cannot unilaterally enforce network-wide # settings, these choices become part of the instance's vote during the # consensus process for each voting ledger. diff --git a/docs/0001-negative-unl/README.md b/docs/0001-negative-unl/README.md index c863cab9da..dd5f9af2ae 100644 --- a/docs/0001-negative-unl/README.md +++ b/docs/0001-negative-unl/README.md @@ -558,7 +558,7 @@ network delay. A test case specifies: 1. a UNL with different number of validators for different test cases, 1. a network with zero or more non-validator nodes, 1. a sequence of validator reliability change events (by killing/restarting - nodes, or by running modified rippled that does not send all validation + nodes, or by running modified xrpld that does not send all validation messages), 1. the correct outcomes. @@ -566,7 +566,7 @@ For all the test cases, the correct outcomes are verified by examining logs. We will grep the log to see if the correct negative UNLs are generated, and whether or not the network is making progress when it should be. The ripdtop tool will be helpful for monitoring validators' states and ledger progress. Some of the -timing parameters of rippled will be changed to have faster ledger time. Most if +timing parameters of xrpld will be changed to have faster ledger time. Most if not all test cases do not need client transactions. For example, the test cases for the prototype: @@ -583,7 +583,7 @@ For example, the test cases for the prototype: We considered testing with the current unit test framework, specifically the [Consensus Simulation -Framework](https://github.com/ripple/rippled/blob/develop/src/test/csf/README.md) +Framework](https://github.com/XRPLF/rippled/blob/develop/src/test/csf/README.md) (CSF). However, the CSF currently can only test the generic consensus algorithm as in the paper: [Analysis of the XRP Ledger Consensus Protocol](https://arxiv.org/abs/1802.07242). diff --git a/docs/0001-negative-unl/negativeUNLSqDiagram.puml b/docs/0001-negative-unl/negativeUNLSqDiagram.puml index d86b98c01f..5c8d0c1fb3 100644 --- a/docs/0001-negative-unl/negativeUNLSqDiagram.puml +++ b/docs/0001-negative-unl/negativeUNLSqDiagram.puml @@ -4,7 +4,7 @@ skinparam sequenceArrowThickness 2 skinparam roundcorner 20 skinparam maxmessagesize 160 -actor "Rippled Start" as RS +actor "Xrpld Start" as RS participant "Timer" as T participant "NetworkOPs" as NOP participant "ValidatorList" as VL #lightgreen diff --git a/docs/Docker.md b/docs/Docker.md index 9f67c87ee5..4c712148d6 100644 --- a/docs/Docker.md +++ b/docs/Docker.md @@ -1,5 +1,5 @@ -# `rippled` Docker Image +# `xrpld` Docker Image - Some info relating to Docker containers can be found here: [../Builds/containers](../Builds/containers) -- Images for building and testing rippled can be found here: [thejohnfreeman/rippled-docker](https://github.com/thejohnfreeman/rippled-docker/) - - These images do not have rippled. They have all the tools necessary to build rippled. +- Images for building and testing xrpld can be found here: [thejohnfreeman/rippled-docker](https://github.com/thejohnfreeman/rippled-docker/) + - These images do not have xrpld. They have all the tools necessary to build xrpld. diff --git a/docs/Doxyfile b/docs/Doxyfile index 750ae0fb64..caa1db30e7 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -2,7 +2,7 @@ # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "rippled" +PROJECT_NAME = "xrpld" PROJECT_NUMBER = PROJECT_BRIEF = PROJECT_LOGO = diff --git a/docs/HeapProfiling.md b/docs/HeapProfiling.md index 2871cccaba..6fcc9f9a67 100644 --- a/docs/HeapProfiling.md +++ b/docs/HeapProfiling.md @@ -1,4 +1,4 @@ -## Heap profiling of rippled with jemalloc +## Heap profiling of xrpld with jemalloc The jemalloc library provides a good API for doing heap analysis, including a mechanism to dump a description of the heap from within the @@ -7,26 +7,26 @@ activity in general, as well as how to acquire the software, are available on the jemalloc site: [https://github.com/jemalloc/jemalloc/wiki/Use-Case:-Heap-Profiling](https://github.com/jemalloc/jemalloc/wiki/Use-Case:-Heap-Profiling) -jemalloc is acquired separately from rippled, and is not affiliated +jemalloc is acquired separately from xrpld, and is not affiliated with Ripple Labs. If you compile and install jemalloc from the source release with default options, it will install the library and header under `/usr/local/lib` and `/usr/local/include`, respectively. Heap -profiling has been tested with rippled on a Linux platform. It should -work on platforms on which both rippled and jemalloc are available. +profiling has been tested with xrpld on a Linux platform. It should +work on platforms on which both xrpld and jemalloc are available. -To link rippled with jemalloc, the argument +To link xrpld with jemalloc, the argument `profile-jemalloc=` is provided after the optional target. The `` argument should be the same as that of the `--prefix` parameter passed to the jemalloc configure script when building. ## Examples: -Build rippled with jemalloc library under /usr/local/lib and +Build xrpld with jemalloc library under /usr/local/lib and header under /usr/local/include: $ scons profile-jemalloc=/usr/local -Build rippled using clang with the jemalloc library under /opt/local/lib +Build xrpld using clang with the jemalloc library under /opt/local/lib and header under /opt/local/include: $ scons clang profile-jemalloc=/opt/local diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 35fcbba2d1..0000000000 --- a/docs/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Building documentation - -## Dependencies - -Install these dependencies: - -- [Doxygen](http://www.doxygen.nl): All major platforms have [official binary - distributions](http://www.doxygen.nl/download.html#srcbin), or you can - build from [source](http://www.doxygen.nl/download.html#srcbin). - - MacOS: We recommend installing via Homebrew: `brew install doxygen`. - The executable will be installed in `/usr/local/bin` which is already - in the default `PATH`. - - If you use the official binary distribution, then you'll need to make - Doxygen available to your command line. You can do this by adding - a symbolic link from `/usr/local/bin` to the `doxygen` executable. For - example, - - ``` - $ ln -s /Applications/Doxygen.app/Contents/Resources/doxygen /usr/local/bin/doxygen - ``` - -- [PlantUML](http://plantuml.com): - 1. Install a functioning Java runtime, if you don't already have one. - 2. Download [`plantuml.jar`](http://sourceforge.net/projects/plantuml/files/plantuml.jar/download). - -- [Graphviz](https://www.graphviz.org): - - Linux: Install from your package manager. - - Windows: Use an [official installer](https://graphviz.gitlab.io/_pages/Download/Download_windows.html). - - MacOS: Install via Homebrew: `brew install graphviz`. - -## Docker - -Instead of installing the above dependencies locally, you can use the official -build environment Docker image, which has all of them installed already. - -1. Install [Docker](https://docs.docker.com/engine/installation/) -2. Pull the image: - -``` -sudo docker pull rippleci/rippled-ci-builder:2944b78d22db -``` - -3. Run the image from the project folder: - -``` -sudo docker run -v $PWD:/opt/rippled --rm rippleci/rippled-ci-builder:2944b78d22db -``` - -## Build - -There is a `docs` target in the CMake configuration. - -``` -mkdir build -cd build -cmake -Donly_docs=ON .. -cmake --build . --target docs --parallel -``` - -The output will be in `build/docs/html`. diff --git a/docs/build/depend.md b/docs/build/depend.md index 2fa14378aa..f44519ddf9 100644 --- a/docs/build/depend.md +++ b/docs/build/depend.md @@ -20,7 +20,7 @@ CMakeToolchain ``` # If you want to depend on a version of libxrpl that is not in ConanCenter, -# then you can export the recipe from the rippled project. +# then you can export the recipe from the xrpld project. conan export ``` @@ -49,9 +49,9 @@ cmake --build . --parallel ## CMake subdirectory -The second method adds the [rippled][] project as a CMake +The second method adds the [xrpld][] project as a CMake [subdirectory][add_subdirectory]. -This method works well when you keep the rippled project as a Git +This method works well when you keep the xrpld project as a Git [submodule][]. It's good for when you want to make changes to libxrpl as part of your own project. @@ -90,6 +90,6 @@ cmake --build . --parallel [add_subdirectory]: https://cmake.org/cmake/help/latest/command/add_subdirectory.html [submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules -[rippled]: https://github.com/ripple/rippled +[xrpld]: https://github.com/XRPLF/rippled [Conan]: https://docs.conan.io/ [CMake]: https://cmake.org/cmake/help/latest/ diff --git a/docs/build/environment.md b/docs/build/environment.md index 66bed06c26..fb1ebde8bc 100644 --- a/docs/build/environment.md +++ b/docs/build/environment.md @@ -55,7 +55,7 @@ clang --version ### Install Xcode Specific Version (Optional) If you develop other applications using XCode you might be consistently updating to the newest version of Apple Clang. -This will likely cause issues building rippled. You may want to install a specific version of Xcode: +This will likely cause issues building xrpld. You may want to install a specific version of Xcode: 1. **Download Xcode** - Visit [Apple Developer Downloads](https://developer.apple.com/download/more/) diff --git a/docs/build/install.md b/docs/build/install.md index 7be01ce726..d3ce1e9d87 100644 --- a/docs/build/install.md +++ b/docs/build/install.md @@ -1,4 +1,4 @@ -This document contains instructions for installing rippled. +This document contains instructions for installing xrpld. The APT package manager is common on Debian-based Linux distributions like Ubuntu, while the YUM package manager is common on Red Hat-based Linux distributions @@ -8,7 +8,7 @@ and the only supported option for installing custom builds. ## From source -From a source build, you can install rippled and libxrpl using CMake's +From a source build, you can install xrpld and libxrpl using CMake's `--install` mode: ``` @@ -16,7 +16,7 @@ cmake --install . --prefix /opt/local ``` The default [prefix][1] is typically `/usr/local` on Linux and macOS and -`C:/Program Files/rippled` on Windows. +`C:/Program Files/xrpld` on Windows. [1]: https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html @@ -50,9 +50,9 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and In particular, make sure that the fingerprint matches. (In the above example, the fingerprint is on the third line, starting with `C001`.) -5. Add the appropriate Ripple repository for your operating system version: +5. Add the appropriate XRPL repository for your operating system version: - echo "deb [signed-by=/usr/local/share/keyrings/ripple-key.gpg] https://repos.ripple.com/repos/rippled-deb focal stable" | \ + echo "deb [signed-by=/usr/local/share/keyrings/ripple-key.gpg] https://repos.ripple.com/repos/xrpld-deb focal stable" | \ sudo tee -a /etc/apt/sources.list.d/ripple.list The above example is appropriate for **Ubuntu 20.04 Focal Fossa**. For other operating systems, replace the word `focal` with one of the following: @@ -61,33 +61,33 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and - `bullseye` for **Debian 11 Bullseye** - `buster` for **Debian 10 Buster** - If you want access to development or pre-release versions of `rippled`, use one of the following instead of `stable`: - - `unstable` - Pre-release builds ([`release` branch](https://github.com/ripple/rippled/tree/release)) - - `nightly` - Experimental/development builds ([`develop` branch](https://github.com/ripple/rippled/tree/develop)) + If you want access to development or pre-release versions of `xrpld`, use one of the following instead of `stable`: + - `unstable` - Pre-release builds ([`release` branch](https://github.com/XRPLF/rippled/tree/release)) + - `nightly` - Experimental/development builds ([`develop` branch](https://github.com/XRPLF/rippled/tree/develop)) **Warning:** Unstable and nightly builds may be broken at any time. Do not use these builds for production servers. -6. Fetch the Ripple repository. +6. Fetch the XRPL repository. sudo apt -y update -7. Install the `rippled` software package: +7. Install the `xrpld` software package: - sudo apt -y install rippled + sudo apt -y install xrpld -8. Check the status of the `rippled` service: +8. Check the status of the `xrpld` service: - systemctl status rippled.service + systemctl status xrpld.service - The `rippled` service should start automatically. If not, you can start it manually: + The `xrpld` service should start automatically. If not, you can start it manually: - sudo systemctl start rippled.service + sudo systemctl start xrpld.service -9. Optional: allow `rippled` to bind to privileged ports. +9. Optional: allow `xrpld` to bind to privileged ports. This allows you to serve incoming API requests on port 80 or 443. (If you want to do so, you must also update the config file's port settings.) - sudo setcap 'cap_net_bind_service=+ep' /opt/ripple/bin/rippled + sudo setcap 'cap_net_bind_service=+ep' /opt/xrpld/bin/xrpld ## With the YUM package manager @@ -106,8 +106,8 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and enabled=1 gpgcheck=0 repo_gpgcheck=1 - baseurl=https://repos.ripple.com/repos/rippled-rpm/stable/ - gpgkey=https://repos.ripple.com/repos/rippled-rpm/stable/repodata/repomd.xml.key + baseurl=https://repos.ripple.com/repos/xrpld-rpm/stable/ + gpgkey=https://repos.ripple.com/repos/xrpld-rpm/stable/repodata/repomd.xml.key REPOFILE _Unstable_ @@ -118,8 +118,8 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and enabled=1 gpgcheck=0 repo_gpgcheck=1 - baseurl=https://repos.ripple.com/repos/rippled-rpm/unstable/ - gpgkey=https://repos.ripple.com/repos/rippled-rpm/unstable/repodata/repomd.xml.key + baseurl=https://repos.ripple.com/repos/xrpld-rpm/unstable/ + gpgkey=https://repos.ripple.com/repos/xrpld-rpm/unstable/repodata/repomd.xml.key REPOFILE _Nightly_ @@ -130,22 +130,22 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and enabled=1 gpgcheck=0 repo_gpgcheck=1 - baseurl=https://repos.ripple.com/repos/rippled-rpm/nightly/ - gpgkey=https://repos.ripple.com/repos/rippled-rpm/nightly/repodata/repomd.xml.key + baseurl=https://repos.ripple.com/repos/xrpld-rpm/nightly/ + gpgkey=https://repos.ripple.com/repos/xrpld-rpm/nightly/repodata/repomd.xml.key REPOFILE 2. Fetch the latest repo updates: sudo yum -y update -3. Install the new `rippled` package: +3. Install the new `xrpld` package: - sudo yum install -y rippled + sudo yum install -y xrpld -4. Configure the `rippled` service to start on boot: +4. Configure the `xrpld` service to start on boot: - sudo systemctl enable rippled.service + sudo systemctl enable xrpld.service -5. Start the `rippled` service: +5. Start the `xrpld` service: - sudo systemctl start rippled.service + sudo systemctl start xrpld.service diff --git a/docs/build/sanitizers.md b/docs/build/sanitizers.md index ac3a0cc865..7677775a3d 100644 --- a/docs/build/sanitizers.md +++ b/docs/build/sanitizers.md @@ -1,9 +1,9 @@ -# Sanitizer Configuration for Rippled +# Sanitizer Configuration for Xrpld This document explains how to properly configure and run sanitizers (AddressSanitizer, undefinedbehaviorSanitizer, ThreadSanitizer) with the xrpld project. Corresponding suppression files are located in the `sanitizers/suppressions` directory. -- [Sanitizer Configuration for Rippled](#sanitizer-configuration-for-rippled) +- [Sanitizer Configuration for Xrpld](#sanitizer-configuration-for-xrpld) - [Building with Sanitizers](#building-with-sanitizers) - [Summary](#summary) - [Build steps:](#build-steps) @@ -100,7 +100,7 @@ export LSAN_OPTIONS="include=sanitizers/suppressions/runtime-lsan-options.txt:su - Boost intrusive containers (used in `aged_unordered_container`) trigger false positives - Boost context switching (used in `Workers.cpp`) confuses ASAN's stack tracking -- Since we usually don't build Boost (because we don't want to instrument Boost and detect issues in Boost code) with ASAN but use Boost containers in ASAN instrumented rippled code, it generates false positives. +- Since we usually don't build Boost (because we don't want to instrument Boost and detect issues in Boost code) with ASAN but use Boost containers in ASAN instrumented xrpld code, it generates false positives. - Building dependencies with ASAN instrumentation reduces false positives. But we don't want to instrument dependencies like Boost with ASAN because it is slow (to compile as well as run tests) and not necessary. - See: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow - More such flags are detailed [here](https://github.com/google/sanitizers/wiki/AddressSanitizerFlags) diff --git a/docs/consensus.md b/docs/consensus.md index 23e5e7d5be..0da23b708a 100644 --- a/docs/consensus.md +++ b/docs/consensus.md @@ -5,9 +5,9 @@ Consensus is the task of reaching agreement within a distributed system in the presence of faulty or even malicious participants. This document outlines the [XRP Ledger Consensus Algorithm](https://arxiv.org/abs/1802.07242) -as implemented in [rippled](https://github.com/ripple/rippled), but +as implemented in [xrpld](https://github.com/XRPLF/rippled), but focuses on its utility as a generic consensus algorithm independent of the -detailed mechanics of the Ripple Consensus Ledger. Most notably, the algorithm +detailed mechanics of the XRPL consensus Ledger. Most notably, the algorithm does not require fully synchronous communication between all nodes in the network, or even a fixed network topology, but instead achieves consensus via collectively trusted subnetworks. @@ -15,7 +15,7 @@ collectively trusted subnetworks. ## Distributed Agreement A challenge for distributed systems is reaching agreement on changes in shared -state. For the Ripple network, the shared state is the current ledger--account +state. For the XRPL network, the shared state is the current ledger--account information, account balances, order books and other financial data. We will refer to shared distributed state as a /ledger/ throughout the remainder of this document. @@ -23,7 +23,7 @@ document. ![Ledger Chain](images/consensus/ledger_chain.png "Ledger Chain") As shown above, new ledgers are made by applying a set of transactions to the -prior ledger. For the Ripple network, transactions include payments, +prior ledger. For the XRPL network, transactions include payments, modification of account settings, updates to offers and more. In a centralized system, generating the next ledger is trivial since there is a @@ -33,10 +33,10 @@ the set of transactions to include, the order to apply those transactions, and even the resulting ledger after applying the transactions. This is even more difficult when some participants are faulty or malicious. -The Ripple network is a decentralized and **trust-full** network. Anyone is free +The XRPL network is a decentralized and **trust-full** network. Anyone is free to join and participants are free to choose a subset of peers that are collectively trusted to not collude in an attempt to defraud the participant. -Leveraging this network of trust, the Ripple algorithm has two main components. +Leveraging this network of trust, the XRPL algorithm has two main components. - _Consensus_ in which network participants agree on the transactions to apply to a prior ledger, based on the positions of their chosen peers. @@ -54,9 +54,9 @@ and was abandoned. The remainder of this section describes the Consensus and Validation algorithms in more detail and is meant as a companion guide to understanding the generic -implementation in `rippled`. The document **does not** discuss correctness, +implementation in `xrpld`. The document **does not** discuss correctness, fault-tolerance or liveness properties of the algorithms or the full details of -how they integrate within `rippled` to support the Ripple Consensus Ledger. +how they integrate within `xrpld` to support the XRPL consensus Ledger. ## Consensus Overview diff --git a/external/README.md b/external/README.md index f6e9f77d2d..4a4181e59e 100644 --- a/external/README.md +++ b/external/README.md @@ -1,6 +1,6 @@ # External Conan recipes -The subdirectories in this directory contain external libraries used by rippled. +The subdirectories in this directory contain external libraries used by xrpld. | Folder | Upstream | Description | | :--------------- | :------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | diff --git a/external/antithesis-sdk/CMakeLists.txt b/external/antithesis-sdk/CMakeLists.txt index 46c7b4bf7a..645b73c530 100644 --- a/external/antithesis-sdk/CMakeLists.txt +++ b/external/antithesis-sdk/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.18) -# Note, version set explicitly by rippled project +# Note, version set explicitly by xrpld project project(antithesis-sdk-cpp VERSION 0.4.4 LANGUAGES CXX) add_library(antithesis-sdk-cpp INTERFACE antithesis_sdk.h) -# Note, both sections below created by rippled project +# Note, both sections below created by xrpld project target_include_directories(antithesis-sdk-cpp INTERFACE $ $ diff --git a/include/xrpl/basics/CountedObject.h b/include/xrpl/basics/CountedObject.h index acf75360e1..1acba18949 100644 --- a/include/xrpl/basics/CountedObject.h +++ b/include/xrpl/basics/CountedObject.h @@ -99,7 +99,7 @@ private: Derived classes have their instances counted automatically. This is used for reporting purposes. - @ingroup ripple_basics + @ingroup basics */ template class CountedObject diff --git a/include/xrpl/basics/IntrusivePointer.h b/include/xrpl/basics/IntrusivePointer.h index f816af1c05..230dec3ebb 100644 --- a/include/xrpl/basics/IntrusivePointer.h +++ b/include/xrpl/basics/IntrusivePointer.h @@ -59,7 +59,7 @@ concept CAdoptTag = std::is_same_v || still retaining the reference counts. For example, for SHAMapInnerNodes the children may be reset in that function. Note that std::shared_pointer WILL run the destructor when the strong count reaches zero, but may not free the - memory used by the object until the weak count reaches zero. In rippled, we + memory used by the object until the weak count reaches zero. In xrpld, we typically allocate shared pointers with the `make_shared` function. When that is used, the memory is not reclaimed until the weak count reaches zero. */ diff --git a/include/xrpl/basics/IntrusiveRefCounts.h b/include/xrpl/basics/IntrusiveRefCounts.h index 5a51b3c3bf..36616bc64f 100644 --- a/include/xrpl/basics/IntrusiveRefCounts.h +++ b/include/xrpl/basics/IntrusiveRefCounts.h @@ -33,7 +33,7 @@ enum class ReleaseWeakRefAction { noop, destroy }; /** Implement the strong count, weak count, and bit flags for an intrusive pointer. - A class can satisfy the requirements of a xrpl::IntrusivePointer by + A class can satisfy the requirements of an xrpl::IntrusivePointer by inheriting from this class. */ struct IntrusiveRefCounts diff --git a/include/xrpl/basics/README.md b/include/xrpl/basics/README.md index f8b19522cd..b20b837ed7 100644 --- a/include/xrpl/basics/README.md +++ b/include/xrpl/basics/README.md @@ -2,9 +2,9 @@ Utility functions and classes. -ripple/basic should contain no dependencies on other modules. +The module xrpl/basics should contain no dependencies on other modules. -# Choosing a rippled container. +# Choosing an xrpld container. - `std::vector` - For ordered containers with most insertions or erases at the end. diff --git a/include/xrpl/basics/UptimeClock.h b/include/xrpl/basics/UptimeClock.h index 4edd38d274..3f2e09bbe3 100644 --- a/include/xrpl/basics/UptimeClock.h +++ b/include/xrpl/basics/UptimeClock.h @@ -26,7 +26,7 @@ public: explicit UptimeClock() = default; static time_point - now(); // seconds since rippled program start + now(); // seconds since xrpld program start private: static std::atomic now_; diff --git a/include/xrpl/basics/random.h b/include/xrpl/basics/random.h index db66b303d4..6a09d8161b 100644 --- a/include/xrpl/basics/random.h +++ b/include/xrpl/basics/random.h @@ -17,13 +17,13 @@ static_assert( // NOLINTNEXTLINE(misc-redundant-expression) std::is_integral::value && std::is_unsigned::value, - "The Ripple default PRNG engine must return an unsigned integral type."); + "The XRPL default PRNG engine must return an unsigned integral type."); static_assert( // NOLINTNEXTLINE(misc-redundant-expression) std::numeric_limits::max() >= std::numeric_limits::max(), - "The Ripple default PRNG engine return must be at least 64 bits wide."); + "The XRPL default PRNG engine return must be at least 64 bits wide."); #endif namespace detail { diff --git a/include/xrpl/ledger/LedgerTiming.h b/include/xrpl/ledger/LedgerTiming.h index 33ccc671e2..8171beed3c 100644 --- a/include/xrpl/ledger/LedgerTiming.h +++ b/include/xrpl/ledger/LedgerTiming.h @@ -34,7 +34,7 @@ auto constexpr decreaseLedgerTimeResolutionEvery = 1; /** Calculates the close time resolution for the specified ledger. - The Ripple protocol uses binning to represent time intervals using only one + The XRPL protocol uses binning to represent time intervals using only one timestamp. This allows servers to derive a common time for the next ledger, without the need for perfectly synchronized clocks. The time resolution (i.e. the size of the intervals) is adjusted dynamically @@ -62,7 +62,7 @@ getNextLedgerTimeResolution( bool previousAgree, Seq ledgerSeq) { - XRPL_ASSERT(ledgerSeq != Seq{0}, "ripple:getNextLedgerTimeResolution : valid ledger sequence"); + XRPL_ASSERT(ledgerSeq != Seq{0}, "xrpl::getNextLedgerTimeResolution : valid ledger sequence"); using namespace std::chrono; // Find the current resolution: @@ -72,7 +72,7 @@ getNextLedgerTimeResolution( previousResolution); XRPL_ASSERT( iter != std::end(ledgerPossibleTimeResolutions), - "ripple:getNextLedgerTimeResolution : found time resolution"); + "xrpl::getNextLedgerTimeResolution : found time resolution"); // This should never happen, but just as a precaution if (iter == std::end(ledgerPossibleTimeResolutions)) diff --git a/include/xrpl/ledger/View.h b/include/xrpl/ledger/View.h index 55be01d677..615f644987 100644 --- a/include/xrpl/ledger/View.h +++ b/include/xrpl/ledger/View.h @@ -30,10 +30,10 @@ enum class SkipEntry : bool { No = false, Yes }; /** Determines whether the given expiration time has passed. In the XRP Ledger, expiration times are defined as the number of whole - seconds after the "Ripple Epoch" which, for historical reasons, is set + seconds after the "XRPL epoch" which, for historical reasons, is set to January 1, 2000 (00:00 UTC). - This is like the way the Unix epoch works, except the Ripple Epoch is + This is like the way the Unix epoch works, except the XRPL epoch is precisely 946,684,800 seconds after the Unix Epoch. See https://xrpl.org/basic-data-types.html#specifying-time diff --git a/include/xrpl/ledger/helpers/EscrowHelpers.h b/include/xrpl/ledger/helpers/EscrowHelpers.h index 70d780da3b..1680dbcad4 100644 --- a/include/xrpl/ledger/helpers/EscrowHelpers.h +++ b/include/xrpl/ledger/helpers/EscrowHelpers.h @@ -148,7 +148,7 @@ escrowUnlockApplyHelper( // if destination is not the issuer then transfer funds if (!receiverIssuer) { - auto const ter = rippleCredit(view, issuer, receiver, finalAmt, true, journal); + auto const ter = directSendNoFee(view, issuer, receiver, finalAmt, true, journal); if (!isTesSuccess(ter)) return ter; // LCOV_EXCL_LINE } @@ -216,7 +216,7 @@ escrowUnlockApplyHelper( // compute balance to transfer finalAmt = amount.value() - xferFee; } - return rippleUnlockEscrowMPT( + return unlockEscrowMPT( view, sender, receiver, diff --git a/include/xrpl/ledger/helpers/MPTokenHelpers.h b/include/xrpl/ledger/helpers/MPTokenHelpers.h index 9f7d639285..466486306c 100644 --- a/include/xrpl/ledger/helpers/MPTokenHelpers.h +++ b/include/xrpl/ledger/helpers/MPTokenHelpers.h @@ -142,14 +142,14 @@ removeEmptyHolding( //------------------------------------------------------------------------------ TER -rippleLockEscrowMPT( +lockEscrowMPT( ApplyView& view, AccountID const& uGrantorID, STAmount const& saAmount, beast::Journal j); TER -rippleUnlockEscrowMPT( +unlockEscrowMPT( ApplyView& view, AccountID const& uGrantorID, AccountID const& uGranteeID, diff --git a/include/xrpl/ledger/helpers/TokenHelpers.h b/include/xrpl/ledger/helpers/TokenHelpers.h index 74d1e4848e..908950a1e1 100644 --- a/include/xrpl/ledger/helpers/TokenHelpers.h +++ b/include/xrpl/ledger/helpers/TokenHelpers.h @@ -235,11 +235,11 @@ canTransfer(ReadView const& view, Asset const& asset, AccountID const& from, Acc // --> bCheckIssuer : normally require issuer to be involved. // [[nodiscard]] // nodiscard commented out so DirectStep.cpp compiles. -/** Calls static rippleCreditIOU if saAmount represents Issue. - * Calls static rippleCreditMPT if saAmount represents MPTIssue. +/** Calls static directSendNoFeeIOU if saAmount represents Issue. + * Calls static directSendNoFeeMPT if saAmount represents MPTIssue. */ TER -rippleCredit( +directSendNoFee( ApplyView& view, AccountID const& uSenderID, AccountID const& uReceiverID, diff --git a/include/xrpl/nodestore/README.md b/include/xrpl/nodestore/README.md index 4b228bfc9a..b78c99e27d 100644 --- a/include/xrpl/nodestore/README.md +++ b/include/xrpl/nodestore/README.md @@ -51,7 +51,7 @@ A blob containing the payload. Stored in the following format. --- The `NodeStore` provides an interface that stores, in a persistent database, a -collection of NodeObjects that rippled uses as its primary representation of +collection of NodeObjects that xrpld uses as its primary representation of ledger entries. All ledger entries are stored as NodeObjects and as such, need to be persisted between launches. If a NodeObject is accessed and is not in memory, it will be retrieved from the database. @@ -110,7 +110,7 @@ The `NodeStore.Timing` test is used to execute a set of read/write workloads to compare current available nodestore backends. It can be executed with: ``` -$rippled --unittest=NodeStoreTiming +$xrpld --unittest=NodeStoreTiming ``` It is also possible to use alternate DB config params by passing config strings @@ -143,10 +143,10 @@ Through various executions and profiling some conclusions are presented below. just after ledger close, then that would provide similar, but more predictable guarantees. It would also remove an unneeded thread and unnecessary memory usage. An alternative point of view is that because there will always be many - other rippled instances running there is no need for such guarantees. The nodes + other xrpld instances running there is no need for such guarantees. The nodes will always be available from another peer. -- Lookup in a block was previously using binary search. With rippled's use case +- Lookup in a block was previously using binary search. With xrpld's use case it is highly unlikely that two adjacent key/values will ever be requested one after the other. Therefore hash indexing of blocks makes much more sense. Rocksdb has a number of options for hash indexing both memtables and blocks and diff --git a/include/xrpl/proto/org/xrpl/rpc/v1/README.md b/include/xrpl/proto/org/xrpl/rpc/v1/README.md index e9b9b55841..e8566ec179 100644 --- a/include/xrpl/proto/org/xrpl/rpc/v1/README.md +++ b/include/xrpl/proto/org/xrpl/rpc/v1/README.md @@ -1,8 +1,8 @@ # Protocol buffer definitions for gRPC -This folder contains the protocol buffer definitions used by the rippled gRPC API. +This folder contains the protocol buffer definitions used by the xrpld gRPC API. The gRPC API attempts to mimic the JSON/Websocket API as much as possible. -As of April 2020, the gRPC API supports a subset of the full rippled API: +As of April 2020, the gRPC API supports a subset of the full xrpld API: tx, account_tx, account_info, fee and submit. ### Making Changes @@ -63,7 +63,7 @@ templated `CallData` class in GRPCServerImpl::setupListeners(). The template parameters should be the request type and the response type. Finally, define the handler itself in the appropriate file under the -src/ripple/rpc/handlers folder. If the method already has a JSON/Websocket +src/xrpld/rpc/handlers folder. If the method already has a JSON/Websocket equivalent, write the gRPC handler in the same file, and abstract common logic into helper functions (see Tx.cpp or AccountTx.cpp for an example). diff --git a/include/xrpl/proto/xrpl.proto b/include/xrpl/proto/xrpl.proto index 0af7deb35d..cd82ed24e6 100644 --- a/include/xrpl/proto/xrpl.proto +++ b/include/xrpl/proto/xrpl.proto @@ -36,7 +36,7 @@ enum MessageType { /* Provides the current ephemeral key for a validator. */ message TMManifest { - // A Manifest object in the Ripple serialization format. + // A Manifest object in the XRPL serialization format. required bytes stobject = 1; } diff --git a/include/xrpl/protocol/AccountID.h b/include/xrpl/protocol/AccountID.h index bc57058d9e..641f2f15c1 100644 --- a/include/xrpl/protocol/AccountID.h +++ b/include/xrpl/protocol/AccountID.h @@ -2,7 +2,7 @@ #include // VFALCO Uncomment when the header issues are resolved -// #include +// #include #include #include #include diff --git a/include/xrpl/protocol/BuildInfo.h b/include/xrpl/protocol/BuildInfo.h index cc7633cfe1..522747bc94 100644 --- a/include/xrpl/protocol/BuildInfo.h +++ b/include/xrpl/protocol/BuildInfo.h @@ -33,7 +33,7 @@ getFullVersionString(); X: 16 bits identifying the particular implementation Y: 48 bits of data specific to the implementation - The rippled-specific format (implementation ID is: 0x18 0x3B) is: + The xrpld-specific format (implementation ID is: 0x18 0x3B) is: 00011000-00111011-MMMMMMMM-mmmmmmmm-pppppppp-TTNNNNNN-00000000-00000000 @@ -55,23 +55,23 @@ encodeSoftwareVersion(std::string_view versionStr); std::uint64_t getEncodedVersion(); -/** Check if the encoded software version is a rippled software version. +/** Check if the encoded software version is an xrpld software version. @param version another node's encoded software version - @return true if the version is a rippled software version, false otherwise + @return true if the version is an xrpld software version, false otherwise */ bool -isRippledVersion(std::uint64_t version); +isXrpldVersion(std::uint64_t version); -/** Check if the version is newer than the local node's rippled software +/** Check if the version is newer than the local node's xrpld software version. @param version another node's encoded software version - @return true if the version is newer than the local node's rippled software + @return true if the version is newer than the local node's xrpld software version, false otherwise. @note This function only understands version numbers that are generated by - rippled. Please see the encodeSoftwareVersion() function for detail. + xrpld. Please see the encodeSoftwareVersion() function for detail. */ bool isNewerVersion(std::uint64_t version); diff --git a/include/xrpl/protocol/ErrorCodes.h b/include/xrpl/protocol/ErrorCodes.h index c138d5d39a..2f16415bdf 100644 --- a/include/xrpl/protocol/ErrorCodes.h +++ b/include/xrpl/protocol/ErrorCodes.h @@ -153,7 +153,7 @@ enum warning_code_i { warnRPC_AMENDMENT_BLOCKED = 1002, warnRPC_EXPIRED_VALIDATOR_LIST = 1003, // unused = 1004 - warnRPC_FIELDS_DEPRECATED = 2004, // rippled needs to maintain + warnRPC_FIELDS_DEPRECATED = 2004, // xrpld needs to maintain // compatibility with Clio on this code. }; diff --git a/include/xrpl/protocol/Feature.h b/include/xrpl/protocol/Feature.h index 0ff02fdac2..112f66f4a1 100644 --- a/include/xrpl/protocol/Feature.h +++ b/include/xrpl/protocol/Feature.h @@ -37,10 +37,10 @@ * 5) If a supported feature (`Supported::yes`) was _ever_ in a released * version, it can never be changed back to `Supported::no`, because * it _may_ still become enabled at any time. This would cause newer - * versions of `rippled` to become amendment blocked. + * versions of `xrpld` to become amendment blocked. * Instead, to prevent newer versions from voting on the feature, use * `VoteBehavior::Obsolete`. Obsolete features can not be voted for - * by any versions of `rippled` built with that setting, but will still + * by any versions of `xrpld` built with that setting, but will still * work correctly if they get enabled. If a feature remains obsolete * for long enough that _all_ clients that could vote for it are * amendment blocked, the feature can be removed from the code diff --git a/include/xrpl/protocol/PublicKey.h b/include/xrpl/protocol/PublicKey.h index 67e55ca136..64ced93ffb 100644 --- a/include/xrpl/protocol/PublicKey.h +++ b/include/xrpl/protocol/PublicKey.h @@ -21,7 +21,7 @@ namespace xrpl { Public keys are used in the public-key cryptography system used to verify signatures attached to messages. - The format of the public key is Ripple specific, + The format of the public key is XRPL specific, information needed to determine the cryptosystem parameters used is stored inside the key. diff --git a/include/xrpl/protocol/Quality.h b/include/xrpl/protocol/Quality.h index e9451d44ed..851e34d396 100644 --- a/include/xrpl/protocol/Quality.h +++ b/include/xrpl/protocol/Quality.h @@ -78,7 +78,7 @@ operator!=(TAmounts const& lhs, TAmounts const& rhs) noexcept //------------------------------------------------------------------------------ -// Ripple specific constant used for parsing qualities and other things +// XRPL specific constant used for parsing qualities and other things #define QUALITY_ONE 1'000'000'000 /** Represents the logical ratio of output currency to input currency. diff --git a/include/xrpl/protocol/README.md b/include/xrpl/protocol/README.md index a6e8d24982..d679c583d4 100644 --- a/include/xrpl/protocol/README.md +++ b/include/xrpl/protocol/README.md @@ -22,7 +22,7 @@ optional fields easier to read: - The operation `x[~sfFoo]` means "return the value of 'Foo' if it exists, or nothing if it doesn't." This usage of the tilde/bitwise NOT operator is not standard outside of the - `rippled` codebase. + `xrpld` codebase. - As a consequence of this, `x[~sfFoo] = y[~sfFoo]` assigns the value of Foo from y to x, including omitting Foo from x if it doesn't exist in y. @@ -33,7 +33,7 @@ or may not hold a value. For things not guaranteed to exist, you use `x[~sfFoo]` because you want such a container. It avoids having to look something up twice, once just to see if it exists and a second time to get/set its value. -([Real example](https://github.com/ripple/rippled/blob/35f4698aed5dce02f771b34cfbb690495cb5efcc/src/ripple/app/tx/impl/PayChan.cpp#L229-L236)) +([Real example](https://github.com/XRPLF/rippled/blob/35f4698aed5dce02f771b34cfbb690495cb5efcc/src/ripple/app/tx/impl/PayChan.cpp#L229-L236)) The source of this "type magic" is in [SField.h](./SField.h#L296-L302). diff --git a/include/xrpl/protocol/STAccount.h b/include/xrpl/protocol/STAccount.h index 76c8f24b7b..b1f112fbb2 100644 --- a/include/xrpl/protocol/STAccount.h +++ b/include/xrpl/protocol/STAccount.h @@ -13,7 +13,7 @@ class STAccount final : public STBase, public CountedObject private: // The original implementation of STAccount kept the value in an STBlob. // But an STAccount is always 160 bits, so we can store it with less - // overhead in a xrpl::uint160. However, so the serialized format of the + // overhead in an xrpl::uint160. However, so the serialized format of the // STAccount stays unchanged, we serialize and deserialize like an STBlob. AccountID value_; bool default_; diff --git a/include/xrpl/protocol/SecretKey.h b/include/xrpl/protocol/SecretKey.h index dd5566915f..530b6fc35f 100644 --- a/include/xrpl/protocol/SecretKey.h +++ b/include/xrpl/protocol/SecretKey.h @@ -118,7 +118,7 @@ derivePublicKey(KeyType type, SecretKey const& sk); /** Generate a key pair deterministically. - This algorithm is specific to Ripple: + This algorithm is specific to the XRPL: For secp256k1 key pairs, the seed is converted to a Generator and used to compute the key pair diff --git a/include/xrpl/protocol/Seed.h b/include/xrpl/protocol/Seed.h index 5b490be12e..04e8481c8f 100644 --- a/include/xrpl/protocol/Seed.h +++ b/include/xrpl/protocol/Seed.h @@ -80,7 +80,7 @@ randomSeed(); /** Generate a seed deterministically. - The algorithm is specific to Ripple: + The algorithm is specific to the XRPL: The seed is calculated as the first 128 bits of the SHA512-Half of the string text excluding diff --git a/include/xrpl/protocol/Units.h b/include/xrpl/protocol/Units.h index b377c80e26..196464fa16 100644 --- a/include/xrpl/protocol/Units.h +++ b/include/xrpl/protocol/Units.h @@ -21,7 +21,7 @@ namespace unit { struct dropTag; /** "fee levels" are used by the transaction queue to compare the relative cost of transactions that require different levels of effort to process. - See also: src/ripple/app/misc/FeeEscalation.md#fee-level */ + See also: src/xrpld/app/misc/FeeEscalation.md#fee-level */ struct feelevelTag; /** unitless values are plain scalars wrapped in a ValueUnit. They are used for calculations in this header. */ diff --git a/include/xrpl/protocol/detail/ledger_entries.macro b/include/xrpl/protocol/detail/ledger_entries.macro index 216f404bec..7955dcb66c 100644 --- a/include/xrpl/protocol/detail/ledger_entries.macro +++ b/include/xrpl/protocol/detail/ledger_entries.macro @@ -578,7 +578,7 @@ LEDGER_ENTRY(ltLOAN, 0x0089, Loan, loan, ({ // The unrounded true total value of the loan. // // - TrueTotalPrincipalOutstanding can be computed using the algorithm - // in the ripple::detail::loanPrincipalFromPeriodicPayment function. + // in the xrpl::detail::loanPrincipalFromPeriodicPayment function. // // - TrueTotalInterestOutstanding = TrueTotalLoanValue - // TrueTotalPrincipalOutstanding diff --git a/include/xrpl/protocol/digest.h b/include/xrpl/protocol/digest.h index 9e6606f51f..7664069e1c 100644 --- a/include/xrpl/protocol/digest.h +++ b/include/xrpl/protocol/digest.h @@ -100,7 +100,7 @@ using sha512_hasher = openssl_sha512_hasher; /** Returns the RIPEMD-160 digest of the SHA256 hash of the message. This operation is used to compute the 160-bit identifier - representing a Ripple account, from a message. Typically the + representing an XRPL account, from a message. Typically the message is the public key of the account - which is not stored in the account root. diff --git a/include/xrpl/protocol/jss.h b/include/xrpl/protocol/jss.h index c12600fe61..ecd9d65b4e 100644 --- a/include/xrpl/protocol/jss.h +++ b/include/xrpl/protocol/jss.h @@ -511,7 +511,7 @@ JSS(response); // websocket JSS(result); // RPC JSS(ripple_lines); // out: NetworkOPs JSS(ripple_state); // in: LedgerEntr -JSS(ripplerpc); // ripple RPC version +JSS(ripplerpc); // XRPL RPC version JSS(role); // out: Ping.cpp JSS(rpc); // JSS(rt_accounts); // in: Subscribe, Unsubscribe diff --git a/include/xrpl/resource/README.md b/include/xrpl/resource/README.md index e525ce83e3..545d4e9ca0 100644 --- a/include/xrpl/resource/README.md +++ b/include/xrpl/resource/README.md @@ -17,7 +17,7 @@ performed, or simply disconnecting the endpoint. Currently, consumption endpoints include websocket connections used to service clients, and peer connections used to create the peer to peer -overlay network implementing the Ripple protocol. +overlay network implementing the XRPL protocol. The current "balance" of a Consumer represents resource consumption debt or credit. Debt is accrued when bad loads are imposed. Credit is @@ -72,6 +72,6 @@ drop connections to those IP addresses that occur commonly in the gossip. ## Access -In rippled, the Application holds a unique instance of Resource::Manager, +In xrpld, the Application holds a unique instance of Resource::Manager, which may be retrieved by calling the method `Application::getResourceManager()`. diff --git a/include/xrpl/server/Manifest.h b/include/xrpl/server/Manifest.h index 02c370561a..2532a3c5bf 100644 --- a/include/xrpl/server/Manifest.h +++ b/include/xrpl/server/Manifest.h @@ -15,9 +15,9 @@ namespace xrpl { Validator key manifests ----------------------- - Suppose the secret keys installed on a Ripple validator are compromised. Not + Suppose the secret keys installed on an XRPL validator are compromised. Not only do you have to generate and install new key pairs on each validator, - EVERY rippled needs to have its config updated with the new public keys, and + EVERY xrpld needs to have its config updated with the new public keys, and is vulnerable to forged validation signatures until this is done. The solution is a new layer of indirection: A master secret key under restrictive access control is used to sign a "manifest": essentially, a @@ -39,11 +39,11 @@ namespace xrpl { seen for that validator, if any. On startup, the [validator_token] config entry (which contains the manifest for this validator) is decoded and added to the manifest cache. Other manifests are added as "gossip" - received from rippled peers. + received from xrpld peers. When an ephemeral key is compromised, a new signing key pair is created, along with a new manifest vouching for it (with a higher sequence number), - signed by the master key. When a rippled peer receives the new manifest, + signed by the master key. When an xrpld peer receives the new manifest, it verifies it with the master key and (assuming it's valid) discards the old ephemeral key and stores the new one. If the master key itself gets compromised, a manifest with sequence number 0xFFFFFFFF will supersede a diff --git a/include/xrpl/server/NetworkOPs.h b/include/xrpl/server/NetworkOPs.h index 75f1e0e1b2..16ec4a4ec0 100644 --- a/include/xrpl/server/NetworkOPs.h +++ b/include/xrpl/server/NetworkOPs.h @@ -63,8 +63,8 @@ enum class OperatingMode { needed. A backend application or local client can trust a local instance of - rippled / NetworkOPs. However, client software connecting to non-local - instances of rippled will need to be hardened to protect against hostile + xrpld / NetworkOPs. However, client software connecting to non-local + instances of xrpld will need to be hardened to protect against hostile or unreliable servers. */ class NetworkOPs : public InfoSub::Source diff --git a/include/xrpl/shamap/README.md b/include/xrpl/shamap/README.md index 419918c0cb..ae37d23ac3 100644 --- a/include/xrpl/shamap/README.md +++ b/include/xrpl/shamap/README.md @@ -112,7 +112,7 @@ When a `SHAMap` decides that it is safe to share a node of its own, it sets the node's sequence number to 0 (a `SHAMap` never has a sequence number of 0). This is done for every node in the trie when `SHAMap::walkSubTree` is executed. -Note that other objects in rippled also have sequence numbers (e.g. ledgers). +Note that other objects in xrpld also have sequence numbers (e.g. ledgers). The `SHAMap` and node sequence numbers should not be confused with these other sequence numbers (no relation). diff --git a/include/xrpl/tx/paths/detail/StrandFlow.h b/include/xrpl/tx/paths/detail/StrandFlow.h index 21cf04dc07..1f05ae1a5b 100644 --- a/include/xrpl/tx/paths/detail/StrandFlow.h +++ b/include/xrpl/tx/paths/detail/StrandFlow.h @@ -771,7 +771,7 @@ flow( { // Rounding in the payment engine is causing this assert to // sometimes fire with "dust" amounts. This is causing issues when - // running debug builds of rippled. While this issue still needs to + // running debug builds of xrpld. While this issue still needs to // be resolved, the assert is causing more harm than good at this // point. // UNREACHABLE("xrpl::flow : rounding error"); diff --git a/sanitizers/suppressions/tsan.supp b/sanitizers/suppressions/tsan.supp index 74f3371e68..702eef1e3d 100644 --- a/sanitizers/suppressions/tsan.supp +++ b/sanitizers/suppressions/tsan.supp @@ -7,7 +7,7 @@ race:boost/context/ race:boost/asio/executor.hpp race:boost::asio -# Suppress tsan related issues in rippled code. +# Suppress tsan related issues in xrpld code. race:src/libxrpl/basics/make_SSLContext.cpp race:src/libxrpl/basics/Number.cpp race:src/libxrpl/json/json_value.cpp @@ -46,7 +46,7 @@ race:xrpl/server/detail/ServerImpl.h race:xrpl/nodestore/detail/DatabaseNodeImp.h race:src/libxrpl/beast/utility/beast_Journal.cpp race:src/test/beast/LexicalCast_test.cpp -race:ripple::ServerHandler +race:ServerHandler # More suppressions in external library code. race:crtstuff.c @@ -65,7 +65,7 @@ deadlock:src/xrpld/app/misc/detail/ValidatorSite.cpp signal:src/libxrpl/beast/utility/beast_Journal.cpp signal:src/xrpld/core/detail/Workers.cpp signal:src/xrpld/core/JobQueue.cpp -signal:ripple::Workers::Worker +signal:Workers::Worker # Aggressive suppressing of deadlock tsan errors deadlock:pthread_create diff --git a/sanitizers/suppressions/ubsan.supp b/sanitizers/suppressions/ubsan.supp index a02cbb17de..1e07065ebd 100644 --- a/sanitizers/suppressions/ubsan.supp +++ b/sanitizers/suppressions/ubsan.supp @@ -74,7 +74,7 @@ vptr:boost # Google protobuf undefined:protobuf -# Suppress UBSan errors in rippled code by source file path +# Suppress UBSan errors in xrpld code by source file path undefined:src/libxrpl/basics/base64.cpp undefined:src/libxrpl/basics/Number.cpp undefined:src/libxrpl/beast/utility/beast_Journal.cpp @@ -165,7 +165,7 @@ unsigned-integer-overflow:xrpl/nodestore/detail/varint.h unsigned-integer-overflow:xrpl/peerfinder/detail/Counts.h unsigned-integer-overflow:xrpl/protocol/nft.h -# Rippled intentional overflows and operations +# Xrpld intentional overflows and operations # STAmount uses intentional negation of INT64_MIN and overflow in arithmetic signed-integer-overflow:src/libxrpl/protocol/STAmount.cpp unsigned-integer-overflow:src/libxrpl/protocol/STAmount.cpp diff --git a/src/libxrpl/basics/UptimeClock.cpp b/src/libxrpl/basics/UptimeClock.cpp index 521a6a1313..3d1664482b 100644 --- a/src/libxrpl/basics/UptimeClock.cpp +++ b/src/libxrpl/basics/UptimeClock.cpp @@ -9,14 +9,14 @@ namespace xrpl { std::atomic UptimeClock::now_{0}; // seconds since start std::atomic UptimeClock::stop_{false}; // stop update thread -// On rippled shutdown, cancel and wait for the update thread +// On xrpld shutdown, cancel and wait for the update thread UptimeClock::update_thread::~update_thread() { if (joinable()) { stop_ = true; // This join() may take up to a 1s, but happens only - // once at rippled shutdown. + // once at xrpld shutdown. join(); } } @@ -40,7 +40,7 @@ UptimeClock::start_clock() }}; } -// This actually measures time since first use, instead of since rippled start. +// This actually measures time since first use, instead of since xrpld start. // However the difference between these two epochs is a small fraction of a // second and unimportant. @@ -50,7 +50,7 @@ UptimeClock::now() // start the update thread on first use static auto const init = start_clock(); - // Return the number of seconds since rippled start + // Return the number of seconds since xrpld start return time_point{duration{now_}}; } diff --git a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp index 90165e3d16..05e4fe1448 100644 --- a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp @@ -488,25 +488,20 @@ canTransfer( } TER -rippleLockEscrowMPT( - ApplyView& view, - AccountID const& sender, - STAmount const& amount, - beast::Journal j) +lockEscrowMPT(ApplyView& view, AccountID const& sender, STAmount const& amount, beast::Journal j) { auto const mptIssue = amount.get(); auto const mptID = keylet::mptIssuance(mptIssue.getMptID()); auto sleIssuance = view.peek(mptID); if (!sleIssuance) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleLockEscrowMPT: MPT issuance not found for " - << mptIssue.getMptID(); + JLOG(j.error()) << "lockEscrowMPT: MPT issuance not found for " << mptIssue.getMptID(); return tecOBJECT_NOT_FOUND; } // LCOV_EXCL_STOP if (amount.getIssuer() == sender) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleLockEscrowMPT: sender is the issuer, cannot lock MPTs."; + JLOG(j.error()) << "lockEscrowMPT: sender is the issuer, cannot lock MPTs."; return tecINTERNAL; } // LCOV_EXCL_STOP @@ -517,7 +512,7 @@ rippleLockEscrowMPT( auto sle = view.peek(mptokenID); if (!sle) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleLockEscrowMPT: MPToken not found for " << sender; + JLOG(j.error()) << "lockEscrowMPT: MPToken not found for " << sender; return tecOBJECT_NOT_FOUND; } // LCOV_EXCL_STOP @@ -527,8 +522,8 @@ rippleLockEscrowMPT( // Underflow check for subtraction if (!canSubtract(STAmount(mptIssue, amt), STAmount(mptIssue, pay))) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleLockEscrowMPT: insufficient MPTAmount for " - << to_string(sender) << ": " << amt << " < " << pay; + JLOG(j.error()) << "lockEscrowMPT: insufficient MPTAmount for " << to_string(sender) + << ": " << amt << " < " << pay; return tecINTERNAL; } // LCOV_EXCL_STOP @@ -539,8 +534,8 @@ rippleLockEscrowMPT( if (!canAdd(STAmount(mptIssue, locked), STAmount(mptIssue, pay))) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleLockEscrowMPT: overflow on locked amount for " - << to_string(sender) << ": " << locked << " + " << pay; + JLOG(j.error()) << "lockEscrowMPT: overflow on locked amount for " << to_string(sender) + << ": " << locked << " + " << pay; return tecINTERNAL; } // LCOV_EXCL_STOP @@ -565,7 +560,7 @@ rippleLockEscrowMPT( // Overflow check for addition if (!canAdd(STAmount(mptIssue, issuanceEscrowed), STAmount(mptIssue, pay))) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleLockEscrowMPT: overflow on issuance " + JLOG(j.error()) << "lockEscrowMPT: overflow on issuance " "locked amount for " << mptIssue.getMptID() << ": " << issuanceEscrowed << " + " << pay; return tecINTERNAL; @@ -586,7 +581,7 @@ rippleLockEscrowMPT( } TER -rippleUnlockEscrowMPT( +unlockEscrowMPT( ApplyView& view, AccountID const& sender, AccountID const& receiver, @@ -596,8 +591,7 @@ rippleUnlockEscrowMPT( { if (!view.rules().enabled(fixTokenEscrowV1)) { - XRPL_ASSERT( - netAmount == grossAmount, "xrpl::rippleUnlockEscrowMPT : netAmount == grossAmount"); + XRPL_ASSERT(netAmount == grossAmount, "xrpl::unlockEscrowMPT : netAmount == grossAmount"); } auto const& issuer = netAmount.getIssuer(); @@ -606,8 +600,7 @@ rippleUnlockEscrowMPT( auto sleIssuance = view.peek(mptID); if (!sleIssuance) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: MPT issuance not found for " - << mptIssue.getMptID(); + JLOG(j.error()) << "unlockEscrowMPT: MPT issuance not found for " << mptIssue.getMptID(); return tecOBJECT_NOT_FOUND; } // LCOV_EXCL_STOP @@ -615,7 +608,7 @@ rippleUnlockEscrowMPT( { if (!sleIssuance->isFieldPresent(sfLockedAmount)) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: no locked amount in issuance for " + JLOG(j.error()) << "unlockEscrowMPT: no locked amount in issuance for " << mptIssue.getMptID(); return tecINTERNAL; } // LCOV_EXCL_STOP @@ -626,7 +619,7 @@ rippleUnlockEscrowMPT( // Underflow check for subtraction if (!canSubtract(STAmount(mptIssue, locked), STAmount(mptIssue, redeem))) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: insufficient locked amount for " + JLOG(j.error()) << "unlockEscrowMPT: insufficient locked amount for " << mptIssue.getMptID() << ": " << locked << " < " << redeem; return tecINTERNAL; } // LCOV_EXCL_STOP @@ -650,7 +643,7 @@ rippleUnlockEscrowMPT( auto sle = view.peek(mptokenID); if (!sle) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: MPToken not found for " << receiver; + JLOG(j.error()) << "unlockEscrowMPT: MPToken not found for " << receiver; return tecOBJECT_NOT_FOUND; } // LCOV_EXCL_STOP @@ -660,8 +653,8 @@ rippleUnlockEscrowMPT( // Overflow check for addition if (!canAdd(STAmount(mptIssue, current), STAmount(mptIssue, delta))) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: overflow on MPTAmount for " - << to_string(receiver) << ": " << current << " + " << delta; + JLOG(j.error()) << "unlockEscrowMPT: overflow on MPTAmount for " << to_string(receiver) + << ": " << current << " + " << delta; return tecINTERNAL; } // LCOV_EXCL_STOP @@ -677,7 +670,7 @@ rippleUnlockEscrowMPT( // Underflow check for subtraction if (!canSubtract(STAmount(mptIssue, outstanding), STAmount(mptIssue, redeem))) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: insufficient outstanding amount for " + JLOG(j.error()) << "unlockEscrowMPT: insufficient outstanding amount for " << mptIssue.getMptID() << ": " << outstanding << " < " << redeem; return tecINTERNAL; } // LCOV_EXCL_STOP @@ -688,7 +681,7 @@ rippleUnlockEscrowMPT( if (issuer == sender) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: sender is the issuer, " + JLOG(j.error()) << "unlockEscrowMPT: sender is the issuer, " "cannot unlock MPTs."; return tecINTERNAL; } // LCOV_EXCL_STOP @@ -697,14 +690,13 @@ rippleUnlockEscrowMPT( auto sle = view.peek(mptokenID); if (!sle) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: MPToken not found for " << sender; + JLOG(j.error()) << "unlockEscrowMPT: MPToken not found for " << sender; return tecOBJECT_NOT_FOUND; } // LCOV_EXCL_STOP if (!sle->isFieldPresent(sfLockedAmount)) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: no locked amount in MPToken for " - << to_string(sender); + JLOG(j.error()) << "unlockEscrowMPT: no locked amount in MPToken for " << to_string(sender); return tecINTERNAL; } // LCOV_EXCL_STOP @@ -714,8 +706,8 @@ rippleUnlockEscrowMPT( // Underflow check for subtraction if (!canSubtract(STAmount(mptIssue, locked), STAmount(mptIssue, delta))) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: insufficient locked amount for " - << to_string(sender) << ": " << locked << " < " << delta; + JLOG(j.error()) << "unlockEscrowMPT: insufficient locked amount for " << to_string(sender) + << ": " << locked << " < " << delta; return tecINTERNAL; } // LCOV_EXCL_STOP @@ -741,7 +733,7 @@ rippleUnlockEscrowMPT( // Underflow check for subtraction if (!canSubtract(STAmount(mptIssue, outstanding), STAmount(mptIssue, diff))) { // LCOV_EXCL_START - JLOG(j.error()) << "rippleUnlockEscrowMPT: insufficient outstanding amount for " + JLOG(j.error()) << "unlockEscrowMPT: insufficient outstanding amount for " << mptIssue.getMptID() << ": " << outstanding << " < " << diff; return tecINTERNAL; } // LCOV_EXCL_STOP diff --git a/src/libxrpl/ledger/helpers/TokenHelpers.cpp b/src/libxrpl/ledger/helpers/TokenHelpers.cpp index 8d2b0d5fff..332cfd83b2 100644 --- a/src/libxrpl/ledger/helpers/TokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/TokenHelpers.cpp @@ -513,7 +513,7 @@ canTransfer(ReadView const& view, Asset const& asset, AccountID const& from, Acc // - Create trust line if needed. // --> bCheckIssuer : normally require issuer to be involved. static TER -rippleCreditIOU( +directSendNoFeeIOU( ApplyView& view, AccountID const& uSenderID, AccountID const& uReceiverID, @@ -527,20 +527,21 @@ rippleCreditIOU( // Make sure issuer is involved. XRPL_ASSERT( !bCheckIssuer || uSenderID == issuer || uReceiverID == issuer, - "xrpl::rippleCreditIOU : matching issuer or don't care"); + "xrpl::directSendNoFeeIOU : matching issuer or don't care"); (void)issuer; // Disallow sending to self. - XRPL_ASSERT(uSenderID != uReceiverID, "xrpl::rippleCreditIOU : sender is not receiver"); + XRPL_ASSERT(uSenderID != uReceiverID, "xrpl::directSendNoFeeIOU : sender is not receiver"); bool const bSenderHigh = uSenderID > uReceiverID; auto const index = keylet::line(uSenderID, uReceiverID, currency); XRPL_ASSERT( - !isXRP(uSenderID) && uSenderID != noAccount(), "xrpl::rippleCreditIOU : sender is not XRP"); + !isXRP(uSenderID) && uSenderID != noAccount(), + "xrpl::directSendNoFeeIOU : sender is not XRP"); XRPL_ASSERT( !isXRP(uReceiverID) && uReceiverID != noAccount(), - "xrpl::rippleCreditIOU : receiver is not XRP"); + "xrpl::directSendNoFeeIOU : receiver is not XRP"); // If the line exists, modify it accordingly. if (auto const sleRippleState = view.peek(index)) @@ -556,7 +557,7 @@ rippleCreditIOU( saBalance -= saAmount; - JLOG(j.trace()) << "rippleCreditIOU: " << to_string(uSenderID) << " -> " + JLOG(j.trace()) << "directSendNoFeeIOU: " << to_string(uSenderID) << " -> " << to_string(uReceiverID) << " : before=" << saBefore.getFullText() << " amount=" << saAmount.getFullText() << " after=" << saBalance.getFullText(); @@ -602,7 +603,7 @@ rippleCreditIOU( // Want to reflect balance to zero even if we are deleting line. sleRippleState->setFieldAmount(sfBalance, saBalance); - // ONLY: Adjust ripple balance. + // ONLY: Adjust balance. if (bDelete) { @@ -623,7 +624,7 @@ rippleCreditIOU( saBalance.setIssuer(noAccount()); - JLOG(j.debug()) << "rippleCreditIOU: " + JLOG(j.debug()) << "directSendNoFeeIOU: " "create line: " << to_string(uSenderID) << " -> " << to_string(uReceiverID) << " : " << saAmount.getFullText(); @@ -656,7 +657,7 @@ rippleCreditIOU( // --> saAmount: Amount/currency/issuer to deliver to receiver. // <-- saActual: Amount actually cost. Sender pays fees. static TER -rippleSendIOU( +directSendNoLimitIOU( ApplyView& view, AccountID const& uSenderID, AccountID const& uReceiverID, @@ -669,13 +670,13 @@ rippleSendIOU( XRPL_ASSERT( !isXRP(uSenderID) && !isXRP(uReceiverID), - "xrpl::rippleSendIOU : neither sender nor receiver is XRP"); - XRPL_ASSERT(uSenderID != uReceiverID, "xrpl::rippleSendIOU : sender is not receiver"); + "xrpl::directSendNoLimitIOU : neither sender nor receiver is XRP"); + XRPL_ASSERT(uSenderID != uReceiverID, "xrpl::directSendNoLimitIOU : sender is not receiver"); if (uSenderID == issuer || uReceiverID == issuer || issuer == noAccount()) { // Direct send: redeeming IOUs and/or sending own IOUs. - auto const ter = rippleCreditIOU(view, uSenderID, uReceiverID, saAmount, false, j); + auto const ter = directSendNoFeeIOU(view, uSenderID, uReceiverID, saAmount, false, j); if (!isTesSuccess(ter)) return ter; saActual = saAmount; @@ -689,14 +690,14 @@ rippleSendIOU( saActual = (waiveFee == WaiveTransferFee::Yes) ? saAmount : multiply(saAmount, transferRate(view, issuer)); - JLOG(j.debug()) << "rippleSendIOU> " << to_string(uSenderID) << " - > " + JLOG(j.debug()) << "directSendNoLimitIOU> " << to_string(uSenderID) << " - > " << to_string(uReceiverID) << " : deliver=" << saAmount.getFullText() << " cost=" << saActual.getFullText(); - TER terResult = rippleCreditIOU(view, issuer, uReceiverID, saAmount, true, j); + TER terResult = directSendNoFeeIOU(view, issuer, uReceiverID, saAmount, true, j); if (tesSUCCESS == terResult) - terResult = rippleCreditIOU(view, uSenderID, issuer, saActual, true, j); + terResult = directSendNoFeeIOU(view, uSenderID, issuer, saActual, true, j); return terResult; } @@ -705,7 +706,7 @@ rippleSendIOU( // --> receivers: Amount/currency/issuer to deliver to receivers. // <-- saActual: Amount actually cost to sender. Sender pays fees. static TER -rippleSendMultiIOU( +directSendNoLimitMultiIOU( ApplyView& view, AccountID const& senderID, Issue const& issue, @@ -716,7 +717,7 @@ rippleSendMultiIOU( { auto const& issuer = issue.getIssuer(); - XRPL_ASSERT(!isXRP(senderID), "xrpl::rippleSendMultiIOU : sender is not XRP"); + XRPL_ASSERT(!isXRP(senderID), "xrpl::directSendNoLimitMultiIOU : sender is not XRP"); // These may diverge STAmount takeFromSender{issue}; @@ -734,15 +735,15 @@ rippleSendMultiIOU( if (!amount || (senderID == receiverID)) continue; - XRPL_ASSERT(!isXRP(receiverID), "xrpl::rippleSendMultiIOU : receiver is not XRP"); + XRPL_ASSERT(!isXRP(receiverID), "xrpl::directSendNoLimitMultiIOU : receiver is not XRP"); if (senderID == issuer || receiverID == issuer || issuer == noAccount()) { // Direct send: redeeming IOUs and/or sending own IOUs. - if (auto const ter = rippleCreditIOU(view, senderID, receiverID, amount, false, j)) + if (auto const ter = directSendNoFeeIOU(view, senderID, receiverID, amount, false, j)) return ter; actual += amount; - // Do not add amount to takeFromSender, because rippleCreditIOU took + // Do not add amount to takeFromSender, because directSendNoFeeIOU took // it. continue; @@ -758,17 +759,18 @@ rippleSendMultiIOU( actual += actualSend; takeFromSender += actualSend; - JLOG(j.debug()) << "rippleSendMultiIOU> " << to_string(senderID) << " - > " + JLOG(j.debug()) << "directSendNoLimitMultiIOU> " << to_string(senderID) << " - > " << to_string(receiverID) << " : deliver=" << amount.getFullText() << " cost=" << actual.getFullText(); - if (TER const terResult = rippleCreditIOU(view, issuer, receiverID, amount, true, j)) + if (TER const terResult = directSendNoFeeIOU(view, issuer, receiverID, amount, true, j)) return terResult; } if (senderID != issuer && takeFromSender) { - if (TER const terResult = rippleCreditIOU(view, senderID, issuer, takeFromSender, true, j)) + if (TER const terResult = + directSendNoFeeIOU(view, senderID, issuer, takeFromSender, true, j)) return terResult; } @@ -813,7 +815,7 @@ accountSendIOU( JLOG(j.trace()) << "accountSendIOU: " << to_string(uSenderID) << " -> " << to_string(uReceiverID) << " : " << saAmount.getFullText(); - return rippleSendIOU(view, uSenderID, uReceiverID, saAmount, saActual, j, waiveFee); + return directSendNoLimitIOU(view, uSenderID, uReceiverID, saAmount, saActual, j, waiveFee); } /* XRP send which does not check reserve and can do pure adjustment. @@ -912,7 +914,7 @@ accountSendMultiIOU( JLOG(j.trace()) << "accountSendMultiIOU: " << to_string(senderID) << " sending " << receivers.size() << " IOUs"; - return rippleSendMultiIOU(view, senderID, issue, receivers, actual, j, waiveFee); + return directSendNoLimitMultiIOU(view, senderID, issue, receivers, actual, j, waiveFee); } /* XRP send which does not check reserve and can do pure adjustment. @@ -1022,7 +1024,7 @@ accountSendMultiIOU( } static TER -rippleCreditMPT( +directSendNoFeeMPT( ApplyView& view, AccountID const& uSenderID, AccountID const& uReceiverID, @@ -1090,7 +1092,7 @@ rippleCreditMPT( } static TER -rippleSendMPT( +directSendNoLimitMPT( ApplyView& view, AccountID const& uSenderID, AccountID const& uReceiverID, @@ -1099,9 +1101,9 @@ rippleSendMPT( beast::Journal j, WaiveTransferFee waiveFee) { - XRPL_ASSERT(uSenderID != uReceiverID, "xrpl::rippleSendMPT : sender is not receiver"); + XRPL_ASSERT(uSenderID != uReceiverID, "xrpl::directSendNoLimitMPT : sender is not receiver"); - // Safe to get MPT since rippleSendMPT is only called by accountSendMPT + // Safe to get MPT since directSendNoLimitMPT is only called by accountSendMPT auto const& issuer = saAmount.getIssuer(); auto const sle = view.read(keylet::mptIssuance(saAmount.get().getMptID())); @@ -1122,7 +1124,7 @@ rippleSendMPT( } // Direct send: redeeming MPTs and/or sending own MPTs. - auto const ter = rippleCreditMPT(view, uSenderID, uReceiverID, saAmount, j); + auto const ter = directSendNoFeeMPT(view, uSenderID, uReceiverID, saAmount, j); if (!isTesSuccess(ter)) return ter; saActual = saAmount; @@ -1134,19 +1136,19 @@ rippleSendMPT( ? saAmount : multiply(saAmount, transferRate(view, saAmount.get().getMptID())); - JLOG(j.debug()) << "rippleSendMPT> " << to_string(uSenderID) << " - > " + JLOG(j.debug()) << "directSendNoLimitMPT> " << to_string(uSenderID) << " - > " << to_string(uReceiverID) << " : deliver=" << saAmount.getFullText() << " cost=" << saActual.getFullText(); - if (auto const terResult = rippleCreditMPT(view, issuer, uReceiverID, saAmount, j); + if (auto const terResult = directSendNoFeeMPT(view, issuer, uReceiverID, saAmount, j); !isTesSuccess(terResult)) return terResult; - return rippleCreditMPT(view, uSenderID, issuer, saActual, j); + return directSendNoFeeMPT(view, uSenderID, issuer, saActual, j); } static TER -rippleSendMultiMPT( +directSendNoLimitMultiMPT( ApplyView& view, AccountID const& senderID, MPTIssue const& mptIssue, @@ -1163,7 +1165,7 @@ rippleSendMultiMPT( // For the issuer-as-sender case, track the running total to validate // against MaximumAmount. The read-only SLE (view.read) is not updated - // by rippleCreditMPT, so a per-iteration SLE read would be stale. + // by directSendNoFeeMPT, so a per-iteration SLE read would be stale. // Use uint64_t, not STAmount, to keep MaximumAmount comparisons in exact // integer arithmetic. STAmount implicitly converts to Number, whose // small-scale mantissa (~16 digits) can lose precision for values near @@ -1195,7 +1197,7 @@ rippleSendMultiMPT( { XRPL_ASSERT_PARTS( takeFromSender == beast::zero, - "xrpl::rippleSendMultiMPT", + "xrpl::directSendNoLimitMultiMPT", "sender == issuer, takeFromSender == zero"); std::uint64_t const sendAmount = amount.mpt().value(); @@ -1231,11 +1233,10 @@ rippleSendMultiMPT( } // Direct send: redeeming MPTs and/or sending own MPTs. - if (auto const ter = rippleCreditMPT(view, senderID, receiverID, amount, j)) + if (auto const ter = directSendNoFeeMPT(view, senderID, receiverID, amount, j)) return ter; actual += amount; - // Do not add amount to takeFromSender, because rippleCreditMPT - // took it. + // Do not add amount to takeFromSender, because directSendNoFeeMPT took it. continue; } @@ -1247,16 +1248,16 @@ rippleSendMultiMPT( actual += actualSend; takeFromSender += actualSend; - JLOG(j.debug()) << "rippleSendMultiMPT> " << to_string(senderID) << " - > " + JLOG(j.debug()) << "directSendNoLimitMultiMPT> " << to_string(senderID) << " - > " << to_string(receiverID) << " : deliver=" << amount.getFullText() << " cost=" << actualSend.getFullText(); - if (auto const terResult = rippleCreditMPT(view, issuer, receiverID, amount, j)) + if (auto const terResult = directSendNoFeeMPT(view, issuer, receiverID, amount, j)) return terResult; } if (senderID != issuer && takeFromSender) { - if (TER const terResult = rippleCreditMPT(view, senderID, issuer, takeFromSender, j)) + if (TER const terResult = directSendNoFeeMPT(view, senderID, issuer, takeFromSender, j)) return terResult; } @@ -1284,7 +1285,7 @@ accountSendMPT( STAmount saActual{saAmount.asset()}; - return rippleSendMPT(view, uSenderID, uReceiverID, saAmount, saActual, j, waiveFee); + return directSendNoLimitMPT(view, uSenderID, uReceiverID, saAmount, saActual, j, waiveFee); } static TER @@ -1298,7 +1299,7 @@ accountSendMultiMPT( { STAmount actual; - return rippleSendMultiMPT(view, senderID, mptIssue, receivers, actual, j, waiveFee); + return directSendNoLimitMultiMPT(view, senderID, mptIssue, receivers, actual, j, waiveFee); } //------------------------------------------------------------------------------ @@ -1308,7 +1309,7 @@ accountSendMultiMPT( //------------------------------------------------------------------------------ TER -rippleCredit( +directSendNoFee( ApplyView& view, AccountID const& uSenderID, AccountID const& uReceiverID, @@ -1320,12 +1321,12 @@ rippleCredit( [&](TIss const& issue) { if constexpr (std::is_same_v) { - return rippleCreditIOU(view, uSenderID, uReceiverID, saAmount, bCheckIssuer, j); + return directSendNoFeeIOU(view, uSenderID, uReceiverID, saAmount, bCheckIssuer, j); } else { - XRPL_ASSERT(!bCheckIssuer, "xrpl::rippleCredit : not checking issuer"); - return rippleCreditMPT(view, uSenderID, uReceiverID, saAmount, j); + XRPL_ASSERT(!bCheckIssuer, "xrpl::directSendNoFee : not checking issuer"); + return directSendNoFeeMPT(view, uSenderID, uReceiverID, saAmount, j); } }, saAmount.asset().value()); diff --git a/src/libxrpl/protocol/BuildInfo.cpp b/src/libxrpl/protocol/BuildInfo.cpp index 0fddb9ff19..543da615cf 100644 --- a/src/libxrpl/protocol/BuildInfo.cpp +++ b/src/libxrpl/protocol/BuildInfo.cpp @@ -160,7 +160,7 @@ getEncodedVersion() } bool -isRippledVersion(std::uint64_t version) +isXrpldVersion(std::uint64_t version) { return (version & implementationVersionIdentifierMask) == implementationVersionIdentifier; } @@ -168,7 +168,7 @@ isRippledVersion(std::uint64_t version) bool isNewerVersion(std::uint64_t version) { - if (isRippledVersion(version)) + if (isXrpldVersion(version)) return version > getEncodedVersion(); return false; } diff --git a/src/libxrpl/protocol/NFTokenID.cpp b/src/libxrpl/protocol/NFTokenID.cpp index a808ef1fcf..f77a6f67df 100644 --- a/src/libxrpl/protocol/NFTokenID.cpp +++ b/src/libxrpl/protocol/NFTokenID.cpp @@ -70,7 +70,7 @@ getNFTokenIDFromPage(TxMeta const& transactionMeta) // field changing, but no NFTs within that page changing. In this // case, there will be no previous NFTs and we need to skip. // However, there will always be NFTs listed in the final fields, - // as rippled outputs all fields in final fields even if they were + // as xrpld outputs all fields in final fields even if they were // not changed. STObject const& previousFields = node.peekAtField(sfPreviousFields).downcast(); diff --git a/src/libxrpl/server/Vacuum.cpp b/src/libxrpl/server/Vacuum.cpp index bcf5941e95..80de45cf66 100644 --- a/src/libxrpl/server/Vacuum.cpp +++ b/src/libxrpl/server/Vacuum.cpp @@ -12,7 +12,7 @@ doVacuumDB(DatabaseCon::Setup const& setup, beast::Journal j) boost::filesystem::path const dbPath = setup.dataDir / TxDBName; uintmax_t const dbSize = file_size(dbPath); - XRPL_ASSERT(dbSize != static_cast(-1), "ripple:doVacuumDB : file_size succeeded"); + XRPL_ASSERT(dbSize != static_cast(-1), "xrpl::doVacuumDB : file_size succeeded"); if (auto available = space(dbPath.parent_path()).available; available < dbSize) { @@ -36,7 +36,7 @@ doVacuumDB(DatabaseCon::Setup const& setup, beast::Journal j) std::cout << "VACUUM beginning. page_size: " << pageSize << std::endl; session << "VACUUM;"; - XRPL_ASSERT(setup.globalPragma, "ripple:doVacuumDB : non-null global pragma"); + XRPL_ASSERT(setup.globalPragma, "xrpl::doVacuumDB : non-null global pragma"); for (auto const& p : *setup.globalPragma) session << p; session << "PRAGMA page_size;", soci::into(pageSize); diff --git a/src/libxrpl/tx/applySteps.cpp b/src/libxrpl/tx/applySteps.cpp index 447ba685cc..b688377541 100644 --- a/src/libxrpl/tx/applySteps.cpp +++ b/src/libxrpl/tx/applySteps.cpp @@ -95,7 +95,6 @@ with_txn_type(Rules const& rules, TxType txnType, F&& f) // For Transactor::Normal // -// Current formatter for rippled is based on clang-10, which does not handle `requires` clauses template requires(T::ConsequencesFactory == Transactor::Normal) TxConsequences diff --git a/src/libxrpl/tx/invariants/FreezeInvariant.cpp b/src/libxrpl/tx/invariants/FreezeInvariant.cpp index 0048da7a84..ee82157d44 100644 --- a/src/libxrpl/tx/invariants/FreezeInvariant.cpp +++ b/src/libxrpl/tx/invariants/FreezeInvariant.cpp @@ -68,7 +68,7 @@ TransfersNotFrozen::finalize( { auto const issuerSle = findIssuer(issue.account, view); // It should be impossible for the issuer to not be found, but check - // just in case so rippled doesn't crash in release. + // just in case so xrpld doesn't crash in release. if (!issuerSle) { // The comment above starting with "assert(enforce)" explains this diff --git a/src/libxrpl/tx/paths/DirectStep.cpp b/src/libxrpl/tx/paths/DirectStep.cpp index 9cae103d8f..9fd90b7755 100644 --- a/src/libxrpl/tx/paths/DirectStep.cpp +++ b/src/libxrpl/tx/paths/DirectStep.cpp @@ -519,7 +519,7 @@ DirectStepI::revImp( { IOUAmount const in = mulRatio(srcToDst, srcQOut, QUALITY_ONE, /*roundUp*/ true); cache_.emplace(in, srcToDst, out, srcDebtDir); - rippleCredit( + directSendNoFee( sb, src_, dst_, @@ -536,7 +536,7 @@ DirectStepI::revImp( IOUAmount const in = mulRatio(maxSrcToDst, srcQOut, QUALITY_ONE, /*roundUp*/ true); IOUAmount const actualOut = mulRatio(maxSrcToDst, dstQIn, QUALITY_ONE, /*roundUp*/ false); cache_.emplace(in, maxSrcToDst, actualOut, srcDebtDir); - rippleCredit( + directSendNoFee( sb, src_, dst_, @@ -628,7 +628,7 @@ DirectStepI::fwdImp( { IOUAmount const out = mulRatio(srcToDst, dstQIn, QUALITY_ONE, /*roundUp*/ false); setCacheLimiting(in, srcToDst, out, srcDebtDir); - rippleCredit( + directSendNoFee( sb, src_, dst_, @@ -645,7 +645,7 @@ DirectStepI::fwdImp( IOUAmount const actualIn = mulRatio(maxSrcToDst, srcQOut, QUALITY_ONE, /*roundUp*/ true); IOUAmount const out = mulRatio(maxSrcToDst, dstQIn, QUALITY_ONE, /*roundUp*/ false); setCacheLimiting(actualIn, maxSrcToDst, out, srcDebtDir); - rippleCredit( + directSendNoFee( sb, src_, dst_, diff --git a/src/libxrpl/tx/transactors/dex/AMMClawback.cpp b/src/libxrpl/tx/transactors/dex/AMMClawback.cpp index 5291a1b25b..fb0999bfb0 100644 --- a/src/libxrpl/tx/transactors/dex/AMMClawback.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMClawback.cpp @@ -204,7 +204,7 @@ AMMClawback::applyGuts(Sandbox& sb) << to_string(newLPTokenBalance.iou()) << " old balance: " << to_string(lptAMMBalance.iou()); - auto const ter = rippleCredit(sb, holder, issuer, amountWithdraw, true, j_); + auto const ter = directSendNoFee(sb, holder, issuer, amountWithdraw, true, j_); if (!isTesSuccess(ter)) return ter; // LCOV_EXCL_LINE @@ -217,7 +217,7 @@ AMMClawback::applyGuts(Sandbox& sb) auto const flags = ctx_.tx.getFlags(); if ((flags & tfClawTwoAssets) != 0u) - return rippleCredit(sb, holder, issuer, *amount2Withdraw, true, j_); + return directSendNoFee(sb, holder, issuer, *amount2Withdraw, true, j_); return tesSUCCESS; } diff --git a/src/libxrpl/tx/transactors/dex/OfferCreate.cpp b/src/libxrpl/tx/transactors/dex/OfferCreate.cpp index 5d98e3625e..71343ca8ab 100644 --- a/src/libxrpl/tx/transactors/dex/OfferCreate.cpp +++ b/src/libxrpl/tx/transactors/dex/OfferCreate.cpp @@ -726,7 +726,7 @@ OfferCreate::applyGuts(Sandbox& sb, Sandbox& sbCancel) { // Any ImmediateOrCancel offer that transfers absolutely no funds // returns tecKILLED rather than tesSUCCESS. Motivation for the - // change is here: https://github.com/ripple/rippled/issues/4115 + // change is here: https://github.com/XRPLF/rippled/issues/4115 return {tecKILLED, false}; } return {tesSUCCESS, true}; diff --git a/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp b/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp index ed0bbeea44..a14b3abf37 100644 --- a/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp +++ b/src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp @@ -353,7 +353,8 @@ escrowLockApplyHelper( if (issuer == sender) return tecINTERNAL; // LCOV_EXCL_LINE - auto const ter = rippleCredit(view, sender, issuer, amount, !amount.holds(), journal); + auto const ter = + directSendNoFee(view, sender, issuer, amount, !amount.holds(), journal); if (!isTesSuccess(ter)) return ter; // LCOV_EXCL_LINE return tesSUCCESS; @@ -372,7 +373,7 @@ escrowLockApplyHelper( if (issuer == sender) return tecINTERNAL; // LCOV_EXCL_LINE - auto const ter = rippleLockEscrowMPT(view, sender, amount, journal); + auto const ter = lockEscrowMPT(view, sender, amount, journal); if (!isTesSuccess(ter)) return ter; // LCOV_EXCL_LINE return tesSUCCESS; diff --git a/src/libxrpl/tx/transactors/payment/Payment.cpp b/src/libxrpl/tx/transactors/payment/Payment.cpp index c9e2da0d25..e3ceddeae3 100644 --- a/src/libxrpl/tx/transactors/payment/Payment.cpp +++ b/src/libxrpl/tx/transactors/payment/Payment.cpp @@ -403,7 +403,7 @@ Payment::doApply() if (ripple) { - // Ripple payment with at least one intermediate step and uses + // XRPL payment with at least one intermediate step and uses // transitive balances. // An account that requires authorization has two ways to get an diff --git a/src/libxrpl/tx/transactors/token/Clawback.cpp b/src/libxrpl/tx/transactors/token/Clawback.cpp index 57175ba427..d7304e5cf1 100644 --- a/src/libxrpl/tx/transactors/token/Clawback.cpp +++ b/src/libxrpl/tx/transactors/token/Clawback.cpp @@ -212,7 +212,7 @@ applyHelper(ApplyContext& ctx) fhIGNORE_FREEZE, ctx.journal); - return rippleCredit( + return directSendNoFee( ctx.view(), holder, issuer, std::min(spendableAmount, clawAmount), true, ctx.journal); } @@ -233,7 +233,7 @@ applyHelper(ApplyContext& ctx) ahIGNORE_AUTH, ctx.journal); - return rippleCredit( + return directSendNoFee( ctx.view(), holder, issuer, diff --git a/src/libxrpl/tx/transactors/token/TrustSet.cpp b/src/libxrpl/tx/transactors/token/TrustSet.cpp index 7c208c5855..801645d1c0 100644 --- a/src/libxrpl/tx/transactors/token/TrustSet.cpp +++ b/src/libxrpl/tx/transactors/token/TrustSet.cpp @@ -336,7 +336,7 @@ TrustSet::doApply() // items. // // We do this because being able to exchange currencies, - // which needs trust lines, is a powerful Ripple feature. + // which needs trust lines, is a powerful XRPL feature. // So we want to make it easy for a gateway to fund the // accounts of its users without fear of being tricked. // diff --git a/src/test/README.md b/src/test/README.md index b012607f58..179d75941b 100644 --- a/src/test/README.md +++ b/src/test/README.md @@ -2,10 +2,10 @@ ## Running Tests -Unit tests are bundled in the `rippled` executable and can be executed using the +Unit tests are bundled in the `xrpld` executable and can be executed using the `--unittest` parameter. Without any arguments to this option, all non-manual unit tests will be executed. If you want to run one or more manual tests, you -must specify it by suite or full-name (e.g. `ripple.app.NoRippleCheckLimits` or +must specify it by suite or full-name (e.g. `xrpl.app.NoRippleCheckLimits` or just `NoRippleCheckLimits`). More than one suite or group of suites can be specified as a comma separated diff --git a/src/test/app/Credentials_test.cpp b/src/test/app/Credentials_test.cpp index db09bfc0ca..317fd47b2b 100644 --- a/src/test/app/Credentials_test.cpp +++ b/src/test/app/Credentials_test.cpp @@ -471,7 +471,7 @@ struct Credentials_test : public beast::unit_test::suite { testcase("Credentials fail, expiration in the past."); auto jv = credentials::create(subject, issuer, credType); - // current time in ripple epoch - 1s + // current time in XRPL epoch - 1s uint32_t const t = env.current()->header().parentCloseTime.time_since_epoch().count() - 1; jv[sfExpiration.jsonName] = t; @@ -812,7 +812,7 @@ struct Credentials_test : public beast::unit_test::suite testcase("CredentialsDelete fail, time not expired yet."); auto jv = credentials::create(subject, issuer, credType); - // current time in ripple epoch + 1000s + // current time in XRPL epoch + 1000s uint32_t const t = env.current()->header().parentCloseTime.time_since_epoch().count() + 1000; jv[sfExpiration.jsonName] = t; diff --git a/src/test/app/DepositAuth_test.cpp b/src/test/app/DepositAuth_test.cpp index 7a8404aad8..9b5dca3ca2 100644 --- a/src/test/app/DepositAuth_test.cpp +++ b/src/test/app/DepositAuth_test.cpp @@ -1045,7 +1045,7 @@ struct DepositPreauth_test : public beast::unit_test::suite // Create credentials auto jv = credentials::create(alice, issuer, credType); - // Current time in ripple epoch. + // Current time in XRPL epoch. // Every time ledger close, unittest timer increase by 10s uint32_t const t = env.current()->header().parentCloseTime.time_since_epoch().count() + 60; diff --git a/src/test/app/LedgerReplay_test.cpp b/src/test/app/LedgerReplay_test.cpp index b30dce4756..f9ab08e900 100644 --- a/src/test/app/LedgerReplay_test.cpp +++ b/src/test/app/LedgerReplay_test.cpp @@ -1023,20 +1023,20 @@ struct LedgerReplayer_test : public beast::unit_test::suite { Config c; - std::string const toLoad(R"rippleConfig( + std::string const toLoad(R"xrpldConfig( [ledger_replay] 1 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.LEDGER_REPLAY == true); } { Config c; - std::string const toLoad = (R"rippleConfig( + std::string const toLoad = (R"xrpldConfig( [ledger_replay] 0 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.LEDGER_REPLAY == false); } diff --git a/src/test/app/MPToken_test.cpp b/src/test/app/MPToken_test.cpp index 81fcec4b7a..b7f1d22aa7 100644 --- a/src/test/app/MPToken_test.cpp +++ b/src/test/app/MPToken_test.cpp @@ -3276,7 +3276,7 @@ class MPToken_test : public beast::unit_test::suite void testMultiSendMaximumAmount(FeatureBitset features) { - // Verify that rippleSendMultiMPT correctly enforces MaximumAmount + // Verify that directSendNoLimitMultiMPT correctly enforces MaximumAmount // when the issuer sends to multiple receivers. Pre-fixSecurity3_1_3, // a stale view.read() snapshot caused per-iteration checks to miss // aggregate overflows. Post-fix, a running total is used instead. diff --git a/src/test/app/Offer_test.cpp b/src/test/app/Offer_test.cpp index 66e84360ef..ad6ec656cb 100644 --- a/src/test/app/Offer_test.cpp +++ b/src/test/app/Offer_test.cpp @@ -4279,8 +4279,7 @@ public: Env env{*this, features}; - // This test mimics the payment flow used in the Ripple Connect - // smoke test. The players: + // This test mimics a payment flow. The players: // A USD gateway with hot and cold wallets // A EUR gateway with hot and cold walllets // A MM gateway that will provide offers from USD->EUR and EUR->USD diff --git a/src/test/app/ValidatorSite_test.cpp b/src/test/app/ValidatorSite_test.cpp index 004c59609c..9f9b0cbdf7 100644 --- a/src/test/app/ValidatorSite_test.cpp +++ b/src/test/app/ValidatorSite_test.cpp @@ -65,7 +65,7 @@ private: "http://207.261.33.37:8080/validators", "https://ripple.com/validators", "https://ripple.com:443/validators", - "file:///etc/opt/ripple/validators.txt", + "file:///etc/opt/xrpld/validators.txt", "file:///C:/Lib/validators.txt" #if !_MSC_VER , diff --git a/src/test/core/Config_test.cpp b/src/test/core/Config_test.cpp index a7f44836d5..6392a75f80 100644 --- a/src/test/core/Config_test.cpp +++ b/src/test/core/Config_test.cpp @@ -81,7 +81,7 @@ time.apple.com time.nist.gov pool.ntp.org -# Where to find some other servers speaking the Ripple protocol. +# Where to find some other servers speaking the XRPL protocol. # [ips] r.ripple.com 51235 @@ -107,7 +107,7 @@ backend=sqlite } /** - Write a xrpld config file and remove when done. + Write an xrpld config file and remove when done. */ class FileCfgGuard : public xrpl::detail::FileDirGuard { diff --git a/src/test/csf/README.md b/src/test/csf/README.md index 30d5abb042..081c9807d7 100644 --- a/src/test/csf/README.md +++ b/src/test/csf/README.md @@ -2,7 +2,7 @@ The Consensus Simulation Framework is a set of software components for describing, running and analyzing simulations of the consensus algorithm in a -controlled manner. It is also used to unit test the generic Ripple consensus +controlled manner. It is also used to unit test the generic XRPL consensus algorithm implementation. The framework is in its early stages, so the design and supported features are subject to change. diff --git a/src/test/csf/Validation.h b/src/test/csf/Validation.h index 5ebbcf3ae5..ba4da148f4 100644 --- a/src/test/csf/Validation.h +++ b/src/test/csf/Validation.h @@ -129,7 +129,7 @@ public: Validation const& unwrap() const { - // For the rippled implementation in which RCLValidation wraps + // For the xrpld implementation in which RCLValidation wraps // STValidation, the csf::Validation has no more specific type it // wraps, so csf::Validation unwraps to itself return *this; diff --git a/src/test/jtx/AbstractClient.h b/src/test/jtx/AbstractClient.h index 9b1ef178ca..94e58f60cd 100644 --- a/src/test/jtx/AbstractClient.h +++ b/src/test/jtx/AbstractClient.h @@ -5,10 +5,10 @@ namespace xrpl { namespace test { -/* Abstract Ripple Client interface. +/* Abstract XRPL client interface. This abstracts the transport layer, allowing - commands to be submitted to a rippled server. + commands to be submitted to an xrpld server. */ class AbstractClient { diff --git a/src/test/jtx/Oracle.h b/src/test/jtx/Oracle.h index 7924d278e5..8f48ad4d37 100644 --- a/src/test/jtx/Oracle.h +++ b/src/test/jtx/Oracle.h @@ -81,7 +81,7 @@ struct RemoveArg std::optional const& err = std::nullopt; }; -// Simulate testStartTime as 10'000s from Ripple epoch time to make +// Simulate testStartTime as 10'000s from XRPL epoch time to make // LastUpdateTime validation to work and to make unit-test consistent. // The value doesn't matter much, it has to be greater // than maxLastUpdateTimeDelta in order to pass LastUpdateTime diff --git a/src/test/jtx/TrustedPublisherServer.h b/src/test/jtx/TrustedPublisherServer.h index d36babf380..c9304426cf 100644 --- a/src/test/jtx/TrustedPublisherServer.h +++ b/src/test/jtx/TrustedPublisherServer.h @@ -295,7 +295,7 @@ public: openssl genrsa -out ca.key 2048 openssl req -new -x509 -nodes -days 10000 -key ca.key -out ca.crt \ -subj "/C=US/ST=CA/L=Los - Angeles/O=rippled-unit-tests/CN=example.com" # generate private cert + Angeles/O=xrpld-unit-tests/CN=example.com" # generate private cert openssl genrsa -out server.key 2048 # Generate certificate signing request # since our unit tests can run in either ipv4 or ipv6 mode, @@ -318,7 +318,7 @@ public: openssl req -new -key server.key -out server.csr \ -config extras.cnf \ -subj "/C=US/ST=California/L=San - Francisco/O=rippled-unit-tests/CN=127.0.0.1" \ + Francisco/O=xrpld-unit-tests/CN=127.0.0.1" \ # Create public certificate by signing with our CA openssl x509 -req -days 10000 -in server.csr -CA ca.crt -CAkey ca.key diff --git a/src/test/jtx/impl/Oracle.cpp b/src/test/jtx/impl/Oracle.cpp index d48432e8e4..c692664b93 100644 --- a/src/test/jtx/impl/Oracle.cpp +++ b/src/test/jtx/impl/Oracle.cpp @@ -18,7 +18,7 @@ Oracle::Oracle(Env& env, CreateArg const& arg, bool submit) : env_(env) // {close-maxLastUpdateTimeDelta, close+maxLastUpdateTimeDelta}. // To make the validation work and to make the clock consistent // for tests running at different time, simulate Unix time starting - // on testStartTime since Ripple epoch. + // on testStartTime since XRPL epoch. auto const now = env_.timeKeeper().now(); if (now.time_since_epoch().count() == 0 || arg.close) env_.close(now + testStartTime - epoch_offset); diff --git a/src/test/jtx/utility.h b/src/test/jtx/utility.h index 15c323f047..c9189efc36 100644 --- a/src/test/jtx/utility.h +++ b/src/test/jtx/utility.h @@ -49,7 +49,7 @@ fill_fee(Json::Value& jv, ReadView const& view); void fill_seq(Json::Value& jv, ReadView const& view); -/** Given a rippled unit test rpc command, return the corresponding JSON. */ +/** Given an xrpld unit test rpc command, return the corresponding JSON. */ Json::Value cmdToJSONRPC(std::vector const& args, beast::Journal j, unsigned int apiVersion); diff --git a/src/test/ledger/PaymentSandbox_test.cpp b/src/test/ledger/PaymentSandbox_test.cpp index ab01c4852e..69e2657d0c 100644 --- a/src/test/ledger/PaymentSandbox_test.cpp +++ b/src/test/ledger/PaymentSandbox_test.cpp @@ -125,19 +125,19 @@ class PaymentSandbox_test : public beast::unit_test::suite } { - // rippleCredit, no deferredCredits + // directSendNoFee, no deferredCredits ApplyViewImpl av(&*env.current(), tapNONE); auto const iss = USD_gw1.issue(); auto const startingAmount = accountHolds(av, alice, iss.currency, iss.account, fhIGNORE_FREEZE, j); - rippleCredit(av, gw1, alice, toCredit, true, j); + directSendNoFee(av, gw1, alice, toCredit, true, j); BEAST_EXPECT( accountHolds(av, alice, iss.currency, iss.account, fhIGNORE_FREEZE, j) == startingAmount + toCredit); - rippleCredit(av, alice, gw1, toDebit, true, j); + directSendNoFee(av, alice, gw1, toDebit, true, j); BEAST_EXPECT( accountHolds(av, alice, iss.currency, iss.account, fhIGNORE_FREEZE, j) == startingAmount + toCredit - toDebit); @@ -170,7 +170,7 @@ class PaymentSandbox_test : public beast::unit_test::suite } { - // rippleCredit, w/ deferredCredits + // directSendNoFee, w/ deferredCredits ApplyViewImpl av(&*env.current(), tapNONE); PaymentSandbox pv(&av); @@ -178,7 +178,7 @@ class PaymentSandbox_test : public beast::unit_test::suite auto const startingAmount = accountHolds(pv, alice, iss.currency, iss.account, fhIGNORE_FREEZE, j); - rippleCredit(pv, gw1, alice, toCredit, true, j); + directSendNoFee(pv, gw1, alice, toCredit, true, j); BEAST_EXPECT( accountHolds(pv, alice, iss.currency, iss.account, fhIGNORE_FREEZE, j) == startingAmount); diff --git a/src/test/nodestore/Timing_test.cpp b/src/test/nodestore/Timing_test.cpp index fb60e6c7a5..39e8b59638 100644 --- a/src/test/nodestore/Timing_test.cpp +++ b/src/test/nodestore/Timing_test.cpp @@ -490,7 +490,7 @@ public: backend->close(); } - // Simulate a rippled workload: + // Simulate an xrpld workload: // Each thread randomly: // inserts a new key // fetches an old key diff --git a/src/test/overlay/reduce_relay_test.cpp b/src/test/overlay/reduce_relay_test.cpp index 4a8d62fbc2..bac70d35a6 100644 --- a/src/test/overlay/reduce_relay_test.cpp +++ b/src/test/overlay/reduce_relay_test.cpp @@ -1270,10 +1270,10 @@ protected: doTest("Test Config - squelch enabled (legacy)", log, [&](bool log) { Config c; - std::string const toLoad(R"rippleConfig( + std::string const toLoad(R"xrpldConfig( [reduce_relay] vp_enable=1 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE == true); @@ -1282,19 +1282,19 @@ vp_enable=1 doTest("Test Config - squelch disabled (legacy)", log, [&](bool log) { Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [reduce_relay] vp_enable=0 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE == false); Config c1; - toLoad = R"rippleConfig( + toLoad = R"xrpldConfig( [reduce_relay] -)rippleConfig"; +)xrpldConfig"; c1.loadFromString(toLoad); BEAST_EXPECT(c1.VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE == false); @@ -1303,10 +1303,10 @@ vp_enable=0 doTest("Test Config - squelch enabled", log, [&](bool log) { Config c; - std::string const toLoad(R"rippleConfig( + std::string const toLoad(R"xrpldConfig( [reduce_relay] vp_base_squelch_enable=1 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE == true); @@ -1315,10 +1315,10 @@ vp_base_squelch_enable=1 doTest("Test Config - squelch disabled", log, [&](bool log) { Config c; - std::string const toLoad(R"rippleConfig( + std::string const toLoad(R"xrpldConfig( [reduce_relay] vp_base_squelch_enable=0 -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE == false); @@ -1327,11 +1327,11 @@ vp_base_squelch_enable=0 doTest("Test Config - legacy and new", log, [&](bool log) { Config c; - std::string const toLoad(R"rippleConfig( + std::string const toLoad(R"xrpldConfig( [reduce_relay] vp_base_squelch_enable=0 vp_enable=0 -)rippleConfig"); +)xrpldConfig"); std::string error; auto const expectedError = @@ -1356,29 +1356,29 @@ vp_enable=0 doTest("Test Config - max selected peers", log, [&](bool log) { Config c; - std::string toLoad(R"rippleConfig( + std::string toLoad(R"xrpldConfig( [reduce_relay] -)rippleConfig"); +)xrpldConfig"); c.loadFromString(toLoad); BEAST_EXPECT(c.VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS == 5); Config c1; - toLoad = R"rippleConfig( + toLoad = R"xrpldConfig( [reduce_relay] vp_base_squelch_max_selected_peers=6 -)rippleConfig"; +)xrpldConfig"; c1.loadFromString(toLoad); BEAST_EXPECT(c1.VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS == 6); Config c2; - toLoad = R"rippleConfig( + toLoad = R"xrpldConfig( [reduce_relay] vp_base_squelch_max_selected_peers=2 -)rippleConfig"; +)xrpldConfig"; std::string error; auto const expectedError = diff --git a/src/test/peerfinder/PeerFinder_test.cpp b/src/test/peerfinder/PeerFinder_test.cpp index a787a38e14..2726604c72 100644 --- a/src/test/peerfinder/PeerFinder_test.cpp +++ b/src/test/peerfinder/PeerFinder_test.cpp @@ -469,32 +469,32 @@ public: pass(); } }; - run(R"rippleConfig( + run(R"xrpldConfig( [peers_in_max] 100 -)rippleConfig"); - run(R"rippleConfig( +)xrpldConfig"); + run(R"xrpldConfig( [peers_out_max] 100 -)rippleConfig"); - run(R"rippleConfig( +)xrpldConfig"); + run(R"xrpldConfig( [peers_in_max] 100 [peers_out_max] 5 -)rippleConfig"); - run(R"rippleConfig( +)xrpldConfig"); + run(R"xrpldConfig( [peers_in_max] 1001 [peers_out_max] 10 -)rippleConfig"); - run(R"rippleConfig( +)xrpldConfig"); + run(R"xrpldConfig( [peers_in_max] 10 [peers_out_max] 1001 -)rippleConfig"); +)xrpldConfig"); } void diff --git a/src/test/protocol/BuildInfo_test.cpp b/src/test/protocol/BuildInfo_test.cpp index d9810e93ea..589eb00637 100644 --- a/src/test/protocol/BuildInfo_test.cpp +++ b/src/test/protocol/BuildInfo_test.cpp @@ -53,13 +53,13 @@ public: } void - testIsRippledVersion() + testIsXrpldVersion() { - testcase("IsRippledVersion"); + testcase("IsXrpldVersion"); auto vFF = 0xFFFF'FFFF'FFFF'FFFFLLU; - BEAST_EXPECT(!BuildInfo::isRippledVersion(vFF)); - auto vRippled = 0x183B'0000'0000'0000LLU; - BEAST_EXPECT(BuildInfo::isRippledVersion(vRippled)); + BEAST_EXPECT(!BuildInfo::isXrpldVersion(vFF)); + auto vXrpld = 0x183B'0000'0000'0000LLU; + BEAST_EXPECT(BuildInfo::isXrpldVersion(vXrpld)); } void @@ -83,7 +83,7 @@ public: run() override { testEncodeSoftwareVersion(); - testIsRippledVersion(); + testIsXrpldVersion(); testIsNewerVersion(); } }; diff --git a/src/test/protocol/Hooks_test.cpp b/src/test/protocol/Hooks_test.cpp index 53f20a2b5e..6f08517c0f 100644 --- a/src/test/protocol/Hooks_test.cpp +++ b/src/test/protocol/Hooks_test.cpp @@ -11,7 +11,7 @@ class Hooks_test : public beast::unit_test::suite { /** * This unit test was requested here: - * https://github.com/ripple/rippled/pull/4089#issuecomment-1050274539 + * https://github.com/XRPLF/rippled/pull/4089#issuecomment-1050274539 * These are tests that exercise facilities that are reserved for when Hooks * is merged in the future. **/ diff --git a/src/test/protocol/Seed_test.cpp b/src/test/protocol/Seed_test.cpp index d7ad1f4afa..75c7e402a1 100644 --- a/src/test/protocol/Seed_test.cpp +++ b/src/test/protocol/Seed_test.cpp @@ -100,8 +100,8 @@ public: void testKeypairGenerationAndSigning() { - std::string const message1 = "http://www.ripple.com"; - std::string const message2 = "https://www.ripple.com"; + std::string const message1 = "http://www.xrpl.org"; + std::string const message2 = "https://www.xrpl.org"; { testcase("Node keypair generation & signing (secp256k1)"); diff --git a/src/test/rpc/Handler_test.cpp b/src/test/rpc/Handler_test.cpp index 7aeb059f56..30ea8831ff 100644 --- a/src/test/rpc/Handler_test.cpp +++ b/src/test/rpc/Handler_test.cpp @@ -25,7 +25,7 @@ operator<<(std::ostream& os, std::chrono::nanoseconds ns) // NOTE This is a rather naive effort at a microbenchmark. Ideally we want // Google Benchmark, or something similar. Also, this actually does not belong // to unit tests, as it makes little sense to run it in conditions very -// dissimilar to how rippled will normally work. +// dissimilar to how xrpld will normally work. // TODO as https://github.com/XRPLF/rippled/issues/4765 class Handler_test : public beast::unit_test::suite diff --git a/src/test/rpc/KeyGeneration_test.cpp b/src/test/rpc/KeyGeneration_test.cpp index f11df0dffb..6a6d71ca10 100644 --- a/src/test/rpc/KeyGeneration_test.cpp +++ b/src/test/rpc/KeyGeneration_test.cpp @@ -685,9 +685,9 @@ public: } void - testRippleLibEd25519() + testXrplLibEd25519() { - testcase("ripple-lib encoded Ed25519 keys"); + testcase("XrplLib encoded Ed25519 keys"); auto test = [this](char const* seed, char const* addr) { { @@ -784,7 +784,7 @@ public: testKeypairForSignature(std::string("ed25519"), ed25519_strings); testKeypairForSignature(std::string("secp256k1"), strong_brain_strings); - testRippleLibEd25519(); + testXrplLibEd25519(); testKeypairForSignatureErrors(); } diff --git a/src/test/rpc/ServerInfo_test.cpp b/src/test/rpc/ServerInfo_test.cpp index 978b995ce8..495bb8ba1b 100644 --- a/src/test/rpc/ServerInfo_test.cpp +++ b/src/test/rpc/ServerInfo_test.cpp @@ -33,7 +33,7 @@ public: makeValidatorConfig() { auto p = std::make_unique(); - boost::format toLoad(R"rippleConfig( + boost::format toLoad(R"xrpldConfig( [validator_token] %1% @@ -49,7 +49,7 @@ ip = 0.0.0.0 port = 50052 protocol = wss2 admin = 127.0.0.1 -)rippleConfig"); +)xrpldConfig"); p->loadFromString(boost::str(toLoad % validator_data::token % validator_data::public_key)); diff --git a/src/test/unit_test/multi_runner.h b/src/test/unit_test/multi_runner.h index 8148079292..2eda4e66a0 100644 --- a/src/test/unit_test/multi_runner.h +++ b/src/test/unit_test/multi_runner.h @@ -131,10 +131,10 @@ class multi_runner_base print_results(S& s); }; - static constexpr char const* shared_mem_name_ = "RippledUnitTestSharedMem"; + static constexpr char const* shared_mem_name_ = "XrpldUnitTestSharedMem"; // name of the message queue a multi_runner_child will use to communicate // with multi_runner_parent - static constexpr char const* message_queue_name_ = "RippledUnitTestMessageQueue"; + static constexpr char const* message_queue_name_ = "XrpldUnitTestMessageQueue"; // `inner_` will be created in shared memory inner* inner_; diff --git a/src/xrpld/README.md b/src/xrpld/README.md index cf71589dd7..83dc8c6a84 100644 --- a/src/xrpld/README.md +++ b/src/xrpld/README.md @@ -1,4 +1,4 @@ -# Ripple Source Guidelines +# XRPL Source Guidelines Each folder contains a single module following the newest style: diff --git a/src/xrpld/app/consensus/README.md b/src/xrpld/app/consensus/README.md index bdf5afe87c..44a4dc8ae7 100644 --- a/src/xrpld/app/consensus/README.md +++ b/src/xrpld/app/consensus/README.md @@ -2,11 +2,11 @@ This directory holds the types and classes needed to connect the generic consensus algorithm to the -rippled-specific instance of consensus. +xrpld-specific instance of consensus. - `RCLCxTx` adapts a `SHAMapItem` transaction. - `RCLCxTxSet` adapts a `SHAMap` to represent a set of transactions. - `RCLCxLedger` adapts a `Ledger`. - `RCLConsensus` is implements the requirements of the generic - `Consensus` class by connecting to the rest of the `rippled` + `Consensus` class by connecting to the rest of the `xrpld` application. diff --git a/src/xrpld/app/ledger/README.md b/src/xrpld/app/ledger/README.md index cb935897b8..7dc38ce9fa 100644 --- a/src/xrpld/app/ledger/README.md +++ b/src/xrpld/app/ledger/README.md @@ -63,7 +63,7 @@ that the validator sends its proposals and validations to the network. ## Ledger Priorities -There are two ledgers that are the most important for a rippled server to have: +There are two ledgers that are the most important for an xrpld server to have: - The consensus ledger and - The last validated ledger. @@ -224,7 +224,7 @@ conclusion about which last closed ledger is authoritative. ## Consensus -A distributed agreement protocol. Ripple uses the consensus process to solve +A distributed agreement protocol. XRPL uses the consensus process to solve the problem of double-spending. ## Validation @@ -402,7 +402,7 @@ are occupied by the exchange rate. ## Overview -The Ripple server permits clients to subscribe to a continuous stream of +The XRPL server permits clients to subscribe to a continuous stream of fully-validated ledgers. The publication code maintains this stream. The server attempts to maintain this continuous stream unless it falls diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index 876a7e0578..b9305b743f 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -971,10 +971,10 @@ LedgerMaster::checkAccept(std::shared_ptr const& ledger) if (ledger->seq() % 256 == 0) { - // Check if the majority of validators run a higher version rippled + // Check if the majority of validators run a higher version xrpld // software. If so print a warning. // - // Validators include their rippled software version in the validation + // Validators include their xrpld software version in the validation // messages of every (flag - 1) ledger. We wait for one ledger time // before checking the version information to accumulate more validation // messages. @@ -990,28 +990,28 @@ LedgerMaster::checkAccept(std::shared_ptr const& ledger) auto const vals = app_.getValidations().getTrustedForLedger( ledger->header().parentHash, ledger->header().seq - 1); std::size_t higherVersionCount = 0; - std::size_t rippledCount = 0; + std::size_t xrpldCount = 0; for (auto const& v : vals) { if (v->isFieldPresent(sfServerVersion)) { auto version = v->getFieldU64(sfServerVersion); higherVersionCount += BuildInfo::isNewerVersion(version) ? 1 : 0; - rippledCount += BuildInfo::isRippledVersion(version) ? 1 : 0; + xrpldCount += BuildInfo::isXrpldVersion(version) ? 1 : 0; } } // We report only if (1) we have accumulated validation messages // from 90% validators from the UNL, (2) 60% of validators - // running the rippled implementation have higher version numbers, + // running the xrpld implementation have higher version numbers, // and (3) the calculation won't cause divide-by-zero. - if (higherVersionCount > 0 && rippledCount > 0) + if (higherVersionCount > 0 && xrpldCount > 0) { constexpr std::size_t reportingPercent = 90; constexpr std::size_t cutoffPercent = 60; auto const unlSize{app_.getValidators().getQuorumKeys().second.size()}; needPrint = unlSize > 0 && calculatePercent(vals.size(), unlSize) >= reportingPercent && - calculatePercent(higherVersionCount, rippledCount) >= cutoffPercent; + calculatePercent(higherVersionCount, xrpldCount) >= cutoffPercent; } } // To throttle the warning messages, instead of printing a warning diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 6d02ea38ae..129bab8e20 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -1399,7 +1399,7 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline) "implications and have"; JLOG(m_journal.warn()) << "*** been deprecated. They will be removed " "in a future release of"; - JLOG(m_journal.warn()) << "*** rippled."; + JLOG(m_journal.warn()) << "*** xrpld."; JLOG(m_journal.warn()) << "*** If you do not use them to sign " "transactions please edit your"; JLOG(m_journal.warn()) << "*** configuration file and remove the [enable_signing] stanza."; @@ -1949,7 +1949,7 @@ ApplicationImp::loadOldLedger( << " UTC.\n" "This replay will not handle your ledger as it was " "originally " - "handled.\nConsider running an earlier version of rippled " + "handled.\nConsider running an earlier version of xrpld " "to " "get the older rules.\n*** CONTINUING ***\n"; } diff --git a/src/xrpld/app/main/GRPCServer.cpp b/src/xrpld/app/main/GRPCServer.cpp index a6c0c933be..c8017d9ac0 100644 --- a/src/xrpld/app/main/GRPCServer.cpp +++ b/src/xrpld/app/main/GRPCServer.cpp @@ -557,7 +557,7 @@ GRPCServer::start() { thread_ = std::thread([this]() { // Start the event loop and begin handling requests - beast::setCurrentThreadName("rippled: grpc"); + beast::setCurrentThreadName("xrpld: grpc"); this->impl_.handleRpcs(); }); } diff --git a/src/xrpld/app/main/GRPCServer.h b/src/xrpld/app/main/GRPCServer.h index 037c91df93..7fa9364174 100644 --- a/src/xrpld/app/main/GRPCServer.h +++ b/src/xrpld/app/main/GRPCServer.h @@ -234,14 +234,14 @@ private: getClientEndpoint(); // If the request was proxied through - // another rippled node, returns the ip of the originating client. + // another xrpld node, returns the ip of the originating client. // Empty optional if request was not proxied or there was an error // decoding the client ip std::optional getProxiedClientIpAddress(); // If the request was proxied through - // another rippled node, returns the endpoint of the originating client. + // another xrpld node, returns the endpoint of the originating client. // Empty optional if request was not proxied or there was an error // decoding the client endpoint std::optional @@ -261,7 +261,7 @@ private: bool clientIsUnlimited(); - // True if the request was proxied through another rippled node prior + // True if the request was proxied through another xrpld node prior // to arriving here bool wasForwarded(); diff --git a/src/xrpld/app/main/Main.cpp b/src/xrpld/app/main/Main.cpp index f3953823dd..ebd5920492 100644 --- a/src/xrpld/app/main/Main.cpp +++ b/src/xrpld/app/main/Main.cpp @@ -470,8 +470,8 @@ run(int argc, char** argv) } catch (std::exception const& ex) { - std::cerr << "rippled: " << ex.what() << std::endl; - std::cerr << "Try 'rippled --help' for a list of options." << std::endl; + std::cerr << "xrpld: " << ex.what() << std::endl; + std::cerr << "Try 'xrpld --help' for a list of options." << std::endl; return 1; } @@ -483,7 +483,7 @@ run(int argc, char** argv) if (vm.contains("version")) { - std::cout << "rippled version " << BuildInfo::getVersionString() << std::endl; + std::cout << "xrpld version " << BuildInfo::getVersionString() << std::endl; std::cout << "Git commit hash: " << xrpl::git::getCommitHash() << std::endl; std::cout << "Git build branch: " << xrpl::git::getBuildBranch() << std::endl; return 0; @@ -492,8 +492,8 @@ run(int argc, char** argv) #ifndef ENABLE_TESTS if (vm.count("unittest") || vm.count("unittest-child")) { - std::cerr << "rippled: Tests disabled in this build." << std::endl; - std::cerr << "Try 'rippled --help' for a list of options." << std::endl; + std::cerr << "xrpld: Tests disabled in this build." << std::endl; + std::cerr << "Try 'xrpld --help' for a list of options." << std::endl; return 1; } #else @@ -529,7 +529,7 @@ run(int argc, char** argv) if (vm.contains("unittest-jobs")) { // unittest jobs only makes sense with `unittest` - std::cerr << "rippled: '--unittest-jobs' specified without " + std::cerr << "xrpld: '--unittest-jobs' specified without " "'--unittest'.\n"; std::cerr << "To run the unit tests the '--unittest' option must " "be present.\n"; @@ -793,7 +793,7 @@ run(int argc, char** argv) } // We have an RPC command to process: - beast::setCurrentThreadName("rippled: rpc"); + beast::setCurrentThreadName("xrpld: rpc"); return RPCCall::fromCommandLine( *config, vm["parameters"].as>(), *logs); // LCOV_EXCL_STOP diff --git a/src/xrpld/app/misc/FeeEscalation.md b/src/xrpld/app/misc/FeeEscalation.md index 7843620320..5a3edbe95a 100644 --- a/src/xrpld/app/misc/FeeEscalation.md +++ b/src/xrpld/app/misc/FeeEscalation.md @@ -1,6 +1,6 @@ # Fees -Rippled's fee mechanism consists of several interrelated processes: +Xrpld's fee mechanism consists of several interrelated processes: 1. [Rapid Fee escalation](#fee-escalation) 2. [The Transaction Queue](#transaction-queue) @@ -184,7 +184,7 @@ than a more complex transaction paying more XRP. ### Load Fee -Each rippled server maintains a minimum cost threshold based on its current load. If you submit a transaction with a fee that is lower than the current load-based transaction cost of the rippled server, the server neither applies nor relays the transaction to its peers. A transaction is very unlikely to survive the consensus process unless its transaction fee value meets the requirements of a majority of servers. +Each xrpld server maintains a minimum cost threshold based on its current load. If you submit a transaction with a fee that is lower than the current load-based transaction cost of the xrpld server, the server neither applies nor relays the transaction to its peers. A transaction is very unlikely to survive the consensus process unless its transaction fee value meets the requirements of a majority of servers. ### Reference Transaction @@ -193,7 +193,7 @@ single-signed transaction (eg. Payment, Account Set, Offer Create, etc) that requires a fee. In the future, there may be other transaction types that require -more (or less) work for rippled to process. Those transactions may have +more (or less) work for xrpld to process. Those transactions may have a higher (or lower) base fee, requiring a correspondingly higher (or lower) fee to get into the same position as a reference transaction. @@ -211,7 +211,7 @@ Another factor to consider is the duration of the consensus process itself. This generally takes under 5 seconds on the main network under low volume. This is based on historical observations. However factors such as transaction volume -can increase consensus duration. This is because rippled performs +can increase consensus duration. This is because xrpld performs more work as transaction volume increases. Under sufficient load this tends to increase consensus duration. It's possible that relatively high consensus duration indicates a problem, but it is not appropriate to @@ -293,7 +293,7 @@ values by 5 for a multi-signed transaction with 4 signatures.) The `fee` result is always instantaneous, and relates to the open ledger. It includes the sequence number of the current open ledger, -but may not make sense if rippled is not synced to the network. +but may not make sense if xrpld is not synced to the network. Result format: diff --git a/src/xrpld/app/misc/README.md b/src/xrpld/app/misc/README.md index 2f9fff0ca3..359f58578d 100644 --- a/src/xrpld/app/misc/README.md +++ b/src/xrpld/app/misc/README.md @@ -1,6 +1,6 @@ # Fee Voting -The Ripple payment protocol enforces a fee schedule expressed in units of the +The XRPL payment protocol enforces a fee schedule expressed in units of the native currency, XRP. Fees for transactions are paid directly from the account owner. There are also reserve requirements for each item that occupies storage in the ledger. The reserve fee schedule contains both a per-account reserve, @@ -20,7 +20,7 @@ subsequent ledgers a new fee schedule is enacted. ## Consensus -The Ripple consensus algorithm allows distributed participants to arrive at +The XRPL consensus algorithm allows distributed participants to arrive at the same answer for yes/no questions. The canonical case for consensus is whether or not a particular transaction is included in the ledger. Fees present a more difficult challenge, since the decision on the new fee is not @@ -54,7 +54,7 @@ be converged in the consensus process, the following algorithm is used: ## Configuration -A validating instance of rippled uses information in the configuration file +A validating instance of xrpld uses information in the configuration file to determine how it wants to vote on the fee schedule. It is the responsibility of the administrator to set these values. @@ -64,7 +64,7 @@ of the administrator to set these values. An Amendment is a new or proposed change to a ledger rule. Ledger rules affect transaction processing and consensus; peers must use the same set of rules for -consensus to succeed, otherwise different instances of rippled will get +consensus to succeed, otherwise different instances of xrpld will get different results. Amendments can be almost anything but they must be accepted by a network majority through a consensus process before they are utilized. An Amendment must receive at least an 80% approval rate from validating nodes for @@ -77,7 +77,7 @@ process of an Amendment from its conception to approval and usage. - Some members contribute their time and work to develop the Amendment. -- A pull request is created and the new code is folded into a rippled build +- A pull request is created and the new code is folded into an xrpld build and made available for use. - The consensus process begins with the validating nodes. diff --git a/src/xrpld/app/misc/SHAMapStoreImp.h b/src/xrpld/app/misc/SHAMapStoreImp.h index df3c16b24f..c361fa426c 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.h +++ b/src/xrpld/app/misc/SHAMapStoreImp.h @@ -195,7 +195,7 @@ private: clearPrior(LedgerIndex lastRotated); /** - * This is a health check for online deletion that waits until rippled is + * This is a health check for online deletion that waits until xrpld is * stable before returning. It returns an indication of whether the server * is stopping. * diff --git a/src/xrpld/app/misc/TxQ.h b/src/xrpld/app/misc/TxQ.h index 772d51b959..b9ea7cc8f6 100644 --- a/src/xrpld/app/misc/TxQ.h +++ b/src/xrpld/app/misc/TxQ.h @@ -398,9 +398,9 @@ private: Updates fee metrics based on the transactions in the ReadView for use in fee escalation calculations. - @param app Rippled Application object. + @param app Xrpld Application object. @param view View of the LCL that was just closed or received. - @param timeLeap Indicates that rippled is under load so fees + @param timeLeap Indicates that xrpld is under load so fees should grow faster. @param setup Customization params. */ diff --git a/src/xrpld/app/misc/ValidatorList.h b/src/xrpld/app/misc/ValidatorList.h index 9b7670a482..ff5aa8c71f 100644 --- a/src/xrpld/app/misc/ValidatorList.h +++ b/src/xrpld/app/misc/ValidatorList.h @@ -108,11 +108,11 @@ struct ValidatorBlobInfo Trusted Validators List ----------------------- - Rippled accepts ledger proposals and validations from trusted validator + Xrpld accepts ledger proposals and validations from trusted validator nodes. A ledger is considered fully-validated once the number of received trusted validations for a ledger meets or exceeds a quorum value. - This class manages the set of validation public keys the local rippled node + This class manages the set of validation public keys the local xrpld node trusts. The list of trusted keys is populated using the keys listed in the configuration file as well as lists signed by trusted publishers. The trusted publisher public keys are specified in the config. @@ -121,9 +121,9 @@ struct ValidatorBlobInfo @li @c "blob": Base64-encoded JSON string containing a @c "sequence", @c "validFrom", @c "validUntil", and @c "validators" field. @c "validFrom" - contains the Ripple timestamp (seconds since January 1st, 2000 (00:00 + contains the XRPL timestamp (seconds since January 1st, 2000 (00:00 UTC)) for when the list becomes valid. @c "validUntil" contains the - Ripple timestamp for when the list expires. @c "validators" contains + XRPL timestamp for when the list expires. @c "validators" contains an array of objects with a @c "validation_public_key" and optional @c "manifest" field. @c "validation_public_key" should be the hex-encoded master public key. @c "manifest" should be the diff --git a/src/xrpld/app/misc/ValidatorSite.h b/src/xrpld/app/misc/ValidatorSite.h index 270df6f9f0..ab82ae168d 100644 --- a/src/xrpld/app/misc/ValidatorSite.h +++ b/src/xrpld/app/misc/ValidatorSite.h @@ -28,7 +28,7 @@ namespace xrpl { @li @c "blob": Base64-encoded JSON string containing a @c "sequence", @c "validUntil", and @c "validators" field. @c "validUntil" contains the - Ripple timestamp (seconds since January 1st, 2000 (00:00 UTC)) for when + XRPL timestamp (seconds since January 1st, 2000 (00:00 UTC)) for when the list expires. @c "validators" contains an array of objects with a @c "validation_public_key" and optional @c "manifest" field. @c "validation_public_key" should be the hex-encoded master public key. diff --git a/src/xrpld/app/misc/detail/ValidatorList.cpp b/src/xrpld/app/misc/detail/ValidatorList.cpp index 0b203114b3..1951c657b0 100644 --- a/src/xrpld/app/misc/detail/ValidatorList.cpp +++ b/src/xrpld/app/misc/detail/ValidatorList.cpp @@ -340,7 +340,7 @@ ValidatorList::cacheValidatorFile(ValidatorList::lock_guard const& lock, PublicK boost::system::error_code ec; Json::Value value = buildFileData(strHex(pubKey), publisherLists_.at(pubKey), j_); - // rippled should be the only process writing to this file, so + // xrpld should be the only process writing to this file, so // if it ever needs to be read, it is not expected to change externally, so // delay the refresh as long as possible: 24 hours. (See also // `ValidatorSite::missingSite()`) diff --git a/src/xrpld/app/rdb/README.md b/src/xrpld/app/rdb/README.md index a50bb395c1..53e6b0c6fa 100644 --- a/src/xrpld/app/rdb/README.md +++ b/src/xrpld/app/rdb/README.md @@ -2,7 +2,7 @@ The guiding principles of the Relational Database Interface are summarized below: -- All hard-coded SQL statements should be stored in the [files](#source-files) under the `xrpld/app/rdb` directory. With the exception of test modules, no hard-coded SQL should be added to any other file in rippled. +- All hard-coded SQL statements should be stored in the [files](#source-files) under the `xrpld/app/rdb` directory. With the exception of test modules, no hard-coded SQL should be added to any other file in xrpld. - The base class `RelationalDatabase` is inherited by derived classes that each provide an interface for operating on distinct relational database systems. ## Overview diff --git a/src/xrpld/app/rdb/backend/detail/Node.cpp b/src/xrpld/app/rdb/backend/detail/Node.cpp index b176588771..bc19a25b40 100644 --- a/src/xrpld/app/rdb/backend/detail/Node.cpp +++ b/src/xrpld/app/rdb/backend/detail/Node.cpp @@ -1288,7 +1288,7 @@ dbHasSpace(soci::session& session, Config const& config, beast::Journal j) if (freeSpace < megabytes(512)) { JLOG(j.fatal()) << "Free SQLite space for transaction db is less than " - "512MB. To fix this, rippled must be executed with the " + "512MB. To fix this, xrpld must be executed with the " "vacuum parameter before restarting. " "Note that this activity can take multiple days, " "depending on database size."; diff --git a/src/xrpld/core/Config.h b/src/xrpld/core/Config.h index 78a35c6bc1..d4d8396ba5 100644 --- a/src/xrpld/core/Config.h +++ b/src/xrpld/core/Config.h @@ -273,10 +273,10 @@ public: // First, attempt to load the latest ledger directly from disk. bool FAST_LOAD = false; - // When starting rippled with existing database it do not know it has those + // When starting xrpld with existing database it do not know it has those // ledgers locally until the server naturally tries to backfill. This makes // is difficult to test some functionality (in particular performance - // testing sidechains). With this variable the user is able to force rippled + // testing sidechains). With this variable the user is able to force xrpld // to consider the ledger range to be present. It should be used for testing // only. std::optional> FORCED_LEDGER_RANGE_PRESENT; diff --git a/src/xrpld/core/TimeKeeper.h b/src/xrpld/core/TimeKeeper.h index 72c4468e1f..0d809d076d 100644 --- a/src/xrpld/core/TimeKeeper.h +++ b/src/xrpld/core/TimeKeeper.h @@ -34,7 +34,7 @@ public: protocol, but it is possible for them to make an educated guess if this server publishes proposals or validations. - @note The network time is adjusted for the "Ripple epoch" which + @note The network time is adjusted for the "XRPL epoch" which was arbitrarily defined as 2000-01-01T00:00:00Z by Arthur Britto and David Schwartz during early development of the code. No rationale has been provided for this curious and diff --git a/src/xrpld/overlay/README.md b/src/xrpld/overlay/README.md index 51eb96a001..bda0027ea7 100644 --- a/src/xrpld/overlay/README.md +++ b/src/xrpld/overlay/README.md @@ -3,11 +3,11 @@ ## Introduction The _XRP Ledger network_ consists of a collection of _peers_ running -**`rippled`** or other compatible software. Each peer maintains multiple +**`xrpld`** or other compatible software. Each peer maintains multiple outgoing connections and optional incoming connections to other peers. These connections are made over both the public Internet and private local area networks. This network defines a connected directed graph of nodes -where vertices are instances of `rippled` and edges are persistent TCP/IP +where vertices are instances of `xrpld` and edges are persistent TCP/IP connections. Peers send and receive messages to other connected peers. This peer to peer network, layered on top of the public and private Internet, forms an [_overlay network_][overlay_network]. The contents of the messages @@ -56,7 +56,7 @@ failed (e.g. by sending HTTP 400 "Bad Request" or HTTP 503 "Service Unavailable" ``` GET / HTTP/1.1 -User-Agent: rippled-1.4.0-b1+DEBUG +User-Agent: xrpld-1.4.0-b1+DEBUG Upgrade: RTXP/1.2, XRPL/2.0 Connection: Upgrade Connect-As: Peer @@ -77,7 +77,7 @@ HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: RTXP/1.2 Connect-As: Peer -Server: rippled-1.3.1 +Server: xrpld-1.3.1 Crawl: public Public-Key: n9K1ZXXXzzA3dtgKBuQUnZXkhygMRgZbSo3diFNPVHLMsUG5osJM Session-Signature: MEQCIHMlLGTcGyPvHji7WY2nRM2B0iSBnw9xeDUGW7bPq7IjAiAmy+ofEu+8nOq2eChRTr3wjoKi3EYRqLgzP+q+ORFcig== @@ -90,7 +90,7 @@ Previous-Ledger: EPvIpAD2iavGFyyZYi8REexAXyKGXsi1jMF7OIBY6/Y= ``` HTTP/1.1 503 Service Unavailable -Server: rippled-0.27.0 +Server: xrpld-0.27.0 Remote-Address: 63.104.209.13 Content-Length: 253 Content-Type: application/json @@ -354,9 +354,9 @@ transferred between A and B and will not be able to intelligently tamper with th message stream between Alice and Bob, although she may be still be able to inject delays or terminate the link. -# Ripple Clustering +# XRPL clustering -A cluster consists of more than one Ripple server under common +A cluster consists of more than one XRPL server under common administration that share load information, distribute cryptography operations, and provide greater response consistency. diff --git a/src/xrpld/overlay/detail/Handshake.cpp b/src/xrpld/overlay/detail/Handshake.cpp index f70ec864da..9d86724b82 100644 --- a/src/xrpld/overlay/detail/Handshake.cpp +++ b/src/xrpld/overlay/detail/Handshake.cpp @@ -99,7 +99,7 @@ makeFeaturesResponseHeader( @note This construct is non-standard. There are potential "standard" alternatives that should be considered. For a discussion, on this topic, see https://github.com/openssl/openssl/issues/5509 and - https://github.com/ripple/rippled/issues/2413. + https://github.com/XRPLF/rippled/issues/2413. */ static std::optional> hashLastMessage(SSL const* ssl, size_t (*get)(const SSL*, void*, size_t)) diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index 9bfd3f6818..10ebae6b0f 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -663,7 +663,7 @@ OverlayImpl::reportOutboundTraffic(TrafficCount::category cat, int size) } /** The number of active peers on the network Active peers are only those peers that have completed the handshake - and are running the Ripple protocol. + and are running the XRPL protocol. */ std::size_t OverlayImpl::size() const diff --git a/src/xrpld/overlay/detail/PeerImp.h b/src/xrpld/overlay/detail/PeerImp.h index 61b8e1e758..7f7d8c9324 100644 --- a/src/xrpld/overlay/detail/PeerImp.h +++ b/src/xrpld/overlay/detail/PeerImp.h @@ -408,7 +408,7 @@ public: return publicKey_; } - /** Return the version of rippled that the peer is running, if reported. */ + /** Return the version of xrpld that the peer is running, if reported. */ std::string getVersion() const; diff --git a/src/xrpld/overlay/detail/PeerReservationTable.cpp b/src/xrpld/overlay/detail/PeerReservationTable.cpp index 8f90848954..6ea2253df9 100644 --- a/src/xrpld/overlay/detail/PeerReservationTable.cpp +++ b/src/xrpld/overlay/detail/PeerReservationTable.cpp @@ -38,7 +38,7 @@ PeerReservationTable::list() const -> std::vector return list; } -// See `ripple/app/main/DBInit.cpp` for the `CREATE TABLE` statement. +// See `include/xrpl/rdb/DBInit.h` for the `CREATE TABLE` statement. // It is unfortunate that we do not get to define a function for it. // We choose a `bool` return type to fit in with the error handling scheme diff --git a/src/xrpld/peerfinder/README.md b/src/xrpld/peerfinder/README.md index 806984035b..e6eda747ce 100644 --- a/src/xrpld/peerfinder/README.md +++ b/src/xrpld/peerfinder/README.md @@ -2,8 +2,8 @@ ## Introduction -The _Ripple payment network_ consists of a collection of _peers_ running the -**rippled software**. Each peer maintains multiple outgoing connections and +The _XRPL payment network_ consists of a collection of _peers_ running the +**xrpld software**. Each peer maintains multiple outgoing connections and optional incoming connections to other peers. These connections are made over both the public Internet and private local area networks. This network defines a fully connected directed graph of nodes. Peers send and receive messages to @@ -175,7 +175,7 @@ When choosing addresses from the boot cache for the purpose of establishing outgoing connections, addresses are ranked in decreasing order of valence. The Bootcache is persistent. Entries are periodically inserted and updated in the corresponding SQLite database during program operation. When -**rippled** is launched, the existing Bootcache database data is accessed and +**xrpld** is launched, the existing Bootcache database data is accessed and loaded to accelerate the bootstrap process. Desirable entries in the Bootcache are addresses for servers which are known to @@ -306,7 +306,7 @@ the address, and its retry timer has expired. The PeerFinder makes its best effort to become fully connected to the fixed addresses specified in the configuration file before moving on to establish -outgoing connections to foreign peers. This security feature helps rippled +outgoing connections to foreign peers. This security feature helps xrpld establish itself with a trusted set of peers first before accepting untrusted data from the network. diff --git a/src/xrpld/peerfinder/detail/Bootcache.cpp b/src/xrpld/peerfinder/detail/Bootcache.cpp index 580ebe0c53..dac55d50d6 100644 --- a/src/xrpld/peerfinder/detail/Bootcache.cpp +++ b/src/xrpld/peerfinder/detail/Bootcache.cpp @@ -134,7 +134,7 @@ Bootcache::on_success(beast::IP::Endpoint const& endpoint) ++entry.valence(); m_map.erase(result.first); result = m_map.insert(value_type(endpoint, entry)); - XRPL_ASSERT(result.second, "ripple:PeerFinder::Bootcache::on_success : endpoint inserted"); + XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::on_success : endpoint inserted"); } Entry const& entry(result.first->right); JLOG(m_journal.info()) << beast::leftw(18) << "Bootcache connect " << endpoint << " with " @@ -158,7 +158,7 @@ Bootcache::on_failure(beast::IP::Endpoint const& endpoint) --entry.valence(); m_map.erase(result.first); result = m_map.insert(value_type(endpoint, entry)); - XRPL_ASSERT(result.second, "ripple:PeerFinder::Bootcache::on_failure : endpoint inserted"); + XRPL_ASSERT(result.second, "xrpl::PeerFinder::Bootcache::on_failure : endpoint inserted"); } Entry const& entry(result.first->right); auto const n(std::abs(entry.valence())); diff --git a/src/xrpld/rpc/README.md b/src/xrpld/rpc/README.md index 749f3d0ed1..cf023770ea 100644 --- a/src/xrpld/rpc/README.md +++ b/src/xrpld/rpc/README.md @@ -6,7 +6,7 @@ By default, an RPC handler runs as an uninterrupted task on the JobQueue. This is fine for commands that are fast to compute but might not be acceptable for tasks that require multiple parts or are large, like a full ledger. -For this purpose, the rippled RPC handler allows _suspension with continuation_ +For this purpose, the xrpld RPC handler allows _suspension with continuation_ - a request to suspend execution of the RPC response and to continue it after some function or job has been executed. A default continuation is supplied diff --git a/src/xrpld/rpc/RPCCall.h b/src/xrpld/rpc/RPCCall.h index 6ab9f1d1fa..9994195bb0 100644 --- a/src/xrpld/rpc/RPCCall.h +++ b/src/xrpld/rpc/RPCCall.h @@ -20,7 +20,7 @@ namespace xrpl { // // Improvements to be more strict and to provide better diagnostics are welcome. -/** Processes Ripple RPC calls. */ +/** Processes XRPL RPC calls. */ namespace RPCCall { int @@ -52,7 +52,7 @@ rpcCmdToJson( beast::Journal j); /** Internal invocation of RPC client. - * Used by both rippled command line as well as rippled unit tests + * Used by both xrpld command line as well as xrpld unit tests */ std::pair rpcClient( diff --git a/src/xrpld/rpc/detail/RPCCall.cpp b/src/xrpld/rpc/detail/RPCCall.cpp index f4613a3e72..4396037f2e 100644 --- a/src/xrpld/rpc/detail/RPCCall.cpp +++ b/src/xrpld/rpc/detail/RPCCall.cpp @@ -118,7 +118,7 @@ private: if (!strIssuer.empty()) { - // Could confirm issuer is a valid Ripple address. + // Could confirm issuer is a valid XRPL address. jvResult[jss::issuer] = strIssuer; } @@ -1406,7 +1406,7 @@ struct RPCCallImp { Throw( "no response from server. Please " - "ensure that the rippled server is running in another " + "ensure that the xrpld server is running in another " "process."); } diff --git a/src/xrpld/rpc/detail/RPCHelpers.cpp b/src/xrpld/rpc/detail/RPCHelpers.cpp index 120479ded8..190254fc37 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.cpp +++ b/src/xrpld/rpc/detail/RPCHelpers.cpp @@ -114,10 +114,10 @@ readLimitField(unsigned int& limit, Tuning::LimitRange const& range, JsonContext } std::optional -parseRippleLibSeed(Json::Value const& value) +parseXrplLibSeed(Json::Value const& value) { - // ripple-lib encodes seed used to generate an Ed25519 wallet in a - // non-standard way. While rippled never encode seeds that way, we + // XrplLib encodes seed used to generate an Ed25519 wallet in a + // non-standard way. While xrpld never encode seeds that way, we // try to detect such keys to avoid user confusion. if (!value.isString()) return std::nullopt; @@ -258,14 +258,14 @@ keypairForSignature(Json::Value const& params, Json::Value& error, unsigned int } } - // ripple-lib encodes seed used to generate an Ed25519 wallet in a + // XrplLib encodes seed used to generate an Ed25519 wallet in a // non-standard way. While we never encode seeds that way, we try // to detect such keys to avoid user confusion. // using strcmp as pointers may not match (see // https://developercommunity.visualstudio.com/t/assigning-constexpr-char--to-static-cha/10021357?entry=problem) if (strcmp(secretType, jss::seed_hex.c_str()) != 0) { - seed = RPC::parseRippleLibSeed(params[secretType]); + seed = RPC::parseXrplLibSeed(params[secretType]); if (seed) { diff --git a/src/xrpld/rpc/detail/RPCHelpers.h b/src/xrpld/rpc/detail/RPCHelpers.h index 54a976b78e..00a0018870 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.h +++ b/src/xrpld/rpc/detail/RPCHelpers.h @@ -94,16 +94,16 @@ std::optional getSeedFromRPC(Json::Value const& params, Json::Value& error); /** - * @brief Parses a RippleLib seed from RPC parameters. + * @brief Parses a XrplLib seed from RPC parameters. * * Attempts to extract and return a Seed from the provided JSON parameters using - * RippleLib conventions. + * XrplLib conventions. * * @param params The JSON value containing RPC parameters. * @return An optional Seed if parsing is successful, or std::nullopt otherwise. */ std::optional -parseRippleLibSeed(Json::Value const& params); +parseXrplLibSeed(Json::Value const& params); /** * @brief Chooses the ledger entry type based on RPC parameters. diff --git a/src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp b/src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp index ec06017b1b..428dfb5380 100644 --- a/src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp +++ b/src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp @@ -56,7 +56,7 @@ walletPropose(Json::Value const& params) { std::optional keyType; std::optional seed; - bool rippleLibSeed = false; + bool libSeed = false; if (params.isMember(jss::key_type)) { @@ -71,22 +71,22 @@ walletPropose(Json::Value const& params) return rpcError(rpcINVALID_PARAMS); } - // ripple-lib encodes seed used to generate an Ed25519 wallet in a + // XrplLib encodes seed used to generate an Ed25519 wallet in a // non-standard way. While we never encode seeds that way, we try // to detect such keys to avoid user confusion. { if (params.isMember(jss::passphrase)) { - seed = RPC::parseRippleLibSeed(params[jss::passphrase]); + seed = RPC::parseXrplLibSeed(params[jss::passphrase]); } else if (params.isMember(jss::seed)) { - seed = RPC::parseRippleLibSeed(params[jss::seed]); + seed = RPC::parseXrplLibSeed(params[jss::seed]); } if (seed) { - rippleLibSeed = true; + libSeed = true; // If the user *explicitly* requests a key type other than // Ed25519 we return an error. @@ -137,7 +137,7 @@ walletPropose(Json::Value const& params) // If a passphrase was specified, and it was hashed and used as a seed // run a quick entropy check and add an appropriate warning, because // "brain wallets" can be easily attacked. - if (!rippleLibSeed && params.isMember(jss::passphrase)) + if (!libSeed && params.isMember(jss::passphrase)) { auto const passphrase = params[jss::passphrase].asString(); diff --git a/src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp b/src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp index ac4f22a1aa..1b19061b9d 100644 --- a/src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp +++ b/src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp @@ -94,7 +94,7 @@ doRipplePathFind(RPC::JsonContext& context) // Both of these failure modes are hard to recreate in a unit test // because they are so dependent on inter-thread timing. However // the failure modes can be observed by synchronously (inside the - // rippled source code) shutting down the application. The code to + // xrpld source code) shutting down the application. The code to // do so looks like this: // // context.app.signalStop(); diff --git a/src/xrpld/rpc/handlers/transaction/Simulate.cpp b/src/xrpld/rpc/handlers/transaction/Simulate.cpp index c1d6d7f334..433603338d 100644 --- a/src/xrpld/rpc/handlers/transaction/Simulate.cpp +++ b/src/xrpld/rpc/handlers/transaction/Simulate.cpp @@ -339,7 +339,7 @@ doSimulate(RPC::JsonContext& context) { return simulateTxn(context, transaction); } - // LCOV_EXCL_START this is just in case, so rippled doesn't crash + // LCOV_EXCL_START this is just in case, so xrpld doesn't crash catch (std::exception const& e) { Json::Value jvResult = Json::objectValue; diff --git a/tests/README.md b/tests/README.md index c4a96005e7..431c2c464a 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,5 +1,5 @@ # Integration tests This directory contains integration tests for the project. These tests are run -against the `libxrpl` library or `rippled` binary to verify they are working as +against the `libxrpl` library or `xrpld` binary to verify they are working as expected. From b0fe2ec58a8b2a693544f017fd1bf0a19e73c55e Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Tue, 7 Apr 2026 15:32:13 +0100 Subject: [PATCH 8/9] ci: Change conditions for uploading artifacts in public/private/org repos (#6734) --- .github/workflows/publish-docs.yml | 4 ++-- .github/workflows/reusable-build-test-config.yml | 2 +- .github/workflows/reusable-clang-tidy-files.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index bed97cfafa..48832cb079 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -81,13 +81,13 @@ jobs: cmake --build . --target docs --parallel ${BUILD_NPROC} - name: Create documentation artifact - if: ${{ (github.repository_owner == 'XRPLF' || github.event.repository.visibility == 'public') && github.event_name == 'push' }} + if: ${{ github.event.repository.visibility == 'public' && github.event_name == 'push' }} uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 with: path: ${{ env.BUILD_DIR }}/docs/html deploy: - if: ${{ (github.repository_owner == 'XRPLF' || github.event.repository.visibility == 'public') && github.event_name == 'push' }} + if: ${{ github.repository == 'XRPLF/rippled' && github.event_name == 'push' }} needs: build runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/reusable-build-test-config.yml b/.github/workflows/reusable-build-test-config.yml index c79b22ac54..57112ed96a 100644 --- a/.github/workflows/reusable-build-test-config.yml +++ b/.github/workflows/reusable-build-test-config.yml @@ -199,7 +199,7 @@ jobs: fi - name: Upload the binary (Linux) - if: ${{ (github.repository_owner == 'XRPLF' || github.event.repository.visibility == 'public') && runner.os == 'Linux' }} + if: ${{ github.event.repository.visibility == 'public' && runner.os == 'Linux' }} uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: xrpld-${{ inputs.config_name }} diff --git a/.github/workflows/reusable-clang-tidy-files.yml b/.github/workflows/reusable-clang-tidy-files.yml index b6c66bc27a..a64a773c86 100644 --- a/.github/workflows/reusable-clang-tidy-files.yml +++ b/.github/workflows/reusable-clang-tidy-files.yml @@ -83,7 +83,7 @@ jobs: run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "${BUILD_DIR}" -quiet -allow-no-checks ${TARGETS} 2>&1 | tee clang-tidy-output.txt - name: Upload clang-tidy output - if: ${{ (github.repository_owner == 'XRPLF' || github.event.repository.visibility == 'public') && steps.run_clang_tidy.outcome != 'success' }} + if: ${{ github.event.repository.visibility == 'public' && steps.run_clang_tidy.outcome != 'success' }} uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: clang-tidy-results From 6d1a5be8d28e19feba530fed812ff28c341a1dc4 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Apr 2026 20:15:40 +0100 Subject: [PATCH 9/9] fix: Handle WSClient write failure when server closes WebSocket (#6671) Co-authored-by: Claude Opus 4.6 --- src/test/jtx/impl/WSClient.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/jtx/impl/WSClient.cpp b/src/test/jtx/impl/WSClient.cpp index 0c9b72c4d0..2c3389c131 100644 --- a/src/test/jtx/impl/WSClient.cpp +++ b/src/test/jtx/impl/WSClient.cpp @@ -184,7 +184,14 @@ public: jp[jss::command] = cmd; } auto const s = to_string(jp); - ws_.write_some(true, buffer(s)); + + // Use the error_code overload to avoid an unhandled exception + // when the server closes the WebSocket connection (e.g. after + // booting a client that exceeded resource thresholds). + error_code ec; + ws_.write_some(true, buffer(s), ec); + if (ec) + return {}; } auto jv =