Skip to content

feat(governance): Add support for upgrade options to InstallCode proposals. - #10979

Open
daniel-wong-dfinity-org-twin wants to merge 5 commits into
masterfrom
add-support-for-upgrade-options-to-proposals-daniel-wong
Open

feat(governance): Add support for upgrade options to InstallCode proposals.#10979
daniel-wong-dfinity-org-twin wants to merge 5 commits into
masterfrom
add-support-for-upgrade-options-to-proposals-daniel-wong

Conversation

@daniel-wong-dfinity-org-twin

Copy link
Copy Markdown
Contributor

@daniel-wong-dfinity-org-twin
daniel-wong-dfinity-org-twin requested a review from a team as a code owner July 30, 2026 16:53
@github-actions github-actions Bot added the feat label Jul 30, 2026
github-actions[bot]

This comment was marked as resolved.

@zeropath-ai

zeropath-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 78b6724.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/nns/governance/api/src/types.rs
    Add canister_upgrade_options to InstallCode and define CanisterUpgradeOptions
► rs/nns/governance/canister/governance.did
    Introduce CanisterUpgradeOptions type and canister_upgrade_options field in InstallCode/InstallCodeRequest
► rs/nns/governance/proto/ic_nns_governance/pb/v1/governance.proto
    Add CanisterUpgradeOptions message and canister_upgrade_options field to InstallCode/InstallCodeRequest definitions
► rs/nns/governance/protobuf_generator/src/lib.rs
    Configure extern_path for types.v1 to support new upgrade options
► rs/nns/governance/src/gen/ic_nns_governance.pb.v1.rs
    Gen: add canister_upgrade_options field to InstallCode and include CanisterUpgradeOptions struct
► rs/nns/governance/src/pb/conversions/mod.rs
    Convert canister_upgrade_options between pb and api types
► rs/nns/governance/src/pb/proposal_conversions.rs
    Include canister_upgrade_options in install_code conversion and tests
► rs/nns/governance/src/proposals/install_code.rs
    Handle CanisterUpgradeOptions: add fields, validation, and conversion logic; support upgrade mode handling and options mapping
► rs/nns/governance/src/governance/benches.rs
    Initialize canister_upgrade_options: None in benchmarks
► rs/nns/governance/tests/governance.rs
    Include canister_upgrade_options: None in relevant test cases
► rs/nns/governance/unreleased_changelog.md
    Note: mention of added support for upgrade options to InstallCode proposals
► rs/nns/test_utils/src/governance.rs
    Default canister_upgrade_options: None in test helpers
► rs/nns/test_utils/src/state_test_helpers.rs
    canister_upgrade_options: None in test state setup
► rs/registry/admin/bin/main.rs
    ProposeToChangeNnsCanisterCmd: include canister_upgrade_options: None

@daniel-wong-dfinity-org-twin daniel-wong-dfinity-org-twin changed the title feat(governance): Add support for upgrade options to InstallCode proposals. WAIT FOR PR 10952 feat(governance): Add support for upgrade options to InstallCode proposals. Jul 30, 2026
@daniel-wong-dfinity-org-twin
daniel-wong-dfinity-org-twin force-pushed the add-support-for-upgrade-options-to-proposals-daniel-wong branch 4 times, most recently from f95de79 to de277e8 Compare July 31, 2026 13:23
Base automatically changed from add-eop-support-to-nns-daniel-wong to master July 31, 2026 14:35
@daniel-wong-dfinity-org-twin
daniel-wong-dfinity-org-twin force-pushed the add-support-for-upgrade-options-to-proposals-daniel-wong branch from de277e8 to 78b6724 Compare July 31, 2026 16:00
@daniel-wong-dfinity-org-twin
daniel-wong-dfinity-org-twin dismissed github-actions[bot]’s stale review July 31, 2026 16:00
  1. Done.
  2. Just enhanced an existing proposal type.
  3. Ditto.
  4. Seems low risk.
@daniel-wong-dfinity-org-twin daniel-wong-dfinity-org-twin changed the title WAIT FOR PR 10952 feat(governance): Add support for upgrade options to InstallCode proposals. feat(governance): Add support for upgrade options to InstallCode proposals. Jul 31, 2026
@yhabib
yhabib requested a review from Copilot July 31, 2026 16:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) with canister_upgrade_options, and wire conversions between stored PB types and public API types.
  • Validate and translate canister_upgrade_options into the Root canister’s CanisterInstallModeV2::Upgrade(Some(options)) execution payload.
  • Update tests/bench/helpers/changelog to include the new field (defaulting to None in 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants