From c062f110dff6cdfd3a2f9d7a7b092e53e1d46b92 Mon Sep 17 00:00:00 2001 From: Michael Weigelt Date: Mon, 21 Oct 2024 13:37:01 +0000 Subject: [PATCH 1/4] added subnet stats sections --- spec/_attachments/ic.did | 11 +++++++++++ spec/index.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/spec/_attachments/ic.did b/spec/_attachments/ic.did index e4c920f4..43d22f8c 100644 --- a/spec/_attachments/ic.did +++ b/spec/_attachments/ic.did @@ -342,6 +342,14 @@ type node_metrics_history_result = vec record { node_metrics : vec node_metrics; }; +type subnet_stats_args = record { + subnet_id : principal; +}; + +type subnet_stats_result = record { + replica_version : text; +}; + type provisional_create_canister_with_cycles_args = record { amount : opt nat; settings : opt canister_settings; @@ -444,6 +452,9 @@ service ic : { // metrics interface node_metrics_history : (node_metrics_history_args) -> (node_metrics_history_result); + // subnet stats + subnet_stats : (subnet_stats_args) -> (subnet_stats_result); + // provisional interfaces for the pre-ledger world provisional_create_canister_with_cycles : (provisional_create_canister_with_cycles_args) -> (provisional_create_canister_with_cycles_result); provisional_top_up_canister : (provisional_top_up_canister_args) -> (); diff --git a/spec/index.md b/spec/index.md index ee37e789..44ba9418 100644 --- a/spec/index.md +++ b/spec/index.md @@ -2548,6 +2548,14 @@ A single metric entry is a record with the following fields: - `num_block_failures_total` (`nat64`): the number of failed block proposals by this node. +### IC method `subnet_stats` {#ic-subnet-stats} + +This method can only be called by canisters, i.e., it cannot be called by external users via ingress messages. + +Given a subnet ID as input, this method returns a record `subnet_stats` containing metadata about that subnet. + +Currently, the only field returned is the `replica_version` (`text`) of the targeted subnet. + ### IC method `take_canister_snapshot` {#ic-take_canister_snapshot} This method can be called by canisters as well as by external users via ingress messages. @@ -5439,6 +5447,27 @@ S with ``` +#### IC Management Canister: Subnet Stats + +The management canister returns subnet metadata given a subnet ID. + +Conditions + +```html +S.messages = Older_messages · CallMessage M · Younger_messages (M.queue = +Unordered) or (∀ CallMessage M' | FuncMessage M' ∈ Older_messages. M'.queue ≠ +M.queue) M.callee = ic_principal M.method_name = 'subnet_stats' R = + +``` + +State after + +```html +S with messages = Older_messages · Younger_messages · ResponseMessage { origin = +M.origin response = Reply (candid(R)) refunded_cycles = M.transferred_cycles } +``` + + #### IC Management Canister: Canister creation with cycles This is a variant of `create_canister`, which sets the initial cycle balance based on the `amount` argument. From b3b05571cf34b7f55961a29388d22ebf7fb8e56f Mon Sep 17 00:00:00 2001 From: Michael Weigelt Date: Mon, 21 Oct 2024 13:45:22 +0000 Subject: [PATCH 2/4] format --- spec/index.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spec/index.md b/spec/index.md index 44ba9418..2ea4fd5b 100644 --- a/spec/index.md +++ b/spec/index.md @@ -5454,17 +5454,23 @@ The management canister returns subnet metadata given a subnet ID. Conditions ```html -S.messages = Older_messages · CallMessage M · Younger_messages (M.queue = -Unordered) or (∀ CallMessage M' | FuncMessage M' ∈ Older_messages. M'.queue ≠ -M.queue) M.callee = ic_principal M.method_name = 'subnet_stats' R = - +S.messages = Older_messages · CallMessage M · Younger_messages +(M.queue = Unordered) or (∀ CallMessage M' | FuncMessage M' ∈ Older_messages. M'.queue ≠ M.queue) +M.callee = ic_principal +M.method_name = 'subnet_stats' +R = ``` State after ```html -S with messages = Older_messages · Younger_messages · ResponseMessage { origin = -M.origin response = Reply (candid(R)) refunded_cycles = M.transferred_cycles } +S with + messages = Older_messages · Younger_messages · + ResponseMessage { + origin = M.origin + response = Reply (candid(R)) + refunded_cycles = M.transferred_cycles + } ``` From c37859849a53ec3bb67987b5a072f002eab275b3 Mon Sep 17 00:00:00 2001 From: Michael Weigelt Date: Wed, 23 Oct 2024 07:27:05 +0000 Subject: [PATCH 3/4] rename --- spec/_attachments/ic.did | 8 ++++---- spec/index.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/_attachments/ic.did b/spec/_attachments/ic.did index 43d22f8c..b30fc13d 100644 --- a/spec/_attachments/ic.did +++ b/spec/_attachments/ic.did @@ -342,11 +342,11 @@ type node_metrics_history_result = vec record { node_metrics : vec node_metrics; }; -type subnet_stats_args = record { +type subnet_metrics_args = record { subnet_id : principal; }; -type subnet_stats_result = record { +type subnet_metrics_result = record { replica_version : text; }; @@ -452,8 +452,8 @@ service ic : { // metrics interface node_metrics_history : (node_metrics_history_args) -> (node_metrics_history_result); - // subnet stats - subnet_stats : (subnet_stats_args) -> (subnet_stats_result); + // subnet metrics + subnet_metrics : (subnet_metrics_args) -> (subnet_metrics_result); // provisional interfaces for the pre-ledger world provisional_create_canister_with_cycles : (provisional_create_canister_with_cycles_args) -> (provisional_create_canister_with_cycles_result); diff --git a/spec/index.md b/spec/index.md index 2ea4fd5b..3ade8142 100644 --- a/spec/index.md +++ b/spec/index.md @@ -2548,11 +2548,11 @@ A single metric entry is a record with the following fields: - `num_block_failures_total` (`nat64`): the number of failed block proposals by this node. -### IC method `subnet_stats` {#ic-subnet-stats} +### IC method `subnet_metrics` {#ic-subnet-metrics} This method can only be called by canisters, i.e., it cannot be called by external users via ingress messages. -Given a subnet ID as input, this method returns a record `subnet_stats` containing metadata about that subnet. +Given a subnet ID as input, this method returns a record `subnet_metrics` containing metadata about that subnet. Currently, the only field returned is the `replica_version` (`text`) of the targeted subnet. @@ -5447,7 +5447,7 @@ S with ``` -#### IC Management Canister: Subnet Stats +#### IC Management Canister: Subnet Metrics The management canister returns subnet metadata given a subnet ID. @@ -5457,7 +5457,7 @@ Conditions S.messages = Older_messages · CallMessage M · Younger_messages (M.queue = Unordered) or (∀ CallMessage M' | FuncMessage M' ∈ Older_messages. M'.queue ≠ M.queue) M.callee = ic_principal -M.method_name = 'subnet_stats' +M.method_name = 'subnet_metrics' R = ``` From da1d9471a4349e1bec07f9eb849aae52225abbf8 Mon Sep 17 00:00:00 2001 From: Martin Raszyk Date: Fri, 1 Nov 2024 09:29:21 +0100 Subject: [PATCH 4/4] metrics -> info --- spec/_attachments/ic.did | 8 ++++---- spec/index.md | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/_attachments/ic.did b/spec/_attachments/ic.did index b30fc13d..533b09f1 100644 --- a/spec/_attachments/ic.did +++ b/spec/_attachments/ic.did @@ -342,11 +342,11 @@ type node_metrics_history_result = vec record { node_metrics : vec node_metrics; }; -type subnet_metrics_args = record { +type subnet_info_args = record { subnet_id : principal; }; -type subnet_metrics_result = record { +type subnet_info_result = record { replica_version : text; }; @@ -452,8 +452,8 @@ service ic : { // metrics interface node_metrics_history : (node_metrics_history_args) -> (node_metrics_history_result); - // subnet metrics - subnet_metrics : (subnet_metrics_args) -> (subnet_metrics_result); + // subnet info + subnet_info : (subnet_info_args) -> (subnet_info_result); // provisional interfaces for the pre-ledger world provisional_create_canister_with_cycles : (provisional_create_canister_with_cycles_args) -> (provisional_create_canister_with_cycles_result); diff --git a/spec/index.md b/spec/index.md index 3ade8142..aca6608d 100644 --- a/spec/index.md +++ b/spec/index.md @@ -2548,11 +2548,11 @@ A single metric entry is a record with the following fields: - `num_block_failures_total` (`nat64`): the number of failed block proposals by this node. -### IC method `subnet_metrics` {#ic-subnet-metrics} +### IC method `subnet_info` {#ic-subnet-info} This method can only be called by canisters, i.e., it cannot be called by external users via ingress messages. -Given a subnet ID as input, this method returns a record `subnet_metrics` containing metadata about that subnet. +Given a subnet ID as input, this method returns a record `subnet_info` containing metadata about that subnet. Currently, the only field returned is the `replica_version` (`text`) of the targeted subnet. @@ -5457,7 +5457,7 @@ Conditions S.messages = Older_messages · CallMessage M · Younger_messages (M.queue = Unordered) or (∀ CallMessage M' | FuncMessage M' ∈ Older_messages. M'.queue ≠ M.queue) M.callee = ic_principal -M.method_name = 'subnet_metrics' +M.method_name = 'subnet_info' R = ```