NNS Updates 2024-09-20

NNS Cycles Minting

# Upgrade the Cycles-minting Canister to Commit 87343a8

__Proposer__: daniel.wong at dfinity.org\
__Source Code__: [87343a880050ca72b1361138535211f5770dd52e][new-commit]

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


## Features, Fixes, and Optimizations

- get default subnets query
- Fix the data certification for the `get_average_icp_xdr_conversion_rate` endpoint

(Previous security fixes that were released as a hotfix are (still) here.)


## New Commits

```
$ git log --format="%C(auto) %h %s" 77f48ae63af09b6538b1bf33d3accc3bc74d14f8..87343a880050ca72b1361138535211f5770dd52e --  ./rs/nns/cmc
 ebb4dc57d9 feat(cmc): get default subnets query (#892)
 df1dbfc8a2 chore: Add file extension to globs (#1543)
 bbb8a51524 fix(cmc): Fix the data certification for the `get_average_icp_xdr_conversion_rate` endpoint (#1423)
 3aa43520c4 chore(cmc): Clean up the CMC state migration code (#1424)
 c2b4a0aaf4 fix(cmc): Merging CMC hotfix back to master (#1368)
 137faea9ee chore(cmc): Simplify get_next_multiply_of (#1236)
 4d09678d23 chore: sort rust derive traits (#1241)
```


## Upgrade Arguments

```candid
()
```


## Current Version

- Current Git Hash: 77f48ae63af09b6538b1bf33d3accc3bc74d14f8
- Current Wasm Hash: 3260e795bd3e446a189539ce89d44cb29f7d196b92cdd2e2c75571c062ef1e50


## WASM Verification

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

[prereqs]: https://github.com/dfinity/ic?tab=readme-ov-file#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 87343a880050ca72b1361138535211f5770dd52e

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

NNS Governance

# Upgrade the Governance Canister to Commit 87343a8

__Proposer__: daniel.wong at dfinity.org\
__Source Code__: [87343a880050ca72b1361138535211f5770dd52e][new-commit]

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


## Features, Fixes, and Optimizations

- Use timer instead of heartbeat to poll archives.
- Disable NnsCanisterUpgrade and NnsRootUpgrade in favor of InstallCode.
- Only set the `wasm_memory_limit` for SNS Governance when deploying an SNS.
- Further increase panic probability for deprecated pb methods. 😈


## New Commits

```
$ git log --format="%C(auto) %h %s" b60c9012db8fecebb2937334e6301ea2dfa9416f..87343a880050ca72b1361138535211f5770dd52e --  ./rs/nns/governance ./rs/sns/init
 96814ec4af refactor(nns): Remove unnecessary test_feature library (#1582)
 d399ee7f6f refactor(nns): remove unnecessary mut from call_canister_method signature (#1520)
 df1dbfc8a2 chore: Add file extension to globs (#1543)
 4e8565c624 revert(nns): Re-apply changes from #1496 except for the ones that caused the tests to fail (#1561)
 ad9e529296 feat(nns): Further increase panic probability for deprecated pb methods (#1562)
 fbde007ff4 revert(nns): Disable NnsCanisterUpgrade and NnsRootUpgrade in favor of InstallCode (#1496) (#1559)
 41f6ce3a7c refactor: Remove dependencies on nns governance crate from sns cli and ic-admin (#1252)
 a4b9ab2ec1 feat(sns): Only set the `wasm_memory_limit` for SNS Governance when deploying an SNS (#1427)
 bfc9da0790 refactor(nervous_system): use Runtime trait for Ledger (#1455)
 d123a2a015 feat(nns): Disable NnsCanisterUpgrade and NnsRootUpgrade in favor of InstallCode (#1496)
 2e85a2e961 feat(sns): Use timer instead of heartbeat to poll archives (#1477)
```


## Current Version

- Current Git Hash: b60c9012db8fecebb2937334e6301ea2dfa9416f
- Current Wasm Hash: 3f0eabca37f82ddefcc71bb0a144de665b92981a540931051c6b7fcf841c3542


## WASM Verification

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

