From f28ba57b81ee63c300f8b45c4ae45be9eddade81 Mon Sep 17 00:00:00 2001 From: Jingchen Date: Tue, 4 Nov 2025 17:04:01 +0000 Subject: [PATCH] refactor: Retire HardenedValidations amendment (#5988) Amendments activated for more than 2 years can be retired. This change retires the HardenedValidations amendment. --- include/xrpl/protocol/detail/features.macro | 2 +- src/libxrpl/protocol/STValidation.cpp | 1 - src/xrpld/app/consensus/RCLConsensus.cpp | 22 ++++++++------------ src/xrpld/app/ledger/detail/LedgerMaster.cpp | 8 +++---- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index f02319a3da..92f05f8149 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -68,7 +68,6 @@ XRPL_FEATURE(CheckCashMakesTrustLine, Supported::yes, VoteBehavior::DefaultNo XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(TicketBatch, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(NegativeUNL, Supported::yes, VoteBehavior::DefaultYes) -XRPL_FEATURE(HardenedValidations, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (PayChanRecipientOwnerDir, Supported::yes, VoteBehavior::DefaultYes) @@ -125,6 +124,7 @@ XRPL_RETIRE(Escrow) XRPL_RETIRE(EnforceInvariants) XRPL_RETIRE(FeeEscalation) XRPL_RETIRE(FlowCross) +XRPL_RETIRE(HardenedValidations) XRPL_RETIRE(ImmediateOfferKilled) XRPL_RETIRE(MultiSign) XRPL_RETIRE(NonFungibleTokensV1_1) diff --git a/src/libxrpl/protocol/STValidation.cpp b/src/libxrpl/protocol/STValidation.cpp index 8e3ad354a8..3c89f31896 100644 --- a/src/libxrpl/protocol/STValidation.cpp +++ b/src/libxrpl/protocol/STValidation.cpp @@ -51,7 +51,6 @@ STValidation::validationFormat() {sfSigningPubKey, soeREQUIRED}, {sfSignature, soeREQUIRED}, {sfConsensusHash, soeOPTIONAL}, - // featureHardenedValidations {sfCookie, soeDEFAULT}, {sfValidatedHash, soeOPTIONAL}, {sfServerVersion, soeOPTIONAL}, diff --git a/src/xrpld/app/consensus/RCLConsensus.cpp b/src/xrpld/app/consensus/RCLConsensus.cpp index b6b281f209..7734ab790d 100644 --- a/src/xrpld/app/consensus/RCLConsensus.cpp +++ b/src/xrpld/app/consensus/RCLConsensus.cpp @@ -831,21 +831,17 @@ RCLConsensus::Adaptor::validate( if (proposing) v.setFlag(vfFullValidation); - if (ledger.ledger_->rules().enabled(featureHardenedValidations)) - { - // Attest to the hash of what we consider to be the last fully - // validated ledger. This may be the hash of the ledger we are - // validating here, and that's fine. - if (auto const vl = ledgerMaster_.getValidatedLedger()) - v.setFieldH256(sfValidatedHash, vl->info().hash); + // Attest to the hash of what we consider to be the last fully + // validated ledger. This may be the hash of the ledger we are + // validating here, and that's fine. + if (auto const vl = ledgerMaster_.getValidatedLedger()) + v.setFieldH256(sfValidatedHash, vl->info().hash); - v.setFieldU64(sfCookie, valCookie_); + v.setFieldU64(sfCookie, valCookie_); - // Report our server version every flag ledger: - if (ledger.ledger_->isVotingLedger()) - v.setFieldU64( - sfServerVersion, BuildInfo::getEncodedVersion()); - } + // Report our server version every flag ledger: + if (ledger.ledger_->isVotingLedger()) + v.setFieldU64(sfServerVersion, BuildInfo::getEncodedVersion()); // Report our load { diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index 8f0a2601eb..0c3b3266d9 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -993,10 +993,10 @@ LedgerMaster::checkAccept(std::shared_ptr const& ledger) // Check if the majority of validators run a higher version rippled // software. If so print a warning. // - // Once the HardenedValidations amendment is enabled, validators include - // their rippled software version in the validation messages of every - // (flag - 1) ledger. We wait for one ledger time before checking the - // version information to accumulate more validation messages. + // Validators include their rippled software version in the validation + // messages of every (flag - 1) ledger. We wait for one ledger time + // before checking the version information to accumulate more validation + // messages. auto currentTime = app_.timeKeeper().now(); bool needPrint = false;