SPIKE: Protocol 28 (CAP-0084)#980
Draft
sisuresh wants to merge 2 commits into
Draft
Conversation
Bump XDR pin to stellar-xdr#306 (7b56181) and regen for CAP-0084 muxed contract addresses. Add Address-level encode/decode for the SC_ADDRESS_TYPE_MUXED_CONTRACT arm (muxedContract factory, contractId()/muxedId(), <C-strkey>:<id> display). Canonical strkey deferred — no upstream version byte yet.
Author
|
Downstream: the same CAP-0084 muxed-contract changes are ported into js-stellar-sdk v16 (which vendored stellar-base into |
The SC_ADDRESS_TYPE_MUXED_CONTRACT arm was leaking into the released `curr` codec. Per the feature-flag contract a gated CAP def must be `next`-only until the protocol is enabled. - Makefile: split XDR_FEATURES into XDR_FEATURES_CURR (CAP_0083) and XDR_FEATURES_NEXT (CAP_0083,CAP_0084_MUXED_CONTRACT); regen curr. - curr_generated.js + types/curr.d.ts: drop the muxed-contract arm. - address.js: guard the fromScAddress case label with optional chaining so the curr-bound Address codec no longer throws when the arm is absent (the write path stays dormant until the arm lands in curr). - address_test.js: codec round-trip cases run only when the active codec defines the arm; Address-level assertions stay codec-agnostic.
sisuresh
added a commit
to sisuresh/js-stellar-sdk
that referenced
this pull request
Jun 27, 2026
The SC_ADDRESS_TYPE_MUXED_CONTRACT arm was leaking into the released `curr` codec. Per the feature-flag contract a gated CAP def must be `next`-only until the protocol is enabled. Mirrors the fix on stellar/js-stellar-base#980. - xdr/curr/Stellar-contract.x + src/base/generated/curr{,_generated}.{js,d.ts}: drop the muxed-contract arm (next-channel files keep it). - src/base/address.ts: guard the fromScAddress case label with optional chaining and reach the gated members via a cast so the curr-bound Address codec no longer fails to type-check or throws when the arm is absent (the write path stays dormant until the arm lands in curr). - test/unit/base/address.test.ts: codec round-trip cases run only when the active codec defines the arm; Address-level assertions stay codec-agnostic.
Author
|
Downstream lab PR (CAP-0084 SPIKE): stellar/laboratory#2131 |
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.
SPIKE for Protocol 28 / CAP-0084 (muxed contract addresses). Re-pins XDR to the current
stellar-xdr#306head and addsAddress-level support.Changes
stellar/stellar-xdr@7b56181(PR TS Errors trying to build envelope from xdr string #306 head); rename feature gateCAP_0084→CAP_0084_MUXED_CONTRACT, drop now-ungatedCAP_0071. Generated JS +.xare byte-identical to the prior pin.SCAddressType.SC_ADDRESS_TYPE_MUXED_CONTRACT=5,struct MuxedContract,SCAddressmuxedContract arm.Addressdecodes/encodes the muxed-contract arm:Address.muxedContract(contractId, id),fromScAddress/toScAddressround-trip (uint64 kept asxdr.Uint64),contractId()/muxedId()accessors,<C-strkey>:<id>display,toBuffer()throws.scripts/post-process-generated.pyinlines bare const use-sites (terser-safe const-inlining), wired as a post-xdrgen Makefile step.Deferred
<C-strkey>:<id>, round-trip viaScAddress/ScVal.Cross-links
7b56181)