Adapt to CAP-0071 xdr#5233
Merged
Merged
Conversation
sisuresh
commented
Apr 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adapts Stellar Core’s build + Rust/C++ bridge to work with CAP-0071-style feature-gated XDR (via #ifdef in .x files) on a single stellar-xdr branch, and introduces protocol-27 Soroban plumbing for “next protocol” builds.
Changes:
- Add CAP-0071 build plumbing: propagate
CAP_0071to xdrc/C++ andcap_0071/nextCargo features, plus add protocol-27 Soroban host/module-cache support. - Rework XDR identity verification: canonicalize
.xfile hashes (strip#ifdef/#else/#endif+ whitespace) and add a C++↔Rust “enabled XDR features” comparison. - Update Rust bridge/version reporting to include XDR feature list and add a new p27 dep-tree expectation.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/util/ProtocolVersion.h | Adds protocol 27 and defines FIRST_PROTOCOL_CAP71 gated by CAP_0071. |
| src/rust/src/soroban_proto_any.rs | Refactors Soroban version info generation; now reports XDR pkg/git/base rev + features via per-proto helpers. |
| src/rust/src/soroban_proto_all.rs | Introduces p27 module (cfg next), switches soroban_curr to p27 in next builds, and wires p27 into dispatch. |
| src/rust/src/soroban_module_cache.rs | Adds a protocol-27 module cache and routes protocol 27 operations to it when enabled. |
| src/rust/src/dep-trees/p27-expect.txt | Adds expected dependency tree snapshot for the new p27 submodule. |
| src/rust/src/common.rs | Adjusts Rust-side XDR identity check to new stellar_quorum_analyzer XDR layout. |
| src/rust/src/bridge.rs | Extends SorobanVersionInfo with xdr_features for C++ consumption. |
| src/rust/Cargo.toml | Adds optional unified dependency for soroban-env-host-p27 and updates stellar-quorum-analyzer rev. |
| src/main/main.cpp | Updates/extends XDR identity checking with feature comparison and changes when the check runs. |
| src/Makefile.am | Removes protocol-next hashing path; adds CAP_0071 defines for xdrc, passes cap_0071 Cargo feature, and includes p27 in next builds. |
| hash-xdrs.sh | Changes hash generation to canonicalize by stripping ifdef blocks + whitespace. |
| docs/versioning-soroban.md | Updates documentation describing “next” build behavior with CAP feature-gated XDR. |
| configure.ac | Adds ENABLE_CAP_0071 automake conditional (currently tied to next-protocol builds). |
| common.mk | Removes protocol-next include path; adds -DCAP_0071 when enabled. |
| Cargo.lock | Updates lockfile for new/updated Rust dependencies. |
| .gitmodules | Removes protocol-next submodule, points protocol-curr/xdr at main, adds p27 Soroban submodule. |
Comments suppressed due to low confidence (1)
src/rust/src/soroban_proto_all.rs:1372
- This comment refers to a
soroban-vnextfeature, but this crate’s feature flag is namednext(and that’s what the build system passes). Updating the comment would prevent confusion when diagnosing protocol/version mismatches.
// This check should be safe to keep. The feature soroban-vnext is passed
// through to soroban-env-host-p{NN}/next and so should enable protocol
// support for the next version simultaneously in core and soroban; and we
dmkozh
previously approved these changes
Apr 17, 2026
Contributor
dmkozh
left a comment
There was a problem hiding this comment.
Let's keep this as is for the time being, we can iterate on it further.
5e903c7 to
4c43c60
Compare
6 tasks
dmkozh
approved these changes
May 5, 2026
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.
Description
This is an alternative to #5214.
The differences -
CAP-0071is set if vnext is enabled. That can be added as a follow up if needed. A core build that has CAP-0071 support shouldn't break downstream systems that don't have support for CAP-0071 transactions, so the flags may not be as helpful. We can add it for the purpose of seeing how it'll flow through, but we may not learn much.FIRST_PROTOCOL_CAP71is introduced and the value is gated on if the CAP-0071 compile time flag is enabled. This is just an implementation detail and something we've discussed before. This lets us only guard the XDR changes with ifdefs, and not the protocol changes.Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)