From 842954bcf2c2e465c1ba539dff9fe0c058a2cb63 Mon Sep 17 00:00:00 2001 From: Martin Raszyk Date: Fri, 15 Nov 2024 12:10:51 +0100 Subject: [PATCH 1/3] [FINAL] feat: Add sections for new subnet_info endpoint --- docs/references/_attachments/ic.did | 11 +++++++++ docs/references/ic-interface-spec.md | 35 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/docs/references/_attachments/ic.did b/docs/references/_attachments/ic.did index 8c43e699bc..a12cd58a1f 100644 --- a/docs/references/_attachments/ic.did +++ b/docs/references/_attachments/ic.did @@ -343,6 +343,14 @@ type node_metrics_history_result = vec record { node_metrics : vec node_metrics; }; +type subnet_info_args = record { + subnet_id : principal; +}; + +type subnet_info_result = record { + replica_version : text; +}; + type provisional_create_canister_with_cycles_args = record { amount : opt nat; settings : opt canister_settings; @@ -445,6 +453,9 @@ service ic : { // metrics interface node_metrics_history : (node_metrics_history_args) -> (node_metrics_history_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); provisional_top_up_canister : (provisional_top_up_canister_args) -> (); diff --git a/docs/references/ic-interface-spec.md b/docs/references/ic-interface-spec.md index 81fa75be62..fe85bfedf7 100644 --- a/docs/references/ic-interface-spec.md +++ b/docs/references/ic-interface-spec.md @@ -2550,6 +2550,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_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_info` 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. @@ -5474,6 +5482,33 @@ S with ``` +#### IC Management Canister: Subnet Metrics + +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_info' +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 b005d645389bed42be7c53d595a78e8749fdbf11 Mon Sep 17 00:00:00 2001 From: Martin Raszyk Date: Tue, 19 Nov 2024 19:07:06 +0100 Subject: [PATCH 2/3] changelog --- docs/references/_attachments/interface-spec-changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/references/_attachments/interface-spec-changelog.md b/docs/references/_attachments/interface-spec-changelog.md index 7d9ab08fe9..0ee7c8eb01 100644 --- a/docs/references/_attachments/interface-spec-changelog.md +++ b/docs/references/_attachments/interface-spec-changelog.md @@ -1,5 +1,8 @@ ## Changelog {#changelog} +### 0.30.0 (2024-11-19) {#0_30_0} +* Add management canister endpoint `subnet_info`. + ### 0.29.0 (2024-11-14) {#0_29_0} * Allow anonymous query and read state requests with invalid `ingress_expiry`. * Add allowed viewers variant to canister log visibility. From b687537a36284c7a87696d8263698987e19daa40 Mon Sep 17 00:00:00 2001 From: Martin Raszyk Date: Tue, 19 Nov 2024 19:08:25 +0100 Subject: [PATCH 3/3] metrics -> information --- docs/references/ic-interface-spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/references/ic-interface-spec.md b/docs/references/ic-interface-spec.md index fe85bfedf7..9b382ac6fd 100644 --- a/docs/references/ic-interface-spec.md +++ b/docs/references/ic-interface-spec.md @@ -5482,7 +5482,7 @@ S with ``` -#### IC Management Canister: Subnet Metrics +#### IC Management Canister: Subnet information The management canister returns subnet metadata given a subnet ID.