feat(governance): Add support for upgrade options to InstallCode proposals. - #10979
Open
daniel-wong-dfinity-org-twin wants to merge 5 commits into
Open
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to 78b6724. Security Overview
Detected Code Changes
|
daniel-wong-dfinity-org-twin
force-pushed
the
add-support-for-upgrade-options-to-proposals-daniel-wong
branch
4 times, most recently
from
July 31, 2026 13:23
f95de79 to
de277e8
Compare
…grade_options to the InstallCode proposal type.
…to the InstallCode proposal type. Basically, these tests are fixed by adding 'canister_upgrade_options: None` to InstallCode proposals.
daniel-wong-dfinity-org-twin
force-pushed
the
add-support-for-upgrade-options-to-proposals-daniel-wong
branch
from
July 31, 2026 16:00
de277e8 to
78b6724
Compare
daniel-wong-dfinity-org-twin
dismissed
github-actions[bot]’s stale review
July 31, 2026 16:00
- Done.
- Just enhanced an existing proposal type.
- Ditto.
- Seems low risk.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for passing upgrade-specific options through NNS InstallCode proposals, enabling upgrades of canisters that require management-canister upgrade options (e.g., Wasm memory persistence for enhanced orthogonal persistence).
Changes:
- Extend
InstallCode(proto + DID + API types) withcanister_upgrade_options, and wire conversions between stored PB types and public API types. - Validate and translate
canister_upgrade_optionsinto the Root canister’sCanisterInstallModeV2::Upgrade(Some(options))execution payload. - Update tests/bench/helpers/changelog to include the new field (defaulting to
Nonein most call sites).
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rs/registry/admin/bin/main.rs | Populate the new canister_upgrade_options field when constructing InstallCode proposals (default None). |
| rs/nns/test_utils/src/state_test_helpers.rs | Update test helper proposal construction to include canister_upgrade_options: None. |
| rs/nns/test_utils/src/neuron_helpers.rs | Update proposal helper to include canister_upgrade_options: None. |
| rs/nns/test_utils/src/governance.rs | Update governance test util proposal payload construction with canister_upgrade_options: None. |
| rs/nns/governance/unreleased_changelog.md | Document new support for upgrade options on InstallCode proposals. |
| rs/nns/governance/tests/governance.rs | Update tests to include the new field in expected proposal/action structures. |
| rs/nns/governance/tests/degraded_mode.rs | Update degraded-mode tests to include the new field. |
| rs/nns/governance/src/proposals/install_code.rs | Add validation + encoding support for upgrade options and expand unit tests to cover acceptance/rejection behavior. |
| rs/nns/governance/src/pb/proposal_conversions.rs | Extend PB→API conversions (and related tests) to carry the new field. |
| rs/nns/governance/src/pb/conversions/mod.rs | Add bidirectional conversions for CanisterUpgradeOptions and thread the field through InstallCode/InstallCodeRequest conversions. |
| rs/nns/governance/src/governance/benches.rs | Update benchmark proposal payload construction to include canister_upgrade_options: None. |
| rs/nns/governance/src/gen/ic_nns_governance.pb.v1.rs | Regenerated prost output including the new InstallCode.canister_upgrade_options nested message. |
| rs/nns/governance/protobuf_generator/src/lib.rs | Configure prost extern path for .types.v1 so the new enum reference resolves cleanly. |
| rs/nns/governance/proto/ic_nns_governance/pb/v1/governance.proto | Add InstallCode.CanisterUpgradeOptions and canister_upgrade_options field; import management canister types proto. |
| rs/nns/governance/canister/governance.did | Expose CanisterUpgradeOptions and add it to InstallCode and InstallCodeRequest candid interfaces. |
| rs/nns/governance/api/src/types.rs | Add API types for CanisterUpgradeOptions and include it in InstallCode/InstallCodeRequest. |
| rs/nervous_system/integration_tests/src/pocket_ic_helpers.rs | Update integration test helpers to set canister_upgrade_options: None in upgrade proposals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| canister_upgrade_options: None, | ||
| }, | ||
| ), | ||
| ]; |
| }), | ||
|
|
||
| // The rest of this object is not really interesting to this test. | ||
| // (It need to look right though to avoid triggering some other |
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.
👈 Previous PR