Skip to content

feat(sns): support upgrade options (wasm_memory_persistence, skip_pre_upgrade) in UpgradeSnsControlledCanister - #11076

Draft
claude[bot] wants to merge 2 commits into
masterfrom
eop-upgrade-support-sns
Draft

feat(sns): support upgrade options (wasm_memory_persistence, skip_pre_upgrade) in UpgradeSnsControlledCanister#11076
claude[bot] wants to merge 2 commits into
masterfrom
eop-upgrade-support-sns

Conversation

@claude

@claude claude Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Requested by Björn Tackmann · Slack thread

What

SNS Governance's UpgradeSnsControlledCanister proposal had no way to specify the EOP (Enhanced Orthogonal Persistence) upgrade options skip_pre_upgrade and wasm_memory_persistence when upgrading an SNS-controlled canister. This PR ports that support from NNS, mirroring the already-merged NNS PRs #10952, #10979, and #11027.

Before: UpgradeSnsControlledCanister proposals could only specify the target canister, new WASM, and canister upgrade args — no control over pre-upgrade skipping or Wasm memory persistence mode.

After: the proposal (and its API/candid/proto representations) carries new optional upgrade-options fields (mirroring NNS's ChangeCanisterRequest options), exposing skip_pre_upgrade: Option<bool> and wasm_memory_persistence: Option<i32> (enum), which are threaded through to the install/upgrade call to the target canister.

How

  • Proto/candid: rs/sns/governance/proto/ic_sns_governance/pb/v1/governance.proto and rs/sns/governance/canister/governance.did gain the new upgrade-options fields on UpgradeSnsControlledCanister.
  • Generated/hand-written Rust: rs/sns/governance/src/gen/ic_sns_governance.pb.v1.rs (generated), rs/sns/governance/api/src/ic_sns_governance.pb.v1.rs, rs/sns/governance/src/pb/conversions.rs (API <-> internal conversions), rs/sns/governance/src/types.rs (validation/helpers).
  • Proposal/validation logic: rs/sns/governance/src/proposal.rs and rs/sns/governance/src/governance.rs validate and apply the new options when executing the upgrade against the target canister, including the CanisterInstallMode/CanisterChangeDetails handling.
  • Extensions: rs/sns/governance/src/extensions.rs updated for consistency with the new options where extensions interact with canister upgrades.
  • CLI: rs/sns/cli/src/upgrade_sns_controlled_canister.rs and rs/sns/cli/Cargo.toml/rs/sns/cli/BUILD.bazel add new --skip-pre-upgrade / --wasm-memory-persistence flags so the SNS CLI can submit proposals using the new options.
  • Tests: rs/sns/governance/src/types/tests.rs, rs/sns/governance/src/governance/assorted_governance_tests.rs, rs/sns/integration_tests/src/upgrade_canister.rs, rs/sns/testing/src/sns.rs, and rs/nervous_system/integration_tests/tests/upgrade_sns_controlled_canister_with_large_wasm.rs are updated/extended to cover the new fields.
  • Changelog: rs/sns/governance/unreleased_changelog.md documents the change.

Local validation note

cargo check for ic-sns-governance requires a private git dependency (dfinity-lab/build-info) this dev environment isn't authorized to fetch — confirmed this also fails identically on a clean master checkout, so it's a pre-existing environment limitation, not caused by this change. bazel isn't installed locally either. Relying on CI to validate the full build/test matrix.

As a lighter-weight local check, rustfmt --check was run against every touched .rs file (using the repo's rustfmt.toml, edition 2024) and reported no formatting issues.


Generated by Claude Code

…_upgrade) in UpgradeSnsControlledCanister

Ports the NNS Governance/Root "canister upgrade options" plumbing
(#10952, #10979, #11027) to SNS Governance, SNS CLI, and the
already-shared ic_nervous_system_root::change_canister code.

- Adds UpgradeSnsControlledCanister.CanisterUpgradeOptions
  (skip_pre_upgrade, wasm_memory_persistence) to the SNS Governance
  proto/candid interface, mirroring InstallCode.CanisterUpgradeOptions
  in NNS Governance.
- Threads the options through proposal validation
  (UpgradeSnsControlledCanister::upgrade_options), execution
  (Governance::upgrade_non_root_canister / assemble_mode), and into
  CanisterInstallModeV2::Upgrade(Some(_)) when calling SNS Root's
  change_canister (SNS Root's .did/change_canister already gained
  support for this via the shared ic_nervous_system_root crate in
  #10952).
- Adds --skip-pre-upgrade / --wasm-memory-persistence flags to
  `sns upgrade-sns-controlled-canister`, mirroring ic-admin's
  propose-to-change-nns-canister flags.
- Adds unit tests for the new validation/conversion logic and for
  proposal-data redaction (limited_for_get_proposal /
  limited_for_list_proposals) preserving canister_upgrade_options.

Requested by Björn Tackmann. Original NNS work driven by Daniel Wong.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kJkdE1XdE2VG9YwfbAhqK
@github-actions github-actions Bot added the feat label Aug 7, 2026
@claude
claude Bot requested a lite review from Copilot August 7, 2026 15:01

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants