Compare commits

...

2 Commits

Author SHA1 Message Date
JCW
e5158182f7 Fix an issue
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-11-19 15:08:50 +00:00
JCW
5ee23d92dd Retire the features
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-11-19 15:00:39 +00:00
7 changed files with 35 additions and 85 deletions

View File

@@ -65,11 +65,9 @@ XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DisallowIncoming, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(Checks, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(Flow, Supported::yes, VoteBehavior::DefaultYes)
// The following amendments are obsolete, but must remain supported
// because they could potentially get enabled.
@@ -124,7 +122,9 @@ XRPL_RETIRE_FEATURE(Escrow)
XRPL_RETIRE_FEATURE(EnforceInvariants)
XRPL_RETIRE_FEATURE(ExpandedSignerList)
XRPL_RETIRE_FEATURE(FeeEscalation)
XRPL_RETIRE_FEATURE(Flow)
XRPL_RETIRE_FEATURE(FlowCross)
XRPL_RETIRE_FEATURE(FlowSortStrands)
XRPL_RETIRE_FEATURE(HardenedValidations)
XRPL_RETIRE_FEATURE(ImmediateOfferKilled)
XRPL_RETIRE_FEATURE(MultiSign)

View File

@@ -267,9 +267,8 @@ public:
// strand dry until the liquidity is actually used)
// The implementation allows any single step to consume at most 1000
// offers. With the `FlowSortStrands` feature enabled, if the total
// number of offers consumed by all the steps combined exceeds 1500, the
// payment stops.
// offers.If the total number of offers consumed by all the steps
// combined exceeds 1500, the payment stops.
{
Env env(*this, features);
@@ -457,16 +456,12 @@ public:
// below the limit. However, if all the offers are consumed it would
// create a tecOVERSIZE error.
// The featureFlowSortStrands introduces a way of tracking the total
// number of consumed offers; with this feature the transaction no
// longer fails with a tecOVERSIZE error.
// The implementation allows any single step to consume at most 1000
// offers. With the `FlowSortStrands` feature enabled, if the total
// number of offers consumed by all the steps combined exceeds 1500, the
// payment stops. Since the first set of offers consumes 998 offers, the
// second set will consume 998, which is not over the limit and the
// payment stops. So 2*998, or 1996 is the expected value when
// `FlowSortStrands` is enabled.
// offers. If the total number of offers consumed by all the steps
// combined exceeds 1500, the payment stops. Since the first set of
// offers consumes 998 offers, the second set will consume 998, which is
// not over the limit and the payment stops. So 2*998, or 1996 is the
// expected value.
n_offers(env, 998, alice, XRP(1.00), USD(1));
n_offers(env, 998, alice, XRP(0.99), USD(1));
n_offers(env, 998, alice, XRP(0.98), USD(1));
@@ -474,22 +469,12 @@ public:
n_offers(env, 998, alice, XRP(0.96), USD(1));
n_offers(env, 998, alice, XRP(0.95), USD(1));
bool const withSortStrands = features[featureFlowSortStrands];
auto const expectedTER = [&]() -> TER {
if (!withSortStrands)
return TER{tecOVERSIZE};
return tesSUCCESS;
}();
auto const expectedTER = tesSUCCESS;
env(offer(bob, USD(8000), XRP(8000)), ter(expectedTER));
env.close();
auto const expectedUSD = [&] {
if (!withSortStrands)
return USD(0);
return USD(1996);
}();
auto const expectedUSD = USD(1996);
env.require(balance(bob, expectedUSD));
}
@@ -507,9 +492,7 @@ public:
using namespace jtx;
auto const sa = testable_amendments();
testAll(sa);
testAll(sa - featureFlowSortStrands);
testAll(sa - featurePermissionedDEX);
testAll(sa - featureFlowSortStrands - featurePermissionedDEX);
}
};

View File

