SPIKE: Protocol 28 (CAP-0084) — Muxed Contract Addresses#2
Closed
sisuresh wants to merge 2 commits into
Closed
Conversation
…bundle rebuild
CAP-0084 (Muxed Contract Addresses) adds a new SCAddress arm
SC_ADDRESS_TYPE_MUXED_CONTRACT=5 with struct MuxedContract { uint64 id;
ContractID contractId; }, gated behind the CAP_0084 XDR feature flag.
Canonical XDR head: stellar/stellar-xdr @ 2769fed744c4ec5a2cf6581addfc1704abfcba7c (stellar#305).
js-stellar-sdk has NO XDR of its own and NO CAP feature-flag config: it
re-exports everything (including `xdr`) from @stellar/stellar-base
(src/index.ts: `export * from "@stellar/stellar-base"`). So the only
SDK-side work for CAP-0084 is to consume a CAP-0084-patched stellar-base
and rebuild the shipped artifacts.
This commit re-points the dependency from the 15.0.0 release to the
CAP-0084 js-stellar-base fork branch, mirroring the cap-71-p27 spike:
"@stellar/stellar-base": "github:sisuresh/js-stellar-base#p28-cap-0084"
DEFERRED (cannot run yet — the CAP-0084 js-stellar-base is being
regenerated in a sibling branch and is not yet published/buildable):
- Install + regenerate lockfile against the new base:
yarn install
- Rebuild node + browser bundles (the browser bundle embeds
stellar-base's generated XDR at build time; without this rebuild the
SDK ships STALE XDR and the SC_ADDRESS_TYPE_MUXED_CONTRACT arm will be
missing from dist/):
yarn build:prod # = build:node:all + build:browser:all
or just the browser bundle:
yarn build:browser:all
- For a real PR (not a fork-branch ref), bump to the published
CAP-0084 stellar-base version, e.g. "@stellar/stellar-base": "^15.x.0".
- tsc may surface implicit-any regressions from the regenerated base
types (same as cap-71-p27); resolve before merge.
dist/ and lib/ are gitignored, so no bundle artifacts are committed here;
they must be produced by the build commands above once the dependency is
available. DO NOT fabricate them.
Re-resolves @stellar/stellar-base to the github fork branch (sisuresh/js-stellar-base#p28-cap-0084, tarball daec58d). Only the stellar-base entry changes; transitive deps are unchanged. Build verified locally with 'yarn build:prod': node lib/ re-exports the CAP-0084 SC_ADDRESS_TYPE_MUXED_CONTRACT arm (xdr.ScAddressType .scAddressTypeMuxedContract) and the browser bundle dist/stellar-sdk.min.js embeds it. dist/ and lib/ are gitignored, so no bundle artifacts are committed. Note: env node 22.5.1 is below the 22.13.0 floor required by a transitive devDep (eslint-visitor-keys@5.0.1), so local install/build needs 'yarn install --ignore-engines'; CI on node >=22.13 is unaffected.
Owner
Author
|
Downstream: consumed by the Lab CAP-0084 SPIKE — sisuresh/laboratory#2 |
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.
Summary
Spike tracking Protocol 28 / CAP-0084 (Muxed Contract Addresses) in js-stellar-sdk.
CAP-0084 adds a new
SCAddressarmSC_ADDRESS_TYPE_MUXED_CONTRACT = 5withstruct MuxedContract { uint64 id; ContractID contractId; }, gated behind theCAP_0084XDR feature flag. Canonical XDR head:stellar/stellar-xdr @ 2769fed(stellar#305).js-stellar-sdk has no XDR of its own and no CAP feature-flag config —
src/index.tsdoesexport * from "@stellar/stellar-base". So the only SDK-side work for CAP-0084 is to consume a CAP-0084-patched stellar-base and rebuild the shipped artifacts.Changes
package.json: re-point@stellar/stellar-base→github:sisuresh/js-stellar-base#p28-cap-0084(mirrors the cap-71-p27 spike).yarn.lock: regenerated; only the@stellar/stellar-baseentry changes (now the github fork tarballdaec58d), transitive deps unchanged.dist/andlib/are gitignored, so no bundle artifacts are committed.Build verification (
yarn build:prod, local)lib/re-exports the new arm:xdr.ScAddressType.scAddressTypeMuxedContractis present.dist/stellar-sdk.min.jsembeds the regenerated XDR (scAddressTypeMuxedContract).Build environment note
The local environment runs node
22.5.1, which is below the^22.13.0floor required by a transitive devDep (eslint-visitor-keys@5.0.1, already in the master lockfile). This makes a bareyarn installfail the engine check — and also silently leaves yarn's nested prepare-build of the git-dep fork unbuilt, cascading intoModule not found: @stellar/stellar-base.Workaround for local builds on old node:
yarn install --ignore-engines(and ensure the fork is built). CI on node ≥ 22.13 is unaffected — the engine check passes and yarn builds the fork'spreparestep normally.Before merge (deferred — spike)
@stellar/stellar-baseversion (e.g.^15.x.0) instead ofgithub:sisuresh/....