Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

[FINAL] feat: Add sections for new subnet_info endpoint #351

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
11 changes: 11 additions & 0 deletions spec/_attachments/ic.did
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ type node_metrics_history_result = vec record {
node_metrics : vec node_metrics;
};

type subnet_stats_args = record {
michael-weigelt marked this conversation as resolved.
Show resolved Hide resolved
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;
Expand Down Expand Up @@ -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) -> ();
Expand Down
35 changes: 35 additions & 0 deletions spec/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -5439,6 +5447,33 @@ 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 = <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
Loading