Skip to content

SPIKE: Protocol 28 (CAP-0084) — Muxed Contract Addresses#2

Closed
sisuresh wants to merge 2 commits into
masterfrom
p28-cap-0084
Closed

SPIKE: Protocol 28 (CAP-0084) — Muxed Contract Addresses#2
sisuresh wants to merge 2 commits into
masterfrom
p28-cap-0084

Conversation

@sisuresh

Copy link
Copy Markdown
Owner

Summary

Spike tracking Protocol 28 / CAP-0084 (Muxed Contract Addresses) in js-stellar-sdk.

CAP-0084 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 @ 2769fed (stellar#305).

js-stellar-sdk has no XDR of its own and no CAP feature-flag configsrc/index.ts does 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.

Changes

  • package.json: re-point @stellar/stellar-basegithub:sisuresh/js-stellar-base#p28-cap-0084 (mirrors the cap-71-p27 spike).
  • yarn.lock: regenerated; only the @stellar/stellar-base entry changes (now the github fork tarball daec58d), transitive deps unchanged.

dist/ and lib/ are gitignored, so no bundle artifacts are committed.

Build verification (yarn build:prod, local)

  • ✅ node lib/ re-exports the new arm: xdr.ScAddressType.scAddressTypeMuxedContract is present.
  • ✅ browser bundle dist/stellar-sdk.min.js embeds the regenerated XDR (scAddressTypeMuxedContract).
  • ✅ all four browser variants (default / no-axios / no-eventsource / minimal) compile; tsc clean — no implicit-any regressions surfaced from the regenerated base types.

Build environment note

The local environment runs node 22.5.1, which is below the ^22.13.0 floor required by a transitive devDep (eslint-visitor-keys@5.0.1, already in the master lockfile). This makes a bare yarn install fail the engine check — and also silently leaves yarn's nested prepare-build of the git-dep fork unbuilt, cascading into Module 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's prepare step normally.

Before merge (deferred — spike)

  • Replace the fork-branch ref with a published CAP-0084 @stellar/stellar-base version (e.g. ^15.x.0) instead of github:sisuresh/....
  • Re-run full test suite against the published base.

Draft / spike — not for merge as-is (depends on an unpublished fork branch).

sisuresh added 2 commits June 24, 2026 23:06
…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.
@sisuresh

Copy link
Copy Markdown
Owner Author

Downstream: consumed by the Lab CAP-0084 SPIKE — sisuresh/laboratory#2

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.

1 participant