Skip to content

Commit c06b152

Browse files
committed
bump versions
1 parent 168c6ac commit c06b152

File tree

11 files changed

+961
-404
lines changed

11 files changed

+961
-404
lines changed

Cargo.lock

Lines changed: 913 additions & 323 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ resolver = "2"
99
version = "2.0.141"
1010

1111
[workspace.dependencies]
12-
ic-cdk = "0.17.1"
13-
ic-cdk-timers = "0.11.0"
14-
ic-management-canister-types = "0.4.1"
12+
ic-cdk = "0.19.0"
13+
ic-cdk-timers = "1.0.0"
14+
ic-management-canister-types = "0.5.0"
1515

16-
cycles-minting-canister = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
17-
dfn_candid = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
18-
dfn_protobuf = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
19-
ic-base-types = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
20-
ic-crypto-sha2 = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
21-
ic-ledger-core = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
22-
ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
23-
ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
24-
ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
25-
ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
26-
ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
27-
icp-ledger = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
28-
icrc-ledger-types = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
29-
on_wire = { git = "https://github.com/dfinity/ic", rev = "release-2025-08-14_03-27-base" }
16+
cycles-minting-canister = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
17+
dfn_candid = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
18+
dfn_protobuf = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
19+
ic-base-types = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
20+
ic-crypto-sha2 = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
21+
ic-ledger-core = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
22+
ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
23+
ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
24+
ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
25+
ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
26+
ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
27+
icp-ledger = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
28+
icrc-ledger-types = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
29+
on_wire = { git = "https://github.com/dfinity/ic", rev = "release-2026-04-02_04-48-base" }
3030

3131
[profile.release]
3232
lto = false

config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
"IDL2JSON_VERSION": "0.8.8",
113113
"OPTIMIZER_VERSION": "0.3.6",
114114
"BINSTALL_VERSION": "1.3.0",
115-
"DIDC_RELEASE": "2024-05-14",
116-
"DIDC_VERSION": "didc 0.4.0",
115+
"DIDC_RELEASE": "2025-12-18",
116+
"DIDC_VERSION": "didc 0.5.4",
117117
"POCKETIC_VERSION": "3.0.1",
118118
"CARGO_SORT_VERSION": "1.0.9",
119119
"SNSDEMO_RELEASE": "release-2026-04-01",

rs/backend/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ on_wire = { workspace = true }
4141

4242
[dev-dependencies]
4343
anyhow = "1.0.95"
44-
candid_parser = "0.1.2"
44+
candid_parser = "0.3.0"
4545
ic_principal = "0.1.0"
4646
maplit = "1.0.2"
4747
pretty_assertions = "1.4.0"

rs/backend/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ mod canisters;
2727
mod constants;
2828
mod metrics_encoder;
2929
mod perf;
30-
mod spawn;
3130
mod state;
3231
mod stats;
3332
mod time;

