dfinity / interface-spec

IC Interface Specification
https://khsfq-wqaaa-aaaak-qckvq-cai.icp0.io/docs
37 stars 20 forks source link

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

Closed michael-weigelt closed 2 weeks ago

michael-weigelt commented 1 month ago

In certain circumstances, canisters wish to learn about subnet-specific data or metadata. This endpoint enables these use cases, starting with exposing the replica version a subnet is currently running.

Open questions:

github-actions[bot] commented 1 month ago

🤖 Here's your preview: https://pjpim-riaaa-aaaak-qckja-cai.icp0.io/docs

adambratschikaye commented 1 month ago

If a canister wants to get the information for it's own subnet, how is it supposed to figure out which subnet it is on?

mraszyk commented 1 month ago

If a canister wants to get the information for it's own subnet, how is it supposed to figure out which subnet it is on?

The registry has an endpoint that serves this information.

dsarlis commented 1 month ago

Is there a reason why we went with subnet_metrics instead of subnet_metadata or subnet_info? The replica_version is not exactly a metric. Do we envision that we would eventually have things like number of canisters or state of the subnet served through this endpoint? Even then, I think subnet_info would still be ok (subnet_metrics would still suffer from including the replica_version which is not really a metric).

michael-weigelt commented 1 month ago

Do we envision that we would eventually have things like number of canisters or state of the subnet served through this endpoint

Yes, I believe. But I see the point. It's a misnomer now, and will be less of a misnomer later, but still not quite right.

why

Just in case you missed the collapsed item.

mraszyk commented 1 month ago

Is there a reason why we went with subnet_metrics instead of subnet_metadata or subnet_info? The replica_version is not exactly a metric. Do we envision that we would eventually have things like number of canisters or state of the subnet served through this endpoint? Even then, I think subnet_info would still be ok (subnet_metrics would still suffer from including the replica_version which is not really a metric).

I agree that subnet_info makes more sense and is consistent with the existing canister_info endpoint. We already have a path /subnet/<subnet_id>/metrics in the state tree though and if we eventually converge into having the same data in the state tree and in subnet_info, then the name would be inconsistent (unless we could rename the state tree path).

dsarlis commented 1 month ago

Is there a reason why we went with subnet_metrics instead of subnet_metadata or subnet_info? The replica_version is not exactly a metric. Do we envision that we would eventually have things like number of canisters or state of the subnet served through this endpoint? Even then, I think subnet_info would still be ok (subnet_metrics would still suffer from including the replica_version which is not really a metric).

I agree that subnet_info makes more sense and is consistent with the existing canister_info endpoint. We already have a path /subnet/<subnet_id>/metrics in the state tree though and if we eventually converge into having the same data in the state tree and in subnet_info, then the name would be inconsistent (unless we could rename the state tree path).

The state tree path contains only metrics for now so that is consistent imo. If we want to unify at some point (the two return a different set of information for now), then we can switch to subnet_info for the state tree path too. (Likely by introducing a new path that supersedes the old for backward compatibility).

Dfinity-Bjoern commented 1 month ago

I am also fine with subnet_info, if that's the preferred term overall.

michael-weigelt commented 1 month ago

Thanks for the changes @mraszyk. Do we consider this PR final? @Dfinity-Bjoern The implementation is updated, here.

mraszyk commented 2 weeks ago

Superseded by https://github.com/dfinity/portal/pull/3755