NNS Updates, Dec 13, 2024

The NNS Team submitted the following proposals. DFINITY plans to vote on these proposals the following Monday.

Proposals to be Submitted

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


# Upgrade the Cycles-minting Canister to Commit ee52ab3

__Proposer__: jason.zhu at dfinity.org

__Source code__: [ee52ab3056cf5f39b09b08de70bdd20485c8b2dc][new-commit]

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

## Summary

Increase the cycles limit by 3x and add metrics for the limiter.

## New Commits

```

$ git log --format="%C(auto) %h %s" ca8847547d327ce8a3bd81d25a590e01da1a3af5..ee52ab3056cf5f39b09b08de70bdd20485c8b2dc -- ./rs/nns/cmc

c89c23e5e5 feat(cmc): Increase cycles_limit by 3x. (#3093)

7b5227e9dd feat(cmc): Limiter metrics. (#3118)

```

## Upgrade Arguments

```candid

()

```

## Current Version

__Current git hash__: ca8847547d327ce8a3bd81d25a590e01da1a3af5

__Current wasm hash__: 57f2cbbdbc2d8943173acc6ebd55aca9b9c12e2140b38ff5f20aea7b101ea570

## 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/ee52ab3056cf5f39b09b08de70bdd20485c8b2dc/rs/nervous_system/docs/proposal_verification.md

### WASM Verification

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

[prereqs]: https://github.com/dfinity/ic/tree/ee52ab3056cf5f39b09b08de70bdd20485c8b2dc/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 ee52ab3056cf5f39b09b08de70bdd20485c8b2dc

# 2. Build canisters.

./ci/container/build-ic.sh -c

# 3. Fingerprint the result.

sha256sum ./artifacts/canisters/cycles-minting-canister.wasm.gz

```

This should match `wasm_module_hash` field of this proposal.

### Upgrade Arguments Verification

[`didc`][latest-didc] is required.

[latest-didc]: https://github.com/dfinity/candid/releases/latest

```

didc encode '()' | xxd -r -p | sha256sum

```

This should match the `arg_hash` field of this proposal.

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


# Upgrade the Governance Canister to Commit ee52ab3

__Proposer__: jason.zhu at dfinity.org

__Source code__: [ee52ab3056cf5f39b09b08de70bdd20485c8b2dc][new-commit]

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

## Summary

* Prepare for neurons migration to stable memory by adding benchmarks and optimizing neuron related operations.

* Changes needed for periodic confirmation.

## New Commits

```

$ git log --format="%C(auto) %h %s" 0f35ac817bdf3b44680111fc90ce5d6e3bc79be1..ee52ab3056cf5f39b09b08de70bdd20485c8b2dc -- ./rs/nns/governance ./rs/sns/init

