Skip to content

Protocol 27 Support#5947

Merged
urvisavla merged 2 commits into
mainfrom
protocol-next
Jun 9, 2026
Merged

Protocol 27 Support#5947
urvisavla merged 2 commits into
mainfrom
protocol-next

Conversation

@Shaptic

@Shaptic Shaptic commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
  • xdr: regenerate for Protocol 27 CAP-0071

    • Bump XDR to stellar-xdr@68fa1ac (CAP-0071 address-bound/delegated Soroban credentials STELLAR_VALUE_EMPTY_TX_SET). goxdr and Ruby xdrgen cannot parse #ifdef, so CAP_0071 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.
    • 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.
  • go.mod: bump go-xdr to 0bf8f49 (raise DecodeDefaultMaxDepth to 1500)

    • Pulls in decoder: raise default max depth to 1500 and add DecodeUnlimitedDepth 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.
  • ci: bump go-test timeout to 20m

    • 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.
  • txnbuild: cap CAP-71 nestedDelegates recursion in TestOperationCoverage

    • 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.

* xdr: regenerate for Protocol 27 CAP-0071 + CAP-0083

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 #503) before codegen, driven
by XDR_FEATURES. Regenerated xdr/, gxdr/, and xdr/xdr_views_generated.go.

* xdr: drop CAP-0083 from regen; only CAP-0071 ships in p27

- Bump XDR_COMMIT to stellar-xdr@68fa1ac (post-#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.

* go.mod: bump go-xdr to 0bf8f49 (raise DecodeDefaultMaxDepth to 1500)

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.

* go.sum: drop stale go-xdr@a87d4d0 entry (go mod tidy)

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.

* ci: bump go-test timeout to 20m

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.

* txnbuild: cap CAP-71 nestedDelegates recursion in TestOperationCoverage

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).
Copilot AI review requested due to automatic review settings June 8, 2026 23:15
@socket-security

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

Copilot AI 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.

Pull request overview

This PR updates the SDK for Stellar Protocol 27 by regenerating XDR artifacts for CAP-0071 (including new Soroban credential / authorization variants) and adjusting generation/test infrastructure to handle newly introduced recursive structures safely and within CI time limits.

Changes:

  • Regenerate xdr/, gxdr/, and XDR “views” to include new Protocol 27/CAP-0071 types and enum arms.
  • Add recursion-capping presets for CAP-71 delegate chains in randxdr and apply them to txnbuild coverage tests.
  • Bump github.com/stellar/go-xdr and extend GitHub Actions go test timeout to reduce CI flakes/timeouts.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
xdr/xdr_views_generated.go Regenerated view types; adds CAP-0071-related views and new discriminants.
xdr/xdr_generated.go Regenerated Go XDR types/unions/enums to include new Protocol 27/CAP-0071 definitions.
gxdr/xdr_generated.go Regenerated goxdr-based types/enums/unions for the updated XDR schema.
xdr/Stellar-transaction.x Updates XDR schema with Soroban delegate signature structures and new credential variants.
xdr/Stellar-ledger-entries.x Extends EnvelopeType with ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS.
xdr/Stellar-types.x Minor schema formatting change as part of regeneration.
xdr/xdr_commit_generated.txt Updates recorded upstream stellar-xdr commit used for generation.
randxdr/presets.go Adds IsDeepNestedDelegates selector and applies it to canonical presets.
txnbuild/operation_test.go Applies new preset to avoid runaway recursion during random operation generation.
Makefile Updates XDR commit and adds a preprocessing step prior to codegen.
go.mod Bumps github.com/stellar/go-xdr dependency.
go.sum Updates module sums for the new go-xdr version.
.github/workflows/go.yml Increases go test timeout to 20 minutes for race+cover runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
@urvisavla urvisavla merged commit dd844ab into main Jun 9, 2026
19 of 28 checks passed
@urvisavla urvisavla deleted the protocol-next branch June 9, 2026 19:43
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.

5 participants