DisburseMaturity Incorrectly Turned On

TL;DR

A previous proposal 136224 contains a bad commit which incorrectly turns on the DisburseMaturity feature. We will propose another proposal which will correctly turn it back off so that people don’t accidentally call the endpoint.

Impact

If the endpoint is called and succeeds, the maturity will be taken from the account and disbursements will be correctly stored. However, the minting of ICP (which should happen 7 days later) will not happen until the feature is fully available. When the feature is fully implemented, the minting should happen correctly. If it has been more than 7 days after the initiation of the disbursement, then the minting should happen immediately after the upgrade.

We don’t expect many people to accidentally call the endpoint as one would have to watch the governance.did file and figure out how to call the new manage neuron command (since the feature is not yet available on the NNS Dapp).

4 Likes

The NNS Team submitted the following proposals. DFINITY plans to vote on these proposals on Wednesday (April 16, 2025).

https://dashboard.internetcomputer.org/proposal/136285

Additional Notes

DFINITY plans to vote on it sooner, as this proposal contains a commit which prevents people accidentally use a functionality that’s not ready.

Proposals to be Submitted

Governance

# Upgrade the Governance Canister to Commit 1c46b8a

__Proposer__: jason.zhu at dfinity.org

__Source code__: [1c46b8a2c717616bca1b5ba264e7b3ff81a3ce52][new-commit]

[new-commit]: https://github.com/dfinity/ic/tree/1c46b8a2c717616bca1b5ba264e7b3ff81a3ce52


## Features & Fixes

###  Added

* A timer task is added to take daily snapshots of voting power for standard proposals.

###  Fixed

* Turned off `DisburseMaturity` that was incorrectly turned on before.


## New Commits

```
$ git log --format="%C(auto) %h %s" 7575e49a4afa83524c06ad72ce40f588eca93ae2..1c46b8a2c717616bca1b5ba264e7b3ff81a3ce52 --  ./rs/nns/governance ./rs/sns/init
 1c46b8a2c7 fix(nns): Turn off disburse maturity which was incorrectly turned on (#4827)
 28ef5ff672 chore(nns): Delete flags related to periodic confirmation of following. (#3782)
 13b6e2630f feat(nns): Add a timer task to perform voting power snapshots (#4405)
 e41b1f0c46 feat(nns): Define NeuronAsyncLock to be compatible with safer access pattern to global state (#4774)
 971eecc54a chore(nns): update changelogs (#4793)
 6aca5540e6 feat(nns): Add an index for maturity disbursement based on finalization timestamp (#4770)
```


## Current Version

__Current git hash__: 7575e49a4afa83524c06ad72ce40f588eca93ae2

__Current wasm hash__: 5048768a1527413737fca111c9ef794fb817a20d69725dae2c6192e53c5b1fbc


## Verification

See the general instructions on [how to verify] proposals like this. A "quick
start" guide is provided here.

[how to verify]: https://github.com/dfinity/ic/tree/1c46b8a2c717616bca1b5ba264e7b3ff81a3ce52/rs/nervous_system/docs/proposal_verification.md


### WASM Verification

See ["Building the code"][prereqs] for prerequisites.

[prereqs]: https://github.com/dfinity/ic/tree/1c46b8a2c717616bca1b5ba264e7b3ff81a3ce52/README.adoc#building-the-code

```
# 1. Get a copy of the code.
git clone git@github.com:dfinity/ic.git
cd ic
# Or, if you already have a copy of the ic repo,
git fetch
git checkout 1c46b8a2c717616bca1b5ba264e7b3ff81a3ce52

# 2. Build canisters.
./ci/container/build-ic.sh -c

# 3. Fingerprint the result.
sha256sum ./artifacts/canisters/governance-canister.wasm.gz
```

This should match `wasm_module_hash` field of this proposal.
1 Like

proposal - 136285 – Cyberowl | CodeGov

Checks

Proposals:
136285

Vote: ADOPT
Hashes Match: MATCH
Proposer Checks: MATCH
Target Canisters: MATCH
Feedback: NONE
Reason:
I successfully built and verified the hash. All the commit descriptions match their code changes.

