Compare commits

...

1 Commits

Author SHA1 Message Date
JCW
87257f26c5 Add XRPL_RETIRE_FIX and XRPL_RETIRE_FEATURE
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
2025-11-07 16:23:22 +00:00
3 changed files with 79 additions and 56 deletions

View File

@@ -78,12 +78,15 @@ namespace detail {
#undef XRPL_FEATURE #undef XRPL_FEATURE
#pragma push_macro("XRPL_FIX") #pragma push_macro("XRPL_FIX")
#undef XRPL_FIX #undef XRPL_FIX
#pragma push_macro("XRPL_RETIRE") #pragma push_macro("XRPL_RETIRE_FEATURE")
#undef XRPL_RETIRE #undef XRPL_RETIRE_FEATURE
#pragma push_macro("XRPL_RETIRE_FIX")
#undef XRPL_RETIRE_FIX
#define XRPL_FEATURE(name, supported, vote) +1 #define XRPL_FEATURE(name, supported, vote) +1
#define XRPL_FIX(name, supported, vote) +1 #define XRPL_FIX(name, supported, vote) +1
#define XRPL_RETIRE(name) +1 #define XRPL_RETIRE_FEATURE(name) +1
#define XRPL_RETIRE_FIX(name) +1
// This value SHOULD be equal to the number of amendments registered in // This value SHOULD be equal to the number of amendments registered in
// Feature.cpp. Because it's only used to reserve storage, and determine how // Feature.cpp. Because it's only used to reserve storage, and determine how
@@ -94,8 +97,10 @@ static constexpr std::size_t numFeatures =
#include <xrpl/protocol/detail/features.macro> #include <xrpl/protocol/detail/features.macro>
); );
#undef XRPL_RETIRE #undef XRPL_RETIRE_FEATURE
#pragma pop_macro("XRPL_RETIRE") #pragma pop_macro("XRPL_RETIRE_FEATURE")
#undef XRPL_RETIRE_FIX
#pragma pop_macro("XRPL_RETIRE_FIX")
#undef XRPL_FIX #undef XRPL_FIX
#pragma pop_macro("XRPL_FIX") #pragma pop_macro("XRPL_FIX")
#undef XRPL_FEATURE #undef XRPL_FEATURE
@@ -339,17 +344,22 @@ foreachFeature(FeatureBitset bs, F&& f)
#undef XRPL_FEATURE #undef XRPL_FEATURE
#pragma push_macro("XRPL_FIX") #pragma push_macro("XRPL_FIX")
#undef XRPL_FIX #undef XRPL_FIX
#pragma push_macro("XRPL_RETIRE") #pragma push_macro("XRPL_RETIRE_FEATURE")
#undef XRPL_RETIRE #undef XRPL_RETIRE_FEATURE
#pragma push_macro("XRPL_RETIRE_FIX")
#undef XRPL_RETIRE_FIX
#define XRPL_FEATURE(name, supported, vote) extern uint256 const feature##name; #define XRPL_FEATURE(name, supported, vote) extern uint256 const feature##name;
#define XRPL_FIX(name, supported, vote) extern uint256 const fix##name; #define XRPL_FIX(name, supported, vote) extern uint256 const fix##name;
#define XRPL_RETIRE(name) #define XRPL_RETIRE_FEATURE(name)
#define XRPL_RETIRE_FIX(name)
#include <xrpl/protocol/detail/features.macro> #include <xrpl/protocol/detail/features.macro>
#undef XRPL_RETIRE #undef XRPL_RETIRE_FEATURE
#pragma pop_macro("XRPL_RETIRE") #pragma pop_macro("XRPL_RETIRE_FEATURE")
#undef XRPL_RETIRE_FIX
#pragma pop_macro("XRPL_RETIRE_FIX")
#undef XRPL_FIX #undef XRPL_FIX
#pragma pop_macro("XRPL_FIX") #pragma pop_macro("XRPL_FIX")
#undef XRPL_FEATURE #undef XRPL_FEATURE

View File

