Files
rippled/include/xrpl/protocol
Ed Hennis 1cf85a5a8d Merge remote-tracking branch 'XRPLF/develop' into ximinez/fix-getledger
* XRPLF/develop: (99 commits)
  refactor: Clean up tec object deletion logic (6588)
  fix: Move AMMInvariant weakInvariantCheck logic into the transaction (7032)
  fix: Improve ValidAMM invariant (7295)
  feat: Remove clear mutable flags for DynamicMPT XLS-94 (7439)
  ci: Build and push docker images in forks too (7588)
  ci: [DEPENDABOT] bump actions/checkout from 6.0.3 to 7.0.0 (7585)
  fix: Ensure xrpld service directories exist at startup (7565)
  fix: Use template for granular delegation permissions (6613)
  docs: Fix some comments to improve readability (7405)
  ci: Disable assertions on Release builds (7443)
  build: Add graphviz to Nix images (7566)
  refactor: Rerevert "Explicitly trim the heap after cache sweeps (6022)"
  release: Bump version to 3.3.0-b0
  ci: Make clang-tidy workflow adjustments to stay in sync with Clio (7563)
  build: Add git-lfs to Nix images (7561)
  build: Add zip to Nix images (7551)
  docs: Rewrite build environment docs (7533)
  release: Bump version to 3.2.0
  ci: [DEPENDABOT] bump codecov/codecov-action from 6.0.1 to 7.0.0 (7426)
  release: Bump version to 3.2.0-rc6
  ...
2026-06-22 17:30:27 -04:00
..
2026-06-09 17:36:17 +00:00
2026-06-09 17:36:17 +00:00

protocol

Classes and functions for handling data and values associated with the XRP Ledger protocol.

Serialized Objects

Objects transmitted over the network must be serialized into a canonical format. The prefix "ST" refers to classes that deal with the serialized format.

The term "Tx" or "tx" is an abbreviation for "Transaction", a commonly occurring object type.

Optional Fields

Our serialized fields have some "type magic" to make optional fields easier to read:

  • The operation x[sfFoo] means "return the value of 'Foo' if it exists, or the default value if it doesn't."
  • The operation x[~sfFoo] means "return the value of 'Foo' if it exists, or nothing if it doesn't." This usage of the tilde/bitwise NOT operator is not standard outside of the xrpld codebase.
    • As a consequence of this, x[~sfFoo] = y[~sfFoo] assigns the value of Foo from y to x, including omitting Foo from x if it doesn't exist in y.

Typically, for things that are guaranteed to exist, you use x[sfFoo] and avoid having to deal with a container that may or may not hold a value. For things not guaranteed to exist, you use x[~sfFoo] because you want such a container. It avoids having to look something up twice, once just to see if it exists and a second time to get/set its value. (Real example)

The source of this "type magic" is in SField.h.