Skip to content

Commit

Permalink
[FINAL] feat: Add sections for new subnet_info endpoint (#3755)
Browse files Browse the repository at this point in the history
* [FINAL] feat: Add sections for new subnet_info endpoint

* changelog

* metrics -> information
  • Loading branch information
mraszyk authored Nov 19, 2024
1 parent 0b1584f commit 7b300dc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/references/_attachments/ic.did
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) -> ();
Expand Down
3 changes: 3 additions & 0 deletions docs/references/_attachments/interface-spec-changelog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
35 changes: 35 additions & 0 deletions docs/references/ic-interface-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -2565,6 +2565,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.
Expand Down Expand Up @@ -5489,6 +5497,33 @@ S with

```

#### IC Management Canister: Subnet information

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 = <implementation-specific>
```

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.
Expand Down

0 comments on commit 7b300dc

Please sign in to comment.