Skip to content

fix(host): bound ed25519-dalek below v3#1706

Draft
kalepail wants to merge 2 commits into
stellar:mainfrom
kalepail:fix/ed25519-dalek-v2-1705
Draft

fix(host): bound ed25519-dalek below v3#1706
kalepail wants to merge 2 commits into
stellar:mainfrom
kalepail:fix/ed25519-dalek-v2-1705

Conversation

@kalepail

Copy link
Copy Markdown

What

Bound soroban-env-host's ed25519-dalek dependency to the compatible 2.x major.

Why

The host uses rand_chacha 0.3.1 / rand_core 0.6 when it calls SigningKey::generate in test utilities. The existing >=2.0.0 constraint lets a fresh lockfile select ed25519-dalek 3.0.0 / rand_core 0.10, which makes soroban-sdk 27.0.0 with testutils fail to compile due to an unsatisfied CryptoRng bound.

This is the narrow constraint fix discussed in #1705. The adjacent manifest comments already require these RNG-related versions to match.

Validation:

  • Minimal fresh-lock SDK 27 reproduction fails before the constraint/workaround and passes with the 2.x line.
  • Fresh dependency resolution with this manifest selects ed25519-dalek 2.2.0, not 3.0.0.
  • cargo test -p soroban-env-host --lib: 766 passed, 0 failed.

Fixes #1705.

Known limitations

The published soroban-env-host 27.0.0 crate will still require a patch release (or a downstream direct pin/lockfile) for existing SDK 27 consumers to receive this bound.

Host test utilities use rand_core 0.6 through rand_chacha 0.3. Fresh lockfiles otherwise select ed25519-dalek 3 and fail the CryptoRng bound.

Fixes stellar#1705
@kalepail
kalepail force-pushed the fix/ed25519-dalek-v2-1705 branch from 9b8fea7 to 960ebd0 Compare July 15, 2026 14:14

@leighmcculloch leighmcculloch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good although we should simplify it per below.

hmac = "0.12.1"
# NB: We'll need to pin this again after switching the Core to the new env version.
ed25519-dalek = {version = ">=2.0.0", features = ["rand_core"] }
ed25519-dalek = {version = ">=2.0.0, <3.0.0", features = ["rand_core"] }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definition simply needs to be the version, it is equivalent.

Suggested change
ed25519-dalek = {version = ">=2.0.0, <3.0.0", features = ["rand_core"] }
ed25519-dalek = {version = "2.0.0", features = ["rand_core"] }

When no operator is provided, then it is equivalent to using a caret ^2.0.0 which is equivalent to >= 2.0.0, <3.0.0.

Ref: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#version-requirement-syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fresh SDK 27 testutils lock resolves incompatible ed25519-dalek 3

2 participants