@@ -4330,7 +4330,7 @@ public:
Account const ellie("ellie");
Account const fiona("fiona");
constexpr int ledgersInQueue = 10;
constexpr int ledgersInQueue = 20;
auto cfg = makeConfig(
{{"minimum_txn_in_ledger_standalone", "1"},
{"ledgers_in_queue", std::to_string(ledgersInQueue)},

View File

@@ -798,16 +798,18 @@ public:
{
// a Env FeatureBitset has *only* those features
Env env{*this, FeatureBitset{featureDynamicMPT | featureFlow}};
Env env{
*this, FeatureBitset{featureDynamicMPT | featureTokenEscrow}};
BEAST_EXPECT(env.app().config().features.size() == 2);
foreachFeature(supported, [&](uint256 const& f) {
bool const has = (f == featureDynamicMPT || f == featureFlow);
bool const has =
(f == featureDynamicMPT || f == featureTokenEscrow);
this->BEAST_EXPECT(has == hasFeature(env, f));
});
}
auto const missingSomeFeatures =
testable_amendments() - featureDynamicMPT - featureFlow;
testable_amendments() - featureDynamicMPT - featureTokenEscrow;
BEAST_EXPECT(missingSomeFeatures.count() == (supported.count() - 2));
{
// a Env supported_features_except is missing *only* those features
@@ -815,7 +817,8 @@ public:
BEAST_EXPECT(
env.app().config().features.size() == (supported.count() - 2));
foreachFeature(supported, [&](uint256 const& f) {
bool hasnot = (f == featureDynamicMPT || f == featureFlow);
bool hasnot =
(f == featureDynamicMPT || f == featureTokenEscrow);
this->BEAST_EXPECT(hasnot != hasFeature(env, f));
});
}
@@ -828,7 +831,9 @@ public:
Env env{
*this,
FeatureBitset{
featureDynamicMPT, featureFlow, *neverSupportedFeat}};
featureDynamicMPT,
featureTokenEscrow,
*neverSupportedFeat}};
// this app will have just 2 supported amendments and
// one additional never supported feature flag
@@ -836,7 +841,7 @@ public:
BEAST_EXPECT(hasFeature(env, *neverSupportedFeat));
foreachFeature(supported, [&](uint256 const& f) {
bool has = (f == featureDynamicMPT || f == featureFlow);
bool has = (f == featureDynamicMPT || f == featureTokenEscrow);
this->BEAST_EXPECT(has == hasFeature(env, f));
});
}
@@ -856,7 +861,8 @@ public:
(supported.count() - 2 + 1));
BEAST_EXPECT(hasFeature(env, *neverSupportedFeat));
foreachFeature(supported, [&](uint256 const& f) {
bool hasnot = (f == featureDynamicMPT || f == featureFlow);
bool hasnot =
(f == featureDynamicMPT || f == featureTokenEscrow);
this->BEAST_EXPECT(hasnot != hasFeature(env, f));
});
}

View File

@@ -123,7 +123,7 @@ class Feature_test : public beast::unit_test::suite
BEAST_EXPECT(
featureToName(fixRemoveNFTokenAutoTrustLine) ==
"fixRemoveNFTokenAutoTrustLine");
BEAST_EXPECT(featureToName(featureFlow) == "Flow");
BEAST_EXPECT(featureToName(featureBatch) == "Batch");
BEAST_EXPECT(
featureToName(featureDeletableAccounts) == "DeletableAccounts");
BEAST_EXPECT(

View File

@@ -43,15 +43,6 @@ RippleCalc::rippleCalculate(
PaymentSandbox flowSB(&view);
auto j = l.journal("Flow");
if (!view.rules().enabled(featureFlow))
{
// The new payment engine was enabled several years ago. New transaction
// should never use the old rules. Assume this is a replay
j.fatal()
<< "Old payment rules are required for this transaction. Assuming "
"this is a replay and running with the new rules.";
}
{
bool const defaultPaths =
!pInputs ? true : pInputs->defaultPathsAllowed;

View File

@@ -433,7 +433,7 @@ public:
// add the strands in `next_` to `cur_`, sorted by theoretical quality.
// Best quality first.
cur_.clear();
if (v.rules().enabled(featureFlowSortStrands) && !next_.empty())
if (!next_.empty())
{
std::vector<std::pair<Quality, Strand const*>> strandQuals;
strandQuals.reserve(next_.size());
@@ -719,46 +719,16 @@ flow(
continue;
}
if (baseView.rules().enabled(featureFlowSortStrands))
{
XRPL_ASSERT(!best, "ripple::flow : best is unset");
if (!f.inactive)
activeStrands.push(strand);
best.emplace(f.in, f.out, std::move(*f.sandbox), *strand, q);
activeStrands.pushRemainingCurToNext(strandIndex + 1);
break;
}
activeStrands.push(strand);
if (!best || best->quality < q ||
(best->quality == q && best->out < f.out))
{
// If this strand is inactive (because it consumed too many
// offers) and ends up having the best quality, remove it
// from the activeStrands. If it doesn't end up having the
// best quality, keep it active.
if (f.inactive)
{
// This should be `nextSize`, not `size`. This issue is
// fixed in featureFlowSortStrands.
markInactiveOnUse = activeStrands.size() - 1;
}
else
{
markInactiveOnUse.reset();
}
best.emplace(f.in, f.out, std::move(*f.sandbox), *strand, q);
}
XRPL_ASSERT(!best, "ripple::flow : best is unset");
if (!f.inactive)
activeStrands.push(strand);
best.emplace(f.in, f.out, std::move(*f.sandbox), *strand, q);
activeStrands.pushRemainingCurToNext(strandIndex + 1);
break;
}
bool const shouldBreak = [&] {
if (baseView.rules().enabled(featureFlowSortStrands))
return !best || offersConsidered >= maxOffersToConsider;
return !best;
}();
bool const shouldBreak =
!best || offersConsidered >= maxOffersToConsider;
if (best)
{