Commits Summary

1c46b8a2c7
Turn off IS_DISBURSE_MATURITY_ENABLED

28ef5ff672
Eliminates the two flags IS_VOTING_POWER_ADJUSTMENT_ENABLED and IS_PRUNE_FOLLOWING_ENABLED, removes all helper functions and tests that toggled them, and makes both the voting‑power adjustment and the prune‑following task permanently active.

13b6e2630f
Replaces create_ballots_for_standard_proposal with compute_voting_power_snapshot_for_standard_proposal, introduces a VotingPowerSnapshot struct. It also adds a daily SnapshotVotingPowerTask that persists snapshots in stable memory, allowing the system to monitor for abnormal voting‑power spikes and disable early adoption when necessary.

e41b1f0c46
Relocates the old LedgerUpdateLock into a new neuron_lock.rs module and introduces NeuronAsyncLock, which leverages a &'static LocalKey<RefCell<Governance>> to give async code a safe, pointer‑free way to lock neurons.

971eecc54a
Update change logs.

6aca5540e6
Adds a MaturityDisbursementIndex—a stable‑memory StableBTreeMap keyed by (finalization_timestamp, neuron_id)—so governance can instantly find which neurons’ maturity disbursements are ready and when the next one is due. It wires the index into NeuronStore, StableNeuronIndexes, metrics, and a new test suite all gated behind the is_disburse_maturity_enabled feature flag.

If you like the review please follow:

About CodeGov…(click to expand)

CodeGov has a team of developers who review and vote independently on the following proposal topics: IC-OS Version Election, Protocol Canister Management, Subnet Management, Node Admin, and Participant Management. The CodeGov NNS known neuron is configured to follow our reviewers on these topics and Synapse on most other topics. We strive to be a credible and reliable Followee option that votes on every proposal and every proposal topic in the NNS. We also support decentralization of SNS projects such as WaterNeuron and KongSwap with a known neuron and credible Followees.

Learn more about CodeGov and it’s mission at codegov.org.

1 Like

Proposal 136285 – LaCosta | CodeGov

Vote: ADOPT

Governance Canister

image
Reason:
Build successful and hashes match, commits look great and match the description. Found no issues.

[1c46b8a2c7]: Turns off IS_DISBURSE_MATURITY_ENABLED that was previously incorrectly turned on.

[28ef5ff672]: Remves feature flags IS_VOTING_POWER_ADJUSTMENT_ENABLED and IS_PRUNE_FOLLOWING_ENABLED related to periodic confirmation of following.

[13b6e2630f]: Refactors function compute_ballots_for_new_proposal to use a new method neuron_store.compute_voting_power_snapshot_for_standard_proposal that returns a VotingPowerSnapshot calls it’s method create_ballots_and_total_potential_voting_power to generate ballots from the snapshot and returning them along with total_potential_voting_power. This makes it usable for both proposal ballot creation and snapshot recordings. Because of this the old create_ballots_for_standard_proposal that is no longer needed is removed. Defines SnapshotVotingPowerTask that is essentially responsible for running every day a snapshot of the voting power.

[e41b1f0c46]: Migrates LedgerUpdateLock and the locking/unlocking mechanism into rs/nns/governance/src/neuron_lock.rs. Implements a new struct NeuronAsyncLock that uses a new access pattern for the governance canister state with LocalKey<RefCell<Governance>>.

[971eecc54a]: Updates change logs to include adopted proposals and corresponding changes.

[6aca5540e6]: Adds a new data structure MaturityDisbursementIndex that store (finalization_timestamp, neuron_id) pairs in a StableBTreeMap. The index is included into indexes_mut behind feature flag is_disburse_maturity_enabled. A new metric governance_maturity_disbursement_index_len is also added behind the same feature flag that tracks the number of entries in the index.

About CodeGov

