Skip to content

SPIKE: Protocol 28 (CAP-0084) - #307

Merged
sisuresh merged 4 commits into
stellar:mainfrom
sisuresh:p28-cap-0084
Jul 27, 2026
Merged

sisuresh merged 4 commits into
stellar:mainfrom
sisuresh:p28-cap-0084

Conversation

@sisuresh

@sisuresh sisuresh commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Add SC_ADDRESS_TYPE_MUXED_CONTRACT enum arm + MuxedContract { uint64 id; ContractID contractId; } struct + SCAddress union arm to Stellar-contract.x, all gated behind #ifdef CAP_0084_MUXED_CONTRACT, mirroring the existing MuxedEd25519Account muxed-account pattern.
  • Gated, so the new types appear only in the next branch (built --all-features) and stay out of curr until core bumps max protocol to 28. curr/next regenerate automatically on merge — not edited here.
  • Stellar-ledger.x comment revert (deliberate — reviewer please note): drops the unrelated Fix conflicting comment on rent fee #304 comment change so the p28 SPIKE XDR base stays byte-identical to the frozen p27 host (ledger.x hash 93cdd4dd), avoiding downstream host-identity drift.

Flag-token contract (downstream)

This repo is the root of the chain — no upstream. Downstreams pin this PR's head commit by full 40-char SHA: 787382ef2099cca168ca1cb282730d6b7b9e2f16 (never the truncated 787382e). The ifdef token CAP_0084_MUXED_CONTRACT is the verbatim contract for every downstream:

  • cargo feature (rs-stellar-xdr / rs-soroban-env / js-xdr-json): cap_0084_muxed_contract
  • XDR_FEATURES / xfile preprocess --features (go-stellar-sdk / js-stellar-base): CAP_0084_MUXED_CONTRACT

A mismatched/truncated token silently strips the new types downstream.

Verification

Local stellar-xdr xfile preprocess: arm absent with no features (curr); all three arms present and file parses with --features CAP_0084_MUXED_CONTRACT.

Deferred

  • Downstream PRs (rs-soroban-env/-sdk, stellar-core, go-stellar-sdk, horizon, rpc, js-stellar-base/-sdk, js-stellar-xdr-json, laboratory, docker) pin this PR's head SHA — opened by their own per-repo passes.

Downstream: stellar/rs-stellar-xdr#551 (pins this PR head 787382e)
CAP-0084: stellar/stellar-protocol#1968

sisuresh added 2 commits June 26, 2026 14:54
Add SC_ADDRESS_TYPE_MUXED_CONTRACT arm and MuxedContract struct to
SCAddress, gated behind #ifdef CAP_0084_MUXED_CONTRACT, mirroring the
existing MuxedEd25519Account muxed-account pattern. Appears only in the
`next` branch until core bumps the max supported protocol to 28.

CAP-0084 (Muxed Contract Addresses):
stellar/stellar-protocol#1968

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR spikes Protocol 28 / CAP-0084 support by introducing a feature-gated “muxed contract” SCAddress variant, mirroring the existing muxed-account pattern, and includes a deliberate comment revert in the ledger XDR.

Changes:

  • Add SC_ADDRESS_TYPE_MUXED_CONTRACT plus MuxedContract { id, contractId } and a new SCAddress union arm behind #ifdef CAP_0084_MUXED_CONTRACT.
  • Revert a Stellar-ledger.x documentation comment related to rentFeeCharged.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Stellar-contract.x Adds a feature-gated muxed-contract address type and corresponding struct/union arm.
Stellar-ledger.x Reverts a rent-fee documentation comment inside SorobanTransactionMetaExtV1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Stellar-ledger.x Outdated
rentFeeCharged is part of totalRefundableResourceFeeCharged (as the
totalRefundableResourceFeeCharged comment itself states: 'comprises the
rent fee'). An automation drive-by had flipped it to NonRefundable — out
of scope for CAP-0084 and factually wrong. Restores the original comment;
stellar#307 now touches only Stellar-contract.x (the CAP-0084 XDR).
@sisuresh
sisuresh requested a review from dmkozh July 7, 2026 22:24
Comment thread Stellar-contract.x
@sisuresh
sisuresh merged commit 13fc2c3 into stellar:main Jul 27, 2026
5 checks passed
sisuresh added a commit to sisuresh/rs-stellar-xdr that referenced this pull request Jul 27, 2026
stellar/stellar-xdr#307 merged (squash) as 13fc2c3 on main, so pin the
submodule + xdr-version at the canonical commit instead of the PR branch
head 341179e (which is not an ancestor of main after the squash).

The .x tree is byte-identical between the two commits, so `make generate`
produces no change to the generated Rust or JSON schemas.
kanwalpreetd pushed a commit to kanwalpreetd/rs-stellar-xdr that referenced this pull request Aug 20, 2026
* Ungate CAP-0083 and CAP-0085, repin xdr to 9c9c145

Repins the xdr submodule to stellar-xdr main (stellar/stellar-xdr#311),
which removes the CAP_0083 and CAP_0085_EXECUTABLE_REF ifdefs, and drops
the matching cap_0083 / cap_0085_executable_ref crate features. Their
types are now generated unconditionally.

Also drops the two hand-written gates on those features: the
VERSION.features list in lib.rs and the ScVal::ExecutableTag arm in
scval_validations.rs, which would otherwise leave the match
non-exhaustive.

The repin also crosses stellar/stellar-xdr#307, so the .x now carries
CAP_0084_MUXED_CONTRACT ifdefs. That forces a cap_0084_muxed_contract
feature to be declared (generated code cfgs on it) plus a Display arm
for ScAddress::MuxedContract; both are taken verbatim from the in-flight
SPIKE stellar#552. The feature is off by default.

* Merge ExecutableTag into the trivially-valid arm

Now that the arm is unconditional it has a body identical to the
preceding one, which clippy::pedantic rejects (match_same_arms).

* update comment
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.

3 participants