Stellar XDR Changes and Support for Feature Flags #1896
leighmcculloch
started this conversation in
General Discussion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
The way that the
currandnextbranches of stellar/stellar-xdr get produced is changing.However, if you consume the
currornextbranch, nothing is changing for you. Thecurrandnextbranches will continue to exist and work as they do today.What's Changing
Today development and changes to the XDR happens directly on the
currandnextbranches. For direct development thecurrandnextbranches are being replaced by themainbranch, which will use feature flags with#ifdef...#else...#endifC pre-processor compatible directives in the.xfiles to gate any features for the next protocol.The
currbranch will be code generated from themainbranch through the preprocessor with a final feature set for the current protocol.The
nextbranch will be code generated from themainbranch through the preprocessor with an all-features-enabled feature set.Example
Here's what this will look like in practice for
.xfiles onmain:currIf feature
XDR_TRANSACTION_META_V5is not yet included in the final feature set for the current protocol, thecurrbranch can be expected to contain:nextThe
nextbranch will always have all features on and can be expected to contain:Why
Today, two independently-maintained versions of the XDR definitions are maintained under the
currandnextbranches of the stellar/stellar-xdr repository. Some projects, such as stellar/stellar-core and stellar/rs-stellar-xdr, consume both of these, and some projects, such as stellar/go-stellar-sdk, stellar/stellar-rpc, and stellar/stellar-horizon consume one or the other depending on the phase of development, but most other projects consume onlycurr.We've been experimenting with this new approach to:
nextindependent XDR changes. To allow projects to adopt and then release a subset of upcoming XDR changes. To reduce coordination across products during protocol development. To allow longer lived experiments to share XDR without upcoming protocol releases needing to navigate them.What This Means if You Use
currNothing. Continue to consume the
currbranch.What This Means if You Use
nextTooling that consumes the
nextbranch can continue to consume thenextbranch as it will be code generated from themainbranch with all features enabled. Alternatively, tooling can transition to consuming themainbranch directly and either handling the #ifdef directives in their XDR code generator, or pre-process them using the tool below.We plan to transition stellar/rs-stellar-xdr and stellar/stellar-core to pass through feature flags so they can be built with a subset of upcoming XDR. This is a work-in-progress that is only just beginning, so exactly what that will look like, and how granular those feature flags are, is still being worked out.
To support tooling that doesn't understand
#ifdefdirectives, the stellar-xdr CLI (embedded in stellar-cli under thexdrsub-command) will be getting a new utility to pre-process.xfiles given a desired feature set.Caveats
This work is a work-in-progress and may change and adapt as it takes place, as well as feedback is heard. We'll keep this thread updated with any changes that diverge significantly from this. Subscribe to follow.
Beta Was this translation helpful? Give feedback.
All reactions