Skip to content

SPIKE: Protocol 28 (CAP-0084): muxed contract address support#18

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

SPIKE: Protocol 28 (CAP-0084): muxed contract address support#18
sisuresh wants to merge 2 commits into
p28-cap-0084-basefrom
p28-cap-0084

Conversation

@sisuresh

Copy link
Copy Markdown
Owner

SPIKE — protocol 28 / CAP-0084 (muxed contract address support) for stellar-core. Pins unmerged upstream refs; opened as a draft for review while the upstream chain lands.

What this does

  • Adds the src/rust/soroban/p28 rs-soroban-env submodule (CAP-0084 host, pinned at 8cf4f5e1580b86d65529e6ed4f78b734908c62fa on sisuresh/rs-soroban-env@p28-cap-0084) and wires it into the multi-soroban rlib build. A new p28 submodule is created — p27 is untouched.
  • soroban_module_cache.rs: adds a separate p28 protocol-specific module cache (the next protocol is a real WIP host, not an alias of p27).
  • Bumps src/protocol-curr/xdr to the CAP-0084 .x (7b5618146590e15d2e250538dccbc7c89ac55c58).
  • Handles the new SC_ADDRESS_TYPE_MUXED_CONTRACT arm in LedgerHashUtils.h and XDRCereal.cpp, gated on CAP_0084_MUXED_CONTRACT.
  • Wires the CAP_0084_MUXED_CONTRACT feature flag (configure.ac / common.mk / src/Makefile.am), auto-enabled with --enable-next-protocol-version-unsafe-for-production.
  • Tests: makeMuxedContractAddress helper + de-muxing of MUXED_CONTRACT → underlying contract in transfer invocations; new muxed-contract transfer/mint sections in the "Stellar asset contract transfer with CAP-67 address types" test.

Upstream chain (cross-links)

Notes for the reviewer

  • TxMeta baseline re-recorded. test-tx-meta-baseline-next/InvokeHostFunctionTests.json changed only for "Stellar asset contract transfer with CAP-67 address types"; the entry count is unchanged (existing SAC-transfer meta differs under the p28 host). Please sanity-check that this SAC meta delta is expected for CAP-0084.
  • "Module cache across protocol versions" test updated: since p28 ships its own WIP host with a separate module cache, the next protocol version now adds to the module-cache entry count, so the vnext -1 adjustment is dropped (it was previously there for the case where vnext aliases the current host).
  • src/util/xdrquery/XDRFieldResolver.h renders a muxed-contract address as UNKNOWN under --query (same as every non-account/contract arm); left as-is.
  • Mint and storage-key-rejection behavior for muxed contracts is covered by the env's own tests (stellar_asset_contract.rs, storage.rs).

Opened on the sisuresh/stellar-core fork against p28-cap-0084-base (a copy of upstream master at the branch point, d6f254679) because the automation token cannot create PRs against stellar/stellar-core. The diff is therefore a clean single commit vs. upstream master. To productionize, re-target upstream once the chain merges.

Add protocol 28 / CAP-0084 (muxed contract addresses) to the vnext build.

Soroban host:
- Add the src/rust/soroban/p28 rs-soroban-env submodule (CAP-0084 host) with
  its .gitmodules entry, and wire it into the multi-soroban rlib build
  (src/Makefile.am, src/rust/Cargo.toml, Cargo.lock, soroban_proto_all.rs).
- soroban_module_cache.rs: add a separate p28 protocol-specific module cache
  (the next protocol is a real WIP host, not an alias of p27).

XDR / address handling (gated on CAP_0084_MUXED_CONTRACT):
- Bump the src/protocol-curr/xdr submodule to the CAP-0084 .x.
- Hash and JSON-serialize the new SC_ADDRESS_TYPE_MUXED_CONTRACT arm
  (LedgerHashUtils.h, XDRCereal.cpp).
- Wire the CAP_0084_MUXED_CONTRACT feature flag (configure.ac, common.mk,
  src/Makefile.am); enabled with
  --enable-next-protocol-version-unsafe-for-production.

Tests:
- SorobanTxTestUtils: makeMuxedContractAddress helper + de-muxing of
  MUXED_CONTRACT to the underlying contract in transfer invocations.
- InvokeHostFunctionTests: new muxed-contract transfer/mint sections in the
  "Stellar asset contract transfer with CAP-67 address types" test; update
  "Module cache across protocol versions" to account for p28's separate
  module cache (next protocol now adds to the module-cache entry count).
- Re-record test-tx-meta-baseline-next/InvokeHostFunctionTests.json and add
  the p28 cargo dep-tree expectation.

SPIKE: depends on unmerged upstream rs-soroban-env / rs-stellar-xdr / stellar-xdr.
@sisuresh sisuresh closed this Jul 1, 2026
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