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>
This commit is contained in:
Pratik Mankawde
2025-10-23 14:35:54 +01:00
committed by GitHub
parent 5e33ca56fd
commit 2bf77cc8f6
2 changed files with 8 additions and 36 deletions

View File

@@ -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)

View File

@@ -47,7 +47,7 @@ class BookStep : public StepImp<TIn, TOut, BookStep<TIn, TOut, TDerived>>
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> 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<TIn, TOut, TDerived>::forEachOffer(
ownerPaysTransferFee_ ? rate(book_.out.account) : QUALITY_ONE;
typename FlowOfferStream<TIn, TOut>::StepCounter counter(
maxOffersToConsume_, j_);
MaxOffersToConsume, j_);
FlowOfferStream<TIn, TOut> offers(
sb, afView, book_, sb.parentCloseTime(), counter, j_);
@@ -1093,18 +1084,9 @@ BookStep<TIn, TOut, TDerived>::revImp(
offersUsed_ = offersConsumed;
SetUnion(ofrsToRm, toRm);
if (offersConsumed >= maxOffersToConsume_)
{
// Too many iterations, mark this strand as inactive
if (!afView.rules().enabled(fix1515))
if (offersConsumed >= MaxOffersToConsume)
{
// 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<TIn, TOut, TDerived>::fwdImp(
offersUsed_ = offersConsumed;
SetUnion(ofrsToRm, toRm);
if (offersConsumed >= maxOffersToConsume_)
{
// Too many iterations, mark this strand as inactive (dry)
if (!afView.rules().enabled(fix1515))
if (offersConsumed >= MaxOffersToConsume)
{
// 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;
}
}