mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-18 01:55:50 +00:00
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:
@@ -109,8 +109,6 @@ XRPL_FIX (MasterKeyAsRegularKey, Supported::yes, VoteBehavior::DefaultYe
|
|||||||
XRPL_FIX (TakerDryOfferRemoval, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FIX (TakerDryOfferRemoval, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FEATURE(MultiSignReserve, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FEATURE(MultiSignReserve, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FIX (1578, 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_FEATURE(DepositPreauth, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FIX (1623, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FIX (1623, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
XRPL_FIX (1543, Supported::yes, VoteBehavior::DefaultYes)
|
XRPL_FIX (1543, Supported::yes, VoteBehavior::DefaultYes)
|
||||||
@@ -156,3 +154,4 @@ XRPL_RETIRE(fix1523)
|
|||||||
XRPL_RETIRE(fix1528)
|
XRPL_RETIRE(fix1528)
|
||||||
XRPL_RETIRE(FlowCross)
|
XRPL_RETIRE(FlowCross)
|
||||||
XRPL_RETIRE(fix1513)
|
XRPL_RETIRE(fix1513)
|
||||||
|
XRPL_RETIRE(fix1515)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class BookStep : public StepImp<TIn, TOut, BookStep<TIn, TOut, TDerived>>
|
|||||||
protected:
|
protected:
|
||||||
enum class OfferType { AMM, CLOB };
|
enum class OfferType { AMM, CLOB };
|
||||||
|
|
||||||
uint32_t const maxOffersToConsume_;
|
static constexpr uint32_t MaxOffersToConsume{1000};
|
||||||
Book book_;
|
Book book_;
|
||||||
AccountID strandSrc_;
|
AccountID strandSrc_;
|
||||||
AccountID strandDst_;
|
AccountID strandDst_;
|
||||||
@@ -82,18 +82,9 @@ protected:
|
|||||||
|
|
||||||
std::optional<Cache> cache_;
|
std::optional<Cache> cache_;
|
||||||
|
|
||||||
static uint32_t
|
|
||||||
getMaxOffersToConsume(StrandContext const& ctx)
|
|
||||||
{
|
|
||||||
if (ctx.view.rules().enabled(fix1515))
|
|
||||||
return 1000;
|
|
||||||
return 2000;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BookStep(StrandContext const& ctx, Issue const& in, Issue const& out)
|
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)
|
, strandSrc_(ctx.strandSrc)
|
||||||
, strandDst_(ctx.strandDst)
|
, strandDst_(ctx.strandDst)
|
||||||
, prevStep_(ctx.prevStep)
|
, prevStep_(ctx.prevStep)
|
||||||
@@ -738,7 +729,7 @@ BookStep<TIn, TOut, TDerived>::forEachOffer(
|
|||||||
ownerPaysTransferFee_ ? rate(book_.out.account) : QUALITY_ONE;
|
ownerPaysTransferFee_ ? rate(book_.out.account) : QUALITY_ONE;
|
||||||
|
|
||||||
typename FlowOfferStream<TIn, TOut>::StepCounter counter(
|
typename FlowOfferStream<TIn, TOut>::StepCounter counter(
|
||||||
maxOffersToConsume_, j_);
|
MaxOffersToConsume, j_);
|
||||||
|
|
||||||
FlowOfferStream<TIn, TOut> offers(
|
FlowOfferStream<TIn, TOut> offers(
|
||||||
sb, afView, book_, sb.parentCloseTime(), counter, j_);
|
sb, afView, book_, sb.parentCloseTime(), counter, j_);
|
||||||
@@ -1093,18 +1084,9 @@ BookStep<TIn, TOut, TDerived>::revImp(
|
|||||||
offersUsed_ = offersConsumed;
|
offersUsed_ = offersConsumed;
|
||||||
SetUnion(ofrsToRm, toRm);
|
SetUnion(ofrsToRm, toRm);
|
||||||
|
|
||||||
if (offersConsumed >= maxOffersToConsume_)
|
|
||||||
{
|
|
||||||
// Too many iterations, mark this strand as inactive
|
// 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;
|
inactive_ = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1266,18 +1248,9 @@ BookStep<TIn, TOut, TDerived>::fwdImp(
|
|||||||
offersUsed_ = offersConsumed;
|
offersUsed_ = offersConsumed;
|
||||||
SetUnion(ofrsToRm, toRm);
|
SetUnion(ofrsToRm, toRm);
|
||||||
|
|
||||||
if (offersConsumed >= maxOffersToConsume_)
|
|
||||||
{
|
|
||||||
// Too many iterations, mark this strand as inactive (dry)
|
// 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;
|
inactive_ = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user