Skip to content

SPIKE: Protocol 28 (CAP-0085)#982

Draft
sisuresh wants to merge 1 commit into
stellar:masterfrom
sisuresh:p28-cap-0085
Draft

SPIKE: Protocol 28 (CAP-0085)#982
sisuresh wants to merge 1 commit into
stellar:masterfrom
sisuresh:p28-cap-0085

Conversation

@sisuresh

Copy link
Copy Markdown

SPIKE regenerating the JS XDR codec for Protocol 28 / CAP-0085 (externally managed contract executables). Pinned to stellar-xdr 76218a994f8c5ba752cba368080fb2f89843ad3c (#308); resolves #ifdef gates via stellar-xdr xfile preprocess before xdrgen.

Changes

  • Makefile: pin bump + xfile preprocess step; XDR_FEATURES_NEXT=CAP_0085_EXECUTABLE_REF, XDR_FEATURES_CURR= (empty). next channel only.
  • Regen adds SCV_EXECUTABLE_TAG (ScValType) and CONTRACT_EXECUTABLE_EXTERNAL_REF + ContractExecutableExternalRef (ContractExecutable).
  • scValToNative: decode the scvExecutableTag SCString payload (next-only case label guarded with optional chaining).
  • buildInvocationTree: non-throwing external_ref arm; wasm↔preimage sanity check now scoped to wasm/sac arms only.
  • Hand-aligned types/next.d.ts (dts-xdr master format drift) + .gitignore *.tgz, CHANGELOG.

Verification (pinned SHA 76218a9):

  • grep -c contractExecutableExternalRef src/generated/next_generated.js → 2 (present)
  • grep -c contractExecutableExternalRef src/generated/curr_generated.js → 0 (next-only)
  • CAP-0083 leak check: grep -ci EMPTY_TX_SET src/generated/*_generated.js → 0 (both channels)

Needs review

  • invocation.js external-ref ContractIdPreimage validation — the preimage shape for external-ref creation is not finalized in the CAP, so it is decoded but not validated. Flagged, not guessed.

Deferred

  • Typed operation builder for external-ref contract creation (new op surface) — follow-up.
  • Canonical strkey — N/A for this CAP.

Out-of-scope observations

  • Bumping the pin brings in ungated Soroban delegate / SorobanCredentialsAddressV2 structs on the curr channel (present at the pinned .x, not CAP-gated); matches the sibling protocol-28 stacks. No action taken.

Upstream

  • stellar/stellar-xdr#308 — canonical .x (already merged/pinned; not modified here).
  • stellar/rs-soroban-env#1703 — host draft.

Independent of the CAP-0083 / CAP-0084 SPIKE stacks; enables only CAP-0085. Stays draft.

Bump XDR pin to stellar-xdr#308 (76218a9) and regen for CAP-0085
externally managed contract executables. Enables only
CAP_0085_EXECUTABLE_REF on the next channel (curr channel has no CAP
features; this stack is independent of the CAP-0083/CAP-0084 stacks).
Adds the SCV_EXECUTABLE_TAG ScVal arm and the
CONTRACT_EXECUTABLE_EXTERNAL_REF / ContractExecutableExternalRef
ContractExecutable arm. Graceful handling of the new executable arm in
buildInvocationTree; external-ref preimage validation flagged for spec
review.
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