Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nns/sns): Add query stats to canister status #3710

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

jasonz-dfinity
Copy link
Contributor

@jasonz-dfinity jasonz-dfinity commented Jan 31, 2025

Why

The query_stats field from the canister_status management canister API has been available for a while. Some NNS/SNS canisters expose methods to proxy the management canister method, and they haven't been updated to expose query_stats yet.

What

  • Add query_stats: QueryStatsFromManagementCanister for the management canister call. No opt is needed since the management canister doesn't have opt.
  • Add query_stats: opt QueryStats to the CanisterStatusResult/CanisterStatusResultV2 structs, where each field in QueryStats is also opt. This is consistent with other NNS/SNS APIs where we use opt to allow removing such fields if needed.

Why the API change is safe

Since every addition in *.did files changed by this PR is opt, decoding will always be successful no matter whether the sender/receiver of the message gets the change first.

@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-3541-2 branch 2 times, most recently from 3bc290e to f340a67 Compare January 31, 2025 19:19
@jasonz-dfinity jasonz-dfinity changed the title Add query stats to canister status feat(nns/sns): Add query stats to canister status Jan 31, 2025
@github-actions github-actions bot added the feat label Jan 31, 2025
@jasonz-dfinity jasonz-dfinity marked this pull request as ready for review January 31, 2025 19:35
@jasonz-dfinity jasonz-dfinity requested a review from a team as a code owner January 31, 2025 19:35
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this pull request affects the behavior of any canister owned by
the Governance team, remember to update the corresponding
unreleased_changes.md file(s).

To acknowldge this reminder (and unblock the PR), dismiss this
code review by going to the bottom of the pull request page, and
supply one of the following reasons:

  1. Done.

  2. No canister behavior changes.

Base automatically changed from jason/NNS1-3541-1 to master January 31, 2025 21:23
@jasonz-dfinity jasonz-dfinity added this pull request to the merge queue Feb 4, 2025
Merged via the queue into master with commit 01fcadf Feb 4, 2025
25 checks passed
@jasonz-dfinity jasonz-dfinity deleted the jason/NNS1-3541-2 branch February 4, 2025 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants