[Bug Fix] Resolve Cargo Workspace Dependency Version Mismatch Across Contracts - #716
Open
abbys-code-hub wants to merge 4 commits into
Open
[Bug Fix] Resolve Cargo Workspace Dependency Version Mismatch Across Contracts#716abbys-code-hub wants to merge 4 commits into
abbys-code-hub wants to merge 4 commits into
Conversation
…on and fee bump preview
|
@abbys-code-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…encies - Replace explicit member list with 'contracts/*' glob pattern - Add [workspace.dependencies] section pinning soroban-sdk = '22.0.0' - Ensures all current and future contracts inherit a single SDK version
- Had both '20.5.0' and '22.0.0' soroban-sdk entries - Replaced with workspace = true to inherit from root workspace
…rkspace = true - Updates 31 contract crates to inherit soroban-sdk version from workspace - Preserves per-crate feature flags (testutils, etc.)
abbys-code-hub
force-pushed
the
feat/version-mismatch
branch
from
July 28, 2026 12:35
b809b61 to
e6946d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixes workspace compilation failures caused by conflicting
soroban-sdkversions across contract crates. All 32+ contractCargo.tomlfiles now inheritsoroban-sdkfrom the root[workspace.dependencies], guaranteeing a single pinned version (22.0.0) across the entire workspace.Closes #678
Root Cause
The root
Cargo.tomlworkspace only included 3 contracts (error_codes,math,staking_rewards) explicitly, while the remaining 29+ contracts were standalone crates each pinning their ownsoroban-sdkversion. This caused compilation failures when different contracts in the dependency graph resolved to different SDK versions.A critical bug was found in
contracts/cross_chain_payload/Cargo.tomlwhich had twosoroban-sdkentries — one pinned at20.5.0and another at22.0.0— which would cause an immediate Cargo resolution failure.Changes
Root
Cargo.toml"contracts/*"— automatically includes all current and future contract directories[workspace.dependencies]section withsoroban-sdk = "22.0.0"as the single source of truthcontracts/cross_chain_payload/Cargo.tomlsoroban-sdkentries (20.5.0and22.0.0) and replaced with{ workspace = true, features = ["testutils"] }All 32 Contract
Cargo.tomlFiles[dependencies]: Changedsoroban-sdk = "22.0.0"→soroban-sdk.workspace = true[dev-dependencies]: Changedsoroban-sdk = { version = "22.0.0", features = ["testutils"] }→soroban-sdk = { workspace = true, features = ["testutils"] }Files Changed
33 files — 65 insertions, 65 deletions
Cargo.toml[workspace.dependencies]contracts/cross_chain_payload/Cargo.tomlcontracts/*/Cargo.toml(31 files)soroban-sdk→workspace = trueDesign Decisions
"contracts/*"ensures new contracts automatically participate in workspace versioning without needing to update the root manifestsoroban-sdkfeatures it needs (e.g.,testutilsfor dev) via{ workspace = true, features = [...] }core/not included: Thecorecrate usessoroban-sdkvia a different dependency pattern and is intentionally kept outside the workspace to avoid dependency conflicts with its unique requirements (soroban-env-host, etc.)Acceptance Criteria
soroban-sdkversion from root workspacecross_chain_payloadduplicate version conflict resolvedsoroban-sdkversions remain in any contractCargo.tomltestutils, etc.) preserved via per-crate feature declarationscargo checkandcargo test— CI will validate compilation (cargo not installed in dev environment)Closes #678