Skip to content

Protocol 27 (CAP-0071) XDR - #5945

Merged
Shaptic merged 6 commits into
stellar:protocol-nextfrom
sisuresh:cap-0083-xdr
Jun 5, 2026
Merged

Protocol 27 (CAP-0071) XDR#5945
Shaptic merged 6 commits into
stellar:protocol-nextfrom
sisuresh:cap-0083-xdr

Conversation

@sisuresh

Copy link
Copy Markdown
Contributor

SPIKE — exploratory, not intended to merge as-is.

This branch was used to stand up an end-to-end Stellar Quickstart test of CAP-0083 ("Allow validators to vote to skip the current ledger", stellar-core PR #5209), together with CAP-0071. It carries the downstream changes required so a custom quickstart image (CAP-83 stellar-core + this component) runs at protocol 27 and handles CAP-83 skip ledgers (STELLAR_VALUE_EMPTY_TX_SET).

Rebased on main; opened against protocol-next.

go-stellar-sdk

  • Regenerate XDR for Protocol 27 (bump XDR_COMMIT to stellar-xdr@5187e69): CAP-0071 SOROBAN_CREDENTIALS_ADDRESS_V2 / delegated credentials and CAP-0083 STELLAR_VALUE_EMPTY_TX_SET.
  • goxdr and Ruby xdrgen can't parse #ifdef, so the feature gates are resolved with stellar-xdr xfile preprocess (rs-stellar-xdr findpaths: simplify simplepath/order_book.go and fix order_book_test.go #503) before codegen, driven by XDR_FEATURES. Regenerated xdr/, gxdr/, and xdr/xdr_views_generated.go.

Bump XDR to stellar-xdr@5187e69 (CAP-0071 address-bound/delegated Soroban
credentials + CAP-0083 STELLAR_VALUE_EMPTY_TX_SET). goxdr and Ruby xdrgen
cannot parse #ifdef, so CAP_0071/CAP_0083 gates are resolved with
'stellar-xdr xfile preprocess' (rs-stellar-xdr stellar#503) before codegen, driven
by XDR_FEATURES. Regenerated xdr/, gxdr/, and xdr/xdr_views_generated.go.
- Bump XDR_COMMIT to stellar-xdr@68fa1ac (post-stellar#303 which ungated CAP-0071).
- Clear XDR_FEATURES default so CAP-0083 #ifdef blocks are stripped during
  preprocess. CAP-0071 is ungated and needs no feature flag.
- Regenerate gxdr/, xdr/xdr_generated.go, xdr/xdr_views_generated.go.
- randxdr: add IsDeepNestedDelegates preset to cap recursion through CAP-71
  SorobanDelegateSignature.nestedDelegates, mirroring the existing
  IsDeepAuthorizedInvocationTree handling for subInvocations. Without it
  TestView_RandXDR_RawRoundTrip stack-overflows on unbounded random trees.
@sisuresh sisuresh changed the title SPIKE: Protocol 27 (CAP-0071 + CAP-0083) XDR Protocol 27 (CAP-0071) XDR Jun 3, 2026
@sisuresh

sisuresh commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Update (CAP-71-only for p27 release)

P27 ships with CAP-0071 only — CAP-0083 has been deferred. Pushed beb394ed to bring the regen in line:

  • Bumped XDR_COMMITstellar-xdr@68fa1ac (post-Add payment stream example #303, which ungated CAP-0071).
  • Cleared XDR_FEATURES default — CAP-0083 #ifdef blocks are now stripped during preprocess.
  • Regenerated gxdr/, xdr/xdr_generated.go, xdr/xdr_views_generated.go.
  • randxdr: added IsDeepNestedDelegates preset so TestView_RandXDR_RawRoundTrip doesn't stack-overflow on unbounded random SorobanDelegateSignature.nestedDelegates trees — mirrors the existing subInvocations preset.

Branch name still says cap-0083-xdr (legacy); not renaming to avoid breaking any external links to the PR.

Pulls in stellar/go-xdr#32 which lifts the default XDR decode depth from
250 → 1500 and adds the DecodeUnlimitedDepth sentinel. Necessary so the
CAP-71 SorobanDelegateSignature delegate chain (which the protocol allows
to nest arbitrarily, with only Soroban's runtime trap policing depth) can
be decoded by stellar-core LCM consumers without stalling.
@socket-security

socket-security Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​stellar/​go-xdr@​v0.0.0-20260423131911-a87d4d0789c3 ⏵ v0.0.0-20260529210834-0bf8f495636498 +1100100100100

View full report

sisuresh added 3 commits June 3, 2026 16:51
The previous commit bumped go-xdr to 0bf8f49 in go.mod, but go.sum still
carried the old a87d4d0789c3 lines. CI's gomod.sh runs `go mod tidy` and
fails the build on the residual diff.
The default per-test-binary timeout is 10m, which is borderline for
this repo's race-cover suite (xdr/ alone takes ~230s with -race
locally, longer on slower CI runners). CAP-71's added generated
XDR pushed the run past 10m, killing the test job with SIGTERM
before xdr/ and txnbuild/ finished.

20m gives generous headroom and matches the conservative timeout
other Stellar Go repos use for race+cover runs.
TestOperationCoverage generates 10,000 random gxdr.Operation values
which now include InvokeHostFunctionOp.auth[].credentials carrying
the new SorobanAddressCredentialsWithDelegates with the recursive
nestedDelegates field. Without bounding, the random generator
recurses unboundedly through SorobanDelegateSignature.nestedDelegates
and the test hangs past go test's default 10-minute per-binary
timeout, killing the CI test matrix.

Add IsDeepNestedDelegates preset (already defined in
randxdr/presets.go for LedgerCloseMetaPresets) — caps the tree height
at 2. With the preset, the test runs in ~8s under -race instead of
timing out.

Pairs with the -timeout=20m bump on the test workflow (which is now
just headroom — the real fix is this preset).

@Shaptic Shaptic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome 💪

@Shaptic Shaptic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm almost certain this can be merged as-is to move along the release on our side. Any objections?

Comment thread Makefile
@Shaptic
Shaptic marked this pull request as ready for review June 5, 2026 22:09
@Shaptic
Shaptic merged commit 532e2b5 into stellar:protocol-next Jun 5, 2026
11 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8b1ff4ce9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Makefile
printf "%s" ${XDR_COMMIT} > xdr/xdr_commit_generated.txt
curl -Lsf -o $@ https://raw.githubusercontent.com/stellar/stellar-xdr/$(XDR_COMMIT)/$(@F)
# goxdr / ruby xdrgen cannot parse #ifdef; resolve CAP feature gates first (rs-stellar-xdr #503).
stellar-xdr xfile preprocess --features "$(XDR_FEATURES)" $@ > [email protected] && mv -f [email protected] $@

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Set Protocol 27 features for XDR regeneration

When make xdr-update is run without extra environment, this recipe preprocesses the freshly downloaded XDR with XDR_FEATURES still empty (the default just below says empty means no feature-gated definitions are emitted). In that default regeneration path the CAP-0071 definitions checked in by this commit, such as the new delegate credential arms, are filtered out before goxdr/xdrgen run, so the generated Protocol 27 files are not reproducible and future XDR refreshes can silently drop the feature unless the caller knows to pass the right feature list.

Useful? React with 👍 / 👎.

sydneynotthecity added a commit to sydneynotthecity/stellar-galexie that referenced this pull request Jun 8, 2026
Bump stellar-core to 27.0.0-3288.7696c069d.noble and go-stellar-sdk
to the protocol-next commit carrying CAP-0071 XDR (stellar/go-stellar-sdk#5945).
go-xdr follows transitively (DecodeDefaultMaxDepth 250 -> 1500).

Adapts test/integration_test.go to GetFile's widened return signature.
sydneynotthecity added a commit to sydneynotthecity/stellar-galexie that referenced this pull request Jun 8, 2026
Bump stellar-core to 27.0.0-3288.7696c069d.noble and go-stellar-sdk
to the protocol-next commit carrying CAP-0071 XDR (stellar/go-stellar-sdk#5945).
go-xdr follows transitively (DecodeDefaultMaxDepth 250 -> 1500).

Adapts test/integration_test.go to GetFile's widened return signature.
sydneynotthecity added a commit to stellar/stellar-galexie that referenced this pull request Jun 9, 2026
Bump stellar-core to 27.0.0-3288.7696c069d.noble and go-stellar-sdk
to the protocol-next commit carrying CAP-0071 XDR (stellar/go-stellar-sdk#5945).
go-xdr follows transitively (DecodeDefaultMaxDepth 250 -> 1500).

Adapts test/integration_test.go to GetFile's widened return signature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants