feat: Export ledger name spaces via server_definitions#7823
Closed
dangell7 wants to merge 1 commit into
Closed
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7823 +/- ##
=======================================
Coverage 82.5% 82.5%
=======================================
Files 1039 1040 +1
Lines 80446 80487 +41
Branches 9080 9080
=======================================
+ Hits 66332 66369 +37
- Misses 14105 14109 +4
Partials 9 9
🚀 New features to boost your workflow:
|
dangell7
force-pushed
the
dangell7/export-ledger-name-spaces
branch
from
July 17, 2026 01:11
429bf64 to
c7bfd6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
Adds a
LEDGER_NAME_SPACESsection to theserver_definitionsRPC response. It exports the name → value map of theLedgerNameSpacetagged-hash prefixes so clients can compute keylets offline instead of hard-coding the ASCII prefixes or round-tripping to a server.Context of Change
Clients that want to derive ledger object indexes (keylets) locally need the type-specific prefixes used in the tagged hashing. Today those only exist as a private enum in
Indexes.cpp, so every client library carries its own copy and has to chase new amendments by hand.server_definitionsalready exports fields, ledger entry types, transaction types, etc. for exactly this reason — this just extends it to name spaces.The enum moves from
Indexes.cppintoIndexes.hand is generated from a single X-macro list (detail/ledger_name_spaces.macro). The same list co-generatesledgerNameSpaceMap(), so the enum and the exported map cannot drift — adding a name space in one place updates both. Deprecated name spaces (Contract,Generator,Nickname) stay in the list to reserve their values but are intentionally NOT exported, since keylets should never be computed for retired spaces.The alternative was exporting a hand-written map next to the enum, but that's two lists to keep in sync and the whole point is to stop copies drifting.
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)