Core Protocol Impact

← Back to Building an Amendments I: Lifecycle and Impact on Core Protocol


Introduction

The activation of an amendment has profound consequences on the XRPL protocol. Unlike simple software updates, an amendment modifies the fundamental rules that govern consensus, transaction validation, and ledger structure. These changes are irreversible and must be applied uniformly by all nodes on the network.

In this section, we will analyze the impact that an amendment like Subscriptions (XLS-0078) has on the core protocol: modifications to consensus rules, changes in transaction validation, compatibility considerations, and management of nodes that do not support an enabled amendment.

Understanding this impact is crucial for assessing the risks associated with an amendment and for planning deployment and migration strategies.


Modification of Consensus Rules

The Rules Object

The XRPL protocol encapsulates the set of active rules in a Rules object that is constructed for each ledger based on enabled amendments.

Conceptual structure:

class Rules {
private:
    // Set of all enabled amendments
    std::set<uint256> enabledAmendments_;

    // Pre-calculation of commonly used rules
    bool fixQualityUpperBound_;
    bool fixTrustLinesToSelf_;
    bool flowCross_;
    bool ownerPaysFee_;
    // ... etc for each impacting amendment

public:
    // Check if an amendment is enabled
    bool enabled(uint256 const& amendment) const {
        return enabledAmendments_.count(amendment) > 0;
    }

    // Quick accessors for specific rules
    bool fixQualityUpperBound() const { return fixQualityUpperBound_; }
    bool flowCross() const { return flowCross_; }
    // ... etc
};

Construction: The Rules object is constructed from the sfAmendments field of the ledger:

Impact of Subscriptions on Rules

When Subscriptions is enabled, several aspects of the protocol change:

1. New transaction types:

2. New ledger entry types:

3. New validation logic:


Changes in Transaction Validation

Validation Phases

Every XRPL transaction goes through several validation phases. Amendments can affect each of these phases.

1. Preflight: Basic syntactic validation (before applying to ledger)

2. Preclaim: Contextual validation (with ledger access but without modifying it)

3. DoApply: Actual application to ledger

Backward Compatibility

Before activation: ttSUBSCRIPTION_SET transactions submitted before Subscriptions activation are rejected with temDISABLED.

After activation: These transactions become valid and can be processed.

No backward compatibility for ledgers: A ledger built after activation potentially contains ltSUBSCRIPTION objects that would not exist in a pre-activation ledger. A node that does not support Subscriptions cannot correctly validate such a ledger.


Impact on Consensus

LedgerHash Calculation

The hash of a ledger is calculated from all its components, including:

  • The root hash of the accounts SHAMap

  • The root hash of the transactions SHAMap

  • The ledger index, close time, parent hash

  • The sfAmendments and sfMajorities fields

Importance: If two nodes apply different rules (one with Subscriptions, the other without), they will build different ledgers with different hashes, which will prevent consensus.

Consensus on Rules

XRPL consensus is not only about which transactions to include, but also about the rules to apply. All nodes must:

  1. Agree on the parent ledger

  2. Agree on transactions to include

  3. Agree on enabled amendments (rules to apply)

Protection mechanism: If a node does not support an enabled amendment, it enters "amendment blocked" mode and ceases to participate in consensus, thus avoiding building an invalid ledger.


Management of Unsupported Amendments

Detection of Unsupported Amendment

When an amendment is enabled, the system immediately checks if the node supports it:

Amendment Blocked Mode

When a node enters "amendment blocked" mode:

Consensus stopped: The node ceases to propose and validate ledgers

API still functional: The node can still:

  • Respond to RPC queries

  • Synchronize ledgers from peers

  • Provide historical data

But it cannot:

  • Propose new ledgers

  • Validate peer proposals

  • Submit new transactions to the network

Signaling via server_info:

Prior Warnings

The system warns operators before an unsupported amendment is activated:

firstUnsupportedExpected: If an unsupported amendment has reached majority, the system calculates when it will be activated and emits warnings.


Forward Compatibility: Anticipating Changes

Unsupported vs Obsolete

Unsupported: An amendment that this node does not recognize or for which it does not have implementation code.

Obsolete: A historical amendment that is no longer relevant but must remain in the code in case it was activated on a historical ledger.

Design for Forward Compatibility

rippled developers design code to anticipate future changes:

1. Tolerant parsing: Data structures ignore unknown fields rather than rejecting

2. Structure versioning: Some structures include version fields

3. Feature flags everywhere: Each new code explicitly checks amendments


Backward Compatibility: Supporting Old Ledgers

Historical Rules

Even after an amendment is enabled, nodes must be able to validate historical ledgers that date from before activation.

Reconstruction of historical Rules:

Retired Amendments

After an amendment has been active for at least 2 years, the pre-amendment code can be removed:

Marking in features.macro:

This indicates that:

  • Pre-amendment code has been removed

  • The identifier is deprecated

  • New ledgers always assume the amendment is active


Special Cases and Edge Cases

Simultaneous Activation of Multiple Amendments

It is possible that multiple amendments reach their activation period at the same flag ledger.

Application order: Pseudo-transactions are ordered deterministically by amendment hash:

Dependencies between amendments: Some amendments may depend on others. Code must manage these dependencies:

Conflicting Amendments

It is theoretically possible to create two amendments that modify the same logic in incompatible ways.

Prevention strategy:

  • Rigorous code review before release

  • Integration tests with all amendments enabled

  • Coordination between development teams

Management if conflict detected:

  • Validators must withdraw their vote for one of the conflicting amendments

  • Or a third corrective amendment must be developed

Network Partition During Activation

If the network partitions at the moment of amendment activation, two scenarios are possible:

1. Both partitions activate the amendment: No problem, they will converge when the partition is resolved.

2. One partition activates, the other doesn't: Partitions will build incompatible ledgers. When the partition is resolved, the minority partition must abandon its chain and adopt the majority partition's chain (normal consensus).


Migration Strategies

Progressive Deployment

Node operators can update their software before an amendment is activated:

Phase 1: Code release with the new amendment (e.g., rippled 1.12.0 with Subscriptions)

  • Nodes update but the amendment is not yet voted on

Phase 2: Validators begin voting

  • Amendment is supported but not yet enabled

  • Nodes not updated can still function

Phase 3: Amendment exceeds 80% and enters majority

  • 2 weeks notice for the last nodes not updated

Phase 4: Amendment activation

  • Nodes not updated are blocked

Read-Only Mode Nodes

Nodes that are not validators (simple fullhistory or API nodes) can choose to:

1. Update quickly: To continue following the network in real-time

2. Stay in historical mode: Serve only data up to the ledger preceding activation, and synchronize from other nodes for following ledgers without applying the rules themselves

3. Depend on other nodes: Relay requests to updated nodes


Impact on Third-Party Applications

Wallets and Exchanges

Applications that interact with XRPL must adapt their code when an amendment is activated:

New transactions: Support for ttSUBSCRIPTION_SET, ttSUBSCRIPTION_CLAIM, and ttSUBSCRIPTION_CANCEL in the UI

New fields: Parsing of fields sfAccount, sfDestination, sfDestinationTag, sfAmount, sfFrequency, sfNextPaymentTime, sfExpiration, etc.

New business logic: Management of recurring subscriptions (display, cancellation, claim, monitoring)

APIs and Libraries

Libraries like xrpl.js, xrpl-py must be updated to support new features:

Last updated