Skip to content

feat(governance): expose get_maturity_modulation query endpoint#9879

Open
jasonz-dfinity wants to merge 6 commits intojason/NNS1-4319-compute-maturity-modulationfrom
jason/NNS1-4319-get-maturity-modulation-api
Open

feat(governance): expose get_maturity_modulation query endpoint#9879
jasonz-dfinity wants to merge 6 commits intojason/NNS1-4319-compute-maturity-modulationfrom
jason/NNS1-4319-get-maturity-modulation-api

Conversation

@jasonz-dfinity
Copy link
Copy Markdown
Contributor

@jasonz-dfinity jasonz-dfinity commented Apr 14, 2026

Why

PR #9847 computes maturity modulation locally but does not expose it via the canister API.
This adds a query endpoint so that external tools and dashboards can read the current
maturity modulation value, as defined by Mission 70.

https://dfinity.atlassian.net/browse/NNS1-4319

What

  • Add MaturityModulation, GetMaturityModulationRequest, and GetMaturityModulationResponse types to the ic-nns-governance-api crate
  • Add Governance::get_maturity_modulation() method
  • Add #[query] fn get_maturity_modulation endpoint to the governance canister
  • Add corresponding types and service entry to governance.did
  • Add pb::api From conversion for MaturityModulation

PR Chain

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR exposes the Mission 70 “maturity modulation” value through the Governance canister’s public Candid interface so external tools/dashboards can query it.

Changes:

  • Added MaturityModulation, GetMaturityModulationRequest, and GetMaturityModulationResponse to ic-nns-governance-api.
  • Added Governance::get_maturity_modulation() and a corresponding #[query] get_maturity_modulation canister endpoint.
  • Updated governance.did and added the required pb→api conversion for MaturityModulation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rs/nns/governance/src/pb/conversions/mod.rs Adds pb→api From conversion for MaturityModulation.
rs/nns/governance/src/governance.rs Adds a getter that exposes maturity modulation from heap state via API response type.
rs/nns/governance/canister/governance.did Declares new request/response + MaturityModulation types and adds the new service method.
rs/nns/governance/canister/canister.rs Implements the new public query endpoint that returns the modulation value.
rs/nns/governance/api/src/types.rs Introduces new public API types for the query endpoint and payload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-get-maturity-modulation-api branch from 40e573b to ebb47a9 Compare April 14, 2026 23:12
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-compute-maturity-modulation branch from 0724790 to 9a31ba9 Compare April 15, 2026 19:27
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-get-maturity-modulation-api branch from ebb47a9 to 83dc934 Compare April 15, 2026 19:28
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-compute-maturity-modulation branch from 9a31ba9 to a7108f0 Compare April 15, 2026 21:29
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-get-maturity-modulation-api branch from 83dc934 to ee64f46 Compare April 15, 2026 21:30
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-get-maturity-modulation-api branch from ee64f46 to 5ff783e Compare April 15, 2026 22:29
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-get-maturity-modulation-api branch from 5ff783e to c1a9ced Compare April 16, 2026 05:21
@jasonz-dfinity jasonz-dfinity marked this pull request as ready for review May 5, 2026 17:56
@jasonz-dfinity jasonz-dfinity requested a review from a team as a code owner May 5, 2026 17:56
Copy link
Copy Markdown
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.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-compute-maturity-modulation branch from 1455d28 to 876292a Compare May 5, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants