UpgradeSnsControlledCanister mode

According documentation, the Sns proposal type UpgradeSnsControlledCanister requires an optional parameter mode : opt int32.

At first glance, I would have expected it to be a variant similar to the canister_install_mode of the IC spec. However, since it is an optional number and no particular notes are provided in the documentation, I’m a bit confused about it.

What is the mode and what are its values?

Yes, sorry, this is poorly documented. Here is the mapping:

  CANISTER_INSTALL_MODE_INSTALL = 1;
  CANISTER_INSTALL_MODE_REINSTALL = 2;
  CANISTER_INSTALL_MODE_UPGRADE = 3;

These are defined in the ic repo here.

By the way, the latest master of quill can create UpgradeSnsControlledCanister proposals and supports setting the mode (docs). However I’m not sure this version of quill has been released as I landed this functionality fairly recently.

edit: fixed link

2 Likes

Aaaaaaah, it’s because of protobuf. Got it now. Thanks a lot for the feedback!

If anyone is ever interested, here’s the mentionned link to the GitHub repo: https://github.com/dfinity/ic/blob/master/rs/protobuf/def/types/v1/management_canister_types.proto#L5-10

Thanks, but I don’t plan to ever use Quill.

1 Like

Do I understand correctly that it is now possible to reinstall canisters under SNS control? I was under the impression that only upgrades were possible for SNS controlled canisters. That would indeed be nice!