From c7796c17d891ed3eaf63daf4d25b1e88ae84142e Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 02:55:37 +0000 Subject: [PATCH 1/6] update stellar-strkey to 0.0.17 --- Cargo.lock | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++--- Cargo.toml | 2 +- src/str.rs | 36 +++++++++++---------------- 3 files changed, 84 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 641b9e9a..e691f28b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,6 +65,12 @@ version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes-lit" version = "0.0.5" @@ -189,6 +195,17 @@ dependencies = [ "serde_json", ] +[[package]] +name = "crate-git-revision" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54851b5b3f24621804b1cded2820975623c205e3055d2d44031cdb1237339ac8" +dependencies = [ + "serde", + "serde_derive", + "serde_json", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -367,6 +384,15 @@ dependencies = [ "wasi", ] +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -379,6 +405,17 @@ version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +[[package]] +name = "heapless" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ba4bd83f9415b58b4ed8dc5714c76e626a105be4646c02630ad730ad3b5aa4" +dependencies = [ + "hash32", + "stable_deref_trait", + "zeroize", +] + [[package]] name = "heck" version = "0.4.0" @@ -713,14 +750,22 @@ dependencies = [ "digest", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + [[package]] name = "stellar-strkey" -version = "0.0.13" +version = "0.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee1832fb50c651ad10f734aaf5d31ca5acdfb197a6ecda64d93fcdb8885af913" +checksum = "0247b168bdee20244445e3d9cdea697dde6211e88742dd04acfd1b498661e936" dependencies = [ - "crate-git-revision", + "crate-git-revision 0.0.9", "data-encoding", + "heapless", + "zeroize", ] [[package]] @@ -732,7 +777,7 @@ dependencies = [ "bytes-lit", "cfg_eval", "clap", - "crate-git-revision", + "crate-git-revision 0.0.6", "escape-bytes", "ethnum", "hex", @@ -980,3 +1025,23 @@ dependencies = [ "quote", "syn 2.0.101", ] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] diff --git a/Cargo.toml b/Cargo.toml index e497f31a..eeee3dd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ crate-git-revision = "0.0.6" [dependencies] cfg_eval = { version = "0.1.2", optional = true } -stellar-strkey = { version = "0.0.13", optional = true } +stellar-strkey = { version = "0.0.17", optional = true } base64 = { version = "0.22.1", optional = true } serde = { version = "1.0.139", features = ["derive"], optional = true } serde_with = { version = "3.12.0", features = ["schemars_0_8"], optional = true } diff --git a/src/str.rs b/src/str.rs index 26cff8bd..3d8dbd0b 100644 --- a/src/str.rs +++ b/src/str.rs @@ -160,8 +160,7 @@ impl core::str::FromStr for MuxedAccount { ed25519: Uint256(ed25519), id, })), - stellar_strkey::Strkey::PrivateKeyEd25519(_) - | stellar_strkey::Strkey::PreAuthTx(_) + stellar_strkey::Strkey::PreAuthTx(_) | stellar_strkey::Strkey::HashX(_) | stellar_strkey::Strkey::SignedPayloadEd25519(_) | stellar_strkey::Strkey::Contract(_) @@ -204,10 +203,8 @@ impl core::fmt::Display for SignerKeyEd25519SignedPayload { ed25519: Uint256(ed25519), payload, } = self; - let k = stellar_strkey::ed25519::SignedPayload { - ed25519: *ed25519, - payload: payload.into(), - }; + let k = stellar_strkey::ed25519::SignedPayload::new(*ed25519, payload.as_ref()) + .map_err(|_| core::fmt::Error)?; let s = k.to_string(); f.write_str(&s)?; Ok(()) @@ -217,11 +214,10 @@ impl core::fmt::Display for SignerKeyEd25519SignedPayload { impl core::str::FromStr for SignerKeyEd25519SignedPayload { type Err = Error; fn from_str(s: &str) -> core::result::Result { - let stellar_strkey::ed25519::SignedPayload { ed25519, payload } = - stellar_strkey::ed25519::SignedPayload::from_str(s)?; + let sp = stellar_strkey::ed25519::SignedPayload::from_str(s)?; Ok(SignerKeyEd25519SignedPayload { - ed25519: Uint256(ed25519), - payload: payload.try_into()?, + ed25519: Uint256(*sp.ed25519()), + payload: sp.payload().try_into()?, }) } } @@ -240,16 +236,13 @@ impl core::str::FromStr for SignerKey { stellar_strkey::Strkey::HashX(stellar_strkey::HashX(h)) => { Ok(SignerKey::HashX(Uint256(h))) } - stellar_strkey::Strkey::SignedPayloadEd25519( - stellar_strkey::ed25519::SignedPayload { ed25519, payload }, - ) => Ok(SignerKey::Ed25519SignedPayload( - SignerKeyEd25519SignedPayload { - ed25519: Uint256(ed25519), - payload: payload.try_into()?, - }, - )), - stellar_strkey::Strkey::PrivateKeyEd25519(_) - | stellar_strkey::Strkey::Contract(_) + stellar_strkey::Strkey::SignedPayloadEd25519(sp) => Ok( + SignerKey::Ed25519SignedPayload(SignerKeyEd25519SignedPayload { + ed25519: Uint256(*sp.ed25519()), + payload: sp.payload().try_into()?, + }), + ), + stellar_strkey::Strkey::Contract(_) | stellar_strkey::Strkey::MuxedAccountEd25519(_) | stellar_strkey::Strkey::LiquidityPool(_) | stellar_strkey::Strkey::ClaimableBalance(_) => Err(Error::Invalid), @@ -332,8 +325,7 @@ impl core::str::FromStr for ScAddress { )) => Ok(ScAddress::ClaimableBalance( ClaimableBalanceId::ClaimableBalanceIdTypeV0(Hash(claimable_balance)), )), - stellar_strkey::Strkey::PrivateKeyEd25519(_) - | stellar_strkey::Strkey::PreAuthTx(_) + stellar_strkey::Strkey::PreAuthTx(_) | stellar_strkey::Strkey::HashX(_) | stellar_strkey::Strkey::SignedPayloadEd25519(_) => Err(Error::Invalid), } From 6f3e5ca2b8c984011231d128be4d90bd1872350c Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 05:20:45 +0000 Subject: [PATCH 2/6] raise msrv to 1.87 for strkey 0.0.17 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index eeee3dd7..3460b21e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" version = "27.0.0" edition = "2021" -rust-version = "1.84.0" +rust-version = "1.87.0" [[bin]] name = "stellar-xdr" From e69fdd3bff66bd04ae4670e60ea53630a80b0446 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 05:32:12 +0000 Subject: [PATCH 3/6] allow new pedantic lints from 1.87 clippy --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 21635663..d8f8b168 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,10 @@ #![allow(clippy::tabs_in_doc_comments)] #![allow(clippy::doc_markdown)] #![allow(clippy::doc_lazy_continuation)] +// Pedantic lints raised by the newer clippy that ships with the bumped MSRV, +// firing on the auto-generated code. +#![allow(clippy::unnecessary_semicolon)] +#![allow(clippy::non_std_lazy_statics)] #![allow(unused_attributes)] //! Library and CLI containing types and functionality for working with Stellar From 150246b5017147ef8322b06e45a4ba8beaae9c93 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 16:07:16 +1000 Subject: [PATCH 4/6] Apply suggestion from @leighmcculloch --- src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d8f8b168..ecf86428 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,8 +6,6 @@ #![allow(clippy::tabs_in_doc_comments)] #![allow(clippy::doc_markdown)] #![allow(clippy::doc_lazy_continuation)] -// Pedantic lints raised by the newer clippy that ships with the bumped MSRV, -// firing on the auto-generated code. #![allow(clippy::unnecessary_semicolon)] #![allow(clippy::non_std_lazy_statics)] #![allow(unused_attributes)] From 5c69faa13f024d9e0791c66bd9fa382c6e83f952 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 14:49:35 +0000 Subject: [PATCH 5/6] update stellar-strkey to 0.0.18 0.0.18 includes the strkey CLI fix (accept owned variant keys for Decoded). It is not yet on crates.io, so temporarily patch stellar-strkey to the release/v0.0.18 branch to validate ahead of the release. Remove the patch once 0.0.18 is published. --- Cargo.lock | 5 ++--- Cargo.toml | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e691f28b..00b792f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -758,9 +758,8 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stellar-strkey" -version = "0.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0247b168bdee20244445e3d9cdea697dde6211e88742dd04acfd1b498661e936" +version = "0.0.18" +source = "git+https://github.com/stellar/rs-stellar-strkey?rev=73bf43778a4acad5e7b3589f54a5ec3607c4b7b1#73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" dependencies = [ "crate-git-revision 0.0.9", "data-encoding", diff --git a/Cargo.toml b/Cargo.toml index 3460b21e..6dcbd433 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ crate-git-revision = "0.0.6" [dependencies] cfg_eval = { version = "0.1.2", optional = true } -stellar-strkey = { version = "0.0.17", optional = true } +stellar-strkey = { version = "0.0.18", optional = true } base64 = { version = "0.22.1", optional = true } serde = { version = "1.0.139", features = ["derive"], optional = true } serde_with = { version = "3.12.0", features = ["schemars_0_8"], optional = true } @@ -66,3 +66,9 @@ cli = ["std", "type_enum", "base64", "serde", "serde_json", "schemars", "arbitra [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docs"] + +# Temporary: stellar-strkey 0.0.18 is not yet published to crates.io. Point at +# the release/v0.0.18 branch so this PR can be validated against the actual +# 0.0.18 code ahead of the release. Remove once 0.0.18 is published. +[patch.crates-io] +stellar-strkey = { git = "https://github.com/stellar/rs-stellar-strkey", rev = "73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" } From 355ac1d409d010ddc4062ef19a4ef5cd437a2b54 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 18 Jun 2026 03:22:05 +0000 Subject: [PATCH 6/6] depend on published stellar-strkey 0.0.18 0.0.18 is now published to crates.io, so drop the temporary [patch.crates-io] that pointed stellar-strkey at the release/v0.0.18 git branch (and the matching stellar-cli deny.toml allow-git entry). The dependency now resolves from crates.io. --- Cargo.lock | 3 ++- Cargo.toml | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 00b792f0..392e1a85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -759,7 +759,8 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stellar-strkey" version = "0.0.18" -source = "git+https://github.com/stellar/rs-stellar-strkey?rev=73bf43778a4acad5e7b3589f54a5ec3607c4b7b1#73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f34ff61c0ca6f1c2b4169e8d1633417bd9225f58b6175e4e317204565d16277" dependencies = [ "crate-git-revision 0.0.9", "data-encoding", diff --git a/Cargo.toml b/Cargo.toml index 6dcbd433..78a9c588 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,9 +66,3 @@ cli = ["std", "type_enum", "base64", "serde", "serde_json", "schemars", "arbitra [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docs"] - -# Temporary: stellar-strkey 0.0.18 is not yet published to crates.io. Point at -# the release/v0.0.18 branch so this PR can be validated against the actual -# 0.0.18 code ahead of the release. Remove once 0.0.18 is published. -[patch.crates-io] -stellar-strkey = { git = "https://github.com/stellar/rs-stellar-strkey", rev = "73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" }