diff --git a/Cargo.toml b/Cargo.toml index 8134ebd07..aa4449921 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ ic-cdk-bindgen = { path = "ic-cdk-bindgen", version = "0.2.0" } ic-cdk-timers = { path = "ic-cdk-timers", version = "1.0.0" } ic-cdk-executor = { path = "ic-cdk-executor", version = "2.0.0" } ic-cdk-management-canister = { path = "ic-cdk-management-canister", version = "0.1.0" } -ic-management-canister-types = { path = "ic-management-canister-types", version = "0.6.0" } +ic-management-canister-types = { path = "ic-management-canister-types", version = "0.7.0" } candid = "0.10.18" # sync with the doc comment in ic-cdk/README.md candid_parser = "0.2.1" diff --git a/e2e-tests/Cargo.toml b/e2e-tests/Cargo.toml index 96c2e4f7f..a32976e7b 100644 --- a/e2e-tests/Cargo.toml +++ b/e2e-tests/Cargo.toml @@ -31,7 +31,7 @@ futures = "0.3" hex.workspace = true ic-btc-interface.workspace = true ic-vetkd-utils = { git = "https://github.com/dfinity/ic", rev = "95231520" } -pocket-ic = { git = "https://github.com/dfinity/ic", tag = "release-2025-10-17_03-17-base" } +pocket-ic = { git = "https://github.com/dfinity/ic", tag = "release-2026-03-02_11-09-base" } reqwest = "0.12" [build-dependencies] diff --git a/e2e-tests/src/bin/canister_info.rs b/e2e-tests/src/bin/canister_info.rs index a8b34a55c..1b9b9a314 100644 --- a/e2e-tests/src/bin/canister_info.rs +++ b/e2e-tests/src/bin/canister_info.rs @@ -69,6 +69,7 @@ async fn canister_lifecycle() -> Principal { freezing_threshold: None, reserved_cycles_limit: None, log_visibility: None, + log_memory_limit: None, wasm_memory_limit: None, wasm_memory_threshold: None, environment_variables: None, diff --git a/e2e-tests/src/bin/management_canister.rs b/e2e-tests/src/bin/management_canister.rs index d758837ab..29e6dc3c3 100644 --- a/e2e-tests/src/bin/management_canister.rs +++ b/e2e-tests/src/bin/management_canister.rs @@ -17,6 +17,7 @@ async fn basic() { freezing_threshold: Some(604_800u32.into()), reserved_cycles_limit: Some(0u8.into()), log_visibility: Some(LogVisibility::Public), + log_memory_limit: Some(0u8.into()), wasm_memory_limit: Some(0u8.into()), wasm_memory_threshold: Some(0u8.into()), environment_variables: Some(vec![]), @@ -44,6 +45,7 @@ async fn basic() { definite_canister_setting.log_visibility, LogVisibility::Public ); + assert_eq!(definite_canister_setting.log_memory_limit, 0u8); assert_eq!(definite_canister_setting.wasm_memory_limit, 0u8); assert_eq!(definite_canister_setting.wasm_memory_threshold, 0u8); diff --git a/ic-management-canister-types/CHANGELOG.md b/ic-management-canister-types/CHANGELOG.md index c8565fe8c..21465b749 100644 --- a/ic-management-canister-types/CHANGELOG.md +++ b/ic-management-canister-types/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +## [0.7.0] - 2026-03-02 + +### Changed + +- Added `log_memory_limit` field to `CanisterSettings` and `DefiniteCanisterSettings`. +- Added `filter` field to `FetchCanisterLogsArgs`. + - `FetchCanisterLogsArgs` is now a struct instead of a type alias for `CanisterIdRecord`. + - Added the type `CanisterLogFilter`. + ## [0.6.0] - 2026-01-09 ### Changed diff --git a/ic-management-canister-types/Cargo.toml b/ic-management-canister-types/Cargo.toml index fd2c0b276..e846bac51 100644 --- a/ic-management-canister-types/Cargo.toml +++ b/ic-management-canister-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ic-management-canister-types" -version = "0.6.0" +version = "0.7.0" authors.workspace = true edition.workspace = true repository.workspace = true diff --git a/ic-management-canister-types/src/lib.rs b/ic-management-canister-types/src/lib.rs index 929a8a407..ed9d32d6d 100644 --- a/ic-management-canister-types/src/lib.rs +++ b/ic-management-canister-types/src/lib.rs @@ -113,6 +113,10 @@ pub struct CanisterSettings { /// /// Default value: [`LogVisibility::Controllers`]. pub log_visibility: Option, + /// Indicates the upper limit on the memory used for canister logs (bytes). + /// + /// Default value: `4096`. + pub log_memory_limit: Option, /// Indicates the upper limit on the WASM heap memory (bytes) consumption of the canister. /// /// Must be a number between 0 and 248-1 (i.e 256TB), inclusively. @@ -159,6 +163,8 @@ pub struct DefiniteCanisterSettings { pub reserved_cycles_limit: Nat, /// Visibility of canister logs. pub log_visibility: LogVisibility, + /// Upper limit on the memory used for canister logs (bytes). + pub log_memory_limit: Nat, /// Upper limit on the WASM heap memory (bytes) consumption of the canister. pub wasm_memory_limit: Nat, /// Threshold on the remaining wasm memory size of the canister in bytes. @@ -1658,10 +1664,33 @@ pub enum SnapshotDataOffset { WasmChunk, } +/// # Canister Log Filter. +/// +/// Filter for canister log records. +#[derive( + CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, +)] +pub enum CanisterLogFilter { + /// Filter logs by index range (inclusive). + #[serde(rename = "by_idx")] + ByIdx { start: u64, end: u64 }, + /// Filter logs by timestamp range (inclusive). + #[serde(rename = "by_timestamp_nanos")] + ByTimestampNanos { start: u64, end: u64 }, +} + /// # Fetch Canister Logs Args. /// /// Argument type of [`fetch_canister_logs`](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-fetch_canister_logs). -pub type FetchCanisterLogsArgs = CanisterIdRecord; +#[derive( + CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, +)] +pub struct FetchCanisterLogsArgs { + /// Canister ID. + pub canister_id: CanisterId, + /// Optional filter for the returned log records. + pub filter: Option, +} /// # Canister Log Record /// diff --git a/ic-management-canister-types/tests/ic.did b/ic-management-canister-types/tests/ic.did index 045189f2d..16d4e5793 100644 --- a/ic-management-canister-types/tests/ic.did +++ b/ic-management-canister-types/tests/ic.did @@ -20,6 +20,7 @@ type canister_settings = record { freezing_threshold : opt nat; reserved_cycles_limit : opt nat; log_visibility : opt log_visibility; + log_memory_limit : opt nat; wasm_memory_limit : opt nat; wasm_memory_threshold : opt nat; environment_variables : opt vec environment_variable; @@ -32,6 +33,7 @@ type definite_canister_settings = record { freezing_threshold : nat; reserved_cycles_limit : nat; log_visibility : log_visibility; + log_memory_limit : nat; wasm_memory_limit : nat; wasm_memory_threshold : nat; environment_variables : vec environment_variable; @@ -491,6 +493,10 @@ type delete_canister_snapshot_args = record { type fetch_canister_logs_args = record { canister_id : canister_id; + filter : opt variant { + by_idx : record { start : nat64; end : nat64 }; + by_timestamp_nanos : record { start : nat64; end : nat64 }; + } }; type canister_log_record = record {