CodeGov has a team of developers who review and vote independently on the following proposal topics: IC-OS Version Election, Protocol Canister Management, Subnet Management, Node Admin, and Participant Management. The CodeGov NNS known neuron is configured to follow our reviewers on these technical topics. We also have a group of Followees who vote independently on the Governance and the SNS & Neuron’s Fund topics. We strive to be a credible and reliable Followee option that votes on every proposal and every proposal topic in the NNS. We also support decentralization of SNS projects such as WaterNeuron, KongSwap, and Alice with a known neuron and credible Followees.

Learn more about CodeGov and its mission at codegov.org.

1 Like

Proposal 136285 - Zane | CodeGov

Vote: ADOPT
Reason: Build completes successfully, both hashes and reviewed commits match their descriptions.

136285

1c46b8a2c7 IS_DISBURSE_MATURITY_ENABLED flag was incorrectly enabled in production instead of only for testing, this commit fixes it.

28ef5ff672 Cleaned up feature flags related to periodic confirmation alongside all logic used to toggle between separate behaviours, temporarily toggle on/off the feature and removed a test validating neuron vp not being affected when the feature was disabled.

13b6e2630f Commit 7fb2409c64 introduced logic to create voting power snapshots but it was never called outside of tests, with this commit two memory ids have been reserved to persist the stable maps for the snapshots and a dedicated timer task has been implemented to periodically save them. When the canister is initiated a snapshot will be immediately scheduled to be recorded, if none exist, otherwise a timer is scheduled based on the difference between the current timestamp and the time the last snapshot was taken at + their interval. During normal execution they are taken every hour. Refactored logic to compute ballots for standard proposals in compute_ballots_for_new_proposal, the compute logic has been moved to NeuronStore’s compute_voting_power_snapshot_for_standard_proposal which returns a VotingPowerSnapshot, then the ballots are processed by calling create_ballots_and_total_potential_voting_power on the snapshot instance returned by the compute method. compute_voting_power_snapshot_* is also used in the timer task to generate new snapshots.

e41b1f0c46 Moved LedgerUpdateLock from governance module to neuron_lock. Added NeuronAsyncLock which wraps the governance struct in a thread local RefCell, rather than exposing it as a raw pointer, so it can be accessed in async contexts.

971eecc54a Updated changelogs files.

6aca5540e6 Defined MaturityDisbursementIndex struct which keeps track of when disbursals should happen for each neuron and allows for efficient lookups of the next disbursal event’s timestamp and all neurons which should be processed in it. A memory id has been reserved for it and StableNeuronIndexes has been extended with a maturity_disbursement field to persist it in stable memory. A metric has also been added to track the size of the maturity_disbursement index, though at this time both said metric and the logic to properly keep the index up to date are gated behind the IS_DISBURSE_MATURITY_ENABLED flag, which is disabled in prod.

About CodeGov

CodeGov has a team of developers who review and vote independently on the following proposal topics: IC-OS Version Election, Protocol Canister Management, Subnet Management, Node Admin, and Participant Management. The CodeGov NNS known neuron is configured to follow our reviewers on these technical topics. We also have a group of Followees who vote independently on the Governance and the SNS & Neuron’s Fund topics. We strive to be a credible and reliable Followee option that votes on every proposal and every proposal topic in the NNS. We also support decentralization of SNS projects such as WaterNeuron, KongSwap, and Alice with a known neuron and credible Followees.

Learn more about CodeGov and its mission at codegov.org.

1 Like

Proposal #136285 for Governance — Zack | CodeGov

Vote: Adopted

Reason: The build is reproducible and the wasm hash is a match.
The canister id rrkah-fqaaa-aaaaa-aaaaq-cai is correct and the install mode is upgrade.

About CodeGov

CodeGov has a team of developers who review and vote independently on the following proposal topics: IC-OS Version Election, Protocol Canister Management, Subnet Management, Node Admin, and Participant Management. The CodeGov NNS known neuron is configured to follow our reviewers on these technical topics. We also have a group of Followees who vote independently on the Governance and the SNS & Neuron’s Fund topics. We strive to be a credible and reliable Followee option that votes on every proposal and every proposal topic in the NNS. We also support decentralization of SNS projects such as WaterNeuron, KongSwap, and Alice with a known neuron and credible Followees.

Learn more about CodeGov and its mission at codegov.org.