Dependency Conflict Between `ic-cdk` and `sol_rpc_client` When Using Non-Replicated Outcalls

I want to use Non-Replicated Outcalls to make calls to different chain RPCs, as our project runs on a canister and supports multiple chains via their respective RPC endpoints.

However, when I try to use the sol_rpc_client crate in my canister, I encounter the following dependency error:

error: failed to select a version for ic-cdk-executor
… required by package ic-cdk v0.17.2
… which satisfies dependency ic-cdk = "^0.17.2" of package sol_rpc_client v2.0.0
… which satisfies dependency sol_rpc_client = "^2.0.0" of package test_backend v0.1.0

versions that meet the requirements ^0.1.0 are: 0.1.0

package ic-cdk-executor links to the native library "ic-cdk async executor"
(see https://github.com/dfinity/cdk-rs/blob/links-pin/TROUBLESHOOTING.md),
but it conflicts with a previous package which also links to
"ic-cdk async executor":

package ic-cdk-executor v2.0.0
… which satisfies dependency ic-cdk-executor = "^2.0.0" of package ic-cdk v0.19.0
… which satisfies dependency ic-cdk = "^0.19.0" of package test_backend v0.1.0

Only one package in the dependency graph may specify the same `links` value.
This ensures that only one copy of a native library is linked in the final
binary.

failed to select a version for ic-cdk-executor which could resolve this conflict

From the error, it looks like ic-cdk version 0.19.0 is not compatible with sol_rpc_client version 2.0.0, due to conflicting versions of ic-cdk-executor.

My current Cargo.toml:

[package]
name = "test_backend"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
candid = "0.10.10"
ic-cdk = "0.19.0"
serde = "1.0.228"
sol_rpc_client = "2.0.0"

Questions

  • Is sol_rpc_client currently incompatible with ic-cdk >= 0.19.0?
  • Is there a recommended version matrix for using sol_rpc_client inside canisters?
  • What is the best way to resolve this conflict when using Non-Replicated Outcalls?

Any guidance or best practices would be appreciated.

Hi @Harshal0902! We’ve just released sol_rpc_client@4.0.0 which now depends on the ic-cdk@0.19.0. Note that although the new version of the client uses ic-cdk@0.19.0, the SOL RPC canister does not offer support for non-replicated outcalls yet.

1 Like

Hi @lpahlavi thank you for the update. After upgrading to sol_rpc_client@4.0.0, everything is working fine now.

1 Like