Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
05220a7
Upgrade ic-cdk to v0.18.5, ic-cdk-timers to v0.12.2
lwshang Aug 13, 2025
84b078a
Replace ic_cdk::setup with in_(query_)_executor_context
lwshang Aug 13, 2025
1c46ab5
Replace decoding_quota with decode_with & decode_one_with_decoding_quota
lwshang Aug 13, 2025
63d7b68
Annotate allow(deprecated)
lwshang Aug 13, 2025
2e08da4
fix tests
lwshang Aug 14, 2025
bf677af
fix lint
lwshang Aug 14, 2025
bc80df4
try fix canbench/pocket-ic issue by update MODULE.bazel
lwshang Aug 14, 2025
9287f0b
fix rs/rust_canisters/call_loop_canister:call_loop_canister_test
lwshang Aug 14, 2025
1c95db3
fix rs/sns/integration_tests:integration_test_src/proposals by update…
lwshang Aug 14, 2025
a33beab
update ledger_suite/icp/ledger/canbench_results
lwshang Aug 14, 2025
b0c05f5
fix clippy which was not detected because of the feature gate
lwshang Aug 14, 2025
47ecedc
Merge branch 'master' into lwshang/SDK-2267_unify_ic_cdk
lwshang Aug 18, 2025
1b20003
annotate allow(deprecated) to files revealed in some tests
lwshang Aug 18, 2025
21d1c1a
fix rs/execution_environment/tests/backtraces.rs
lwshang Aug 18, 2025
93bf5dc
fix //rs/execution_environment:execution_environment_misc_integration…
lwshang Aug 18, 2025
1103b21
wrap custom canister_global_timer in in_executor_context
lwshang Aug 18, 2025
32f9a3c
increase max size of sns-governance-canister_test.wasm.gz
lwshang Aug 18, 2025
766468e
Merge branch 'master' into lwshang/SDK-2267_unify_ic_cdk
lwshang Aug 19, 2025
03ac4dd
update icrc1/ledger canbench results
lwshang Aug 19, 2025
a479a25
Merge branch 'master' into lwshang/SDK-2267_unify_ic_cdk
lwshang Aug 19, 2025
e653249
new file from master merge needs allow deprecated annotation
lwshang Aug 19, 2025
f70568d
upgrade to ic-cdk v0.18.6
lwshang Aug 19, 2025
719f02f
fix test_skipping_quota test
lwshang Aug 19, 2025
536ca5d
Merge branch 'master' into lwshang/SDK-2267_unify_ic_cdk
lwshang Aug 19, 2025
7235acb
fix
lwshang Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,335 changes: 1,008 additions & 1,327 deletions Cargo.Bazel.json.lock

Large diffs are not rendered by default.

449 changes: 179 additions & 270 deletions Cargo.Bazel.toml.lock

Large diffs are not rendered by default.