[prereqs]: https://github.com/dfinity/ic?tab=readme-ov-file#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 87343a880050ca72b1361138535211f5770dd52e

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

NNS Registry

# Upgrade the Registry Canister to Commit 87343a8

__Proposer__: daniel.wong at dfinity.org\
__Source Code__: [87343a880050ca72b1361138535211f5770dd52e][new-commit]

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


## Features, Fixes, and Optimizations

- Pulled out canister-based implementations of Ledger/CMC.


## New Commits

```
$ git log --format="%C(auto) %h %s" 656d7a64ab8ef074f2542ed05e19c99293f1d844..87343a880050ca72b1361138535211f5770dd52e --  ./rs/registry/canister
 29f688afe9 chore: Clamp some spammy registry logs (#1575)
 df1dbfc8a2 chore: Add file extension to globs (#1543)
 b14c152f3a refactor(registry): Refactor get_changes_since. (#1333)
 c3a180c94c feat(IC-1579): pull out canister-based implementations of Ledger/CMC (#1386)
```


## Current Version

- Current Git Hash: 656d7a64ab8ef074f2542ed05e19c99293f1d844
- Current Wasm Hash: 0fa54c86ad0e4de01ececb7f5c0478e9d9b75bf06aa05f3ffa90b032d1e4bd86


## WASM Verification

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

[prereqs]: https://github.com/dfinity/ic?tab=readme-ov-file#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 87343a880050ca72b1361138535211f5770dd52e

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

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

This should match `wasm_module_hash` field of this proposal.

NNS SNS Wasm

# Upgrade the Sns-wasm Canister to Commit 87343a8

__Proposer__: daniel.wong at dfinity.org\
__Source Code__: [87343a880050ca72b1361138535211f5770dd52e][new-commit]

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


## Features, Fixes, and Optimizations

- Only set the `wasm_memory_limit` for SNS Governance when deploying an SNS.
- Use timer instead of heartbeat to poll archives.


## New Commits

```
$ git log --format="%C(auto) %h %s" 656d7a64ab8ef074f2542ed05e19c99293f1d844..87343a880050ca72b1361138535211f5770dd52e --  ./rs/nns/sns-wasm ./rs/sns/init
 96814ec4af refactor(nns): Remove unnecessary test_feature library (#1582)
 df1dbfc8a2 chore: Add file extension to globs (#1543)
 41f6ce3a7c refactor: Remove dependencies on nns governance crate from sns cli and ic-admin (#1252)
 a4b9ab2ec1 feat(sns): Only set the `wasm_memory_limit` for SNS Governance when deploying an SNS (#1427)
 2e85a2e961 feat(sns): Use timer instead of heartbeat to poll archives (#1477)
```


## Current Version

- Current Git Hash: 656d7a64ab8ef074f2542ed05e19c99293f1d844
- Current Wasm Hash: 7aafb44fd95e85530d50a1e44d0c4a4e0e7dd432a5963a992b66ac5160cc1d33


## WASM Verification

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

[prereqs]: https://github.com/dfinity/ic?tab=readme-ov-file#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 87343a880050ca72b1361138535211f5770dd52e

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

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

This should match `wasm_module_hash` field of this proposal.

SNS Governance

# Publish SNS Governance WASM Built at Commit 87343a8

__Proposer__: daniel.wong at dfinity.org\
__Source Code__: [87343a880050ca72b1361138535211f5770dd52e][new-commit]

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


## Features, Fixes, and Optimizations

- Use inflation in valuation of SNS tokens.
- Pull out canister-based implementations of Ledger/CMC.


## New Commits

```
$ git log --format="%C(auto) %h %s" 656d7a64ab8ef074f2542ed05e19c99293f1d844..87343a880050ca72b1361138535211f5770dd52e --  ./rs/sns/governance
 4ba0c87dab feat(sns): Use inflation in valuation of SNS tokens. (#1519)
 df1dbfc8a2 chore: Add file extension to globs (#1543)
 490fbd87f2 chore: Pass argument to clamp_debug_len by reference (#1541)
 41f6ce3a7c refactor: Remove dependencies on nns governance crate from sns cli and ic-admin (#1252)
 4cede51f58 chore(sns): Migrate SNS Root's wasm_memory_limit (#1521)
 bfc9da0790 refactor(nervous_system): use Runtime trait for Ledger (#1455)
 c3a180c94c feat(IC-1579): pull out canister-based implementations of Ledger/CMC (#1386)
```


