Skip to content

SPIKE: Protocol 28 (CAP-0085)#5347

Draft
sisuresh wants to merge 2 commits into
stellar:masterfrom
sisuresh:p28-cap-0085
Draft

SPIKE: Protocol 28 (CAP-0085)#5347
sisuresh wants to merge 2 commits into
stellar:masterfrom
sisuresh:p28-cap-0085

Conversation

@sisuresh

Copy link
Copy Markdown
Contributor

SPIKE draft for Protocol 28 / CAP-0085 (externally managed contract executables). Based on dmkozh's drafts.

Changes

  • Add WIP p28 soroban host: new src/rust/soroban/p28 submodule + Cargo pin at rs-soroban-env Load generator tweaks #1704 head b505cd78, CAP_0085_EXECUTABLE_REF flag triple, EXTERNAL_EXECUTABLE_REF_PROTOCOL_VERSION = V_28.
  • Thread ledgerVersion through validateHostFn; accept CONTRACT_EXECUTABLE_EXTERNAL_REF for FROM_ADDRESS CREATE_CONTRACT/CREATE_CONTRACT_V2 at protocol ≥ 28 (CAP-0085 "InvokeHostFunctionOp update"), plus a gated TransactionQueue test for both variants.

Deferred

  • -vnext deb/docker image is a manual Jenkins build; downstream deb/image pins wait for the artifact matching this PR HEAD.
  • Host pins rs-soroban-env with Document performance evaluation #1698 (lazy e2e decode) reverted, so it self-reports 27.0.0.
  • Full --check-test-tx-meta left to CI — this change is mempool-admission only (no ledger-apply meta).

Upstream

  • stellar-xdr#308 (canonical .x, CAP_0085_EXECUTABLE_REF), rs-soroban-env#1703 (host draft)
  • SPIKE pins: rs-stellar-xdr#553, rs-soroban-env#1704

Downstream (separate PRs, not this one)

  • go-stellar-sdk#5962, stellar-horizon#205, stellar-rpc#853, js-stellar-base#982

@sisuresh
sisuresh marked this pull request as ready for review July 14, 2026 21:00
Copilot AI review requested due to automatic review settings July 14, 2026 21:00
@sisuresh
sisuresh marked this pull request as draft July 14, 2026 21:11

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

Stages Protocol 28 / CAP-0085 support for externally managed contract executables.

Changes:

  • Adds gated p28 Soroban host, dependencies, dispatch, and module caching.
  • Gates external-reference contract creation on protocol 28.
  • Adds admission validation tests for both create variants.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.gitmodules Adds p28 and CAP-0085 fork sources.
Cargo.lock Locks p28 host and XDR dependencies.
common.mk Defines the CAP-0085 C++ flag.
configure.ac Adds the CAP-0085 build conditional.
src/Makefile.am Builds gated XDR and p28 host code.
src/herder/TransactionQueue.cpp Passes ledger protocol into host-function validation.
src/herder/test/TransactionQueueTests.cpp Tests external-reference validation rules.
src/rust/Cargo.toml Pins the p28 host dependency.
src/rust/src/dep-trees/p28-expect.txt Records p28 dependencies.
src/rust/src/soroban_module_cache.rs Adds the p28 module cache.
src/rust/src/soroban_proto_all.rs Registers and dispatches the p28 host.
src/transactions/FeeBumpTransactionFrame.cpp Forwards protocol-aware validation.
src/transactions/FeeBumpTransactionFrame.h Updates the validation override.
src/transactions/TransactionFrame.cpp Implements protocol-gated executable validation.
src/transactions/TransactionFrame.h Updates the validation interface.
src/transactions/TransactionFrameBase.h Adds the ledger-version parameter.
src/transactions/test/TransactionTestFrame.cpp Forwards test-frame validation.
src/transactions/test/TransactionTestFrame.h Updates the test-frame override.
src/util/ProtocolVersion.h Defines the CAP-0085 activation version.

Comment on lines +1371 to +1372
REQUIRE(tx->validateHostFn(gate));
REQUIRE_FALSE(tx->validateHostFn(gate - 1));
Comment on lines +1641 to +1642
#[cfg(feature = "next")]
proto_versioned_functions_for_module!(p28),
Wire up a per-protocol soroban-env-host submodule for protocol 28
(CAP-85, externally managed contract executables), gated behind the
`next` feature and WIP_SOROBAN_PROTOCOL, mirroring the existing p27
module:

- .gitmodules + src/rust/soroban/p28 submodule (rs-soroban-env CAP-85).
- src/rust/Cargo.toml: soroban-env-host-p28 git/rev pin (+ unified feature).
- src/rust/src/soroban_proto_all.rs: p28 adaptor module + HOST_MODULES entry;
  soroban_curr aliased to p28 under `next`.
- src/rust/src/soroban_module_cache.rs: p28_cache field + arms.
- src/rust/src/dep-trees/p28-expect.txt, Cargo.lock: regenerated.
- configure.ac / common.mk / src/Makefile.am: CAP-85 flag wiring.
- src/protocol-curr/xdr, ProtocolVersion.h, TransactionFrame.cpp: p28 XDR.

The p28 host is pinned at the CAP-85 branch with rs-soroban-env stellar#1698
("lazily decode ledger entries passed in e2e flow") reverted, so the host
keeps the pre-stellar#1698 e2e_invoke/wasm_module_memory_cost interface that
core's mirror-of-p27 glue targets. Adopting stellar#1698 requires separate C++
bridge work and is out of scope for this WIP host.
Thread ledgerVersion through TransactionFrameBase::validateHostFn and
accept CONTRACT_EXECUTABLE_EXTERNAL_REF for FROM_ADDRESS CREATE_CONTRACT /
CREATE_CONTRACT_V2 starting at EXTERNAL_EXECUTABLE_REF_PROTOCOL_VERSION
(protocol 28), matching CAP-0085 ("InvokeHostFunctionOp update") and the
p28 host (rs-soroban-env#1703). Removes the SPIKE TODO that had left
external-ref creates rejected core-side. FROM_ASSET still requires
STELLAR_ASSET; non-next behavior unchanged.

Adds a gated TransactionQueue section covering both host-fn variants
(external-ref accepted at p28 / rejected below it, FROM_ASSET+external-ref
rejected).
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.

2 participants