Skip to content

refactor(governance): remove old CMC-based maturity modulation and XDR rate polling#9877

Draft
jasonz-dfinity wants to merge 1 commit intojason/NNS1-4319-switch-maturity-modulationfrom
jason/NNS1-4319-remove-old-maturity-polling
Draft

refactor(governance): remove old CMC-based maturity modulation and XDR rate polling#9877
jasonz-dfinity wants to merge 1 commit intojason/NNS1-4319-switch-maturity-modulationfrom
jason/NNS1-4319-remove-old-maturity-polling

Conversation

@jasonz-dfinity
Copy link
Copy Markdown
Contributor

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

Why

Previous PRs added local computation and switched consumers. This PR removes the now-dead CMC polling code.

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

What

Removed from Governance:

  • should_update_maturity_modulation(), update_maturity_modulation()
  • should_refresh_xdr_rate(), maybe_refresh_xdr_rate()
  • Their call sites in run_periodic_tasks

Node provider reward calculations continue to use the CMC get_average_icp_xdr_conversion_rate call (unchanged).

The cmc field is marked #[allow(dead_code)] to avoid a large constructor signature change; full removal is deferred.

PR Chain

Testing

All existing tests pass. Clippy clean.

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 removes now-unused Governance heartbeat code paths that previously polled the Cycles Minting Canister (CMC) for maturity modulation and ICP/XDR conversion-rate updates, reflecting earlier refactors that moved maturity modulation computation locally and shifted consumers away from the old refresh loop.

Changes:

  • Removed should_update_maturity_modulation() / update_maturity_modulation() and their heartbeat call site.
  • Removed should_refresh_xdr_rate() / maybe_refresh_xdr_rate() and their heartbeat call site.
  • Kept the cmc field but marked it #[allow(dead_code)] to avoid a broad constructor signature change.

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

Comment on lines 6294 to 6299
GovernanceError::from(e),
),
}
// Try to update maturity modulation (once per day).
} else if self.should_update_maturity_modulation() {
self.update_maturity_modulation().await;
} else {
// This is the lowest-priority async task. All other tasks should have their own
// `else if`, like the ones above.
let refresh_xdr_rate_result = self.maybe_refresh_xdr_rate().await;
if let Err(err) = refresh_xdr_rate_result {
println!(
"{}Error when refreshing XDR rate in run_periodic_tasks: {}",
LOG_PREFIX, err,
);
}
}

self.maybe_gc();
@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-remove-old-maturity-polling branch 2 times, most recently from b7797f9 to 4fbe4bf Compare April 15, 2026 21:29
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-switch-maturity-modulation branch from f607ce6 to 9da51a1 Compare April 15, 2026 21:29
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-remove-old-maturity-polling branch from 4fbe4bf to c1759e0 Compare April 15, 2026 22:29
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-switch-maturity-modulation branch from 9da51a1 to 8577ae1 Compare April 15, 2026 22:29
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-switch-maturity-modulation branch from 8577ae1 to bc807c4 Compare April 16, 2026 05:21
@jasonz-dfinity jasonz-dfinity force-pushed the jason/NNS1-4319-remove-old-maturity-polling branch from c1759e0 to 21d9a14 Compare April 16, 2026 05:21
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