@@ -4,8 +4,11 @@
#if !defined(XRPL_FIX) #if !defined(XRPL_FIX)
#error "undefined macro: XRPL_FIX" #error "undefined macro: XRPL_FIX"
#endif #endif
#if !defined(XRPL_RETIRE) #if !defined(XRPL_RETIRE_FEATURE)
#error "undefined macro: XRPL_RETIRE" #error "undefined macro: XRPL_RETIRE_FEATURE"
#endif
#if !defined(XRPL_RETIRE_FIX)
#error "undefined macro: XRPL_RETIRE_FIX"
#endif #endif
// Add new amendments to the top of this list. // Add new amendments to the top of this list.
@@ -95,40 +98,41 @@ XRPL_FEATURE(CryptoConditionsSuite, Supported::yes, VoteBehavior::Obsolete)
// must be registered either here or above with the "active" amendments // must be registered either here or above with the "active" amendments
// //
// Please keep this list sorted alphabetically for convenience. // Please keep this list sorted alphabetically for convenience.
XRPL_RETIRE(fix1201) XRPL_RETIRE_FIX(1201)
XRPL_RETIRE(fix1368) XRPL_RETIRE_FIX(1368)
XRPL_RETIRE(fix1373) XRPL_RETIRE_FIX(1373)
XRPL_RETIRE(fix1512) XRPL_RETIRE_FIX(1512)
XRPL_RETIRE(fix1513) XRPL_RETIRE_FIX(1513)
XRPL_RETIRE(fix1515) XRPL_RETIRE_FIX(1515)
XRPL_RETIRE(fix1523) XRPL_RETIRE_FIX(1523)
XRPL_RETIRE(fix1528) XRPL_RETIRE_FIX(1528)
XRPL_RETIRE(fix1543) XRPL_RETIRE_FIX(1543)
XRPL_RETIRE(fix1571) XRPL_RETIRE_FIX(1571)
XRPL_RETIRE(fix1578) XRPL_RETIRE_FIX(1578)
XRPL_RETIRE(fix1623) XRPL_RETIRE_FIX(1623)
XRPL_RETIRE(fix1781) XRPL_RETIRE_FIX(1781)
XRPL_RETIRE(fixAmendmentMajorityCalc) XRPL_RETIRE_FIX(AmendmentMajorityCalc)
XRPL_RETIRE(fixCheckThreading) XRPL_RETIRE_FIX(CheckThreading)
XRPL_RETIRE(fixNonFungibleTokensV1_2) XRPL_RETIRE_FIX(NonFungibleTokensV1_2)
XRPL_RETIRE(fixNFTokenRemint) XRPL_RETIRE_FIX(NFTokenRemint)
XRPL_RETIRE(fixMasterKeyAsRegularKey) XRPL_RETIRE_FIX(MasterKeyAsRegularKey)
XRPL_RETIRE(fixQualityUpperBound) XRPL_RETIRE_FIX(QualityUpperBound)
XRPL_RETIRE(fixReducedOffersV1) XRPL_RETIRE_FIX(ReducedOffersV1)
XRPL_RETIRE(fixRmSmallIncreasedQOffers) XRPL_RETIRE_FIX(RmSmallIncreasedQOffers)
XRPL_RETIRE(fixSTAmountCanonicalize) XRPL_RETIRE_FIX(STAmountCanonicalize)
XRPL_RETIRE(fixTakerDryOfferRemoval) XRPL_RETIRE_FIX(TakerDryOfferRemoval)
XRPL_RETIRE(fixTrustLinesToSelf) XRPL_RETIRE_FIX(TrustLinesToSelf)
XRPL_RETIRE(CryptoConditions)
XRPL_RETIRE(Escrow) XRPL_RETIRE_FEATURE(CryptoConditions)
XRPL_RETIRE(EnforceInvariants) XRPL_RETIRE_FEATURE(Escrow)
XRPL_RETIRE(FeeEscalation) XRPL_RETIRE_FEATURE(EnforceInvariants)
XRPL_RETIRE(FlowCross) XRPL_RETIRE_FEATURE(FeeEscalation)
XRPL_RETIRE(HardenedValidations) XRPL_RETIRE_FEATURE(FlowCross)
XRPL_RETIRE(ImmediateOfferKilled) XRPL_RETIRE_FEATURE(HardenedValidations)
XRPL_RETIRE(MultiSign) XRPL_RETIRE_FEATURE(ImmediateOfferKilled)
XRPL_RETIRE(NonFungibleTokensV1_1) XRPL_RETIRE_FEATURE(MultiSign)
XRPL_RETIRE(PayChan) XRPL_RETIRE_FEATURE(NonFungibleTokensV1_1)
XRPL_RETIRE(SortedDirectories) XRPL_RETIRE_FEATURE(PayChan)
XRPL_RETIRE(TickSize) XRPL_RETIRE_FEATURE(SortedDirectories)
XRPL_RETIRE(TrustSetAuth) XRPL_RETIRE_FEATURE(TickSize)
XRPL_RETIRE_FEATURE(TrustSetAuth)

View File

@@ -411,8 +411,10 @@ featureToName(uint256 const& f)
#undef XRPL_FEATURE #undef XRPL_FEATURE
#pragma push_macro("XRPL_FIX") #pragma push_macro("XRPL_FIX")
#undef XRPL_FIX #undef XRPL_FIX
#pragma push_macro("XRPL_RETIRE") #pragma push_macro("XRPL_RETIRE_FEATURE")
#undef XRPL_RETIRE #undef XRPL_RETIRE_FEATURE
#pragma push_macro("XRPL_RETIRE_FIX")
#undef XRPL_RETIRE_FIX
#define XRPL_FEATURE(name, supported, vote) \ #define XRPL_FEATURE(name, supported, vote) \
uint256 const feature##name = registerFeature(#name, supported, vote); uint256 const feature##name = registerFeature(#name, supported, vote);
@@ -420,16 +422,23 @@ featureToName(uint256 const& f)
uint256 const fix##name = registerFeature("fix" #name, supported, vote); uint256 const fix##name = registerFeature("fix" #name, supported, vote);
// clang-format off // clang-format off
#define XRPL_RETIRE(name) \ #define XRPL_RETIRE_FEATURE(name) \
[[deprecated("The referenced amendment has been retired")]] \ [[deprecated("The referenced amendment has been retired")]] \
[[maybe_unused]] \ [[maybe_unused]] \
uint256 const retired##name = retireFeature(#name); uint256 const retired##name = retireFeature(#name);
#define XRPL_RETIRE_FIX(name) \
[[deprecated("The referenced amendment has been retired")]] \
[[maybe_unused]] \
uint256 const retiredFix##name = retireFeature("fix" #name);
// clang-format on // clang-format on
#include <xrpl/protocol/detail/features.macro> #include <xrpl/protocol/detail/features.macro>
#undef XRPL_RETIRE #undef XRPL_RETIRE_FEATURE
#pragma pop_macro("XRPL_RETIRE") #pragma pop_macro("XRPL_RETIRE_FEATURE")
#undef XRPL_RETIRE_FIX
#pragma pop_macro("XRPL_RETIRE_FIX")
#undef XRPL_FIX #undef XRPL_FIX
#pragma pop_macro("XRPL_FIX") #pragma pop_macro("XRPL_FIX")
#undef XRPL_FEATURE #undef XRPL_FEATURE