497 changes: 191 additions & 306 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ bitcoincore-rpc = "0.19.0"
build-info = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7" }
build-info-build = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7", default-features = false }
bytes = "1.9.0"
candid = { version = "0.10.6" }
canbench-rs = "0.2.1"
candid = { version = "0.10.17" }
candid_parser = { version = "0.1.2" }
chrono = { version = "0.4.38", default-features = false, features = [
"alloc",
Expand Down Expand Up @@ -655,10 +656,10 @@ ic-bn-lib = { git = "https://github.com/dfinity/ic-bn-lib", rev = "620fb49a238b3
"acme_alpn",
] }
ic-btc-interface = "0.2.2"
ic-canister-sig-creation = { git = "https://github.com/dfinity/ic-canister-sig-creation", rev = "7f9e931954637526295269155881207f6c832d6d" }
ic-canister-sig-creation = "1.3.0"
ic-cbor = "3"
ic-cdk = "0.17.2"
ic-cdk-timers = "0.11.0"
ic-cdk = "0.18.6"
ic-cdk-timers = "0.12.2"
ic-certificate-verification = "3"
ic-certification = "3"
ic-gateway = { git = "https://github.com/dfinity/ic-gateway", rev = "b78562340bd00f05f9c055dcba3ec0f74758c927", default-features = false }
Expand All @@ -671,7 +672,7 @@ ic-sha3 = "1.0.0"
ic-stable-structures = "0.6.8"
ic-transport-types = { version = "0.40.1" }
ic-utils = { version = "0.40.1", features = ["raw"] }
ic-vetkeys = { git = "https://github.com/dfinity/vetkeys", rev = "5885675b6ccb5269cfac9740dc3da6f14f75347f" }
ic-vetkeys = "0.4.0"
ic_bls12_381 = { version = "0.10.1", default-features = false, features = [
"groups",
"pairings",
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,8 @@ http_file(
# ci/container/container-run.sh
# bazel build //publish/binaries:pocket-ic.gz
# sha256sum bazel-bin/publish/binaries/pocket-ic.gz
sha256 = "399596330c40a76effbbd20660ce8e892d5d74f3de6380cad4aac1598b9d6394",
url = "https://download.dfinity.systems/ic/c36a05a9d367bb6ba9068444e6d6f53e7911f1b0/binaries/x86_64-linux/pocket-ic.gz",
sha256 = "237272216498074e5250a0685813b96632963ff9abbc51a7030d9b625985028d",
url = "https://github.com/dfinity/pocketic/releases/download/9.0.1/pocket-ic-x86_64-linux.gz",
)

# Management canister candid interface
Expand Down
21 changes: 9 additions & 12 deletions bazel/external_crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ def external_crates_repository(name, cargo_lockfile, lockfile):
default_features = False,
),
"canbench": crate.spec(
version = "^0.1.15",
version = "^0.2.1",
),
"canbench-rs": crate.spec(
version = "^0.1.15",
version = "^0.2.1",
),
"candid": crate.spec(
version = "^0.10.13",
version = "^0.10.17",
),
"cargo_metadata": crate.spec(
version = "^0.14.2",
Expand Down Expand Up @@ -662,21 +662,19 @@ def external_crates_repository(name, cargo_lockfile, lockfile):
version = "^0.2.0",
),
"ic-canister-sig-creation": crate.spec(
git = "https://github.com/dfinity/ic-canister-sig-creation",
rev = "7f9e931954637526295269155881207f6c832d6d",
version = "^1.3.0",
),
"ic-cbor": crate.spec(
version = "3.0.3",
),
"ic-cdk": crate.spec(
version = "^0.17.2",
version = "^0.18.6",
),
"ic-cdk-next": crate.spec(
package = "ic-cdk",
version = "^0.18.0-alpha.2",
"ic-cdk-executor": crate.spec(
version = "^1.0.2",
),
"ic-cdk-timers": crate.spec(
version = "^0.11.0",
version = "^0.12.2",
),
"ic-certified-map": crate.spec(
version = "^0.3.1",
Expand Down Expand Up @@ -746,8 +744,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile):
default_features = False,
),
"ic-vetkeys": crate.spec(
git = "https://github.com/dfinity/vetkeys",
rev = "5885675b6ccb5269cfac9740dc3da6f14f75347f",
version = "^0.4.0",
),
"ic-wasm": crate.spec(
version = "^0.8.4",
Expand Down
1 change: 1 addition & 0 deletions packages/icrc-ledger-client-cdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl Runtime for CdkRuntime {
In: ArgumentEncoder + Send,
Out: for<'a> ArgumentDecoder<'a>,
{
#[allow(deprecated)]
ic_cdk::call(id, method, args)
.await
.map_err(|(code, msg)| (code as i32, msg))
Expand Down
1 change: 1 addition & 0 deletions packages/pocket-ic/test_canister/src/canister.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use candid::{define_function, CandidType, Nat, Principal};
use ic_cdk::api::call::{accept_message, arg_data_raw, reject, RejectionCode};
use ic_cdk::api::instruction_counter;
Expand Down
9 changes: 5 additions & 4 deletions rs/bitcoin/checker/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use bitcoin::{consensus::Decodable, Address, Transaction};
use candid::Nat;
use ic_btc_checker::{
Expand Down Expand Up @@ -69,10 +70,10 @@ fn check_address(args: CheckAddressArgs) -> CheckAddressResponse {
let config = get_config();
let btc_network = config.btc_network();
let address = Address::from_str(args.address.trim())
.unwrap_or_else(|err| ic_cdk::trap(&format!("Invalid Bitcoin address: {}", err)))
.unwrap_or_else(|err| ic_cdk::trap(format!("Invalid Bitcoin address: {}", err)))
.require_network(btc_network.clone().into())
.unwrap_or_else(|err| {
ic_cdk::trap(&format!("Not a Bitcoin {} address: {}", btc_network, err))
ic_cdk::trap(format!("Not a Bitcoin {} address: {}", btc_network, err))
});

match config.check_mode {
Expand Down Expand Up @@ -169,7 +170,7 @@ fn init(arg: Option<CheckArg>) {
init_arg.check_mode,
init_arg.num_subnet_nodes,
)
.unwrap_or_else(|err| ic_cdk::trap(&format!("error creating config: {}", err))),
.unwrap_or_else(|err| ic_cdk::trap(format!("error creating config: {}", err))),
),
_ => {
ic_cdk::trap("cannot init canister state without init args");
Expand All @@ -192,7 +193,7 @@ fn post_upgrade(arg: Option<CheckArg>) {
.unwrap_or(old_config.check_mode);
let config =
Config::new_and_validate(old_config.btc_network(), check_mode, num_subnet_nodes)
.unwrap_or_else(|err| ic_cdk::trap(&format!("error creating config: {}", err)));
.unwrap_or_else(|err| ic_cdk::trap(format!("error creating config: {}", err)));
set_config(config);
}
Some(CheckArg::InitArg(_)) => {
Expand Down
1 change: 1 addition & 0 deletions rs/bitcoin/checker/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use candid::{decode_one, Encode, Principal};
use ic_base_types::PrincipalId;
use ic_btc_checker::{
Expand Down
2 changes: 1 addition & 1 deletion rs/bitcoin/ckbtc/minter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ path = "src/main.rs"
async-trait = { workspace = true }
bech32 = "0.9.0"
bs58 = "0.5.0"
canbench-rs = { version = "0.1.7", optional = true }
canbench-rs = { workspace = true, optional = true }
candid = { workspace = true }
ciborium = { workspace = true }
hex = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions rs/bitcoin/ckbtc/minter/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use crate::address::BitcoinAddress;
use crate::logs::{P0, P1};
use crate::management::CallError;
Expand Down
2 changes: 1 addition & 1 deletion rs/bitcoin/ckbtc/minter/src/lifecycle/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn post_upgrade(upgrade_args: Option<UpgradeArgs>) {
log!(P0, "[upgrade]: replaying {} events", count_events());

let state = replay::<CheckInvariantsImpl>(events()).unwrap_or_else(|e| {
ic_cdk::trap(&format!(
ic_cdk::trap(format!(
"[upgrade]: failed to replay the event log: {:?}",
e
))
Expand Down
14 changes: 10 additions & 4 deletions rs/bitcoin/ckbtc/minter/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use candid::Principal;
use ic_btc_interface::Utxo;
use ic_canister_log::export as export_logs;
Expand Down Expand Up @@ -111,10 +112,15 @@ fn check_anonymous_caller() {

#[export_name = "canister_global_timer"]
fn timer() {
#[cfg(feature = "self_check")]
ok_or_die(check_invariants());

ic_ckbtc_minter::timer(IC_CANISTER_RUNTIME);
// ic_ckbtc_minter::timer invokes ic_cdk::spawn
// which must be wrapped in in_executor_context
// as required by the new ic-cdk-executor.
ic_cdk::futures::in_executor_context(|| {
#[cfg(feature = "self_check")]
ok_or_die(check_invariants());

ic_ckbtc_minter::timer(IC_CANISTER_RUNTIME);
});
}

#[post_upgrade]
Expand Down
2 changes: 1 addition & 1 deletion rs/bitcoin/ckbtc/minter/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ impl CkBtcMinterState {
{
self.stuck_transactions.swap_remove(pos)
} else {
ic_cdk::trap(&format!(
ic_cdk::trap(format!(
"Attempted to finalized a non-existent transaction {}",
txid
));
Expand Down
2 changes: 1 addition & 1 deletion rs/bitcoin/ckbtc/minter/src/updates/get_btc_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub async fn init_ecdsa_public_key() -> ECDSAPublicKey {
let ecdsa_public_key =
crate::management::ecdsa_public_key(key_name, DerivationPath::new(vec![]))
.await
.unwrap_or_else(|e| ic_cdk::trap(&format!("failed to retrieve ECDSA public key: {e}")));
.unwrap_or_else(|e| ic_cdk::trap(format!("failed to retrieve ECDSA public key: {e}")));
log!(
P1,
"ECDSA public key set to {}, chain code to {}",
Expand Down
12 changes: 6 additions & 6 deletions rs/bitcoin/ckbtc/minter/src/updates/retrieve_btc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,11 @@ async fn burn_ckbtcs(user: Principal, amount: u64, memo: Memo) -> Result<u64, Re
"cannot burn ckBTC: the ledger fails with: {} (error code {})", message, error_code
)))
}
Err(TransferError::BadFee { expected_fee }) => ic_cdk::trap(&format!(
Err(TransferError::BadFee { expected_fee }) => ic_cdk::trap(format!(
"unreachable: the ledger demands the fee of {} even though the fee field is unset",
expected_fee
)),
Err(TransferError::Duplicate{ duplicate_of }) => ic_cdk::trap(&format!(
Err(TransferError::Duplicate{ duplicate_of }) => ic_cdk::trap(format!(
"unreachable: the ledger reports duplicate ({}) even though the create_at_time field is unset",
duplicate_of
)),
Expand All @@ -436,7 +436,7 @@ async fn burn_ckbtcs(user: Principal, amount: u64, memo: Memo) -> Result<u64, Re
Err(TransferError::TooOld) => ic_cdk::trap(
"unreachable: the ledger reports TooOld even though the create_at_time field is unset"
),
Err(TransferError::BadBurn { min_burn_amount }) => ic_cdk::trap(&format!(
Err(TransferError::BadBurn { min_burn_amount }) => ic_cdk::trap(format!(
"the minter is misconfigured: retrieve_btc_min_amount {} is less than ledger's min_burn_amount {}",
read_state(|s| s.retrieve_btc_min_amount),
min_burn_amount
Expand Down Expand Up @@ -495,11 +495,11 @@ async fn burn_ckbtcs_icrc2(
"cannot burn ckBTC: the ledger fails with: {} (error code {})", message, error_code
)))
}
Err(TransferFromError::BadFee { expected_fee }) => ic_cdk::trap(&format!(
Err(TransferFromError::BadFee { expected_fee }) => ic_cdk::trap(format!(
"unreachable: the ledger demands the fee of {} even though the fee field is unset",
expected_fee
)),
Err(TransferFromError::Duplicate { duplicate_of }) => ic_cdk::trap(&format!(
Err(TransferFromError::Duplicate { duplicate_of }) => ic_cdk::trap(format!(
"unreachable: the ledger reports duplicate ({}) even though the create_at_time field is unset",
duplicate_of
)),
Expand All @@ -509,7 +509,7 @@ async fn burn_ckbtcs_icrc2(
Err(TransferFromError::TooOld) => ic_cdk::trap(
"unreachable: the ledger reports TooOld even though the create_at_time field is unset"
),
Err(TransferFromError::BadBurn { min_burn_amount }) => ic_cdk::trap(&format!(
Err(TransferFromError::BadBurn { min_burn_amount }) => ic_cdk::trap(format!(
"the minter is misconfigured: retrieve_btc_min_amount {} is less than ledger's min_burn_amount {}",
read_state(|s| s.retrieve_btc_min_amount),
min_burn_amount
Expand Down
1 change: 1 addition & 0 deletions rs/bitcoin/ckbtc/minter/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use assert_matches::assert_matches;
use bitcoin::util::psbt::serialize::Deserialize;
use bitcoin::{Address as BtcAddress, Network as BtcNetwork};
Expand Down
1 change: 1 addition & 0 deletions rs/bitcoin/mock/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use candid::candid_method;
use ic_btc_interface::{
Address, GetCurrentFeePercentilesRequest, GetUtxosRequest, GetUtxosResponse,
Expand Down
1 change: 1 addition & 0 deletions rs/bitcoin/mock/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
use bitcoin::consensus::deserialize;
use bitcoin::Transaction;
use candid::{Decode, Encode};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::anyhow;
use certificate_orchestrator_interface::{
EncryptedPair, ExportPackage, IcCertificate, Id, Registration, LEFT_GUARD, RIGHT_GUARD,
};
use ic_cdk::caller;
use ic_cdk::api::msg_caller;
use prometheus::labels;

use crate::{
Expand Down Expand Up @@ -46,7 +46,7 @@ impl GetCert for CertGetter {

impl<T: GetCert, A: Authorize> GetCert for WithAuthorize<T, A> {
fn get_cert(&self, id: &Id) -> Result<EncryptedPair, GetCertError> {
if let Err(err) = self.1.authorize(&caller()) {
if let Err(err) = self.1.authorize(&msg_caller()) {
return Err(match err {
AuthorizeError::Unauthorized => GetCertError::Unauthorized,
AuthorizeError::UnexpectedError(err) => GetCertError::UnexpectedError(err),
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<T: Upload> Upload for UploadWithIcCertification<T> {

impl<T: Upload, A: Authorize> Upload for WithAuthorize<T, A> {
fn upload(&self, id: &Id, pair: EncryptedPair) -> Result<(), UploadError> {
if let Err(err) = self.1.authorize(&caller()) {
if let Err(err) = self.1.authorize(&msg_caller()) {
return Err(match err {
AuthorizeError::Unauthorized => UploadError::Unauthorized,
AuthorizeError::UnexpectedError(err) => UploadError::UnexpectedError(err),
Expand Down Expand Up @@ -299,7 +299,7 @@ impl Export for Exporter {

impl<T: Export, A: Authorize> Export for WithAuthorize<T, A> {
fn export(&self, key: Option<String>, limit: u64) -> Result<Vec<ExportPackage>, ExportError> {
if let Err(err) = self.1.authorize(&caller()) {
if let Err(err) = self.1.authorize(&msg_caller()) {
return Err(match err {
AuthorizeError::Unauthorized => ExportError::Unauthorized,
AuthorizeError::UnexpectedError(err) => ExportError::UnexpectedError(err),
Expand All @@ -314,7 +314,7 @@ impl<T: Export, A: Authorize> Export for WithAuthorize<T, A> {
key: Option<String>,
limit: u64,
) -> Result<(Vec<ExportPackage>, IcCertificate), ExportError> {
if let Err(err) = self.1.authorize(&caller()) {
if let Err(err) = self.1.authorize(&msg_caller()) {
return Err(match err {
AuthorizeError::Unauthorized => ExportError::Unauthorized,
AuthorizeError::UnexpectedError(err) => ExportError::UnexpectedError(err),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use candid::Encode;
use certificate_orchestrator_interface::{
BoundedString, ExportPackage, IcCertificate, Id, LABEL_DOMAINS, LEFT_GUARD, RIGHT_GUARD,
};
use ic_cdk::api::{data_certificate, set_certified_data};
use ic_cdk::api::{certified_data_set, data_certificate};
use ic_certified_map::{labeled, labeled_hash, AsHashTree, Hash as ICHash, RbTree};
use serde::Serialize;
use serde_cbor::Serializer;
Expand All @@ -19,13 +19,13 @@ pub fn init_cert_tree() {
let value: Vec<u8> = Vec::new();
tree.insert(LEFT_GUARD.into(), Sha256::digest(&value).into());
tree.insert(RIGHT_GUARD.into(), Sha256::digest(&value).into());
set_certified_data(&labeled_hash(LABEL_DOMAINS, &tree.root_hash()));
certified_data_set(labeled_hash(LABEL_DOMAINS, &tree.root_hash()));
});
}

pub fn set_root_hash() {
let root_hash = CERT_TREE.with(|tree| labeled_hash(LABEL_DOMAINS, &tree.borrow().root_hash()));
set_certified_data(&root_hash);
certified_data_set(root_hash);
}

pub fn remove_cert(key: BoundedString<64>) {
Expand Down
Loading
Loading