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
Conversation
Contributor
There was a problem hiding this comment.
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
cmcfield 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(); |
2263afa to
f607ce6
Compare
b7797f9 to
4fbe4bf
Compare
f607ce6 to
9da51a1
Compare
4fbe4bf to
c1759e0
Compare
9da51a1 to
8577ae1
Compare
8577ae1 to
bc807c4
Compare
c1759e0 to
21d9a14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.