Skip to content

Conversation

@DecentAgeCoder
Copy link

@DecentAgeCoder DecentAgeCoder commented Sep 25, 2025

Motivation

To resolve the ingress timeout issue for update calls to the Bitcoin canister, we need to migrate the ic-cdk and its dependent Rust libraries.

Upgrading major ic-cdk and dependent versions from:

ic-cdk = "0.17.2"
ic-cdk-macros = "0.17.0"
ic-ledger-types = "0.13.0"
pocket-ic = "4.0.0"

to:

ic-cdk = "0.18.7"
ic-cdk-macros = "0.18.7"
ic-ledger-types = "0.15.0"
pocket-ic = "9.0.2"

Relevant sources:

Changes

Fixing compile/lint errors:

ic_cdk::api::fn call(..)
deprecated(since = "0.18.0", note = "Please use ic_cdk::call::Call::unbounded_wait() instead.")

ic_cdk::api::call_with_payment128(..)
deprecated(since = "0.18.0", note = "Please use ic_cdk::call::Call::unbounded_wait() instead.")

ic_cdk::api::fn caller()
#[deprecated(since = "0.18.0", note = "Use msg_caller instead")]

ic_cdk::api::call::CallResult = Result<R, (RejectionCode, String)>
deprecated(since = "0.18.0", note = "Please use ic_cdk::call::CallResult instead.")

ic_cdk::api::id()
deprecated(since = "0.18.0", note = "Use canister_self instead")

  1. WasmResult is not supported anymore.
    Fixed code
  2. Function ic_cdk::api::msg_cycles_available() returns a u128 now
    Fixed PaymentGuardTrait in attached_cycles.rs
  3. Fixing version selection for ic-cdk-executor:
    error: failed to select a version for `ic-cdk-executor`.
        ... required by package `ic-cdk v0.16.1`
        ... which satisfies dependency `ic-cdk = "^0.16.0"` of package `ic-ledger-types v0.13.0`
        ... which satisfies dependency `ic-ledger-types = "^0.13.0"` of package `ic-papi-api v0.1.1 (dfinity/others/papi/src/api)`
        ... which satisfies path dependency `ic-papi-api` (locked to 0.1.1) of package `example_app_backend v0.1.1 (dfinity/others/papi/src/example/app_backend)`

upgraded ic-ledger-types to 0.15.0

Fixing deployment

Error due to incompatible dfx version:**

Caused by: The replica returned a rejection error: reject code CanisterError, reject message Error from Canister bd3sg-teaaa-aaaaa-qaaba-cai: Canister's Wasm module is not valid: Wasm module has an invalid import section. Module imports function 'canister_liquid_cycle_balance128' from 'ic0' that is not exported by the runtime..

ic-sdk 0.18.7 requires an update of the dfx version to at least version 0.26.1

Runtime errors:

Tests

  • Built locally
  • Deployed locally
  • Executed integration tests locally

@DecentAgeCoder DecentAgeCoder changed the title feat/upgrading-cdk-libraries feat(backend): upgrading IC CDK libraries Sep 26, 2025
@DecentAgeCoder DecentAgeCoder marked this pull request as ready for review September 26, 2025 13:19
@DecentAgeCoder DecentAgeCoder enabled auto-merge (squash) September 26, 2025 13:19
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.

1 participant