Skip to content

Commit 6fc071c

Browse files
fix(contracts): force ed25519-dalek 2.1.1 via cargo patch and CI lockfile pin
Workspace deps alone still let soroban-env-host compile against ed25519-dalek 3.0. Patch crates.io to the 2.1.1 git tag and generate a pinned lockfile in CI before builds. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7a5373a commit 6fc071c

6 files changed

Lines changed: 11 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ jobs:
5858
with:
5959
workspaces: contracts
6060

61+
- name: Pin ed25519-dalek lockfile
62+
run: |
63+
cargo generate-lockfile
64+
cargo update -p ed25519-dalek --precise 2.1.1
65+
6166
- name: cargo fmt
6267
run: cargo fmt --all -- --check
6368

contracts/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ soroban-sdk = { version = "22.0.0", features = ["alloc"] }
2626
# Pin 2.x so CI stays on the API soroban-env-host 22.1.3 was written for.
2727
ed25519-dalek = { version = "=2.1.1", features = ["rand_core"] }
2828

29+
# Force every crates.io ed25519-dalek resolution (including soroban-env-host's
30+
# loose `>=2.0.0`) onto 2.1.1. Without this, Cargo can still compile
31+
# soroban-env-host against ed25519-dalek 3.0 while other crates use 2.x.
32+
[patch.crates-io]
33+
ed25519-dalek = { git = "https://github.com/dalek-cryptography/curve25519-dalek", tag = "ed25519-2.1.1", features = ["rand_core"] }
34+
2935
[profile.release]
3036
opt-level = "z"
3137
overflow-checks = true

contracts/batch-wallet/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ crate-type = ["cdylib", "rlib"]
99
[dependencies]
1010
soroban-sdk.workspace = true
1111

12-
[target.'cfg(not(target_family = "wasm"))'.dependencies]
13-
ed25519-dalek.workspace = true
14-
1512
[dev-dependencies]
1613
soroban-sdk = { workspace = true, features = ["testutils"] }

contracts/gist-registry/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ crate-type = ["cdylib", "rlib"]
99
[dependencies]
1010
soroban-sdk.workspace = true
1111

12-
[target.'cfg(not(target_family = "wasm"))'.dependencies]
13-
ed25519-dalek.workspace = true
14-
1512
[dev-dependencies]
1613
soroban-sdk = { workspace = true, features = ["testutils"] }

contracts/governance/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ crate-type = ["cdylib", "rlib"]
99
[dependencies]
1010
soroban-sdk.workspace = true
1111

12-
[target.'cfg(not(target_family = "wasm"))'.dependencies]
13-
ed25519-dalek.workspace = true
14-
1512
[dev-dependencies]
1613
soroban-sdk = { workspace = true, features = ["testutils"] }

contracts/multisig/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ crate-type = ["cdylib", "rlib"]
99
[dependencies]
1010
soroban-sdk.workspace = true
1111

12-
[target.'cfg(not(target_family = "wasm"))'.dependencies]
13-
ed25519-dalek.workspace = true
14-
1512
[dev-dependencies]
1613
soroban-sdk = { workspace = true, features = ["testutils"] }

0 commit comments

Comments
 (0)