NNS Updates 2025-01-17

We have 1 NNS upgrade proposal this week. Affected canister(s):

Proposal summaries are copied verbatim below.

Registry

# Upgrade the Registry Canister to Commit a587858

__Proposer__: daniel.wong at dfinity.org

__Source code__: [a5878586e47536d4cd47f0aadb66b73df8131d2b][new-commit]

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


## Features & Fixes

Direct replacement of a node in a subnet.


## New Commits

```
$ git log --format="%C(auto) %h %s" b5192581ccd35b67fe5a1f795ead9cbcd25956d6..a5878586e47536d4cd47f0aadb66b73df8131d2b --  ./rs/registry/canister
 de11e793398 feat: Allow direct replacement of a node in subnet (#3377)
 d90e934eb44 fix: cargo build registry-canister for wasm32 target (#3408)
```


## Current Version

__Current git hash__: b5192581ccd35b67fe5a1f795ead9cbcd25956d6

__Current wasm hash__: 771041412d2af4eb681262ca525bce1a87c199b631e17b55e1d7f9abb2cde3e6


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


### WASM Verification

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

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

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

proposal - 134904

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

Overall Summary:

The do_add_node flow now allows a new node to seamlessly replace an existing node with the same IP address, updating subnet membership to swap the nodes directly, bypassing the previous requirement for the old node to first be removed from all subnets.

Commits

de11e793398
Extend the do_add_node flow so that a new node can seamlessly replace an existing node that shares its IP address, even if the old node is currently in a subnet. The code now updates the subnet membership to swap out the old node for the new node, avoiding the previous restriction that all old nodes must be out of any subnet first.

d90e934eb44
Adds a dependency on the getrandom crate with the custom feature enabled, specifically for builds targeting the wasm32 architecture.

1 Like

Proposal 134904 – Zane | CodeGov

Vote: ADOPT

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

134904

de11e793398 Refactored node management logic to support replacing of a node running in a subnet with a new one provided it has the same IP. The mutation logic was moved out of do_remove_node to a separate function called make_remove_or_replace_node_mutations, this was done to make it possible to reuse it elsewhere so that multiple replace/removal mutations can be constructed before being applied, making it possible to perform them atomically. Furthermore logic was added for replace mutations. Previously trying to remove a node in a subnet would result in a panic, now if a new node id is provided, the subnet’s membership will be updated and the old node will be removed.

do_add_node_ was updated to make use of make_remove_or_replace_node_mutations directly instead of calling do_remove_node. When adding a new node, if exactly one node is found to use the same ip, a replace mutation is constructed and applied, otherwise the old logic is used.

d90e934eb44 Added conditional dependency on getrandom crate with “custom” feature enabled for wasm32 compilation targets

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 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 its mission at codegov.org.

1 Like

Proposal #134904 for Registry — Zack | CodeGov

Vote: Adopted

Reason:
Builds fine and the hash and commits match.

de11e793398 feat: Allow direct replacement of a node in subnet
Direct swap is allowed if the IP address of the new node matches the old one in order to fix the issue where a node cannot be replaced if it’s currently in a subnet.
Done by refactoring node_management logic for do_add_node that deals with managing a list of nodes (nodes_with_same_ip) that share the same IP address as a new node being added (node_id). It generates a series of mutations to remove or replace these conflicting nodes. Depending on the situation it removes a single node directly, or removes multiple nodes with the backwards-compatible logic.
In do_remove_node_directly the added do_replace_node_with_another function is used to replace an existing node (payload.node_id) in the registry with a new node (new_node_id).

d90e934eb44 fix: cargo build registry-canister for wasm32 target
The fix makes sure that the getrandom crate with custom features enabled is included as a dependency for wasm32 targets.

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 its mission at codegov.org.

1 Like

Adopt Proposal #134904 for Registry

Proposal

  • Canister id rwlgt-iiaaa-aaaaa-aaaaa-cai is indeed the registry canister.
  • The upgrade args correspond to the empty args.
  • The install mode is indeed upgrade.
  • The wasm hash is reproducible.

Screenshot 2025-01-27 at 11.00.06

Code Changes

The code changes introduce a feature for direct node replacement within a subnet when their IP addresses match, addressing the scenario where a node can’t be replaced if it’s currently active within a subnet. The node_management logic in do_add_node has been refactored to manage nodes with the same IP (nodes_with_same_ip) by generating mutations to remove or replace conflicting nodes. This includes logic for directly removing a single node or handling multiple nodes in a backward-compatible manner. In do_remove_node_directly, a new function do_replace_node_with_another has been added to swap an existing node in the registry with a new one.

Additionally, a fix has been made to the build process for the registry-canister for wasm32 targets, ensuring that the getrandom crate with custom features is correctly included as a dependency.

1 Like