Finalise sns testflight to not be in status PreInitializationSwap

We recently redeployed a testing SNS on mainnet following this guide.

We basically only ran the command below

dfx sns deploy-testflight --init-config-file="/path/to/sns_init.yaml"

When we now want to pass a canister to this testing SNS to test upgrading via proposals, we get the following error.

SNS governance error: This proposal type is not allowed while governance is in PreInitializationSwap mode: RegisterDappCanisters(
    RegisterDappCanisters {
        canister_ids: [
            <CANISTER_ID>,
        ],
    },
)

The canister IDs of the testing SNS are the following:

{
  "governance_canister_id": "j3ioe-7iaaa-aaaap-ab23q-cai",
  "index_canister_id": "iwgkk-qaaaa-aaaap-ab24a-cai",
  "ledger_canister_id": "irhm6-5yaaa-aaaap-ab24q-cai",
  "root_canister_id": "i7fbw-giaaa-aaaap-ab25q-cai",
  "swap_canister_id": "ikcq3-haaaa-aaaap-ab26a-cai"
}

Are we missing a step in the guide to finalise the SNS and be able to test the normal operation?

Hi @Dustin , can you maybe share what you aim to test?
In a lot of cases nowadays local testing might be more stable and better suited than the SNS testflight, so just wondering what use case you want to cover..

Hi @lara, we are testing handover of canisters to the SNS and upgrading those via proposals. We were doing this via a deployment of a testing SNS on the mainnet but you propose to do this only locally?

we are testing handover of canisters to the SNS and upgrading those via proposals

Indeed, it’s better to test this scenario locally. (We’re considering deprecating the mainnet testflight runbook as it doesn’t add much value for developers at this point — it was quite useful in the early days of the SNS, though).

I recommend taking a look at this existing test that is in the ICP mono repo: upgrade_sns_controlled_canister_with_large_wasm.rs — I think it covers the scenario you describe.

Another place to look (especially if you would like to interact with the system, e.g., via DFX, not just have a Rust-based scenario that runs end-to-end) is the new sns-testing tool that is already available in the ICP mono repo. The tool binary for sns-testing is not yet readily available, you would need to compile that yourself, but if you have bazel installed if should be a few simple commands to run, as described in the README linked above.

Please let us know if you get stuck or have further questions.

1 Like

Hi Dustin, (this is a copy-paste message from other post)

To get the NNS / SNS testing locally, you need to start with the flag --clean

You can use the following commands

dfx start --clean --background

Then open another tab install the NNS

dfx install nns

After this a local replica of the nns will be installed and will be awaiting for an SNS to launch

Just follow the steps here: GitHub - dfinity/sns-testing: Testing SNS in local testing environment

As an alternative here’s a script with all the steps you need cosmicrafts-dao/init.sh at 38e712c8190421d9476abf90370d7c4ae7cf12b7 · cosmicrafts/cosmicrafts-dao · GitHub

you can just copy paste the script to any good LLM and can make you a step breakdown

In addition, SNS testflight tools aren’t working on latest version, I got to use dfx 0.25.0 but I can’t remember what version of the nns and sns extensions work with the current testflight tutorial

hope this helps

1 Like