Hi guys, when I run the sns deploy-testflight --network ic command, then I receive this error:
Could not build canister init payloads: Could not determine whether the SNS init payload is using the one-proposal flow or the legacy because it contains a mix of set and unset one proposal parameters
This seems like a bug in the SNS CLI tool (I suspect that the SnsInitPayload object is being generated in a way that’s no longer supported). We’ll try to fix this over the course of the day, please stay tuned.
Update. While the SNS CLI bug was confirmed, it’s affecting only the case when the init-config-file argument is not passed. In this case, the tool generates a default payload, which is incomplete. Fixing this might take a longer time due to the prioritization being difficult this week.
Could you please try running sns deploy-testflight init-config-file <path-to-your-sns-config-yaml-file> and see if that works? We should also make this suggestion in the documentation.
Thanks @aterga ,of course I try to add the sns_init.yaml file and it did not work. This is the error message:
thread 'main' panicked at rs/sns/cli/src/deploy.rs:452:27:
Could not build canister init payloads: Error: The one-proposal SNS initialization requires some SnsInitPayload parameters to be Some. But the following fields were set to None: nns_proposal_id, neurons_fund_participants, swap_start_timestamp_seconds, swap_due_timestamp_seconds
Error: nns_proposal_id must be specified
Error: neurons_fund_participants must be specified
Error: swap_start_timestamp_seconds must be specified
NeuronsFundParticipationConstraintsValidationError: neurons_fund_participation requires neurons_fund_participation_constraints must be specified
It seems that the current version of the sns_init.yaml doesn’t have the fields it wants in
/Users/admin/.cache/dfinity/versions/0.15.3/sns deploy-testflight --network ic
dfx identity get-principal
xxx
dfx canister --network ic id sns_governance
xxx
dfx canister --network ic id sns_ledger
xxx
dfx canister --network ic id sns_root
xxx
dfx canister --network ic id sns_swap
xxx
dfx canister --network ic id sns_index
xxx
SNS canisters already allocated
SNS canister IDs:
SnsCanisterIds { governance: xxx, ledger: xxx, root: xxx, swap: xxx, index: xxx }
thread 'main' panicked at rs/sns/cli/src/deploy.rs:452:27:
Could not build canister init payloads: Could not determine whether the SNS init payload is using the one-proposal flow or the legacy because it contains a mix of set and unset one proposal parameters
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
deploy-testflight with init file
/Users/admin/.cache/dfinity/versions/0.15.3/sns deploy-testflight --network ic --init-config-file sns_init.yaml
dfx canister --network ic id sns_governance
xxx
dfx canister --network ic id sns_ledger
xxx
dfx canister --network ic id sns_root
xxx
dfx canister --network ic id sns_swap
xxx
dfx canister --network ic id sns_index
xxx
SNS canisters already allocated
SNS canister IDs:
SnsCanisterIds { governance: xxx, ledger: xxx, root: xxx, swap: xxx, index: xxx }
thread 'main' panicked at rs/sns/cli/src/deploy.rs:452:27:
Could not build canister init payloads: Error: The one-proposal SNS initialization requires some SnsInitPayload parameters to be Some. But the following fields were set to None: nns_proposal_id, neurons_fund_participants, swap_start_timestamp_seconds, swap_due_timestamp_seconds
Error: nns_proposal_id must be specified
Error: neurons_fund_participants must be specified
Error: swap_start_timestamp_seconds must be specified
NeuronsFundParticipationConstraintsValidationError: neurons_fund_participation requires neurons_fund_participation_constraints must be specified.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I’m on the NNS team and my current top priority is figuring out how to unblock you on testing. Right now I think the most direct path is to fix the issue you’re encountering with sns testflight. The advantage of sns testflight is that it allows you to test your SNS deployment in a local replica or on mainnet. However, if you only need to test on the local replica for now, let me know as that opens up some other options
Once we have that, we can deploy the testflight like this:
# Requires a modern DFX
dfx --version
# should say: dfx 0.16.1 or similar
# add the sns canisters to your DFX environment
dfx extension install sns --version 0.3.1
export DFX_IC_COMMIT=f72ad66cc01b5441da26a596abaa2117c023844d
dfx sns import
dfx sns download
# start the local replica (in a new terminal)
dfx start --clean
# (you may need to run `dfx stop`)
# deploy a testflight
rm ./sns_canister_ids # ok if this fails
./sns deploy-testflight --verbose --init-config-file=$(pwd)/sns_init.yaml
# you need a canister to give to the SNS, I'll create one but you can deploy it to the local replica any way you like, just set the CID variable to the canister's principal ID
TMP=$(mktemp -d) && (cd $TMP && echo '{"canisters": { "x": {} }}' >dfx.json && dfx canister create --no-wallet x ; rm -rf .dfx ; rm dfx.json ) ; rmdir $TMP
CID="bnz7o-iuaaa-aaaaa-qaaaa-cai" # replace with your canister ID
Edit: replaced with instructions that are tested to work on mainnet. In particular, the steps where we download the sns-cli and add the sns canisters to your dfx environment have been changed. If you followed the previous version of the instructions, run rm ./sns-* && rm ./ic-icrc1-* before re-adding the sns canisters to your environment