rippled
Loading...
Searching...
No Matches
How to add new features

Steps required to add new features to the code:

1) Add the appropriate XRPL_FEATURE or XRPL_FIX macro definition for the feature to features.macro with the feature's name, Supported::no, and VoteBehavior::DefaultNo.

2) Use the generated variable name as the parameter to view.rules.enabled() to control flow into new code that this feature limits. (featureName or fixName)

3) If the feature development is COMPLETE, and the feature is ready to be SUPPORTED, change the macro parameter in features.macro to Supported::yes.

4) In general, any newly supported amendments (Supported::yes) should have a VoteBehavior::DefaultNo indefinitely so that external governance can make the decision on when to activate it. High priority bug fixes can be an exception to this rule. In such cases, ensure the fix has been clearly communicated to the community using appropriate channels, then change the macro parameter in features.macro to VoteBehavior::DefaultYes. The communication process is beyond the scope of these instructions.

5) If a supported feature (Supported::yes) was ever in a released version, it can never be changed back to Supported::no, because it may still become enabled at any time. This would cause newer versions of rippled to become amendment blocked. Instead, to prevent newer versions from voting on the feature, use VoteBehavior::Obsolete. Obsolete features can not be voted for by any versions of rippled built with that setting, but will still work correctly if they get enabled. If a feature remains obsolete for long enough that all clients that could vote for it are amendment blocked, the feature can be removed from the code as if it was unsupported.

When a feature has been enabled for several years, the conditional code may be removed, and the feature "retired". To retire a feature:

1) MOVE the macro definition in features.macro to the "retired features" section at the end of the file, and change the macro to XRPL_RETIRE.

The feature must remain registered and supported indefinitely because it may exist in the Amendments object on ledger. There is no need to vote for it because there's nothing to vote for. If the feature definition is removed completely from the code, any instances running that code will get amendment blocked. Removing the feature from the ledger is beyond the scope of these instructions.