## Wasm Verification

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

[prereqs]: https://github.com/dfinity/ic?tab=readme-ov-file#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 87343a880050ca72b1361138535211f5770dd52e

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

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

This should match `wasm` field of this proposal.

SNS Root

# Publish SNS Root WASM Built at Commit 87343a8

__Proposer__: daniel.wong at dfinity.org\
__Source Code__: [87343a880050ca72b1361138535211f5770dd52e][new-commit]

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


## Features, Fixes, and Optimizations

- Use timer instead of heartbeat to poll archives.


## New Commits

```
$ git log --format="%C(auto) %h %s" a0207146be211cdff83321c99e9e70baa62733c7..87343a880050ca72b1361138535211f5770dd52e --  ./rs/sns/root
 df1dbfc8a2 chore: Add file extension to globs (#1543)
 cedb79facc chore(sns): migrate wasm_memory_limit in non-governance non-root canisters (#1540)
 2e85a2e961 feat(sns): Use timer instead of heartbeat to poll archives (#1477)
 4d09678d23 chore: sort rust derive traits (#1241)
 57293157de chore(sns): Remove migration code for setting SNS memory limits (#1159)
 a3129e0d7c test(nns): Stop generating .did files. (#1114)
```


## Wasm Verification

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

[prereqs]: https://github.com/dfinity/ic?tab=readme-ov-file#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 87343a880050ca72b1361138535211f5770dd52e

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

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

This should match `wasm` field of this proposal.

SNS Swap

# Publish SNS Swap WASM Built at Commit 87343a8

__Proposer__: daniel.wong at dfinity.org\
__Source Code__: [87343a880050ca72b1361138535211f5770dd52e][new-commit]

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


## Features, Fixes, and Optimizations

- Pull out canister-based implementations of Ledger/CMC.


## New Commits

```
$ git log --format="%C(auto) %h %s" 656d7a64ab8ef074f2542ed05e19c99293f1d844..87343a880050ca72b1361138535211f5770dd52e --  ./rs/sns/swap
 df1dbfc8a2 chore: Add file extension to globs (#1543)
 bfc9da0790 refactor(nervous_system): use Runtime trait for Ledger (#1455)
 d4ee25b086 chore(sns): Remove `neuron_parameters` from ClaimSwapNeuronRequest in Swap (#1417)
 c3a180c94c feat(IC-1579): pull out canister-based implementations of Ledger/CMC (#1386)
 7b8d005a9c chore(nns): reduce logging in tests  (#1367)
```


## Wasm Verification

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

[prereqs]: https://github.com/dfinity/ic?tab=readme-ov-file#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 87343a880050ca72b1361138535211f5770dd52e

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

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

This should match `wasm` field of this proposal.
5 Likes

Proposal 133088 for CMC .


Hash and the listed commits match. There is room to improve on the arguments side either not list the verification in the summary when the value in the payload is empty (checked against the NNS as well since with the new install code there were issues when it didn’t render on the dashboard) or provide the correct command for it. Voted to adopt.

