Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e736965
first stab
mvadari Jun 8, 2025
c91afc0
move server_definitions to new file
mvadari Aug 16, 2025
491c6ec
move AccountSet to app
mvadari Aug 16, 2025
acac1c9
[WIP] flags
mvadari Aug 16, 2025
97a2912
finish flags
mvadari Aug 17, 2025
945c5fd
clean up
mvadari Aug 17, 2025
7c4d63b
add universal flags
mvadari Aug 17, 2025
34fdea9
split out common fields
mvadari Aug 17, 2025
a8b0043
Merge remote-tracking branch 'upstream/develop' into server_definitions2
mvadari Aug 18, 2025
cbecdb2
fix flags
mvadari Aug 19, 2025
38a29ab
fix flags
mvadari Aug 19, 2025
034198e
Merge branch 'develop' into server_definitions2
mvadari Aug 19, 2025
fa0d5a6
Merge remote-tracking branch 'upstream/develop' into server_definitions2
mvadari Aug 22, 2025
09ec4ef
Merge branch 'develop' into server_definitions2
mvadari Aug 22, 2025
85b015b
Merge branch 'develop' into server_definitions2
mvadari Aug 25, 2025
b84a348
Merge branch 'develop' into server_definitions2
mvadari Oct 13, 2025
edb04af
add lsf flags
mvadari Oct 20, 2025
7a4d423
Merge branch 'develop' into server_definitions2
mvadari Oct 21, 2025
3e1661b
Merge branch 'develop' into server_definitions2
mvadari Nov 3, 2025
b51292b
Merge branch 'develop' into server_definitions2
mvadari Nov 5, 2025
e5d6f02
Merge branch 'develop' into server_definitions2
mvadari Nov 18, 2025
de9777d
match spec
mvadari Nov 21, 2025
cf9b68c
Merge branch 'develop' into server_definitions2
mvadari Dec 2, 2025
7753f93
fix build issue
mvadari Dec 2, 2025
7e7f497
Merge branch 'develop' into server_definitions2
mvadari Dec 11, 2025
571950d
Merge branch 'develop' into server_definitions2
mvadari Jan 7, 2026
a2c0fdc
Merge branch 'develop' into server_definitions2
mvadari Jan 7, 2026
1e4596d
Merge branch 'develop' into server_definitions2
mvadari Jan 26, 2026
70ff709
Merge commit '92046785d1fea5f9efe5a770d636792ea6cab78b' into server_d…
mvadari Jan 28, 2026
498d533
Merge branch 'develop' into server_definitions2
mvadari Jan 28, 2026
0d57f57
Merge branch 'develop' into server_definitions2
godexsoft Feb 3, 2026
5a8748a
Add tests for updated server_definitions
godexsoft Feb 3, 2026
1a97d9c
Merge branch 'develop' into feature/flags-server-definitions
godexsoft Feb 3, 2026
cb74a25
Trigger ci
godexsoft Feb 3, 2026
b7db360
Remove todo and add include
godexsoft Feb 4, 2026
93bb55f
Fix include
godexsoft Feb 4, 2026
af8e903
Cleanup
godexsoft Feb 5, 2026
1707ef6
Fix formatting
godexsoft Feb 5, 2026
378aa4e
Merge branch 'develop' into feature/flags-server-definitions
godexsoft Feb 5, 2026
ae47880
Merge branch 'develop' into feature/flags-server-definitions
godexsoft Feb 5, 2026
a457fb7
Use universal instead of Universal
godexsoft Feb 6, 2026
2c33afc
Remove total size checks to avoid having to update everytime we add n…
godexsoft Feb 6, 2026
458651f
Replace initializer_list with vector where applicable
godexsoft Feb 6, 2026
1617a24
Modernize a bit
godexsoft Feb 7, 2026
11b0d53
Fix simple review comments
godexsoft Feb 9, 2026
4684bb1
Add test for batch mask
godexsoft Feb 9, 2026
cd65cb3
Fix batch mask via XMACRO
godexsoft Feb 9, 2026
49ea46d
Merge branch 'develop' into feature/flags-server-definitions
godexsoft Feb 9, 2026
63c2325
Add suggestions from review
godexsoft Feb 13, 2026
cedda9d
Merge branch 'feature/flags-server-definitions' of github.com:godexso…
godexsoft Feb 13, 2026
84ff4b6
Merge branch 'develop' into feature/flags-server-definitions
godexsoft Feb 13, 2026
d3fe934
Fix suggestion from review
godexsoft Feb 20, 2026
88e9ff9
Merge develop
godexsoft Feb 20, 2026
7c392be
Fix ODR violation and SIOF
godexsoft Feb 20, 2026
bdd534a
Merge branch 'develop' into feature/flags-server-definitions
ximinez Feb 25, 2026
655cfd3
Fix review comments
godexsoft Feb 26, 2026
80afdd9
Add note about reflection
godexsoft Mar 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions API-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ API version 2 is available in `rippled` version 2.0.0 and later. See [API-VERSIO

This version is supported by all `rippled` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified.

## XRP Ledger server version 3.2.0

[Version 3.2.0](https://github.com/XRPLF/rippled/releases/tag/3.2.0)

### Additions in 3.2.0

- `server_definitions`: Added the following new sections to the response ([#6321](https://github.com/XRPLF/rippled/pull/6321)):
Comment on lines +25 to +31
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new changelog entry for "XRP Ledger server version 3.2.0" doesn’t include a release date, while the surrounding entries do. Please either add the release date (if known) or adjust the heading/link text to match the established format used in this file for unreleased/new versions.

Copilot uses AI. Check for mistakes.
- `TRANSACTION_FORMATS`: Describes the fields and their optionality for each transaction type, including common fields shared across all transactions.
- `LEDGER_ENTRY_FORMATS`: Describes the fields and their optionality for each ledger entry type, including common fields shared across all ledger entries.
- `TRANSACTION_FLAGS`: Maps transaction type names to their supported flags and flag values.
- `LEDGER_ENTRY_FLAGS`: Maps ledger entry type names to their flags and flag values.
- `ACCOUNT_SET_FLAGS`: Maps AccountSet flag names (asf flags) to their numeric values.

## XRP Ledger server version 3.1.0

[Version 3.1.0](https://github.com/XRPLF/rippled/releases/tag/3.1.0) was released on Jan 27, 2026.
Expand Down
18 changes: 10 additions & 8 deletions include/xrpl/protocol/KnownFormats.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ class KnownFormats
Item(
char const* name,
KeyType type,
std::initializer_list<SOElement> uniqueFields,
std::initializer_list<SOElement> commonFields)
: soTemplate_(uniqueFields, commonFields), name_(name), type_(type)
std::vector<SOElement> uniqueFields,
std::vector<SOElement> commonFields)
: soTemplate_(std::move(uniqueFields), std::move(commonFields))
, name_(name)
, type_(type)
{
// Verify that KeyType is appropriate.
static_assert(
Expand Down Expand Up @@ -142,16 +144,16 @@ class KnownFormats

@param name The name of this format.
@param type The type of this format.
@param uniqueFields An std::initializer_list of unique fields
@param commonFields An std::initializer_list of common fields
@param uniqueFields A std::vector of unique fields
@param commonFields A std::vector of common fields

@return The created format.
*/
Item const&
add(char const* name,
KeyType type,
std::initializer_list<SOElement> uniqueFields,
std::initializer_list<SOElement> commonFields = {})
std::vector<SOElement> uniqueFields,
std::vector<SOElement> commonFields = {})
{
if (auto const item = findByType(type))
{
Expand All @@ -160,7 +162,7 @@ class KnownFormats
item->getName());
}

formats_.emplace_front(name, type, uniqueFields, commonFields);
formats_.emplace_front(name, type, std::move(uniqueFields), std::move(commonFields));
Item const& item{formats_.front()};

names_[name] = &item;
Expand Down
329 changes: 206 additions & 123 deletions include/xrpl/protocol/LedgerFormats.h

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions include/xrpl/protocol/SOTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <functional>
#include <initializer_list>
#include <stdexcept>
#include <vector>

namespace xrpl {

Expand Down Expand Up @@ -97,8 +98,12 @@ class SOTemplate
operator=(SOTemplate&& other) = default;

/** Create a template populated with all fields.
After creating the template fields cannot be
added, modified, or removed.
After creating the template fields cannot be added, modified, or removed.
*/
SOTemplate(std::vector<SOElement> uniqueFields, std::vector<SOElement> commonFields = {});

/** Create a template populated with all fields.
Note: Defers to the vector constructor above.
*/
SOTemplate(
std::initializer_list<SOElement> uniqueFields,
Expand Down
668 changes: 409 additions & 259 deletions include/xrpl/protocol/TxFlags.h

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions include/xrpl/protocol/TxFormats.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <xrpl/protocol/KnownFormats.h>

#include <vector>

namespace xrpl {

/** Transaction type identifiers.
Expand Down Expand Up @@ -73,6 +75,9 @@ class TxFormats : public KnownFormats<TxType, TxFormats>
public:
static TxFormats const&
getInstance();

static std::vector<SOElement> const&
getCommonFields();
};

} // namespace xrpl
7 changes: 7 additions & 0 deletions include/xrpl/protocol/jss.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace jss {
JSS(AL_size); // out: GetCounts
JSS(AL_hit_rate); // out: GetCounts
JSS(AcceptedCredentials); // out: AccountObjects
JSS(ACCOUNT_SET_FLAGS); // out: RPC server_definitions
JSS(Account); // in: TransactionSign; field.
JSS(AMMID); // field
JSS(Amount); // in: TransactionSign; field.
Expand Down Expand Up @@ -187,6 +188,7 @@ JSS(closed_ledger); // out: NetworkOPs
JSS(cluster); // out: PeerImp
JSS(code); // out: errors
JSS(command); // in: RPCHandler
JSS(common); // out: RPC server_definitions
JSS(complete); // out: NetworkOPs, InboundLedger
JSS(complete_ledgers); // out: NetworkOPs, PeerImp
JSS(consensus); // out: NetworkOPs, LedgerConsensus
Expand Down Expand Up @@ -356,6 +358,8 @@ JSS(ledger_min); // in, out: AccountTx*
JSS(ledger_time); // out: NetworkOPs
JSS(LEDGER_ENTRY_TYPES); // out: RPC server_definitions
// matches definitions.json format
JSS(LEDGER_ENTRY_FLAGS); // out: RPC server_definitions
JSS(LEDGER_ENTRY_FORMATS); // out: RPC server_definitions
JSS(levels); // LogLevels
JSS(limit); // in/out: AccountTx*, AccountOffers,
// AccountLines, AccountObjects
Expand Down Expand Up @@ -457,6 +461,7 @@ JSS(open); // out: handlers/Ledger
JSS(open_ledger_cost); // out: SubmitTransaction
JSS(open_ledger_fee); // out: TxQ
JSS(open_ledger_level); // out: TxQ
JSS(optionality); // out: server_definitions
JSS(oracles); // in: get_aggregate_price
JSS(oracle_document_id); // in: get_aggregate_price
JSS(owner); // in: LedgerEntry, out: NetworkOPs
Expand Down Expand Up @@ -616,6 +621,8 @@ JSS(TRANSACTION_RESULTS); // out: RPC server_definitions
// matches definitions.json format
JSS(TRANSACTION_TYPES); // out: RPC server_definitions
// matches definitions.json format
JSS(TRANSACTION_FLAGS); // out: RPC server_definitions
JSS(TRANSACTION_FORMATS); // out: RPC server_definitions
JSS(TYPES); // out: RPC server_definitions
// matches definitions.json format
JSS(transfer_rate); // out: nft_info (clio)
Expand Down
3 changes: 0 additions & 3 deletions include/xrpl/tx/transactors/Clawback.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ class Clawback : public Transactor
{
}

static std::uint32_t
getFlagsMask(PreflightContext const& ctx);

static NotTEC
preflight(PreflightContext const& ctx);

Expand Down
3 changes: 0 additions & 3 deletions include/xrpl/tx/transactors/MPT/MPTokenIssuanceDestroy.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ class MPTokenIssuanceDestroy : public Transactor
{
}

static std::uint32_t
getFlagsMask(PreflightContext const& ctx);

static NotTEC
preflight(PreflightContext const& ctx);

Expand Down
3 changes: 0 additions & 3 deletions include/xrpl/tx/transactors/NFT/NFTokenAcceptOffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ class NFTokenAcceptOffer : public Transactor
{
}

static std::uint32_t
getFlagsMask(PreflightContext const& ctx);

static NotTEC
preflight(PreflightContext const& ctx);

Expand Down
3 changes: 0 additions & 3 deletions include/xrpl/tx/transactors/NFT/NFTokenCancelOffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ class NFTokenCancelOffer : public Transactor
{
}

static std::uint32_t
getFlagsMask(PreflightContext const& ctx);

static NotTEC
preflight(PreflightContext const& ctx);

Expand Down
14 changes: 9 additions & 5 deletions src/libxrpl/protocol/LedgerFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@
#include <xrpl/protocol/SOTemplate.h>
#include <xrpl/protocol/jss.h>

#include <initializer_list>
#include <vector>

namespace xrpl {

LedgerFormats::LedgerFormats()
std::vector<SOElement> const&
LedgerFormats::getCommonFields()
{
// Fields shared by all ledger formats:
static std::initializer_list<SOElement> const commonFields{
static auto const commonFields = std::vector<SOElement>{
{sfLedgerIndex, soeOPTIONAL},
{sfLedgerEntryType, soeREQUIRED},
{sfFlags, soeREQUIRED},
};
return commonFields;
}

LedgerFormats::LedgerFormats()
{
#pragma push_macro("UNWRAP")
#undef UNWRAP
#pragma push_macro("LEDGER_ENTRY")
#undef LEDGER_ENTRY

#define UNWRAP(...) __VA_ARGS__
#define LEDGER_ENTRY(tag, value, name, rpcName, fields) \
add(jss::name, tag, UNWRAP fields, commonFields);
add(jss::name, tag, UNWRAP fields, getCommonFields());

#include <xrpl/protocol/detail/ledger_entries.macro>

Expand Down
15 changes: 12 additions & 3 deletions src/libxrpl/protocol/SOTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,32 @@
#include <xrpl/protocol/SField.h>
#include <xrpl/protocol/SOTemplate.h>

#include <algorithm>
#include <cstddef>
#include <initializer_list>
#include <iterator>
#include <stdexcept>
#include <vector>

namespace xrpl {

SOTemplate::SOTemplate(
std::initializer_list<SOElement> uniqueFields,
std::initializer_list<SOElement> commonFields)
: SOTemplate(std::vector(uniqueFields), std::vector(commonFields))
{
}

SOTemplate::SOTemplate(std::vector<SOElement> uniqueFields, std::vector<SOElement> commonFields)
: indices_(SField::getNumFields() + 1, -1) // Unmapped indices == -1
{
// Add all SOElements.
elements_.reserve(uniqueFields.size() + commonFields.size());
elements_.assign(uniqueFields);
elements_.insert(elements_.end(), commonFields);
//
elements_ = std::move(uniqueFields);
std::ranges::move(commonFields, std::back_inserter(elements_));

// Validate and index elements_.
//
for (std::size_t i = 0; i < elements_.size(); ++i)
{
SField const& sField{elements_[i].sField()};
Expand Down
14 changes: 9 additions & 5 deletions src/libxrpl/protocol/TxFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
#include <xrpl/protocol/TxFormats.h>
#include <xrpl/protocol/jss.h>

#include <initializer_list>
#include <vector>

namespace xrpl {

TxFormats::TxFormats()
std::vector<SOElement> const&
TxFormats::getCommonFields()
{
// Fields shared by all txFormats:
static std::initializer_list<SOElement> const commonFields{
static auto const commonFields = std::vector<SOElement>{
{sfTransactionType, soeREQUIRED},
{sfFlags, soeOPTIONAL},
{sfSourceTag, soeOPTIONAL},
Expand All @@ -29,15 +29,19 @@ TxFormats::TxFormats()
{sfNetworkID, soeOPTIONAL},
{sfDelegate, soeOPTIONAL},
};
return commonFields;
}

TxFormats::TxFormats()
{
#pragma push_macro("UNWRAP")
#undef UNWRAP
#pragma push_macro("TRANSACTION")
#undef TRANSACTION

#define UNWRAP(...) __VA_ARGS__
#define TRANSACTION(tag, value, name, delegable, amendment, privileges, fields) \
add(jss::name, tag, UNWRAP fields, commonFields);
add(jss::name, tag, UNWRAP fields, getCommonFields());

#include <xrpl/protocol/detail/transactions.macro>

Expand Down
2 changes: 1 addition & 1 deletion src/libxrpl/tx/transactors/AMM/AMMDeposit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ std::uint32_t
AMMDeposit::getFlagsMask(PreflightContext const& ctx)

{
return tfDepositMask;
return tfAMMDepositMask;
}

NotTEC
Expand Down
2 changes: 1 addition & 1 deletion src/libxrpl/tx/transactors/AMM/AMMWithdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AMMWithdraw::checkExtraFeatures(PreflightContext const& ctx)
std::uint32_t
AMMWithdraw::getFlagsMask(PreflightContext const& ctx)
{
return tfWithdrawMask;
return tfAMMWithdrawMask;
}

NotTEC
Expand Down
6 changes: 3 additions & 3 deletions src/libxrpl/tx/transactors/Change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ NotTEC
Transactor::invokePreflight<Change>(PreflightContext const& ctx)
{
// 0 means "Allow any flags"
// The check for tfChangeMask is gated by LendingProtocol because that
// feature introduced this parameter, and it's not worth adding another
// The check for tfEnableAmendmentMask is gated by LendingProtocol because
// that feature introduced this parameter, and it's not worth adding another
// amendment just for this.
if (auto const ret =
preflight0(ctx, ctx.rules.enabled(featureLendingProtocol) ? tfChangeMask : 0))
preflight0(ctx, ctx.rules.enabled(featureLendingProtocol) ? tfEnableAmendmentMask : 0))
return ret;

auto account = ctx.tx.getAccountID(sfAccount);
Expand Down
6 changes: 0 additions & 6 deletions src/libxrpl/tx/transactors/Clawback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ preflightHelper<MPTIssue>(PreflightContext const& ctx)
return tesSUCCESS;
}

std::uint32_t
Clawback::getFlagsMask(PreflightContext const& ctx)
{
return tfClawbackMask;
}

NotTEC
Clawback::preflight(PreflightContext const& ctx)
{
Expand Down
6 changes: 0 additions & 6 deletions src/libxrpl/tx/transactors/MPT/MPTokenIssuanceDestroy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@

namespace xrpl {

std::uint32_t
MPTokenIssuanceDestroy::getFlagsMask(PreflightContext const& ctx)
{
return tfMPTokenIssuanceDestroyMask;
}

NotTEC
MPTokenIssuanceDestroy::preflight(PreflightContext const& ctx)
{
Expand Down
2 changes: 1 addition & 1 deletion src/libxrpl/tx/transactors/MPT/MPTokenIssuanceSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ MPTokenIssuanceSet::checkPermission(ReadView const& view, STTx const& tx)

// this is added in case more flags will be added for MPTokenIssuanceSet
// in the future. Currently unreachable.
if (txFlags & tfMPTokenIssuanceSetPermissionMask)
if (txFlags & tfMPTokenIssuanceSetMask)
return terNO_DELEGATE_PERMISSION; // LCOV_EXCL_LINE

std::unordered_set<GranularPermissionType> granularPermissions;
Expand Down
6 changes: 0 additions & 6 deletions src/libxrpl/tx/transactors/NFT/NFTokenAcceptOffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@

namespace xrpl {

std::uint32_t
NFTokenAcceptOffer::getFlagsMask(PreflightContext const& ctx)
{
return tfNFTokenAcceptOfferMask;
}

NotTEC
NFTokenAcceptOffer::preflight(PreflightContext const& ctx)
{
Expand Down
6 changes: 0 additions & 6 deletions src/libxrpl/tx/transactors/NFT/NFTokenCancelOffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@

namespace xrpl {

std::uint32_t
NFTokenCancelOffer::getFlagsMask(PreflightContext const& ctx)
{
return tfNFTokenCancelOfferMask;
}

NotTEC
NFTokenCancelOffer::preflight(PreflightContext const& ctx)
{
Expand Down
Loading
Loading