ee52ab3056 fix(nns): Fix benchmark by simulating proper behavior in canbench-rs build (#3160)

0e853680c2 perf(nns): Improve neuron validation batching (#3105)

e3cc69fe44 perf(nns): Avoid running `StableNeuronStoreValidator` after migration (#3104)

09fa8e6796 perf(nns): Read heap neurons for cardinalities (#3103)

1f952c5295 perf(nns): Add benchmarks for neuron data validator (#3102)

cf7d6c2b9b test(nns): Add a benchmark for list neurons (#3076)

c606036a64 feat(nns): Count stale and expired voting power neurons. (#3090)

ac17241242 feat(nns): Periodic confirmation metrics. (#3070)

f1bcb142fd chore(nns): Clarify the purpose of loading the known neuron section when calculating metrics (#3022)

e155963b3e perf(nns): Improve listing neurons fund neurons (#3020)

e4fc40580d perf(nns): Add benchmark for listing neurons fund neurons (#3019)

00eb69d99f test(nns): Add recent_ballots_next_entry_index to NeuronBuilder and let it be So… (#3073)

a2e186250a refactor(nns): pass begin: Bound<NeuronId> to schedule_prune_some_following. (#3061)

3cf3ebcdec docs(nns): Deleted comments that say Comand (and related) types are deprecated. (#3023)

f9636c623c feat(nns): Highly scalable voting (#2932)

```

## Upgrade Arguments

```candid

()

```

## Current Version

__Current git hash__: 0f35ac817bdf3b44680111fc90ce5d6e3bc79be1

__Current wasm hash__: 5ef169ca0f8765e9d2195988bc4ec26b1b8f0480b22fbd16c5ba148547b90c3d

## 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/ee52ab3056cf5f39b09b08de70bdd20485c8b2dc/rs/nervous_system/docs/proposal_verification.md

### WASM Verification

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

[prereqs]: https://github.com/dfinity/ic/tree/ee52ab3056cf5f39b09b08de70bdd20485c8b2dc/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 ee52ab3056cf5f39b09b08de70bdd20485c8b2dc

# 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.

### Upgrade Arguments Verification

[`didc`][latest-didc] is required.

[latest-didc]: https://github.com/dfinity/candid/releases/latest

```

didc encode '()' | xxd -r -p | sha256sum

```

This should match the `arg_hash` field of this proposal.

1 Like

proposal - 134499

Vote: ADOPT

Reason:

I successfully built and verified the hash. All the commit descriptions match their code changes.

Hash Match: MATCH

Feedback: NONE

Proposer Check: MATCH

Commits

ee52ab3056
Conditional compilation to differentiate behavior between production, testing, and benchmarking (canbench-rs) environments.

Allows simulation of instruction limits by tracking and setting a fake instruction threshold. This ensures that during benchmarking, the system accurately mimics production-like instruction constraints.

0e853680c2
Updates the validation logic to only load the necessary parts of each neuron from stable memory (NeuronSections), rather than loading entire neurons.

e3cc69fe44
Removes the need for StableNeuronStoreValidator for ValidationInProgress. Only adds it when migration is NOT in progress.

09fa8e6796
For cardinality_primary_heap it now reads heap_neurons instead of with_active_neurons. This is a perf fix.

1f952c5295
Adds bench neuron_data_validation_heap and neuron_data_validation_stable.

cf7d6c2b9b
New benchmark test measures the performance of the list_neurons function by simulating the retrieval of 100 neurons under both stable and heap memory configurations.

c606036a64
Two new metrics fields in the governance data model: declining_voting_power_neuron_subset_metrics and fully_lost_voting_power_neuron_subset_metrics. These metrics track neurons whose voting power has begun to decay or is fully decayed due to not refreshing their voting power recently.

ac17241242
Two additional voting power metrics alongside the existing total voting power metric, specifically “deciding voting power” and “potential voting power,” and their corresponding bucketed breakdowns.

f1bcb142fd
Matches description clarify the purpose of loading the known neuron section when calculating metrics

e155963b3e
Eliminates the generic filter_map_active_neurons function and directly utilizes with_active_neurons_iter_sections with specified neuron sections to filter and map active Neurons’ Fund neurons.

e4fc40580d
Two new benchmark scenarios (list_active_neurons_fund_neurons_heap and list_active_neurons_fund_neurons_stable), along with small adjustments to the instruction counts in existing benchmarks. Refactor neuron creation in the benchmarking code to use a new_neuron_builder function and conditionally compile certain test fields (like recent_ballots) for better flexibility.

00eb69d99f
Matches description of add recent_ballots_next_entry_index to NeuronBuilder.

a2e186250a
Eliminates the use of the thread-local PRUNE_FOLLOWING_CHECKPOINT by modifying schedule_prune_following to accept the checkpoint (original_begin) as a function parameter instead.

3cf3ebcdec
Removal of comments.

f9636c623c
New pkg (ic-nervous-system-long-message), add it as a dependency in Cargo, and adjust the existing logic for splitting long-running tasks (like cascading neuron votes) into multiple message calls using self-calls to a no-op method. Implement a ProposalVotingStateMachine and VotingStateMachines that track ongoing vote processing across multiple messages. The changes also include updates to how proposals and recent ballots are recorded, ensuring that voting operations can exceed the instruction limits by spanning multiple rounds through self-calls and scheduled timer tasks.

proposal - 134500

Vote: ADOPT

Reason:

I successfully built and verified the hash. All the commit descriptions match their code changes.

Hash Match: MATCH

Feedback: NONE

Proposer Check: MATCH

Commits

c89c23e5e5
Increase default cycles limit to 150e15.

7b5227e9dd
Added metrics track the number of rejected minting requests due to limiter constraints (cmc_limiter_reject_count), the amount of recently minted cycles (cmc_limiter_cycles), and the maximum allowable cycles that can be minted in the recent past (cmc_cycles_limit).

2 Likes

Proposal #134499 Governance canister

Vote: Adopted
Reason: Builds fine and both hashes for the WASM and arguments matches, as do all the listed commits.

2 Likes

Proposal #134500 CMC (Cycles-minting Canister)

Vote: Adopted
Reason: Builds fine and both hashes for the WASM and arguments matches, as do the two commits.

c89c23e5e5 feat(cmc): Increase cycles_limit by 3x.
Done by setting DEFAULT_CYCLES_LIMIT to 150e15 from previous 50e15, this is a 3 times increase that equals to 150,000,000,000,000,000 .
Motivation beeing that with prices currently up some users reportedly hit the previous limit.
7b5227e9dd feat(cmc): Limiter metrics.
Adds LIMITER_REJECT_COUNT counter for tracking the number of rejected operations to the check when a new operation cycles_to_mint will exceed the predefined cycle limit state.cycles_limit. If it will, it rejects the operation and increments the added rejection counter.
Three new limiter metric will be used cmc_limiter_reject_count, cmc_limiter_cycles and cmc_cycles_limit for alerts with very detailed descriptions.

2 Likes

Proposal 134499

Vote: ADOPT

Proposal 134500

Vote: ADOPT

1 Like

Proposal 134499

Vote: ADOPT
Reason: Build is successful and both code changes and hashes match.

134499

f9636c623c Implemented Storable trait for ProposalId. Refactor noop_self_call_if_over_instructions method to make noop call even if call context threshold is reached and return a OverCallContextError instead of panicking. Reserved an additional memory id and added protobuf definitions for voting state machines so they can be persisted in stable memory.

Reworked logic in cast_vote_and_cascade_follow so that processing for the proposal state machine can span across multiple messages, this is achieved by calling a wrapper method of noop_self_call_if_over_instructions, that implements different behavior depending whether it is running under a benchmark or not, for the latter case it makes an async noop call everytime SOFT_VOTING_INSTRUCTIONS_LIMIT is hit and exits the loop if HARD_VOTING_INSTRUCTIONS_LIMIT is reached as a failsafe, otherwise it does nothing. The soft limit also vary based on the tags used when compiling the canister, with it being lower and overridable when test tag is used.

When cast_vote_and_cascade_follow is called the neuron’s vote is immediately registered in the state machine, then as long as HARD_VOTING_INSTRUCTIONS_LIMIT is not reached, the vote is propagated to all eligible followers and finally recent ballots for all affected neurons are updated. A timer has also been added to run every 3 seconds and complete processing of any state machines that didn’t manage to complete in time.

ee52ab3056 Implemented fake instruction counter to be used in benchmarks.

0e853680c2 Optimized neuron validation by only reading necessary neuron sections and limiting iterations by instructions used instead of a fixed batch size.

e3cc69fe44 Only run StableNeuronStoreValidator if is_active_neurons_in_stable_memory_enabled is false.

09fa8e6796 Optimized cardinalities validation by iterating directly on heap neurons instead of relying on with_active_neurons_iter method.

1f952c5295 Same as description.

cf7d6c2b9b Added benchmark for list neurons and minor optimization in get_non_empty_neuron_ids_readable_by_caller by not reading any neuron section when determining if a neuron has any stake.

c606036a64 Added two new metrics to keep track of neurons with declining or zero voting power.

ac17241242 Added metrics to track total and per neuron potential and deciding voting power and timestamp of each pruning process cycle reset.

f1bcb142fd Same as description.

e155963b3e Optimized list_active_neurons_fund_neurons by only reading hot_keys section.

e4fc40580d Same as description.

00eb69d99f Same as description.

a2e186250a Instead of storing the checkpoint neuron id to be used during the pruning process in global state, the initial value is provided directly to schedule_prune_following and then passed on recursively.

3cf3ebcdec Same as description.

2 Likes

Proposal 134500

Vote: ADOPT
Reason: Build is successful and both code changes and hashes match.

c89c23e5e5 Increased limit of cycles that can be minted in a certain timeframe by 3x.

7b5227e9dd Added metrics to track how many times rate limiting has been triggered for cycles minting, how many cycles have been minted in the past hour and the cycle limit used.

2 Likes