ebb4dc57d9 feat(cmc):
Adds a query method that returns a vector of principals for the default subnets.
This is done by adding two functions, get_default_subnets and get_default_subnets_ , which are used to retrieve the list of default subnets.
Added test verifies that the get_default_subnets function in the Cycles Minting canister returns the expected list of default subnets after the cmc_set_default_authorized_subnetworks function is called.
df1dbfc8a2 chore:
Fix for basel build error. The change is documented in detail and matches the description.
bbb8a51524 fix(cmc):
Fix for the wrong label for get_average_icp_xdr_conversion_rate endpoint certification.
Adds verify_cmc_certified_data function that verifies the integrity of a piece of data (data) against a provided certificate and hash tree. It ensures that the data matches the value certified in the certificate and that the certificate itself is valid. It does this with the following steps:
Extracts the root key from the state machine.
Converts the certificate to a Certificate struct.
Verifies the certificate using the root key, current time, and a specified validity period.
Looks up the certified data in the certificate’s hash tree using a specific path.
Deserializes the provided hash_tree into a HashTree struct.
Asserts that the digest of the hash tree matches the certified data from the certificate.
Looks up the data in the hash tree using the specified label.
Asserts that the encoded data matches the value found in the hash tree.
Two new tests are added. Fisrt one is the test_get_icp_xdr_conversion_rate_certification that verifies the process of getting the ICP/XDR conversion rate from the Cycles Minting canister, including the certification and data verification steps.
Second one test_get_average_icp_xdr_conversion_rate_certification for the process of getting the average ICP/XDR conversion rate.
Finally the get_average_icp_xdr_conversion_rate function retrieves the average ICP/XDR conversion rate from the Cycles Minting canister is added to state test helpers.
3aa43520c4 chore(cmc):
Old code cleanup for the CMC state migration mainly the StateV0 type.
c2b4a0aaf4 fix(cmc):
Exactly as it says merges the CMC hotfix back to master. MAX_MEMO_LENGTH is set to 32 used in error for DepositMemoTooLong , and few other changes like the added check for empty subnets.
137faea9ee chore(cmc):
Refactor the get_next_multiply_of function that calculates the next multiple of a given multiple for a given value.
4d09678d23 chore:
Rust #[derive(...)] traits are sorted with keepsorted in 807 files.

Proposal 133089 for Governance .


Hash and commits match, voted to adopt.

96814ec4af refactor(nns):
Removes constants--test_feature
d399ee7f6f refactor(nns):
The call_canister_method function is designed to call a method on a specified canister.
The first parameter is changed from &mut self to &self indicating that function does not modify/mutate the structure state.
df1dbfc8a2 chore:
Same as for CMC.
ad9e529296 feat(nns):
Increases panic probability for pb methods now deprecated, by setting panic_with_probability to 0.7 from previously 0.3.
bfc9da0790 refactor(nervous_system):
Ledger will use the Runtime trait instead of calling dfn_core, as a part of the governance migration from dfn_core to ic_cdk.
d123a2a015 feat(nns):
Disable NnsCanisterUpgrade and NnsRootUpgrade in favor of InstallCode but then it gets reverted by fbde007ff4 .
2e85a2e961 feat(sns):
When polling for archives every 24 hour heartbeat is replaced with timer for efficiency.

Proposal 133090 for Registry .


Hash and commits match, voted to adopt.

29f688afe9 chore:
Adds clamp_debug_len to limit the length of log outputs by setting max_len to 2000 used by the check_global_state_invariants function.
df1dbfc8a2 chore:
Same as for CMC and Governance.
b14c152f3a refactor(registry):
Adds a main function to the get_changes_since function that handles the get_changes_since request and returns a response.
It ensures that only self-authenticating or anonymous principals are allowed to call it.
c3a180c94c
This was reviewed couple of times before already.

2 Likes

proposal - 133088

Vote: ADOPT

Hash: MATCH

[ebb4dc57d9]
New method get_default_subnets

[df1dbfc8a2]
Update the file pattern in glob() functions from ["src/**"] to ["src/**/*.rs"], which more explicitly targets Rust source files in directories. Additionally, similar changes were made to proto files, updating ["proto/**"] to ["proto/**/*.proto"].

[bbb8a51524]
Fix related to the wrong label for convert_conversion_rate_to_payload

[3aa43520c4]
Removal of unused imports like Decode from candid and some refactoring in the State::decode function. Removal of StateV0

Removal of old migration code for StateV0 and an update to the State::decode function to streamline version handling.

[c2b4a0aaf4]
Removal of the RefundFailed variant from the CreateCanisterError and related refunding logic

new validation for deposit memos was introduced, restricting their length to a maximum of 32 bytes.

[137faea9ee]
Removes unnecessary type casting and modular arithmetic, replacing it with a straightforward calculation of the next multiple using division, multiplication, and addition while handling potential overflows.

