From fa71bb62c2d26b81c72b07c25b4c70cbfb560640 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Mon, 13 Jul 2026 05:56:15 +0700 Subject: [PATCH] Revert "feat(consensus): consolidate UNL report amendment" This reverts commit 0cdd7164f4e1e41f1f34126007f028104c966709. --- include/xrpl/protocol/detail/features.macro | 2 +- src/test/consensus/NegativeUNL_test.cpp | 24 ++++++++++----------- src/xrpld/app/misc/NegativeUNLVote.cpp | 16 ++++++++------ 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index 67465e1dd..4fd980069 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -65,7 +65,7 @@ XRPL_FEATURE(AMM, Supported::no, VoteBehavior::DefaultNo XRPL_FIX (ReducedOffersV1, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(HooksUpdate2, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(HookOnV2, Supported::yes, VoteBehavior::DefaultNo) -XRPL_FEATURE(UNLReportV2, Supported::yes, VoteBehavior::DefaultNo) +XRPL_FEATURE(NegativeUNLActiveViewCap, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(Export, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(ConsensusEntropy, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (HookAPI20251128, Supported::yes, VoteBehavior::DefaultYes) diff --git a/src/test/consensus/NegativeUNL_test.cpp b/src/test/consensus/NegativeUNL_test.cpp index 835e565f1..ed97f1f55 100644 --- a/src/test/consensus/NegativeUNL_test.cpp +++ b/src/test/consensus/NegativeUNL_test.cpp @@ -1127,9 +1127,9 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite } void - testFindAllCandidatesWithUNLReportV2() + testFindAllCandidatesWithActiveViewCap() { - testcase("Find All Candidates with UNLReportV2 denominator"); + testcase("Find All Candidates with active-view cap denominator"); jtx::Env env(*this); NegativeUNLVote vote(NodeID(0xA0), env.journal, env.app()); @@ -1155,10 +1155,10 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite BEAST_EXPECT(legacyCandidates.toDisableCandidates.size() == 17); BEAST_EXPECT(legacyCandidates.toReEnableCandidates.empty()); - auto const unlReportV2Candidates = + auto const activeViewCandidates = vote.findAllCandidates(unl, negUnl, scoreTable, 10); - BEAST_EXPECT(unlReportV2Candidates.toDisableCandidates.empty()); - BEAST_EXPECT(unlReportV2Candidates.toReEnableCandidates.empty()); + BEAST_EXPECT(activeViewCandidates.toDisableCandidates.empty()); + BEAST_EXPECT(activeViewCandidates.toReEnableCandidates.empty()); } void @@ -1416,7 +1416,7 @@ class NegativeUNLVoteInternal_test : public beast::unit_test::suite testPickOneCandidate(); testBuildScoreTableSpecialCases(); testFindAllCandidates(); - testFindAllCandidatesWithUNLReportV2(); + testFindAllCandidatesWithActiveViewCap(); testFindAllCandidatesCombination(); testNewValidators(); } @@ -1755,16 +1755,16 @@ class NegativeUNLVoteMaxListed_test : public beast::unit_test::suite { // The same reliability state produces a fourth disable vote under - // the legacy trusted-UNL denominator, but not when UNLReportV2 + // the legacy trusted-UNL denominator, but not when the amended cap // uses the parent-ledger UNLReport active denominator. - auto const legacyFeatures = - (jtx::supported_amendments() - featureUNLReportV2) | + auto const legacyFeatures = (jtx::supported_amendments() - + featureNegativeUNLActiveViewCap) | featureNegativeUNL; BEAST_EXPECT(voteCountWithUNLReport(legacyFeatures) == 1); - auto const unlReportV2Features = jtx::supported_amendments() | - featureUNLReportV2 | featureNegativeUNL; - BEAST_EXPECT(voteCountWithUNLReport(unlReportV2Features) == 0); + auto const activeViewCapFeatures = jtx::supported_amendments() | + featureNegativeUNLActiveViewCap | featureNegativeUNL; + BEAST_EXPECT(voteCountWithUNLReport(activeViewCapFeatures) == 0); } } diff --git a/src/xrpld/app/misc/NegativeUNLVote.cpp b/src/xrpld/app/misc/NegativeUNLVote.cpp index ee87937b8..7a69b9643 100644 --- a/src/xrpld/app/misc/NegativeUNLVote.cpp +++ b/src/xrpld/app/misc/NegativeUNLVote.cpp @@ -28,11 +28,13 @@ namespace ripple { namespace { -//@@start negative-unl-report-v2-denominator +//@@start negative-unl-active-view-cap-denominator std::optional -negativeUNLReportV2Denominator(std::shared_ptr const& prevLedger) +negativeUNLActiveViewCapDenominator( + std::shared_ptr const& prevLedger) { - if (!prevLedger || !prevLedger->rules().enabled(featureUNLReportV2)) + if (!prevLedger || + !prevLedger->rules().enabled(featureNegativeUNLActiveViewCap)) { return std::nullopt; } @@ -56,7 +58,7 @@ negativeUNLReportV2Denominator(std::shared_ptr const& prevLedger) return activeKeys.size(); } -//@@end negative-unl-report-v2-denominator +//@@end negative-unl-active-view-cap-denominator } // namespace @@ -120,13 +122,13 @@ NegativeUNLVote::doVoting( purgeNewValidators(seq); // Process the table and find all candidates to disable or to re-enable - //@@start negative-unl-vote-unl-report-v2-use + //@@start negative-unl-vote-active-view-cap-use auto const candidates = findAllCandidates( unlNodeIDs, negUnlNodeIDs, *scoreTable, - negativeUNLReportV2Denominator(prevLedger)); - //@@end negative-unl-vote-unl-report-v2-use + negativeUNLActiveViewCapDenominator(prevLedger)); + //@@end negative-unl-vote-active-view-cap-use // Pick one to disable and one to re-enable if any, add ttUNL_MODIFY Tx if (!candidates.toDisableCandidates.empty())