build(xdr): regenerate schema from stellar-xdr with CAP-83 and CAP-85 ungated - #1576
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Regenerates the SDK’s XDR schema and classes with ungated CAP-83 and CAP-85 definitions.
Changes:
- Pins the newer
stellar-xdrsnapshot. - Adds external executable references, executable tags, and empty transaction-set values.
- Updates runtime narrowing and generated references.
Reviewed changes
Copilot reviewed 6 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
Makefile |
Updates the pinned XDR commit. |
xdr/xdr.json |
Regenerates the canonical schema. |
src/xdr/generated/contract-executable-external-ref.ts |
Adds the external-reference structure. |
src/xdr/generated/contract-executable-type.ts |
Adds the external-reference enum member. |
src/xdr/generated/contract-executable.ts |
Adds the external-reference union arm. |
src/xdr/generated/index.ts |
Exports new generated types. |
src/xdr/generated/sc-address-type.ts |
Refreshes gated CAP-84 source documentation. |
src/xdr/generated/sc-address.ts |
Refreshes gated CAP-84 source documentation. |
src/xdr/generated/sc-val-type.ts |
Adds the executable-tag enum member. |
src/xdr/generated/sc-val.ts |
Adds the executable-tag union arm. |
src/xdr/generated/soroban-transaction-meta-ext-v1.ts |
Corrects generated fee documentation. |
src/xdr/generated/stellar-value-ext.ts |
Adds the empty-transaction-set union arm. |
src/xdr/generated/stellar-value-proposed-value.ts |
Adds the proposed-value structure. |
src/xdr/generated/stellar-value-type.ts |
Adds the empty-transaction-set enum member. |
src/xdr/generated/stellar-value.ts |
Refreshes the ungated XDR documentation. |
src/contract/client.ts |
Explicitly narrows executable handling to Wasm. |
src/base/scval.ts |
Allows newly generated variants through the fallback conversion. |
docs/reference/core-soroban-primitives.md |
Refreshes generated source links. |
docs/reference/contracts-client.md |
Refreshes generated source links. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 22 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
.github/workflows/tests.yml:54
- This browser-test job split (together with the package script and Vite cache changes) is unrelated to the XDR snapshot and is absent from the PR description, which says the second commit only contains the minimal widened-union fixes. It materially changes CI cost and execution topology, so please move these changes to a dedicated PR rather than coupling them to the protocol update.
# Browser tests get their own job per transport rather than two steps in
# `build_and_test`. Each pass loads the SDK source graph — ~470 unbundled
# `src/xdr` modules — once per test file, across 220 files and two browsers.
# Run back to back on one runner, the second pass reliably lost its browser
# page mid-run ("Browser connection was closed while running tests"), always
# after ~65 files with every test that ran passing. A fresh runner per
# transport keeps each pass within the runner's memory budget.
browser_test:
src/contract/client.ts:267
- This new third-executable branch is not covered by
client_from.test.ts, which currently exercises only Wasm and SAC instances. Add an external-reference instance case that asserts this error and verifies no Wasm lookup occurs; otherwise a regression could pass an external ref into the hash path unnoticed.
if (executable.type !== "contractExecutableWasm") {
throw new TypeError(
`unsupported contract executable type: ${executable.type}`,
);
src/base/scval.ts:467
- The catch-all removes compile-time exhaustiveness for all future
ScValadditions and currently decodes thisSCStringthrough the lenient.valuegetter, unlike the explicit string branches above that preserve invalid wire bytes. HandlescvExecutableTagexplicitly withscv.executableTag.asStringOrBytes(), then restore aneverassertion indefaultso later schema bumps cannot silently acquire incorrect conversion behavior.
default:
// Variants without an explicit case above (currently the newly
// generated `scvExecutableTag`) fall through to their underlying value.
return scv.value;
quietbits
approved these changes
Jul 31, 2026
Ryang-21
added a commit
that referenced
this pull request
Aug 10, 2026
* Class XDR Implementation (#1422) * feat(xdr): codegen tool + schema source * feat(xdr): add class-based XDR runtime and sep51 JSON walker * refactor(numbers): drop LargeInt classes, delegate to new XDR layer * refactor(base): migrate src/base to new XDR layer; drop legacy xdr.ts + generated * refactor: migrate downstream consumers (bindings/contract/horizon/rpc/webauth) * feat(base/scval): add bool to ScValType * allow opaque xdr types to be initalized via string * refactor xdr strings to be represented soley via bytes with a dx friendly XdrString wrapper class * generate a value getter function for void union cases * add a is() function to the generated XDR union classes for instanceOf checks * feat(xdr): regenerate schemas against @stellar/js-xdr and add CAP-71 credentials * feat(xdr): wire the toJSON hook so JSON.stringify emits SEP-0051 * fix(bindings): emit Uint8Array for bytes/bytesN to match scValToNative * refactor(contract): rename fromJSON to fromJson with deprecated aliases * feat(xdr): accept ASCII asset codes with zero padding in constructors * Migrate public API from Buffer to Uint8Array (#1564) * feat(base): migrate crypto and strkey APIs to Uint8Array * feat(base)!: migrate value types to Uint8Array * feat(base)!: migrate transactions, operations, and auth to Uint8Array * feat!: migrate contract, rpc, and webauth layers to Uint8Array * build!: drop buffer polyfill and dependency * fix(horizon): type manage_data value as string to match runtime API * fix(xdr): emit SEP-51 key `type` instead of Rust-escaped `type_` (#1571) * build(xdr): regenerate xdr.json via docker from pinned stellar-xdr commit (#1575) * build(xdr): regenerate schema from stellar-xdr with CAP-83 and CAP-85 ungated (#1576) * build(xdr): regenerate schema from stellar-xdr with CAP-83 and CAP-85 ungated * fix(xdr): keep consumers compiling against the regenerated union arms * fix(vitest): isolate browser dep cache per transport * feat(xdr): support CAP-83 empty tx set values and CAP-85 external executables (#1577) * build(xdr): fail the schema download instead of masking it in a pipe * feat(xdr): support CAP-83 and CAP-85 protocol values * fix(xdr): bound decimal string length before BigInt parse in JSON decode (#1581) * fix(xdr): bound decimal string length before BigInt parse in json decode * refactor(xdr): name the digit-budget constants in bigint-parts * fix(xdr): restrict fromJson to SEP-0051 keys and reject unknown fields (#1582) * fix(xdr): restrict fromJson to SEP-51 keys and reject unknown fields * fix(test): correct horizon corpus fixture path so corpus tests run * fix(strkey): bound decodeCheck input length before base32 decode (#1583) * fix(xdr): reject AssetCode12 JSON codes shorter than 5 bytes (#1585) * fix(horizon)!: make TransactionFailedExtras result_codes.operations optional (#1586) * Fix: signed payload strkey framing (#1588) * fix(strkey): validate signed payload framing in decodeCheck * Fix: xdr json decode validation (#1592) * fix(xdr): throw on unknown union discriminant in fromXdrObject * fix(strkey): validate the claimable balance discriminant byte * fix(xdr): reject non-decimal integer strings in JSON decoding * V17.0.0 rc.1 (#1593) * chore(release): cut v17.0.0-rc.1 * fix(spec): restore instanceof Map check lost in the v17 merge * feat(xdr): add validateXdr static to every generated type (#1597) * feat(xdr): add validateXdr static to every generated type * fix(contract): declare error classes, make types self-contained (#1627) * perf(strkey): reject by length and prefix before decodeCheck throws (#1629) * fix: restore wide-int bounds statics, document Memo.text break (#1628) * fix(xdr): restore wide-int MIN_VALUE/MAX_VALUE statics --------- Co-authored-by: Iveta <[email protected]>
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.
What
Takes a new protocol snapshot by bumping the pinned
stellar-xdrcommit and regenerating both the schema and the XDR classes from it.XDR_COMMITmoves from68fa1ac5to9c9c1459("Ungate CAP_0083 and CAP_0085_EXECUTABLE_REF ifdefs"), thenmake xdrregeneratesxdr/xdr.json(490 definitions) andsrc/xdr/generated/(452 files). No feature flags are needed — the CAPs this picks up are ungated upstream.XDR_FEATURESstays empty, so CAP-84's muxed-contract types, still behind#ifdef CAP_0084_MUXED_CONTRACT, are excluded as before.The generated surface changes as follows:
ContractExecutableTypegainsCONTRACT_EXECUTABLE_EXTERNAL_REF = 2,ContractExecutablegains the matching arm, and a newContractExecutableExternalRefstruct (executableOwner: ScAddress,tag: SCString) is emitted.ScValTypegainsSCV_EXECUTABLE_TAG = 22andScValgains the matchingSCStringarm.StellarValueTypegainsSTELLAR_VALUE_EMPTY_TX_SET = 2,StellarValueExtgains the matching arm, and its anonymous inner struct is emitted asStellarValueProposedValue.sc-address.ts,sc-address-type.ts(the gated CAP-84 lines now appear in the quoted.xsource) andsoroban-transaction-meta-ext-v1.ts(upstream fixed a comment that saidrentFeeChargedis part of the non-refundable fee).The second commit is the smallest change that keeps
tscgreen against the widened unions, so this PR stands on its own:scValToNative'sdefaultbranch drops a@ts-expect-errorthat is no longer triggered now that an unhandled variant exists.Client.fromnarrows explicitly to the Wasm arm before reading the code hash, since excluding the SAC arm no longer leaves exactly one case.Actually handling the new variants — decoding
scvExecutableTag, reporting external-ref executables usefully, and round-trip test coverage — is a separate follow-up PR stacked on this one.