[4d09678d23]
Reordering the attributes in struct definitions and derive macro usage across multiple files.

proposal - 133089

Vote: ADOPT

Hash: MATCH

[96814ec4af]
Removes test /rs/nns/constants--test_feature

[d399ee7f6f]
Removes mut from call_canister_method on self

[df1dbfc8a2]
Duplicate

[4e8565c624]
Replacement of the ChangeCanisterRequest structure and related logic with the InstallCodeRequest structure, and the introduction of new request and command handling for proposal actions.

Replace Proposal and related structures with MakeProposalRequest and ProposalActionRequest

Several tests and integration scenarios have been updated to reflect this new approach to installing and upgrading canisters

[ad9e529296]
panic_with_probability now 0.7 vs 0.3

[fbde007ff4]
This reverts the commits that happened in d123a2a015 but then commit 4e8565c624 introduces some of them back. So 4e8565c624 are the changes applied.

[41f6ce3a7c]
Removal of the ic-nns-governance dependency in multiple places, including in the Cargo files and Bazel build configurations, and the addition of a new module, ic-nervous-system-common-validation, which is responsible for URL and proposal validation logic that was previously part of other modules

create_service_nervous_system.rs got moved into its own file under init

[a4b9ab2ec1]
Refactor func by adding SnsCanisterType to specify different canister types (e.g., Root, Governance, Ledger) and applies different memory limits based on the canister type

[bfc9da0790]
This got reviewed in IC OS but here is the finding.

Use of Rt: Runtime + Send + Sync, which abstracts the underlying execution environment

Rt::call_without_cleanup to interact with the canister, allowing for greater flexibility in testing and supporting different runtime environments.

[d123a2a015]
Commit Reverted by ad9e529296

[2e85a2e961]
Removal of the latest_ledger_archive_poll_timestamp_seconds field from multiple components of the SnsRootCanister, and the replacement of the heartbeat function with a new timer mechanism to poll for new archive canisters at a fixed interval of 24 hours. ic-cdk-timers dependency was introduced to manage this timer-based polling functionality.

proposal - 133090

Vote: ADOPT

Hash: MATCH

[29f688afe9]
New lib ic_nervous_system_string
clamp_debug_len limits the length of the debug output for mutation logs in the check_global_state_invariants method

[df1dbfc8a2]
Duplicate

[b14c152f3a]
The get_changes_since function was refactored to move the main logic into a main() function that uses a Result type for cleaner error handling, allowing for a clear separation of authorization, request parsing, and error handling.

[c3a180c94c]
A new package called ic-nervous-system-canisters has been introduced, which consolidates various dependencies related to the nervous system and ledger functionality. This includes new canisters like CMCCanister and IcpLedgerCanister, which centralize key functions such as managing ledger accounts and handling neuron maturity modulation. These canisters replace their previous implementations that were scattered across common nervous system components, reorganizing the code into a more modular and structured format under the new package.

3 Likes

Proposal 133088

Hashes and code changes match. Voted to adopt.
I’ve noticed some inconsistencies in the verification steps provided, all 3 proposals are canister upgrades with no upgrade args and the arg_hash field in the payload is empty for all of them. Though it shouldn’t be the case even when no args are passed.
Furthermore 133088 verification steps have args verification, which doesn’t match as I said, while the other 2 don’t.
Looking at old proposals, some have an empty string when upgrade args are empty, while others provide the correct value. This isn’t a big deal but it might be confusing for new reviewers.

[ebb4dc57d9] Implement new method to the cycle minting canister which returns a list of subnets where canisters can be deployed.

[bbb8a51524] Duplicate from proposal 133061.

[3aa43520c4] Deleted old code used for state migration

[c2b4a0aaf4] Enforce a max memo length of 32 bytes in notify_mint_cycles. ensure_balance method has been modified to only mint the difference between the passed amount and the current canister cycle balance. do_create_canister no longer has a mint_cycles parameter and always attemp to mint new cycles, assuming there is need to do so. Finally in create_canister the refund logic for failed canister creation has been simplified, instead of taking all cycles passed with the request and then depositing the same amount minus a BAD_REQUEST_CYCLES_PENALTY to the caller in case of errors, now the cycles are only billed after the canister creation is performed and if it fails BAD_REQUEST_CYCLES_PENALTY is subtracted from the available amount, while the rest is returned to the caller.