rs/backend/src/timer.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,42 @@ pub mod testing {
99
use ic_cdk_timers::TimerId;
1010
use slotmap::SlotMap;
1111
use std::cell::RefCell;
12+
use std::future::Future;
13+
use std::pin::Pin;
1214
use std::time::Duration;
1315

1416
pub struct Timer {
1517
pub delay: Duration,
16-
pub func: Box<dyn FnOnce()>,
18+
pub future: Pin<Box<dyn Future<Output = ()>>>,
1719
}
1820

1921
pub struct TimerInterval {
2022
pub interval: Duration,
21-
pub func: Box<dyn FnMut()>,
23+
pub func: Box<dyn FnMut() -> Pin<Box<dyn Future<Output = ()>>>>,
2224
}
2325

2426
thread_local! {
2527
pub static TIMERS: RefCell<SlotMap<TimerId, Timer>> = RefCell::default();
2628
pub static TIMER_INTERVALS: RefCell<SlotMap<TimerId, TimerInterval>> = RefCell::default();
2729
}
2830

29-
pub fn set_timer(delay: Duration, func: impl FnOnce() + 'static) -> TimerId {
31+
pub fn set_timer(delay: Duration, future: impl Future<Output = ()> + 'static) -> TimerId {
3032
TIMERS.with(|timers| {
3133
timers.borrow_mut().insert(Timer {
3234
delay,
33-
func: Box::new(func),
35+
future: Box::pin(future),
3436
})
3537
})
3638
}
3739

38-
pub fn set_timer_interval(interval: Duration, func: impl FnMut() + 'static) -> TimerId {
40+
pub fn set_timer_interval<Fut>(interval: Duration, mut func: impl FnMut() -> Fut + 'static) -> TimerId
41+
where
42+
Fut: Future<Output = ()> + 'static,
43+
{
3944
TIMER_INTERVALS.with(|timer_intervals| {
4045
timer_intervals.borrow_mut().insert(TimerInterval {
4146
interval,
42-
func: Box::new(func),
47+
func: Box::new(move || Box::pin(func()) as Pin<Box<dyn Future<Output = ()>>>),
4348
})
4449
})
4550
}

rs/backend/src/tvl.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{
22
canisters::{exchange_rate_canister, governance},
33
constants::{E8S_PER_UNIT, NANOS_PER_UNIT},
4-
spawn,
54
state::{with_state, with_state_mut},
65
time,
76
timer::{set_timer, set_timer_interval},
@@ -31,25 +30,17 @@ pub fn init_timers() {
3130
}
3231

3332
pub fn start_updating_exchange_rate_in_background() {
34-
set_timer_interval(Duration::from_secs(UPDATE_INTERVAL_SECONDS), || {
35-
spawn::spawn(update_exchange_rate());
36-
});
33+
set_timer_interval(Duration::from_secs(UPDATE_INTERVAL_SECONDS), || update_exchange_rate());
3734
// `set_timer_interval` does not run the callback immediately so we also
3835
// call it after 1 second to have an exchange rate available soon.
39-
set_timer(Duration::from_secs(1), || {
40-
spawn::spawn(update_exchange_rate());
41-
});
36+
set_timer(Duration::from_secs(1), update_exchange_rate());
4237
}
4338

4439
fn start_updating_locked_icp_in_the_background() {
45-
set_timer_interval(Duration::from_secs(UPDATE_INTERVAL_SECONDS), || {
46-
spawn::spawn(update_locked_icp_e8s());
47-
});
40+
set_timer_interval(Duration::from_secs(UPDATE_INTERVAL_SECONDS), || update_locked_icp_e8s());
4841
// `set_timer_interval` does not run the callback immediately so we also
4942
// call it after 1 second to have an exchange rate available soon.
50-
set_timer(Duration::from_secs(1), || {
51-
spawn::spawn(update_locked_icp_e8s());
52-
});
43+
set_timer(Duration::from_secs(1), update_locked_icp_e8s());
5344
}
5445

5546
/// Converts a number such that it can be interpreted as a fixed-point number

rs/backend/src/tvl/tests.rs

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::state::{init_state, with_state, with_state_mut};
22
use crate::timer;
3-
use crate::tvl::{self, exchange_rate_canister, governance, spawn, time};
3+
use crate::tvl::{self, exchange_rate_canister, governance, time};
44
use candid::Nat;
55
use lazy_static::lazy_static;
66

@@ -398,13 +398,7 @@ async fn start_updating_exchange_rate_in_background() {
398398
timer.delay,
399399
std::time::Duration::from_secs(expected_timer_delay_seconds)
400400
);
401-
// The timer calls spawn::spawn, which, during the test, adds the future
402-
// to a queue.
403-
(timer.func)();
404-
// Make sure the spawned future is run.
405-
let mut spawned_futures = spawn::testing::drain_spawned_futures();
406-
assert_eq!(spawned_futures.len(), 1);
407-
spawned_futures.pop().unwrap().await;
401+
timer.future.await;
408402
}
409403

410404
// Step 4: Verify the state after calling the 1-time timer.
@@ -442,13 +436,7 @@ async fn start_updating_exchange_rate_in_background() {
442436
timer.interval,
443437
std::time::Duration::from_secs(expected_timer_interval_seconds)
444438
);
445-
// The timer calls spawn::spawn, which, during the test, adds the future
446-
// to a queue.
447-
(timer.func)();
448-
// Make sure the spawned future is run.
449-
let mut spawned_futures = spawn::testing::drain_spawned_futures();
450-
assert_eq!(spawned_futures.len(), 1);
451-
spawned_futures.pop().unwrap().await;
439+
(timer.func)().await;
452440
}
453441

454442
// Step 4: Verify the state after calling interval timer.
@@ -505,13 +493,7 @@ async fn start_updating_locked_icp_in_the_background() {
505493
timer.delay,
506494
std::time::Duration::from_secs(expected_timer_delay_seconds)
507495
);
508-
// The timer calls spawn::spawn, which, during the test, adds the future
509-
// to a queue.
510-
(timer.func)();
511-
// Make sure the spawned future is run.
512-
let mut spawned_futures = spawn::testing::drain_spawned_futures();
513-
assert_eq!(spawned_futures.len(), 1);
514-
spawned_futures.pop().unwrap().await;
496+
timer.future.await;
515497
}
516498

517499
// Step 4: Verify the state after calling the 1-time timer.
@@ -534,13 +516,7 @@ async fn start_updating_locked_icp_in_the_background() {
534516
timer.interval,
535517
std::time::Duration::from_secs(expected_timer_interval_seconds)
536518
);
537-
// The timer calls spawn::spawn, which, during the test, adds the future
538-
// to a queue.
539-
(timer.func)();
540-
// Make sure the spawned future is run.
541-
let mut spawned_futures = spawn::testing::drain_spawned_futures();
542-
assert_eq!(spawned_futures.len(), 1);
543-
spawned_futures.pop().unwrap().await;
519+
(timer.func)().await;
544520
}
545521

546522
// Step 4: Verify the state after calling interval timer.

rs/sns_aggregator/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ dfn_candid = { workspace = true }
1515
ic-base-types = { workspace = true }
1616
# This next candid is 0.9.0_beta code that fixes serde Nat but has other issues. Keep checking until the issues are fixed.
1717
#candid = { git = "https://github.com/dfinity/candid" , rev = "42ffed660ded37585c4b9f97e3ce90919e24c518" }
18-
ic-cdk = { version = "0.17.1" }
19-
ic-cdk-timers = "0.11.0"
18+
ic-cdk = { version = "0.19.0" }
19+
ic-cdk-timers = "1.0.0"
2020
ic-certified-map = { git = "https://github.com/dfinity/cdk-rs", rev = "58791941b72471e09e3d9e733f2a3d4d54e52b5a" }
2121
ic-management-canister-types = { workspace = true }
2222
ic-nervous-system-common = { workspace = true }

rs/sns_aggregator/src/fast_scheduler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl FastScheduler {
170170

171171
/// Start collecting data now.
172172
pub fn start(&mut self, timer_interval: Duration) {
173-
let timer_id = set_timer_interval(timer_interval, || ic_cdk::spawn(Self::global_update_next()));
173+
let timer_id = set_timer_interval(timer_interval, || Self::global_update_next());
174174
let old_timer = self.update_timer.replace(timer_id);
175175
if let Some(id) = old_timer {
176176
clear_timer(id);
@@ -192,7 +192,7 @@ impl FastScheduler {
192192
/// Note: We request both the delay and the timestamp to avoid making a syscall for data that
193193
/// is almost certainly already available to the caller.
194194
pub fn global_start_at(start_seconds: u64, delay: Duration) {
195-
let start_timer = set_timer(delay, Self::global_start);
195+
let start_timer = set_timer(delay, async { Self::global_start() });
196196
if let Some((_, old_timer)) = STATE.with(|state| {
197197
state
198198
.fast_scheduler

0 commit comments

Comments
 (0)