Retire fix1781 amendment (#5931)

* Retired fix1781 amendment

Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>

* refactor: Retire fix1781 amendment

Amendments activated for more than 2 years can be retired. This change retires the fix1781 amendment.

---------

Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
This commit is contained in:
Pratik Mankawde
2025-10-29 11:32:43 +00:00
committed by GitHub
parent 1dd60242de
commit a8e4da0b11
4 changed files with 29 additions and 49 deletions

View File

@@ -98,8 +98,6 @@ XRPL_FEATURE(TicketBatch, Supported::yes, VoteBehavior::DefaultYe
XRPL_FEATURE(NegativeUNL, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (AmendmentMajorityCalc, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(HardenedValidations, Supported::yes, VoteBehavior::DefaultYes)
// fix1781: XRPEndpointSteps should be included in the circular payment check
XRPL_FIX (1781, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (QualityUpperBound, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes)
@@ -155,3 +153,4 @@ XRPL_RETIRE(FlowCross)
XRPL_RETIRE(fix1513)
XRPL_RETIRE(fix1515)
XRPL_RETIRE(fix1543)
XRPL_RETIRE(fix1781)

View File

@@ -2819,15 +2819,9 @@ private:
testcase("Circular XRP");
using namespace jtx;
for (auto const withFix : {true, false})
{
auto const feats = withFix
? testable_amendments()
: testable_amendments() - FeatureBitset{fix1781};
// Payment path starting with XRP
Env env(*this, feats);
Env env(*this, testable_amendments());
// Note, if alice doesn't have default ripple, then pay
// fails with tecPATH_DRY.
fund(
@@ -2842,8 +2836,7 @@ private:
AMM ammAliceXRP_EUR(env, alice, XRP(100), EUR(101));
env.close();
TER const expectedTer =
withFix ? TER{temBAD_PATH_LOOP} : TER{tesSUCCESS};
TER const expectedTer = TER{temBAD_PATH_LOOP};
env(pay(alice, bob, EUR(1)),
path(~USD, ~XRP, ~EUR),
sendmax(XRP(1)),

View File

@@ -1190,38 +1190,30 @@ struct Flow_test : public beast::unit_test::suite
auto const USD = gw["USD"];
auto const EUR = gw["EUR"];
for (auto const withFix : {true, false})
{
auto const feats = [&withFix]() -> FeatureBitset {
if (withFix)
return testable_amendments();
return testable_amendments() - FeatureBitset{fix1781};
}();
{
// Payment path starting with XRP
Env env(*this, feats);
env.fund(XRP(10000), alice, bob, gw);
env.close();
env.trust(USD(1000), alice, bob);
env.trust(EUR(1000), alice, bob);
env.close();
env(pay(gw, alice, USD(100)));
env(pay(gw, alice, EUR(100)));
env.close();
// Payment path starting with XRP
Env env(*this, testable_amendments());
env.fund(XRP(10000), alice, bob, gw);
env.close();
env.trust(USD(1000), alice, bob);
env.trust(EUR(1000), alice, bob);
env.close();
env(pay(gw, alice, USD(100)));
env(pay(gw, alice, EUR(100)));
env.close();
env(offer(alice, XRP(100), USD(100)), txflags(tfPassive));
env(offer(alice, USD(100), XRP(100)), txflags(tfPassive));
env(offer(alice, XRP(100), EUR(100)), txflags(tfPassive));
env.close();
env(offer(alice, XRP(100), USD(100)), txflags(tfPassive));
env(offer(alice, USD(100), XRP(100)), txflags(tfPassive));
env(offer(alice, XRP(100), EUR(100)), txflags(tfPassive));
env.close();
TER const expectedTer = TER{temBAD_PATH_LOOP};
env(pay(alice, bob, EUR(1)),
path(~USD, ~XRP, ~EUR),
sendmax(XRP(1)),
txflags(tfNoRippleDirect),
ter(expectedTer));
TER const expectedTer =
withFix ? TER{temBAD_PATH_LOOP} : TER{tesSUCCESS};
env(pay(alice, bob, EUR(1)),
path(~USD, ~XRP, ~EUR),
sendmax(XRP(1)),
txflags(tfNoRippleDirect),
ter(expectedTer));
}
pass();
}
{

View File

@@ -362,16 +362,12 @@ XRPEndpointStep<TDerived>::check(StrandContext const& ctx) const
if (ter != tesSUCCESS)
return ter;
if (ctx.view.rules().enabled(fix1781))
auto const issuesIndex = isLast_ ? 0 : 1;
if (!ctx.seenDirectIssues[issuesIndex].insert(xrpIssue()).second)
{
auto const issuesIndex = isLast_ ? 0 : 1;
if (!ctx.seenDirectIssues[issuesIndex].insert(xrpIssue()).second)
{
JLOG(j_.debug())
<< "XRPEndpointStep: loop detected: Index: " << ctx.strandSize
<< ' ' << *this;
return temBAD_PATH_LOOP;
}
JLOG(j_.debug()) << "XRPEndpointStep: loop detected: Index: "
<< ctx.strandSize << ' ' << *this;
return temBAD_PATH_LOOP;
}
return tesSUCCESS;