From f41047c9a716431c321dacc54e1a6e47d26b4350 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:55:08 +0000 Subject: [PATCH 1/5] patch xdr and spec crates to pending prs --- Cargo.lock | 113 +++++++++++------- Cargo.toml | 29 +++-- cmd/crates/soroban-spec-tools/src/contract.rs | 2 +- cmd/crates/soroban-spec-tools/src/lib.rs | 17 ++- 4 files changed, 104 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a63546cca6..b262341f21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5088,6 +5088,16 @@ dependencies = [ "syn 2.0.118", ] +[[package]] +name = "serde_ignored" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115dffd5f3853e06e746965a20dcbae6ee747ae30b543d91b0e089668bb07798" +dependencies = [ + "serde", + "serde_core", +] + [[package]] name = "serde_json" version = "1.0.150" @@ -5371,9 +5381,9 @@ dependencies = [ [[package]] name = "soroban-builtin-sdk-macros" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b77bc93d930032c487cb1506b6ed166b2af49db76d52678ec4887ac621ecce01" +checksum = "dc470cc875cbdeb5ffb0fcb45017803c94b65075d493f097304b132ab95f353c" dependencies = [ "itertools 0.13.0", "proc-macro2", @@ -5446,7 +5456,7 @@ dependencies = [ "stellar-ledger", "stellar-rpc-client", "stellar-strkey 0.0.16", - "stellar-xdr", + "stellar-xdr 28.0.0", "strsim", "strum 0.17.1", "strum_macros 0.17.1", @@ -5474,12 +5484,12 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b22e9981cdd444f3aa6734bc58d76195bf7eca3ccf1dd432b875af5d02da068" +checksum = "74059594274a1b51d0ec410ef1acd9009a888e73c5f8bdd5577d28ea8766e6f2" dependencies = [ "arbitrary", - "crate-git-revision 0.0.6", + "crate-git-revision 0.0.9", "ethnum", "num-derive", "num-traits", @@ -5487,15 +5497,15 @@ dependencies = [ "soroban-env-macros", "soroban-wasmi", "static_assertions", - "stellar-xdr", + "stellar-xdr 28.0.0", "wasmparser 0.116.1", ] [[package]] name = "soroban-env-guest" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6072f99ca6bf8e8d5b04e05d083dac785e5357d9c0f36a6658f819c2fd7d67" +checksum = "769c70c3273c4cb741046db161e804b91b8df81f9df2013dfb98d65370a716cc" dependencies = [ "soroban-env-common", "static_assertions", @@ -5503,9 +5513,9 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c06afd7c75ce150ce53e4d77a77645b18e3fb61856a0ddc42bfcecdc39fa3b9" +checksum = "7d3d108fff17fd4181343e29fd8d81d5053dfc29b337643e3b6c38e750eeb2f7" dependencies = [ "ark-bls12-381", "ark-bn254", @@ -5540,16 +5550,16 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "27.0.1" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "647811bdd28a3ec40296987f6635781e5e1141c8f5affbbd53ba12b6295b7bb6" +checksum = "45f63006270b7ddfa604f4a12a43d1f489aa96c280877f24e37a139bb69964af" dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", "serde", "serde_json", - "stellar-xdr", + "stellar-xdr 28.0.0", "syn 2.0.118", ] @@ -5559,9 +5569,8 @@ version = "27.1.0" [[package]] name = "soroban-ledger-snapshot" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ea48b5d5e22c0cbaa370f813111016c9f5a8a6632edb0684c72be6531c4d3a" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" dependencies = [ "serde", "serde_json", @@ -5573,9 +5582,8 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cfa78af0110f0830d3af9db0361b6cdb50507846cedb8725189318134218b80" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" dependencies = [ "arbitrary", "bytes-lit", @@ -5592,14 +5600,14 @@ dependencies = [ "soroban-ledger-snapshot", "soroban-sdk-macros", "stellar-strkey 0.0.16", + "stellar-xdr 28.0.0", "visibility", ] [[package]] name = "soroban-sdk-macros" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db611bd0acfe5fd348ffdcef16c84090c6ab051f3e325b5ac049a73044a7ee6" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" dependencies = [ "darling 0.20.11", "heck 0.5.0", @@ -5611,35 +5619,33 @@ dependencies = [ "soroban-env-common", "soroban-spec", "soroban-spec-rust", - "stellar-xdr", + "stellar-xdr 28.0.0", "syn 2.0.118", ] [[package]] name = "soroban-spec" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8061fe31998fe9fba8fcd7175b3e3ca914a6f6e3bf829fe91fdf7f930b1251d9" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" dependencies = [ "base64 0.22.1", "sha2 0.10.9", - "stellar-xdr", + "stellar-xdr 28.0.0", "thiserror 1.0.69", "wasmparser 0.116.1", ] [[package]] name = "soroban-spec-rust" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2180cddacf3023a439827cb35c0e391ec413b1328173fe7c8c2743fc67b3af9e" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" dependencies = [ "prettyplease", "proc-macro2", "quote", "sha2 0.10.9", "soroban-spec", - "stellar-xdr", + "stellar-xdr 28.0.0", "syn 2.0.118", "thiserror 1.0.69", ] @@ -5658,7 +5664,7 @@ dependencies = [ "serde_json", "soroban-spec", "stellar-strkey 0.0.16", - "stellar-xdr", + "stellar-xdr 28.0.0", "thiserror 1.0.69", "tokio", "wasm-encoder 0.235.0", @@ -5681,7 +5687,7 @@ dependencies = [ "serde_json", "sha2 0.9.9", "soroban-spec", - "stellar-xdr", + "stellar-xdr 28.0.0", "temp-dir", "thiserror 1.0.69", "walkdir", @@ -5729,18 +5735,16 @@ dependencies = [ [[package]] name = "soroban-token-sdk" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52c6f247f1c3383b9fa8f8ab6bf3c6c7b36e893a2fff585bc819cbc89ec193" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" dependencies = [ "soroban-sdk", ] [[package]] name = "soroban-token-spec" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7417a2ae69b4a6fc52f986c3d501b3bd442ba976a0991f042f81f7ee593e1b30" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" dependencies = [ "soroban-sdk", "soroban-token-sdk", @@ -5789,9 +5793,8 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stellar-asset-spec" -version = "27.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9943559865bce30221f21f2bdd45352c91c253ddf1002dba413a7a0ffc23945" +version = "27.0.5" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" dependencies = [ "soroban-sdk", "soroban-token-sdk", @@ -5833,7 +5836,7 @@ dependencies = [ "serial_test", "sha2 0.10.9", "stellar-strkey 0.0.16", - "stellar-xdr", + "stellar-xdr 28.0.0", "test-case", "testcontainers", "thiserror 1.0.69", @@ -5859,7 +5862,7 @@ dependencies = [ "serde_with", "sha2 0.10.9", "stellar-strkey 0.0.16", - "stellar-xdr", + "stellar-xdr 27.0.0", "termcolor", "termcolor_output", "thiserror 1.0.69", @@ -5897,18 +5900,36 @@ name = "stellar-xdr" version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05ff843326969bdf1ef673dcdba94c08f4a3c8f1e58d6e6ef39b1bd4f749179a" +dependencies = [ + "base64 0.22.1", + "cfg_eval", + "crate-git-revision 0.0.6", + "escape-bytes", + "ethnum", + "hex", + "serde", + "serde_with", + "sha2 0.10.9", + "stellar-strkey 0.0.13", +] + +[[package]] +name = "stellar-xdr" +version = "28.0.0" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=99a031a6f6a0935f68c073705651bd1addca1fd4#99a031a6f6a0935f68c073705651bd1addca1fd4" dependencies = [ "arbitrary", "base64 0.22.1", "cfg_eval", "clap", - "crate-git-revision 0.0.6", + "crate-git-revision 0.0.9", "escape-bytes", "ethnum", "hex", "rand 0.9.2", "schemars 0.8.22", "serde", + "serde_ignored", "serde_json", "serde_with", "sha2 0.10.9", diff --git a/Cargo.toml b/Cargo.toml index 71f7573e4d..a7a0731ac6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,30 +44,30 @@ path = "cmd/crates/stellar-ledger" # Dependencies from the rs-stellar-xdr repo: [workspace.dependencies.stellar-xdr] -version = "27.0.0" +version = "28.0.0" # Dependencies from the rs-stellar-env repo: [workspace.dependencies.soroban-env-host] -version = "27.0.1" +version = "28.0.1" # Dependencies from the rs-soroban-sdk repo: [workspace.dependencies.soroban-spec] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.soroban-spec-rust] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.soroban-sdk] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.soroban-token-sdk] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.stellar-asset-spec] -version = "27.0.2" +version = "27.0.5" [workspace.dependencies.soroban-ledger-snapshot] -version = "27.0.2" +version = "27.0.5" # Dependencies from the rs-stellar-rpc-client repo: [workspace.dependencies.soroban-rpc] @@ -120,6 +120,19 @@ testcontainers = "0.27.2" httpmock = "0.7.0" astral-tokio-tar = "0.6.0" +[patch.crates-io] +# Pending https://github.com/stellar/rs-stellar-xdr/pull/566, which widens the +# user-defined type name limit so that a fully qualified type name fits. +stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "99a031a6f6a0935f68c073705651bd1addca1fd4" } +# Pending https://github.com/stellar/rs-soroban-sdk/pull/1970, which names +# user-defined types in contract specs by their fully qualified path. +soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } +soroban-spec-rust = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } +soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } +soroban-token-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } +stellar-asset-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } +soroban-ledger-snapshot = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } + [profile.release] overflow-checks = true diff --git a/cmd/crates/soroban-spec-tools/src/contract.rs b/cmd/crates/soroban-spec-tools/src/contract.rs index 2cc1343e75..a7445e6e55 100644 --- a/cmd/crates/soroban-spec-tools/src/contract.rs +++ b/cmd/crates/soroban-spec-tools/src/contract.rs @@ -311,7 +311,7 @@ fn indent(s: &str, n: usize) -> String { .join("\n") } -fn format_name(lib: &StringM<80>, name: &StringM<60>) -> String { +fn format_name(lib: &StringM<80>, name: &StringM<256>) -> String { if lib.is_empty() { sanitize(&name.to_utf8_string_lossy()) } else { diff --git a/cmd/crates/soroban-spec-tools/src/lib.rs b/cmd/crates/soroban-spec-tools/src/lib.rs index a12d5821b8..375c9eaffc 100644 --- a/cmd/crates/soroban-spec-tools/src/lib.rs +++ b/cmd/crates/soroban-spec-tools/src/lib.rs @@ -372,7 +372,7 @@ impl Spec { Ok(val) } - fn parse_udt(&self, name: &StringM<60>, value: &Value) -> Result { + fn parse_udt(&self, name: &StringM<256>, value: &Value) -> Result { let name = &name.to_utf8_string_lossy(); match (self.find(name)?, value) { (ScSpecEntry::UdtStructV0(strukt), Value::Object(map)) => { @@ -649,7 +649,7 @@ impl Spec { /// # Panics /// /// May panic - pub fn udt_to_json(&self, name: &StringM<60>, sc_obj: &ScVal) -> Result { + pub fn udt_to_json(&self, name: &StringM<256>, sc_obj: &ScVal) -> Result { let name = &name.to_utf8_string_lossy(); let udt = self.find(name)?; Ok(match (sc_obj, udt) { @@ -1002,6 +1002,11 @@ pub fn to_json(v: &ScVal) -> Result { .map_err(|_| Error::InvalidValue(Some(ScType::Symbol)))? .to_string(), ), + ScVal::ExecutableTag(v) => Value::String( + std::str::from_utf8(v.as_slice()) + .map_err(|_| Error::InvalidValue(Some(ScType::String)))? + .to_string(), + ), ScVal::Vec(v) => { let values: Result, Error> = v.as_ref().map_or_else( || Ok(vec![]), @@ -1094,6 +1099,14 @@ pub fn to_json(v: &ScVal) -> Result { executable: ContractExecutable::StellarAsset, .. }) => json!({"SAC": true}), + ScVal::ContractInstance(ScContractInstance { + executable: ContractExecutable::ExternalRef(external_ref), + .. + }) => json!({ + "executable_owner": sc_address_to_json(&external_ref.executable_owner), + "tag": std::str::from_utf8(external_ref.tag.as_slice()) + .map_err(|_| Error::InvalidValue(Some(ScType::String)))?, + }), ScVal::LedgerKeyNonce(ScNonceKey { nonce }) => { Value::Number(serde_json::Number::from(*nonce)) } From 1f65d7e325c5b09d730ee274e98b1bce4ace423d Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 7 Aug 2026 16:07:41 +0000 Subject: [PATCH 2/5] patch rpc client to xdr 28 and adapt cli --- Cargo.lock | 53 ++++++------------- Cargo.toml | 3 ++ Makefile | 2 +- .../fixtures/test-wasms/token/src/contract.rs | 2 +- .../src/commands/contract/arg_parsing.rs | 10 ++-- cmd/soroban-cli/src/get_spec.rs | 6 +++ cmd/soroban-cli/src/log/auth.rs | 9 ++++ cmd/soroban-cli/src/wasm.rs | 9 +++- 8 files changed, 50 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b262341f21..2036959875 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1194,7 +1194,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -2791,7 +2791,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.4", + "socket2 0.5.10", "system-configuration", "tokio", "tower-service", @@ -4305,7 +4305,7 @@ dependencies = [ "quinn-udp", "rustc-hash 2.1.1", "rustls", - "socket2 0.6.4", + "socket2 0.5.10", "thiserror 2.0.18", "tokio", "tracing", @@ -4342,7 +4342,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.4", + "socket2 0.5.10", "tracing", "windows-sys 0.60.2", ] @@ -5456,7 +5456,7 @@ dependencies = [ "stellar-ledger", "stellar-rpc-client", "stellar-strkey 0.0.16", - "stellar-xdr 28.0.0", + "stellar-xdr", "strsim", "strum 0.17.1", "strum_macros 0.17.1", @@ -5497,7 +5497,7 @@ dependencies = [ "soroban-env-macros", "soroban-wasmi", "static_assertions", - "stellar-xdr 28.0.0", + "stellar-xdr", "wasmparser 0.116.1", ] @@ -5559,7 +5559,7 @@ dependencies = [ "quote", "serde", "serde_json", - "stellar-xdr 28.0.0", + "stellar-xdr", "syn 2.0.118", ] @@ -5600,7 +5600,7 @@ dependencies = [ "soroban-ledger-snapshot", "soroban-sdk-macros", "stellar-strkey 0.0.16", - "stellar-xdr 28.0.0", + "stellar-xdr", "visibility", ] @@ -5619,7 +5619,7 @@ dependencies = [ "soroban-env-common", "soroban-spec", "soroban-spec-rust", - "stellar-xdr 28.0.0", + "stellar-xdr", "syn 2.0.118", ] @@ -5630,7 +5630,7 @@ source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e7 dependencies = [ "base64 0.22.1", "sha2 0.10.9", - "stellar-xdr 28.0.0", + "stellar-xdr", "thiserror 1.0.69", "wasmparser 0.116.1", ] @@ -5645,7 +5645,7 @@ dependencies = [ "quote", "sha2 0.10.9", "soroban-spec", - "stellar-xdr 28.0.0", + "stellar-xdr", "syn 2.0.118", "thiserror 1.0.69", ] @@ -5664,7 +5664,7 @@ dependencies = [ "serde_json", "soroban-spec", "stellar-strkey 0.0.16", - "stellar-xdr 28.0.0", + "stellar-xdr", "thiserror 1.0.69", "tokio", "wasm-encoder 0.235.0", @@ -5687,7 +5687,7 @@ dependencies = [ "serde_json", "sha2 0.9.9", "soroban-spec", - "stellar-xdr 28.0.0", + "stellar-xdr", "temp-dir", "thiserror 1.0.69", "walkdir", @@ -5836,7 +5836,7 @@ dependencies = [ "serial_test", "sha2 0.10.9", "stellar-strkey 0.0.16", - "stellar-xdr 28.0.0", + "stellar-xdr", "test-case", "testcontainers", "thiserror 1.0.69", @@ -5847,8 +5847,7 @@ dependencies = [ [[package]] name = "stellar-rpc-client" version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b65ae2e8788c09fba690afa3b589094fd67ff4d7d5ec4502ec4f2d7d870576" +source = "git+https://github.com/stellar/rs-stellar-rpc-client?rev=e0d44a0b97959820e855eb9058e2114ac390c1fa#e0d44a0b97959820e855eb9058e2114ac390c1fa" dependencies = [ "clap", "hex", @@ -5862,7 +5861,7 @@ dependencies = [ "serde_with", "sha2 0.10.9", "stellar-strkey 0.0.16", - "stellar-xdr 27.0.0", + "stellar-xdr", "termcolor", "termcolor_output", "thiserror 1.0.69", @@ -5895,24 +5894,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "stellar-xdr" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ff843326969bdf1ef673dcdba94c08f4a3c8f1e58d6e6ef39b1bd4f749179a" -dependencies = [ - "base64 0.22.1", - "cfg_eval", - "crate-git-revision 0.0.6", - "escape-bytes", - "ethnum", - "hex", - "serde", - "serde_with", - "sha2 0.10.9", - "stellar-strkey 0.0.13", -] - [[package]] name = "stellar-xdr" version = "28.0.0" @@ -7312,7 +7293,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index a7a0731ac6..e5471735d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,6 +132,9 @@ soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1a soroban-token-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } stellar-asset-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } soroban-ledger-snapshot = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } +# Pending https://github.com/stellar/rs-stellar-rpc-client/pull/108, which +# updates the client to stellar-xdr 28. +stellar-rpc-client = { git = "https://github.com/stellar/rs-stellar-rpc-client", rev = "e0d44a0b97959820e855eb9058e2114ac390c1fa" } [profile.release] overflow-checks = true diff --git a/Makefile b/Makefile index 6e633d8078..397040e81d 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ build: cargo build build-test-wasms: - cargo build --package 'test_*' --profile test-wasms --target wasm32v1-none + SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2=1 cargo build --package 'test_*' --profile test-wasms --target wasm32v1-none build-test: build-test-wasms build-fixtures install diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs b/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs index eac10e5751..8a30558a34 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/src/contract.rs @@ -96,7 +96,7 @@ impl token::Interface for Token { from: from.clone(), spender: spender.clone(), amount, - expiration_ledger, + live_until_ledger: expiration_ledger, } .publish(&e); } diff --git a/cmd/soroban-cli/src/commands/contract/arg_parsing.rs b/cmd/soroban-cli/src/commands/contract/arg_parsing.rs index c97cfa551f..db3acbb124 100644 --- a/cmd/soroban-cli/src/commands/contract/arg_parsing.rs +++ b/cmd/soroban-cli/src/commands/contract/arg_parsing.rs @@ -1074,7 +1074,7 @@ mod tests { }; // Build a minimal Spec with a union type: enum MyEnum { Unit } - let union_name: StringM<60> = "MyEnum".try_into().unwrap(); + let union_name: StringM<256> = "MyEnum".try_into().unwrap(); let case_name: StringM<60> = "Unit".try_into().unwrap(); let spec = Spec(Some(vec![ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { doc: StringM::default(), @@ -1123,7 +1123,7 @@ mod tests { ScSpecUdtUnionCaseV0, ScSpecUdtUnionCaseVoidV0, ScSpecUdtUnionV0, StringM, }; - let union_name: StringM<60> = "MyEnum".try_into().unwrap(); + let union_name: StringM<256> = "MyEnum".try_into().unwrap(); let spec = Spec(Some(vec![ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { doc: StringM::default(), lib: StringM::default(), @@ -1190,7 +1190,7 @@ mod tests { use stellar_xdr::{ ScSpecEntry, ScSpecTypeUdt, ScSpecUdtStructFieldV0, ScSpecUdtStructV0, StringM, }; - let struct_name: StringM<60> = name.try_into().unwrap(); + let struct_name: StringM<256> = name.try_into().unwrap(); let fields_xdr: Vec = fields .iter() .map(|(n, t)| ScSpecUdtStructFieldV0 { @@ -1324,7 +1324,7 @@ mod tests { ScSpecUdtUnionV0, StringM, }; - let union_name: StringM<60> = "Choice".try_into().unwrap(); + let union_name: StringM<256> = "Choice".try_into().unwrap(); let spec = Spec(Some(vec![ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { doc: StringM::default(), lib: StringM::default(), @@ -1362,7 +1362,7 @@ mod tests { ScSpecUdtUnionV0, StringM, }; - let union_name: StringM<60> = "OneOf".try_into().unwrap(); + let union_name: StringM<256> = "OneOf".try_into().unwrap(); let spec = Spec(Some(vec![ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { doc: StringM::default(), lib: StringM::default(), diff --git a/cmd/soroban-cli/src/get_spec.rs b/cmd/soroban-cli/src/get_spec.rs index a72069e7c5..3756caefa6 100644 --- a/cmd/soroban-cli/src/get_spec.rs +++ b/cmd/soroban-cli/src/get_spec.rs @@ -28,6 +28,11 @@ pub enum Error { Config(#[from] config::Error), #[error(transparent)] ContractSpec(#[from] contract_spec::Error), + #[error( + "cannot fetch spec for contract because the contract executable is \ + an external reference that does not have a downloadable code binary" + )] + ContractIsExternalRef, } /// @@ -76,5 +81,6 @@ pub async fn get_remote_contract_spec( ContractExecutable::StellarAsset => { soroban_spec::read::parse_raw(stellar_asset_spec::xdr())? } + ContractExecutable::ExternalRef(_) => return Err(Error::ContractIsExternalRef), }) } diff --git a/cmd/soroban-cli/src/log/auth.rs b/cmd/soroban-cli/src/log/auth.rs index fff3a5321f..0509369ed1 100644 --- a/cmd/soroban-cli/src/log/auth.rs +++ b/cmd/soroban-cli/src/log/auth.rs @@ -127,6 +127,15 @@ fn format_create_contract( ContractExecutable::StellarAsset => { let _ = writeln!(result, "{prefix} Executable: StellarAsset"); } + ContractExecutable::ExternalRef(external_ref) => { + let tag = std::str::from_utf8(external_ref.tag.as_ref()).unwrap_or(""); + let _ = writeln!( + result, + "{prefix} Executable: ExternalRef owner={} tag={}", + format_address(&external_ref.executable_owner), + sanitize(tag) + ); + } } if let Some(args) = constructor_args { if !args.is_empty() { diff --git a/cmd/soroban-cli/src/wasm.rs b/cmd/soroban-cli/src/wasm.rs index 406f001a04..6333ae1bc8 100644 --- a/cmd/soroban-cli/src/wasm.rs +++ b/cmd/soroban-cli/src/wasm.rs @@ -13,7 +13,7 @@ use crate::{ network::{Error as NetworkError, Network}, }, utils::{self, rpc::get_remote_wasm_from_hash}, - wasm::Error::{ContractIsStellarAsset, UnexpectedContractToken}, + wasm::Error::{ContractIsExternalRef, ContractIsStellarAsset, UnexpectedContractToken}, }; #[derive(thiserror::Error, Debug)] @@ -47,6 +47,11 @@ pub enum Error { a network built-in asset contract that does not have a downloadable code binary" )] ContractIsStellarAsset, + #[error( + "cannot fetch wasm for contract because the contract executable is \ + an external reference that does not have a downloadable code binary" + )] + ContractIsExternalRef, #[error(transparent)] Network(#[from] NetworkError), } @@ -133,6 +138,7 @@ pub async fn fetch_from_contract( return match &contract.executable { ContractExecutable::Wasm(hash) => Ok(get_remote_wasm_from_hash(&client, hash).await?), ContractExecutable::StellarAsset => Err(ContractIsStellarAsset), + ContractExecutable::ExternalRef(_) => Err(ContractIsExternalRef), }; } Err(UnexpectedContractToken(Box::new(data_entry))) @@ -158,6 +164,7 @@ pub async fn fetch_wasm_hash_from_contract( return match &contract.executable { ContractExecutable::Wasm(hash) => Ok(hash.clone()), ContractExecutable::StellarAsset => Err(ContractIsStellarAsset), + ContractExecutable::ExternalRef(_) => Err(ContractIsExternalRef), }; } Err(UnexpectedContractToken(Box::new(data_entry))) From 9de228b638930e17b45c2175d49a600527dcf487 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 7 Aug 2026 16:09:30 +0000 Subject: [PATCH 3/5] allow patched git sources in cargo-deny --- deny.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index dd05ae3b5b..b6a4d1c0b8 100644 --- a/deny.toml +++ b/deny.toml @@ -231,7 +231,15 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [ # Only used by the unpublished doc-gen crate, temporarily until PR is merged: https://github.com/ConnorGray/clap-markdown/pull/48 - "https://github.com/ConnorGray/clap-markdown?rev=42956b342cef3325d9060fc43995d595e7c8aa66" + "https://github.com/ConnorGray/clap-markdown?rev=42956b342cef3325d9060fc43995d595e7c8aa66", + + # Temporary patches, remove once the following PRs are merged and released: + # https://github.com/stellar/rs-stellar-xdr/pull/566 + "https://github.com/stellar/rs-stellar-xdr?rev=99a031a6f6a0935f68c073705651bd1addca1fd4", + # https://github.com/stellar/rs-soroban-sdk/pull/1970 + "https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db", + # https://github.com/stellar/rs-stellar-rpc-client/pull/108 + "https://github.com/stellar/rs-stellar-rpc-client?rev=e0d44a0b97959820e855eb9058e2114ac390c1fa", ] [sources.allow-org] From 008def0c0312483cc17ae2ff9a4ccf27d5409039 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 7 Aug 2026 17:07:07 +0000 Subject: [PATCH 4/5] update diagnostic event json field to type --- cmd/crates/soroban-test/tests/it/log.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crates/soroban-test/tests/it/log.rs b/cmd/crates/soroban-test/tests/it/log.rs index d580e52296..f515e3ffd6 100644 --- a/cmd/crates/soroban-test/tests/it/log.rs +++ b/cmd/crates/soroban-test/tests/it/log.rs @@ -30,7 +30,7 @@ fn test_diagnostic_events_logging() { }); let captured_logs = logs.lock().unwrap(); - assert!(captured_logs.iter().any(|log| log.contains(r#"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgfKvD/pIJPlRnGd3RKaBZSHfoq/nJbJSYxkVTScSbhuYAAAAPAAAABGRlY3IAAAAB {"in_successful_contract_call":false,"event":{"ext":"v0","contract_id":null,"type_":"diagnostic","body":{"v0":{"topics":[{"symbol":"fn_call"},{"bytes":"7cabc3fe92093e546719ddd129a0594877e8abf9c96c9498c6455349c49b86e6"},{"symbol":"decr"}],"data":"void"}}}}"#))); + assert!(captured_logs.iter().any(|log| log.contains(r#"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgfKvD/pIJPlRnGd3RKaBZSHfoq/nJbJSYxkVTScSbhuYAAAAPAAAABGRlY3IAAAAB {"in_successful_contract_call":false,"event":{"ext":"v0","contract_id":null,"type":"diagnostic","body":{"v0":{"topics":[{"symbol":"fn_call"},{"bytes":"7cabc3fe92093e546719ddd129a0594877e8abf9c96c9498c6455349c49b86e6"},{"symbol":"decr"}],"data":"void"}}}}"#))); assert!(captured_logs .iter() .any(|log| log.contains("VM call trapped"))); From 65c31beea0bc1ac14528f64eaa41ec94e9688fe7 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Sat, 8 Aug 2026 01:54:00 +0000 Subject: [PATCH 5/5] bump soroban spec crates to latest pr commit --- Cargo.lock | 17 ++++++++--------- Cargo.toml | 12 ++++++------ deny.toml | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2036959875..7ab83180d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5570,7 +5570,7 @@ version = "27.1.0" [[package]] name = "soroban-ledger-snapshot" version = "27.0.5" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "serde", "serde_json", @@ -5583,7 +5583,7 @@ dependencies = [ [[package]] name = "soroban-sdk" version = "27.0.5" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "arbitrary", "bytes-lit", @@ -5607,7 +5607,7 @@ dependencies = [ [[package]] name = "soroban-sdk-macros" version = "27.0.5" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "darling 0.20.11", "heck 0.5.0", @@ -5617,7 +5617,6 @@ dependencies = [ "quote", "sha2 0.10.9", "soroban-env-common", - "soroban-spec", "soroban-spec-rust", "stellar-xdr", "syn 2.0.118", @@ -5626,7 +5625,7 @@ dependencies = [ [[package]] name = "soroban-spec" version = "27.0.5" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "base64 0.22.1", "sha2 0.10.9", @@ -5638,7 +5637,7 @@ dependencies = [ [[package]] name = "soroban-spec-rust" version = "27.0.5" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "prettyplease", "proc-macro2", @@ -5736,7 +5735,7 @@ dependencies = [ [[package]] name = "soroban-token-sdk" version = "27.0.5" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "soroban-sdk", ] @@ -5744,7 +5743,7 @@ dependencies = [ [[package]] name = "soroban-token-spec" version = "27.0.5" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "soroban-sdk", "soroban-token-sdk", @@ -5794,7 +5793,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stellar-asset-spec" version = "27.0.5" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db#c68e1aff76c79998d9e765f8cce0aef727fb86db" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877#5727dc54b5a341d59677329d2dfbcead90bbf877" dependencies = [ "soroban-sdk", "soroban-token-sdk", diff --git a/Cargo.toml b/Cargo.toml index e5471735d9..15ec6c5ed5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -126,12 +126,12 @@ astral-tokio-tar = "0.6.0" stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "99a031a6f6a0935f68c073705651bd1addca1fd4" } # Pending https://github.com/stellar/rs-soroban-sdk/pull/1970, which names # user-defined types in contract specs by their fully qualified path. -soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } -soroban-spec-rust = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } -soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } -soroban-token-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } -stellar-asset-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } -soroban-ledger-snapshot = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "c68e1aff76c79998d9e765f8cce0aef727fb86db" } +soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +soroban-spec-rust = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +soroban-token-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +stellar-asset-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } +soroban-ledger-snapshot = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "5727dc54b5a341d59677329d2dfbcead90bbf877" } # Pending https://github.com/stellar/rs-stellar-rpc-client/pull/108, which # updates the client to stellar-xdr 28. stellar-rpc-client = { git = "https://github.com/stellar/rs-stellar-rpc-client", rev = "e0d44a0b97959820e855eb9058e2114ac390c1fa" } diff --git a/deny.toml b/deny.toml index b6a4d1c0b8..b521773797 100644 --- a/deny.toml +++ b/deny.toml @@ -237,7 +237,7 @@ allow-git = [ # https://github.com/stellar/rs-stellar-xdr/pull/566 "https://github.com/stellar/rs-stellar-xdr?rev=99a031a6f6a0935f68c073705651bd1addca1fd4", # https://github.com/stellar/rs-soroban-sdk/pull/1970 - "https://github.com/stellar/rs-soroban-sdk?rev=c68e1aff76c79998d9e765f8cce0aef727fb86db", + "https://github.com/stellar/rs-soroban-sdk?rev=5727dc54b5a341d59677329d2dfbcead90bbf877", # https://github.com/stellar/rs-stellar-rpc-client/pull/108 "https://github.com/stellar/rs-stellar-rpc-client?rev=e0d44a0b97959820e855eb9058e2114ac390c1fa", ]