Skip to content

Commit b8749b8

Browse files
committed
Add WIP protocol 28 soroban host for CAP-85
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 #1698 ("lazily decode ledger entries passed in e2e flow") reverted, so the host keeps the pre-#1698 e2e_invoke/wasm_module_memory_cost interface that core's mirror-of-p27 glue targets. Adopting #1698 requires separate C++ bridge work and is out of scope for this WIP host.
1 parent d6f2546 commit b8749b8

13 files changed

Lines changed: 678 additions & 30 deletions

File tree

‎.gitmodules‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
ignore = dirty
2626
[submodule "src/protocol-curr/xdr"]
2727
path = src/protocol-curr/xdr
28-
url = https://github.com/stellar/stellar-xdr
29-
branch = main
28+
url = https://github.com/sisuresh/stellar-xdr-next.git
29+
branch = p28-cap-0085
3030
[submodule "src/rust/soroban/p21"]
3131
path = src/rust/soroban/p21
3232
url = https://github.com/stellar/rs-soroban-env
@@ -52,3 +52,7 @@
5252
[submodule "lib/gperftools"]
5353
path = lib/gperftools
5454
url = https://github.com/gperftools/gperftools.git
55+
[submodule "src/rust/soroban/p28"]
56+
path = src/rust/soroban/p28
57+
url = https://github.com/sisuresh/rs-soroban-env.git
58+
branch = p28-cap-0085

‎Cargo.lock‎

Lines changed: 121 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎common.mk‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,8 @@ endif # ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION
4545

4646
if CAP_0083
4747
AM_CPPFLAGS += -DCAP_0083
48-
endif
48+
endif
49+
50+
if CAP_0085_EXECUTABLE_REF
51+
AM_CPPFLAGS += -DCAP_0085_EXECUTABLE_REF
52+
endif

‎configure.ac‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,9 @@ AM_CONDITIONAL(ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION,
564564
AM_CONDITIONAL(CAP_0083,
565565
[test x$enable_next_protocol_version_unsafe_for_production = xyes])
566566

567+
AM_CONDITIONAL(CAP_0085_EXECUTABLE_REF,
568+
[test x$enable_next_protocol_version_unsafe_for_production = xyes])
569+
567570
AC_PATH_PROG(CARGO, cargo)
568571
if test x"$CARGO" = x; then
569572
AC_MSG_ERROR([cannot find cargo, needed for rust code])

‎src/Makefile.am‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ XDR_FEATURE_FLAGS =
100100
if CAP_0083
101101
XDR_FEATURE_FLAGS += -DCAP_0083
102102
endif
103+
if CAP_0085_EXECUTABLE_REF
104+
XDR_FEATURE_FLAGS += -DCAP_0085_EXECUTABLE_REF
105+
endif
103106

104107
SUFFIXES = .x .h .rs
105108
.x.h:
@@ -202,9 +205,15 @@ SOROBAN_BUILD_DIR=$(abspath $(RUST_BUILD_DIR))/soroban
202205
# ALL_SOROBAN_PROTOCOLS as you see fit).
203206

204207
ALL_SOROBAN_PROTOCOLS=p21 p22 p23 p24 p25 p26 p27
205-
WIP_SOROBAN_PROTOCOL=
208+
WIP_SOROBAN_PROTOCOL=p28
206209

207210
CARGO_XDR_FEATURE_FLAGS =
211+
if CAP_0085_EXECUTABLE_REF
212+
# CAP-0085 host code is gated on the per-cap leaf feature `cap_0085_executable_ref`
213+
# (rs-soroban-env#1703), which the umbrella `next` feature aggregates; building the
214+
# p28 host with `next` enables it and pulls in the matching stellar-xdr XDR variant.
215+
CARGO_XDR_FEATURE_FLAGS += --features next
216+
endif
208217

209218
if ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION
210219
ALL_SOROBAN_PROTOCOLS+=$(WIP_SOROBAN_PROTOCOL)

‎src/protocol-curr/xdr‎

‎src/rust/Cargo.toml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ tracy-client = { version = "=0.17.0", features = [
114114
# Cargo.lock! The unified build will re-resolve transitive dependencies and
115115
# unify them, perturbing the contents of the lockfile.
116116

117+
[dependencies.soroban-env-host-p28]
118+
version = "=27.0.0"
119+
git = "https://github.com/sisuresh/rs-soroban-env"
120+
package = "soroban-env-host"
121+
rev = "b505cd7884a63b7eab72433d41fe02b6623aa8ea"
122+
optional = true
123+
117124
[dependencies.soroban-env-host-p27]
118125
version = "=26.1.2"
119126
git = "https://github.com/stellar/rs-soroban-env"
@@ -202,7 +209,9 @@ unified = ["dep:soroban-env-host-p21",
202209
"dep:soroban-env-host-p24",
203210
"dep:soroban-env-host-p25",
204211
"dep:soroban-env-host-p26",
205-
"dep:soroban-env-host-p27"]
212+
"dep:soroban-env-host-p27",
213+
"dep:soroban-env-host-p28",
214+
"soroban-env-host-p28/next"]
206215

207216
tracy = ["dep:tracy-client"]
208217

0 commit comments

Comments
 (0)