Skip to content

DO NOT MERGE until maturity modulation validated in mainnet feat(governance): switch spawning and disbursement to locally computed maturity modulation#9848

Open
jasonz-dfinity wants to merge 2 commits intojason/NNS1-4319-compute-maturity-modulationfrom
jason/NNS1-4319-switch-maturity-modulation
Open

DO NOT MERGE until maturity modulation validated in mainnet feat(governance): switch spawning and disbursement to locally computed maturity modulation#9848
jasonz-dfinity wants to merge 2 commits intojason/NNS1-4319-compute-maturity-modulationfrom
jason/NNS1-4319-switch-maturity-modulation

Conversation

@jasonz-dfinity
Copy link
Copy Markdown
Contributor

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

Why

The previous PR added local maturity modulation computation. This PR switches the actual consumers to use it.

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

What

  • maybe_spawn_neurons() reads from icp_xdr_rate_history.current_maturity_modulation_permyriad instead of cached_daily_maturity_modulation_basis_points
  • try_finalize_maturity_disbursement() reads from the same new source
  • TLA state export updated accordingly
  • Tests updated to set up icp_xdr_rate_history instead of the old field

The old CMC-polled fields are not yet removed; that happens in the next PR.

PR Chain

Testing

Existing disburse_maturity and maybe_spawn_neurons tests updated and passing.

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 aims to switch governance maturity-modulation consumers (neuron spawning + maturity disbursement finalization) to read the locally computed maturity modulation value, and updates TLA export + tests accordingly.

Changes:

  • Update maybe_spawn_neurons and try_finalize_maturity_disbursement to read maturity modulation from a new heap-data source.
  • Update TLA global export to reflect the new maturity-modulation source.
  • Update disburse-maturity tests to set up the new maturity-modulation source.

Reviewed changes

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

Show a summary per file
File Description
rs/nns/governance/src/timer_tasks/mod.rs Adds imports intended for XRC-related logic (currently unused in this module).
rs/nns/governance/src/governance/tla/mod.rs Switches TLA export of cached maturity modulation to the new source.
rs/nns/governance/src/governance/disburse_maturity_tests.rs Updates test setup to populate the new maturity-modulation source.
rs/nns/governance/src/governance/disburse_maturity.rs Switches maturity disbursement finalization to read modulation from the new source.
rs/nns/governance/src/governance.rs Switches neuron spawning to read modulation from the new source.

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

Comment thread rs/nns/governance/src/governance/disburse_maturity_tests.rs Outdated
Comment thread rs/nns/governance/src/timer_tasks/mod.rs Outdated
Comment thread rs/nns/governance/src/governance.rs Outdated
Comment thread rs/nns/governance/src/governance/disburse_maturity.rs Outdated
Comment thread rs/nns/governance/src/governance/tla/mod.rs Outdated
Comment thread rs/nns/governance/src/governance/disburse_maturity_tests.rs Outdated
Comment thread rs/nns/governance/src/governance/disburse_maturity_tests.rs Outdated
@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-switch-maturity-modulation branch from 2263afa to f607ce6 Compare April 15, 2026 19:27
@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-switch-maturity-modulation branch 2 times, most recently from 9da51a1 to 8577ae1 Compare April 15, 2026 22:29
@jasonz-dfinity jasonz-dfinity marked this pull request as ready for review April 15, 2026 22:32
@jasonz-dfinity jasonz-dfinity requested a review from a team as a code owner April 15, 2026 22:32
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 changed the title feat(governance): switch spawning and disbursement to locally computed maturity modulation DO NOT MERGE until maturity modulation validated in mainnet feat(governance): switch spawning and disbursement to locally computed maturity modulation Apr 15, 2026
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-switch-maturity-modulation branch from 8577ae1 to bc807c4 Compare April 16, 2026 05:21
Copy link
Copy Markdown
Contributor

@daniel-wong-dfinity-org daniel-wong-dfinity-org left a comment

Choose a reason for hiding this comment

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

I would put this behind a flag.

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.

3 participants