[137faea9ee] Same as description, simplifies get_next_multiply_of function and adds some comments to the code.

[4d09678d23] Sort rust derive traits giving priority to std traits.

Proposal 133089

Hashes and code changes match. Voted to adopt.

[96814ec4af] Same as description, removes test_feature dependency.

[d399ee7f6f] Same as description, changes call_canister_method signature removing mut from implicit argument.

[ad9e529296] Same as description, Increased panic probability for deprecated pb methods.

[fbde007ff4], [d123a2a015] these two cancel each other out as one is a revert of the other.

[41f6ce3a7c] Duplicate from proposal 133061, mirrored on a separate branch.

[a4b9ab2ec1] Modified create_canister of CanisterApiImpl to take wasm_memory_limit as an argument and use it to set wasm memory limit to the canister settings. When creating SNS canisters the limit is set differently depending on whether the canister is SNS governance or not.

[bfc9da0790] Duplicate from proposal 133061, mirrored on a separate branch.

[2e85a2e961] Replaced heartbeat with timers to schedule archives polling. The operation is performed once a day so using a heartbeat is inefficient.

Proposal 133090

Hashes and code changes match. Voted to adopt.

[29f688afe9] Same as description, uses ic_nervous_system_string::clamp_debug_len to limit the size of the string to log.

[df1dbfc8a2] Duplicate

[b14c152f3a] Minor restructuring of get_changes_since, the principal check and response construction have been moved to a local main function, while error handling and response serialization part stay in the body of the function.

[c3a180c94c] Moved some trait implementations to interact with the ledger and cycle minting canister out of ic-nervous-system-common into ic-nervous-system-canisters

4 Likes

Proposal 133088

Voted to adopt.

Build successful. Hashes match for wasm_module_hash. arg_hash doesn’t match but I’ll take that as a mistake in the writing of the proposal.

[ebb4dc57d9]
Adds a query function get_default_subnets which returns a vector of default subnet principal IDs.

[df1dbfc8a2]
Changes srcs = glob(["src/**"]) to srcs = glob(["src/**/*.rs"]) in several BUILD.bazel files, the effect of which is to specify that the relevant packages should only use Rust files as source files in order to prevent building errors. Similarly, srcs = glob(["proto/**"]) is changed to srcs = glob(["proto/**/*.proto"]) in several places to specify .proto files only.

[bbb8a51524]
Adds new crate ic-certificate-verification to dependencies along with version updates for other dependencies, which are then used in tests. Adds ‘label’ as an input parameter to function convert_conversion_rate_to_payload, which is then utilised in get_icp_xdr_conversion_rate and get_average_icp_xdr_conversion_rate_, the effect of which is to ensure that the certification for get_average_icp_xdr_conversion_rate has its own distinct and correct label, rather than just using the same label for both.

[3aa43520c4]
Removes redundant migrate function and related code.

[c2b4a0aaf4]
Merges the hotfix from proposal 132262 back to master. Adds an error code for DepositMemoTooLong and specifies a maximum memo length of 32. Various other changes including new functions canister_cycles_balance, notify_top_up, total_cycles_minted and related tests.

[137faea9ee]
Simplifies get_next_multiple_of function.

[4d09678d23]
Re-orders traits within #[derive(...)] attribute lines within numerous files.

Proposal 133089

Voted to adopt.

Build successful. Hashes match.

[96814ec4af]
Removes constants--test_feature library as it is deemed unnecessary.

[d399ee7f6f]
Remove unnecessary ‘mut’ from call_canister_method function ‘self’ parameter in several locations.

[df1dbfc8a2]
Reviewed above for 133088.

[4e8565c624]
Similar to d123a2a015 below, but only pocket_ic_helpers.rs and tests are changed, not governance.rs, as changes in this file caused tests to fail.

