Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/src/bin/canister_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions e2e-tests/src/bin/management_canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![]),
Expand Down Expand Up @@ -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);

Expand Down
9 changes: 9 additions & 0 deletions ic-management-canister-types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating management canister types with canister logging extensions!

I also noticed there's one thing missing (as per this doc ):

Canister status result now reports log_memory_store_size in memory_metrics

Could you also add it please?


- 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
Expand Down
2 changes: 1 addition & 1 deletion ic-management-canister-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
31 changes: 30 additions & 1 deletion ic-management-canister-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ pub struct CanisterSettings {
///
/// Default value: [`LogVisibility::Controllers`].
pub log_visibility: Option<LogVisibility>,
/// Indicates the upper limit on the memory used for canister logs (bytes).
///
/// Default value: `4096`.
pub log_memory_limit: Option<Nat>,
/// Indicates the upper limit on the WASM heap memory (bytes) consumption of the canister.
///
/// Must be a number between 0 and 2<sup>48</sup>-1 (i.e 256TB), inclusively.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<CanisterLogFilter>,
}

/// # Canister Log Record
///
Expand Down
6 changes: 6 additions & 0 deletions ic-management-canister-types/tests/ic.did
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Loading