From 2bf77cc8f6925e0a6ae5441a87bdb9517c0c71fe Mon Sep 17 00:00:00 2001 From: Pratik Mankawde Date: Thu, 23 Oct 2025 14:35:54 +0100 Subject: [PATCH] refactor: Retire fix1515 amendment (#5920) Amendments activated for more than 2 years can be retired. This change retires the fix1515 amendment. Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com> --- include/xrpl/protocol/detail/features.macro | 3 +- src/xrpld/app/paths/detail/BookStep.cpp | 41 ++++----------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index 0d50596a61..32dc1a1e3c 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -109,8 +109,6 @@ XRPL_FIX (MasterKeyAsRegularKey, Supported::yes, VoteBehavior::DefaultYe XRPL_FIX (TakerDryOfferRemoval, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(MultiSignReserve, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (1578, Supported::yes, VoteBehavior::DefaultYes) -// fix1515: Use liquidity from strands that consume max offers, but mark as dry -XRPL_FIX (1515, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(DepositPreauth, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (1623, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (1543, Supported::yes, VoteBehavior::DefaultYes) @@ -156,3 +154,4 @@ XRPL_RETIRE(fix1523) XRPL_RETIRE(fix1528) XRPL_RETIRE(FlowCross) XRPL_RETIRE(fix1513) +XRPL_RETIRE(fix1515) diff --git a/src/xrpld/app/paths/detail/BookStep.cpp b/src/xrpld/app/paths/detail/BookStep.cpp index 54d0d8d0c9..5ac08295fc 100644 --- a/src/xrpld/app/paths/detail/BookStep.cpp +++ b/src/xrpld/app/paths/detail/BookStep.cpp @@ -47,7 +47,7 @@ class BookStep : public StepImp> protected: enum class OfferType { AMM, CLOB }; - uint32_t const maxOffersToConsume_; + static constexpr uint32_t MaxOffersToConsume{1000}; Book book_; AccountID strandSrc_; AccountID strandDst_; @@ -82,18 +82,9 @@ protected: std::optional cache_; - static uint32_t - getMaxOffersToConsume(StrandContext const& ctx) - { - if (ctx.view.rules().enabled(fix1515)) - return 1000; - return 2000; - } - public: BookStep(StrandContext const& ctx, Issue const& in, Issue const& out) - : maxOffersToConsume_(getMaxOffersToConsume(ctx)) - , book_(in, out, ctx.domainID) + : book_(in, out, ctx.domainID) , strandSrc_(ctx.strandSrc) , strandDst_(ctx.strandDst) , prevStep_(ctx.prevStep) @@ -738,7 +729,7 @@ BookStep::forEachOffer( ownerPaysTransferFee_ ? rate(book_.out.account) : QUALITY_ONE; typename FlowOfferStream::StepCounter counter( - maxOffersToConsume_, j_); + MaxOffersToConsume, j_); FlowOfferStream offers( sb, afView, book_, sb.parentCloseTime(), counter, j_); @@ -1093,18 +1084,9 @@ BookStep::revImp( offersUsed_ = offersConsumed; SetUnion(ofrsToRm, toRm); - if (offersConsumed >= maxOffersToConsume_) + // Too many iterations, mark this strand as inactive + if (offersConsumed >= MaxOffersToConsume) { - // Too many iterations, mark this strand as inactive - if (!afView.rules().enabled(fix1515)) - { - // Don't use the liquidity - cache_.emplace(beast::zero, beast::zero); - return {beast::zero, beast::zero}; - } - - // Use the liquidity, but use this to mark the strand as inactive so - // it's not used further inactive_ = true; } } @@ -1266,18 +1248,9 @@ BookStep::fwdImp( offersUsed_ = offersConsumed; SetUnion(ofrsToRm, toRm); - if (offersConsumed >= maxOffersToConsume_) + // Too many iterations, mark this strand as inactive (dry) + if (offersConsumed >= MaxOffersToConsume) { - // Too many iterations, mark this strand as inactive (dry) - if (!afView.rules().enabled(fix1515)) - { - // Don't use the liquidity - cache_.emplace(beast::zero, beast::zero); - return {beast::zero, beast::zero}; - } - - // Use the liquidity, but use this to mark the strand as inactive so - // it's not used further inactive_ = true; } }