[ad9e529296]
Increases the panic probability for deprecated pb methods from 0.3 to 0.7

[fbde007ff4]
Reverts d123a2a015 below.

[41f6ce3a7c]
Removes ic-nns-governance as a dependency for ic-admin and ic-sns-cli. Moves proposal fields validation code into its own Rust file.

[a4b9ab2ec1]
Sets DEFAULT_SNS_GOVERNANCE_CANISTER_WASM_MEMORY_LIMIT to 4 GB and DEFAULT_SNS_NON_GOVERNANCE_CANISTER_WASM_MEMORY_LIMIT to 3 GB in place of having both (in a single const) as 4 GB. This provides a buffer to ensure that non-governance canisters can still update even if this limit is reached.

[bfc9da0790]
Removes dfn_candid and dfn_core::call from ic-nervous-system-canisters dependencies. Adds Runtime trait to IcpLedgerCanister in order to eliminate the use of dfn_core::call.

[d123a2a015]
Removes NnsRootUpgrade and NnsCanisterUpgrade from lists of allowed proposal types as these have now been replaced by InstallCode. Adds several related tests.

[2e85a2e961]
Replaces heartbeat function with new functions init_timers and poll_for_new_archive_canisters + other related code changes and tests in order to use ic-cdk-timers instead of heartbeat to poll archives, so as to reduce required instructions.

Proposal 133090

Voted to adopt.

Build successful. Hashes match.

[29f688afe9]
Makes use of ic_nervous_system_string::clamp_debug_len in order to limit the size of some of the logging statements in the registry canister.

[df1dbfc8a2]
Reviewed above for 133088.

[b14c152f3a]
Changes get_changes_since function such that most of the logic is now rolled into a fn main() within it.

[c3a180c94c]
Moves implementations for CMCCanister and IcpLedgerCanister into a new package, ic_nervous_system_canisters.

3 Likes

CMC Proposal

Install mode is upgrade.
Args will work but I would recommend using:

didc encode -d cmc.did -t '(opt CyclesCanisterInitPayload)' '(null)'

Instead of

didc encode '()' 

It’s error-safe to specify the type that you want to pass when encoding the args.

Looking at the proposal on the NNS dapp and the dashboard the arg_hash field is set to “”.

Wasm hash is valid: 0da276e9a80d23b624ec2b7c1a99b1c819a9af49c499adcc93326443ee9ba238

Code changes look good.

Governance Canister

Install mode is upgrade.
Wasm hash is valid: 8665830c50c9a0dddd996008e537d060a380ac7b6c22237679bd0cecc4ee1044

Now the args are not specified in the proposal and argHash is empty. I guess it’s the default candid args: 4449444c0000.

Code changes look good, mainly moving proposal validation and sns init parameters validation to external crates.

Registry Canister

Mode is upgrade.
Hash is valid: 57c72469f01fd6ea8b5c5a962a1fed9b4ad550bbebdae38c29d5ad330c25c724

Args are not specified in the proposal and argHash is empty. I guess it’s the default candid args: 4449444c0000.

4 Likes

As some have pointed out, the cycles-minting arguments in the description (the “intended” args) do not match what will be executed (the “actual” args). This was a mistake (by me, probably).

Recommendation: To avoid attempting an upgrade that will fail, it is better to vote against proposal 13308.

Accordingly, DFINITY will vote no.

I believe that the “actual” args will not work; that is, if the proposal gets executed, an upgrade will be attempted, but it will get rolled back, so the end effect is that CMC would remain unchanged. Nevertheless, I think the safest option is to reject; hence the recommendation.

Where Mistake

Not sure yet, but I strongly suspect this resulted from the proposal summary format changes that I introduced a few weeks ago. I think what is happening is that argument extraction from the summary does not work anymore. We are figuring this out right now, and will have a fix in time for the next release. I’m guessing that the fix will not be super complicated. (Arshavir T. is helping with this :pray:)

4 Likes

Proposal 133088

Vote: REJECT

Build successful but there’s issues with the args that will prevent it from upgrading.

[ebb4dc57d9]: Adds a new query method get_default_subnets that returns a list of default subnets ids.

[df1dbfc8a2]: Changes the globs used to select source files to be more specific by adding file extensions ( .rs for Rust or .proto for protocol files), ensuring only relevant files are included. This solves an issue where when building the compiler would complain about Vim .swp files.

[bbb8a51524]: Adds two new tests test_get_icp_xdr_conversion_rate_certification and test_get_average_icp_xdr_conversion_rate_certification. It solves the problem of using the wrong certification for the get_average_icp_xdr_conversion_rate endpoint which now uses the correct lable LABEL_AVERAGE_ICP_XDR_CONVERSION_RATE. Lastly it standardizes the version of the crates ic-certificate-verification, ic-certification and ic-http-certification to 2.6.0.

[3aa43520c4]: Removes no longer needed migrate function since the migration was performed a long time ago. Also replaces functionality in old state function warning users to perform the migration

[c2b4a0aaf4]: Merges CMC hotfix back to master, refactors code, adds a new validation ensuring that deposit memos don’t exceed 32 characters with const MAX_MEMO_LENGTH

[137faea9ee]: Simplifies the function get_next_multiply_of and adds comments

[4d09678d23]: Sorts Rust #[derive(...)] traits to maintain a consistent style

Proposal 133089

Vote: ADOPT

Build successful and hashes match.

[96814ec4af]: Removes the uncessary //rs/nns/constants:constants--test_feature library

[d399ee7f6f]: Removes uncecessary mut from the parameter self on the call_canister_method method

[df1dbfc8a2]: Changes the globs used to select source files to be more specific by adding file extensions ( .rs for Rust or .proto for protocol files), ensuring only relevant files are included. This solves an issue where when building the compiler would complain about Vim .swp files.

[4e8565c624]: Re-applies the changes from d123a2a except the changes on rs/nns/governance/src/governance.rs that made tests fail.

[ad9e529296]: Increases the probability of deprecated methods panicking from 0.3 to 0.7

[fbde007ff4]: Reverts commit d123a2a.

[41f6ce3a7c]: Removes the nns governance crate as a dependency of the sns cli and ic-admin

[a4b9ab2ec1]: Replaces the const DEFAULT_SNS_FRAMEWORK_CANISTER_WASM_MEMORY_LIMIT (4GB) with two new consts DEFAULT_SNS_GOVERNANCE_CANISTER_WASM_MEMORY_LIMIT (4GB) and DEFAULT_SNS_NON_GOVERNANCE_CANISTER_WASM_MEMORY_LIMIT (3GB). This are important values used to limit the usage of memory in a canister so that pre_upgrade calls can be made.

[bfc9da0790]: Replaces the dfn_core with the Runtime trait in the ledger canister client. Using the Runtime dependency in the IcpLedgerCanister struct and it’s methods and replacing the use of dfn_core::call with Runtime::call_without_cleanup.

[d123a2a015]: Disabled proposal creation for NnsCanisterUpgrade and NnsRootUpgrade and updates tests to use InstallCode

[2e85a2e961]: Changes from the polling for archives from every heartbeat to once per day. The heartbeat function and the latest_ledger_archive_poll_timestamp_seconds field are removed as they are no longer needed and instead a new const POLL_FOR_NEW_ARCHIVES_INTERVAL is used to define the interval and the function init_timers is used to start the timer that triggers the polling.

Proposal 133090

Vote: ADOPT

Build successful and hashes match.

[29f688afe9]: Uses ic_nervous_system_string::clamp_debug_len to limit the size of logs from the registry canister.

[df1dbfc8a2]: Changes the globs used to select source files to be more specific by adding file extensions ( .rs for Rust or .proto for protocol files), ensuring only relevant files are included. This solves an issue where when building the compiler would complain about Vim .swp files.

[b14c152f3a]: Creates a local main function in get_changes_since which handles the core functionality and error handling. Everything else that applies to all scenarios (either error or success) is handled in the body of the function.

[c3a180c94c]: Moves the CMCCanister and IcpLedgerCanister implementations from rs/nervous_system/common/ to rs/nervous_system/canisters/

2 Likes