From da38486a7355ce48e58880afb494de7c944f1d1b Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Mon, 30 Sep 2024 21:24:39 +0200 Subject: [PATCH 01/13] first --- example_sns_init.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_sns_init.yaml b/example_sns_init.yaml index 359a210..e8a1b50 100644 --- a/example_sns_init.yaml +++ b/example_sns_init.yaml @@ -355,7 +355,7 @@ Distribution: # as the treasury. This is initialized in a special sub-account, as the # main account of Governance is the minting account of the SNS Ledger. # This field is specified as a token. For instance, "1 token". - governance: 2_000_000 tokens + treasury: 2_000_000 tokens # The initial SNS token balance of the Swap canister is what will be # available for the decentralization swap. These tokens will be swapped From 0c58eee66f599a05b43a275361581084e9064ac0 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Fri, 1 Nov 2024 14:39:10 +0000 Subject: [PATCH 02/13] Fix lots of stuff --- ...ate_identities_for_neurons_fund_neurons.sh | 4 +-- initial_neurons.csv | 36 +++++++++---------- install.sh | 7 +--- settings.sh | 2 +- setup_locally.sh | 4 +-- 5 files changed, 24 insertions(+), 29 deletions(-) diff --git a/generate_identities_for_neurons_fund_neurons.sh b/generate_identities_for_neurons_fund_neurons.sh index b1d801f..c29a856 100755 --- a/generate_identities_for_neurons_fund_neurons.sh +++ b/generate_identities_for_neurons_fund_neurons.sh @@ -12,8 +12,8 @@ if [ $# -eq 0 ] then echo "No arguments supplied. Please pass a neuron csv with the following format:" echo "" - echo "neuron_id;owner_id;created_ts_ns;duration_to_dissolution_ns;staked_icpt;earnings;follows;not_for_profit;memo;maturity_e8s_equivalent;kyc_verified" - echo "1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;C;;false;0;0;false" + echo "neuron_id;owner_id;created_ts_ns;dissolve_delay_s;staked_icpt;follows;not_for_profit;maturity_e8s_equivalent" + echo "1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;;false;0" echo "etc." exit 1 else diff --git a/initial_neurons.csv b/initial_neurons.csv index dbf057e..17f36c2 100644 --- a/initial_neurons.csv +++ b/initial_neurons.csv @@ -1,18 +1,18 @@ -neuron_id;owner_id;created_ts_ns;duration_to_dissolution_ns;staked_icpt;earnings;follows;not_for_profit;memo;maturity_e8s_equivalent;kyc_verified -1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;C;;false;0;0;false -2;mccsf-b32dl-n42k3-57eqk-6fnii-ojxhg-ukyw7-cstu4-4u3eq-s64id-pqe;0;15780000000000000;0;C;;false;0;100000000;false -3;apudj-s5mmx-ddrec-sawcm-gsc5c-52sdk-4fs3k-ftmay-omsbn-t27lg-zae;0;15780000000000000;0;C;;false;0;500000000;false -4;so5fh-cx7bf-jhqti-t77pu-uxt2p-x7mb5-ybpkg-sp32z-m7lfw-4n7gy-cae;0;15780000000000000;0;C;;false;0;1000000000;false -5;fy5ch-dwxhf-gffsr-z7eum-7iqom-t727t-roth5-zxp7t-6n5di-mtkzo-7qe;0;15780000000000000;0;C;;false;0;10000000000;false -6;se4ei-zaxs6-lnq3z-oo6bp-ci2ed-isads-fe2by-pnjrj-i5fsp-sorcl-uqe;0;15780000000000000;0;C;;false;0;100000000000;false -7;e6xcz-i3oe4-3gp2e-w2g6u-vtdey-sb6dw-vzh5m-2qb4l-dc6ff-to6ll-5qe;0;15780000000000000;0;C;;false;0;1000000000000;false -8;72sl6-z6gmp-tuvar-hngo2-7gjov-jn43j-omkrv-2wx6k-fzcgj-sujmh-zae;0;15780000000000000;0;C;;false;0;10000000000000;false -9;2z6y4-6y7zq-vporp-tiumu-j3qhw-6og2g-sxvxh-e57qp-aevbm-gacrr-yae;0;15780000000000000;0;C;;false;0;100000000000000;false -10;3uigu-x6rsf-lwlyz-fauii-ewr7t-7vcmr-cfbcs-pye3t-oyh3o-5v23u-iae;0;15780000000000000;0;C;;false;0;100000000000000;false -449479075714955186;b2ucp-4x6ou-zvxwi-niymn-pvllt-rdxqr-wi4zj-jat5l-ijt2s-vv4f5-4ae;0;31536000000000000;100;D;;false;0;10000000000;false -3001;py6h5-6xdbk-bpdsi-7vcmw-f3yss-vaa7w-id2rh-knbzp-4hdmp-gxhxn-jae;0;15780000000000000;0;C;;false;0;9000000000;false -3002;6s5du-wqkks-6ljxw-wucs5-yharn-fqcxm-3evkn-ffa3f-iheap-7drpi-uae;0;15780000000000000;0;C;;false;0;90000000000;false -3003;l3mxb-xrmim-b4pej-jpoko-j2ise-baark-y53yo-c647u-rg6uf-2nxpr-pqe;0;15780000000000000;0;C;;false;0;900000000000;false -3004;2rifv-b6jdw-zde6b-3vxyz-xfulb-77gft-fngo4-5j74e-6vfbn-zwlnk-3ae;0;15780000000000000;0;C;;false;0;9000000000000;false -3005;wrrod-le7l3-tv5ya-3qtyl-2t7ik-dqjoi-mrr6y-nw7gx-bxiy6-ilo54-nqe;0;15780000000000000;0;C;;false;0;90000000000000;false -3006;7tkm4-zxi5p-gyfc5-zwtss-hrc6x-uf25u-4qngv-pb3fo-evr5u-wfejc-sae;0;15780000000000000;0;C;;false;0;900000000000000;false +neuron_id;owner_id;created_ts_ns;dissolve_delay_s;staked_icpt;follows;not_for_profit;maturity_e8s_equivalent +1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;;false;0 +2;mccsf-b32dl-n42k3-57eqk-6fnii-ojxhg-ukyw7-cstu4-4u3eq-s64id-pqe;0;15780000000000000;0;;false;100000000 +3;apudj-s5mmx-ddrec-sawcm-gsc5c-52sdk-4fs3k-ftmay-omsbn-t27lg-zae;0;15780000000000000;0;;false;500000000 +4;so5fh-cx7bf-jhqti-t77pu-uxt2p-x7mb5-ybpkg-sp32z-m7lfw-4n7gy-cae;0;15780000000000000;0;;false;1000000000 +5;fy5ch-dwxhf-gffsr-z7eum-7iqom-t727t-roth5-zxp7t-6n5di-mtkzo-7qe;0;15780000000000000;0;;false;10000000000 +6;se4ei-zaxs6-lnq3z-oo6bp-ci2ed-isads-fe2by-pnjrj-i5fsp-sorcl-uqe;0;15780000000000000;0;;false;100000000000 +7;e6xcz-i3oe4-3gp2e-w2g6u-vtdey-sb6dw-vzh5m-2qb4l-dc6ff-to6ll-5qe;0;15780000000000000;0;;false;1000000000000 +8;72sl6-z6gmp-tuvar-hngo2-7gjov-jn43j-omkrv-2wx6k-fzcgj-sujmh-zae;0;15780000000000000;0;;false;10000000000000 +9;2z6y4-6y7zq-vporp-tiumu-j3qhw-6og2g-sxvxh-e57qp-aevbm-gacrr-yae;0;15780000000000000;0;;false;100000000000000 +10;3uigu-x6rsf-lwlyz-fauii-ewr7t-7vcmr-cfbcs-pye3t-oyh3o-5v23u-iae;0;15780000000000000;0;;false;100000000000000 +449479075714955186;b2ucp-4x6ou-zvxwi-niymn-pvllt-rdxqr-wi4zj-jat5l-ijt2s-vv4f5-4ae;0;31536000000000000;100;;false;10000000000 +3001;hol7n-gtwzb-buu75-q3zrr-pqze3-pba4m-d2wss-lr5fo-nm4x6-m3ffv-bae;0;15780000000000000;0;;false;9000000000 +3002;y7e3b-a3irj-4i5ra-gljbg-7y3e6-w4icm-fydkk-e6hxw-h5usa-x2vfl-xqe;0;15780000000000000;0;;false;90000000000 +3003;uomfj-wba5i-ci5gj-yhuna-li2lb-qb3z6-6lzwr-6erii-6iu7c-kdzgy-bae;0;15780000000000000;0;;false;900000000000 +3004;wl2t7-m6zav-y7lh2-q3xnm-6itvx-dgspm-gg47g-nwqrx-th7t2-fjlk5-oae;0;15780000000000000;0;;false;9000000000000 +3005;yie43-s6m5a-sntag-e23dy-7tf46-h7q7z-5im7c-5o6up-myjis-ruyjt-jae;0;15780000000000000;0;;false;90000000000000 +3006;vnkc3-jzx5m-a4kry-wrrim-3yonj-nimst-weddy-k3gha-ysu3a-3y4ms-dqe;0;15780000000000000;0;;false;900000000000000 \ No newline at end of file diff --git a/install.sh b/install.sh index 59f767e..9fd2efe 100755 --- a/install.sh +++ b/install.sh @@ -20,12 +20,7 @@ curl --fail -L "https://download.dfinity.systems/ic/${IC_COMMIT}/binaries/x86_64 gzip -fd ic-regedit.gz chmod +x ic-regedit -if [ "${CANISTER_TEST}" == "_test" ] -then - curl --fail -L "https://download.dfinity.systems/ic/${IC_COMMIT}/binaries/x86_64-${OS}/sns-test-feature.gz" -o sns.gz -else - curl --fail -L "https://download.dfinity.systems/ic/${IC_COMMIT}/binaries/x86_64-${OS}/sns.gz" -o sns.gz -fi +curl --fail -L "https://download.dfinity.systems/ic/${IC_COMMIT}/binaries/x86_64-${OS}/sns.gz" -o sns.gz gzip -fd sns.gz chmod +x sns diff --git a/settings.sh b/settings.sh index 6997cbc..e29686c 100755 --- a/settings.sh +++ b/settings.sh @@ -31,7 +31,7 @@ export SNS_AGGREGATOR_RELEASE="proposal-129614-agg" # $ ./gitlab-ci/src/artifacts/newest_sha_with_disk_image.sh origin/master # from the IC monorepo: https://github.com/dfinity/ic # if you change IC_COMMIT, then you need to rerun `source install.sh` -export IC_COMMIT="f79476803e097d9fd5f7e67d45f6818348b51ac9" +export IC_COMMIT="2b3b69ee4bdad75776a0ed668aa53500600af044" export TESTNET="local" diff --git a/setup_locally.sh b/setup_locally.sh index 784f9da..fd78762 100755 --- a/setup_locally.sh +++ b/setup_locally.sh @@ -8,8 +8,8 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" for canister in cycles-minting-canister genesis-token-canister governance-canister governance-canister_test ic-ckbtc-minter identity-canister ledger-canister_notify-method lifeline_canister nns-ui-canister registry-canister root-canister sns-wasm-canister sns-root-canister "sns-governance-canister${CANISTER_TEST}" sns-swap-canister ic-icrc1-ledger ic-icrc1-archive ic-icrc1-index-ng do - curl -L "https://download.dfinity.systems/ic/${IC_COMMIT}/canisters/${canister}.wasm.gz" -o "${canister}.wasm.gz" - gzip -d "${canister}.wasm.gz" + curl -L "https://download.dfinity.systems/ic/${IC_COMMIT}/canisters/${canister}.wasm.gz" -o "${canister}.wasm" + # gzip -d "${canister}.wasm.gz" done mv "./ic-icrc1-index-ng.wasm" "ic-icrc1-index.wasm" From 587785a5f47829e91ea82f5f04ad2f8f3f4a5b8c Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Fri, 1 Nov 2024 21:44:44 +0000 Subject: [PATCH 03/13] save --- Cargo.lock | 21 ++++---- dfx.json | 110 ++++++++++++++++++++++++++++++++++++--- initial_neurons.csv.orig | 36 ++++++------- run_basic_scenario.sh | 33 ++++-------- settings.sh | 2 +- setup_locally.sh | 1 - test/Cargo.toml | 2 +- upgrade_dapp.sh | 2 +- 8 files changed, 144 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1be6c4f..c2e9068 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,9 +179,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "ic-cdk" -version = "0.13.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8859bc2b863a77750acf199e1fb7e3fc403e1b475855ba13f59cb4e4036d238" +checksum = "dd8ecacd682fa05a985253592963306cb9799622d7b1cce4b1edb89c6ec85be1" dependencies = [ "candid", "ic-cdk-macros", @@ -192,23 +192,23 @@ dependencies = [ [[package]] name = "ic-cdk-macros" -version = "0.13.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45800053d80a6df839a71aaea5797e723188c0b992618208ca3b941350c7355" +checksum = "0d4d857135deef20cc7ea8f3869a30cd9cfeb1392b3a81043790b2cd82adc3e0" dependencies = [ "candid", "proc-macro2", "quote", "serde", "serde_tokenstream", - "syn 1.0.109", + "syn 2.0.12", ] [[package]] name = "ic0" -version = "0.21.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a54b5297861c651551676e8c43df805dad175cc33bc97dbd992edbbb85dcbcdf" +checksum = "8de254dd67bbd58073e23dc1c8553ba12fa1dc610a19de94ad2bbcd0460c067f" [[package]] name = "ic_principal" @@ -359,13 +359,14 @@ dependencies = [ [[package]] name = "serde_tokenstream" -version = "0.1.7" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "797ba1d80299b264f3aac68ab5d12e5825a561749db4df7cd7c8083900c5d4e9" +checksum = "64060d864397305347a78851c51588fd283767e7e7589829e8121d65512340f1" dependencies = [ "proc-macro2", + "quote", "serde", - "syn 1.0.109", + "syn 2.0.12", ] [[package]] diff --git a/dfx.json b/dfx.json index d51b6e3..0826640 100644 --- a/dfx.json +++ b/dfx.json @@ -1,24 +1,120 @@ { "canisters": { - "nns-dapp": { + "internet_identity": { + "candid": "candid/internet_identity.did", "type": "custom", + "wasm": "internet_identity_dev.wasm" + }, + "nns-cycles-minting": { + "build": "", + "candid": "candid/nns-cycles-minting.did", + "remote": { + "id": { + "ic": "rkp4c-7iaaa-aaaaa-aaaca-cai", + "local": "rkp4c-7iaaa-aaaaa-aaaca-cai" + } + }, + "type": "custom", + "wasm": "" + }, + "nns-dapp": { "candid": "candid/nns-dapp.did", + "type": "custom", "wasm": "nns-dapp.wasm" }, - "internet_identity": { + "nns-genesis-token": { + "build": "", + "candid": "candid/nns-genesis-token.did", + "remote": { + "id": { + "ic": "renrk-eyaaa-aaaaa-aaada-cai", + "local": "renrk-eyaaa-aaaaa-aaada-cai" + } + }, "type": "custom", - "candid": "candid/internet_identity.did", - "wasm": "internet_identity_dev.wasm" + "wasm": "" }, - "sns_aggregator": { + "nns-governance": { + "build": "", + "candid": "candid/nns-governance.did", + "remote": { + "id": { + "ic": "rrkah-fqaaa-aaaaa-aaaaq-cai", + "local": "rrkah-fqaaa-aaaaa-aaaaq-cai" + } + }, "type": "custom", + "wasm": "" + }, + "nns-ledger": { + "build": "", + "candid": "candid/nns-ledger.did", + "remote": { + "id": { + "ic": "ryjl3-tyaaa-aaaaa-aaaba-cai", + "local": "ryjl3-tyaaa-aaaaa-aaaba-cai" + } + }, + "type": "custom", + "wasm": "" + }, + "nns-lifeline": { + "build": "", + "candid": "candid/nns-lifeline.did", + "remote": { + "id": { + "ic": "rno2w-sqaaa-aaaaa-aaacq-cai", + "local": "rno2w-sqaaa-aaaaa-aaacq-cai" + } + }, + "type": "custom", + "wasm": "" + }, + "nns-registry": { + "build": "", + "candid": "candid/nns-registry.did", + "remote": { + "id": { + "ic": "rwlgt-iiaaa-aaaaa-aaaaa-cai", + "local": "rwlgt-iiaaa-aaaaa-aaaaa-cai" + } + }, + "type": "custom", + "wasm": "" + }, + "nns-root": { + "build": "", + "candid": "candid/nns-root.did", + "remote": { + "id": { + "ic": "r7inp-6aaaa-aaaaa-aaabq-cai", + "local": "r7inp-6aaaa-aaaaa-aaabq-cai" + } + }, + "type": "custom", + "wasm": "" + }, + "nns-sns-wasm": { + "build": "", + "candid": "candid/nns-sns-wasm.did", + "remote": { + "id": { + "ic": "qaa6y-5yaaa-aaaaa-aaafa-cai", + "local": "qaa6y-5yaaa-aaaaa-aaafa-cai" + } + }, + "type": "custom", + "wasm": "" + }, + "sns_aggregator": { "candid": "candid/sns_aggregator.did", + "type": "custom", "wasm": "sns_aggregator.wasm" }, "test": { "candid": "candid/test.did", - "type": "rust", - "package": "test" + "package": "test", + "type": "rust" } } } diff --git a/initial_neurons.csv.orig b/initial_neurons.csv.orig index dbf057e..17f36c2 100644 --- a/initial_neurons.csv.orig +++ b/initial_neurons.csv.orig @@ -1,18 +1,18 @@ -neuron_id;owner_id;created_ts_ns;duration_to_dissolution_ns;staked_icpt;earnings;follows;not_for_profit;memo;maturity_e8s_equivalent;kyc_verified -1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;C;;false;0;0;false -2;mccsf-b32dl-n42k3-57eqk-6fnii-ojxhg-ukyw7-cstu4-4u3eq-s64id-pqe;0;15780000000000000;0;C;;false;0;100000000;false -3;apudj-s5mmx-ddrec-sawcm-gsc5c-52sdk-4fs3k-ftmay-omsbn-t27lg-zae;0;15780000000000000;0;C;;false;0;500000000;false -4;so5fh-cx7bf-jhqti-t77pu-uxt2p-x7mb5-ybpkg-sp32z-m7lfw-4n7gy-cae;0;15780000000000000;0;C;;false;0;1000000000;false -5;fy5ch-dwxhf-gffsr-z7eum-7iqom-t727t-roth5-zxp7t-6n5di-mtkzo-7qe;0;15780000000000000;0;C;;false;0;10000000000;false -6;se4ei-zaxs6-lnq3z-oo6bp-ci2ed-isads-fe2by-pnjrj-i5fsp-sorcl-uqe;0;15780000000000000;0;C;;false;0;100000000000;false -7;e6xcz-i3oe4-3gp2e-w2g6u-vtdey-sb6dw-vzh5m-2qb4l-dc6ff-to6ll-5qe;0;15780000000000000;0;C;;false;0;1000000000000;false -8;72sl6-z6gmp-tuvar-hngo2-7gjov-jn43j-omkrv-2wx6k-fzcgj-sujmh-zae;0;15780000000000000;0;C;;false;0;10000000000000;false -9;2z6y4-6y7zq-vporp-tiumu-j3qhw-6og2g-sxvxh-e57qp-aevbm-gacrr-yae;0;15780000000000000;0;C;;false;0;100000000000000;false -10;3uigu-x6rsf-lwlyz-fauii-ewr7t-7vcmr-cfbcs-pye3t-oyh3o-5v23u-iae;0;15780000000000000;0;C;;false;0;100000000000000;false -449479075714955186;b2ucp-4x6ou-zvxwi-niymn-pvllt-rdxqr-wi4zj-jat5l-ijt2s-vv4f5-4ae;0;31536000000000000;100;D;;false;0;10000000000;false -3001;py6h5-6xdbk-bpdsi-7vcmw-f3yss-vaa7w-id2rh-knbzp-4hdmp-gxhxn-jae;0;15780000000000000;0;C;;false;0;9000000000;false -3002;6s5du-wqkks-6ljxw-wucs5-yharn-fqcxm-3evkn-ffa3f-iheap-7drpi-uae;0;15780000000000000;0;C;;false;0;90000000000;false -3003;l3mxb-xrmim-b4pej-jpoko-j2ise-baark-y53yo-c647u-rg6uf-2nxpr-pqe;0;15780000000000000;0;C;;false;0;900000000000;false -3004;2rifv-b6jdw-zde6b-3vxyz-xfulb-77gft-fngo4-5j74e-6vfbn-zwlnk-3ae;0;15780000000000000;0;C;;false;0;9000000000000;false -3005;wrrod-le7l3-tv5ya-3qtyl-2t7ik-dqjoi-mrr6y-nw7gx-bxiy6-ilo54-nqe;0;15780000000000000;0;C;;false;0;90000000000000;false -3006;7tkm4-zxi5p-gyfc5-zwtss-hrc6x-uf25u-4qngv-pb3fo-evr5u-wfejc-sae;0;15780000000000000;0;C;;false;0;900000000000000;false +neuron_id;owner_id;created_ts_ns;dissolve_delay_s;staked_icpt;follows;not_for_profit;maturity_e8s_equivalent +1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;;false;0 +2;mccsf-b32dl-n42k3-57eqk-6fnii-ojxhg-ukyw7-cstu4-4u3eq-s64id-pqe;0;15780000000000000;0;;false;100000000 +3;apudj-s5mmx-ddrec-sawcm-gsc5c-52sdk-4fs3k-ftmay-omsbn-t27lg-zae;0;15780000000000000;0;;false;500000000 +4;so5fh-cx7bf-jhqti-t77pu-uxt2p-x7mb5-ybpkg-sp32z-m7lfw-4n7gy-cae;0;15780000000000000;0;;false;1000000000 +5;fy5ch-dwxhf-gffsr-z7eum-7iqom-t727t-roth5-zxp7t-6n5di-mtkzo-7qe;0;15780000000000000;0;;false;10000000000 +6;se4ei-zaxs6-lnq3z-oo6bp-ci2ed-isads-fe2by-pnjrj-i5fsp-sorcl-uqe;0;15780000000000000;0;;false;100000000000 +7;e6xcz-i3oe4-3gp2e-w2g6u-vtdey-sb6dw-vzh5m-2qb4l-dc6ff-to6ll-5qe;0;15780000000000000;0;;false;1000000000000 +8;72sl6-z6gmp-tuvar-hngo2-7gjov-jn43j-omkrv-2wx6k-fzcgj-sujmh-zae;0;15780000000000000;0;;false;10000000000000 +9;2z6y4-6y7zq-vporp-tiumu-j3qhw-6og2g-sxvxh-e57qp-aevbm-gacrr-yae;0;15780000000000000;0;;false;100000000000000 +10;3uigu-x6rsf-lwlyz-fauii-ewr7t-7vcmr-cfbcs-pye3t-oyh3o-5v23u-iae;0;15780000000000000;0;;false;100000000000000 +449479075714955186;b2ucp-4x6ou-zvxwi-niymn-pvllt-rdxqr-wi4zj-jat5l-ijt2s-vv4f5-4ae;0;31536000000000000;100;;false;10000000000 +3001;hol7n-gtwzb-buu75-q3zrr-pqze3-pba4m-d2wss-lr5fo-nm4x6-m3ffv-bae;0;15780000000000000;0;;false;9000000000 +3002;y7e3b-a3irj-4i5ra-gljbg-7y3e6-w4icm-fydkk-e6hxw-h5usa-x2vfl-xqe;0;15780000000000000;0;;false;90000000000 +3003;uomfj-wba5i-ci5gj-yhuna-li2lb-qb3z6-6lzwr-6erii-6iu7c-kdzgy-bae;0;15780000000000000;0;;false;900000000000 +3004;wl2t7-m6zav-y7lh2-q3xnm-6itvx-dgspm-gg47g-nwqrx-th7t2-fjlk5-oae;0;15780000000000000;0;;false;9000000000000 +3005;yie43-s6m5a-sntag-e23dy-7tf46-h7q7z-5im7c-5o6up-myjis-ruyjt-jae;0;15780000000000000;0;;false;90000000000000 +3006;vnkc3-jzx5m-a4kry-wrrim-3yonj-nimst-weddy-k3gha-ysu3a-3y4ms-dqe;0;15780000000000000;0;;false;900000000000000 \ No newline at end of file diff --git a/run_basic_scenario.sh b/run_basic_scenario.sh index 111c1d8..67294f7 100755 --- a/run_basic_scenario.sh +++ b/run_basic_scenario.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euo pipefail +set -xeuo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")" @@ -26,27 +26,12 @@ jq -r '.ledger_canister_id' -e sns_canister_ids.json jq -r '.root_canister_id' -e sns_canister_ids.json jq -r '.swap_canister_id' -e sns_canister_ids.json -# Assert the SNS swap lifecycle is in the OPEN state. -( - # Run the command and capture the output - swap_state=$(./get_sns_swap_state.sh | ./bin/idl2json) - - # Extract the lifecycle value - lifecycle=$(echo "$swap_state" | jq -r '.swap[0].lifecycle') - - # Log the output and extracted lifecycle value - echo "swap_state: ${swap_state}" - - # Check if the lifecycle is in the OPEN state (2) - if [ "${lifecycle}" == "2" ]; then - echo "SNS swap lifecycle is in the OPEN state (2)!" - else - echo "ERROR - SNS swap lifecycle is not in the OPEN state" - echo "Expected: 2 (OPEN state)" - echo "Actual: ${lifecycle}" - exit 1 - fi -) +# Await Swap lifecycle to be in state 2 (OPEN). +# See https://github.com/dfinity/ic/blob/master/rs/sns/swap/proto/ic_sns_swap/pb/v1/swap.proto#L17 +while [ "$(./get_sns_swap_state.sh | ./bin/idl2json | jq -r '.swap[0].lifecycle')" != "2" ]; do + sleep 1 + echo "Awaiting Swap to open ..." +done # Assert that the test canister is indeed registered. [ "$(./get_sns_canisters.sh | ./bin/idl2json | jq -r '.dapps[0]')" == "$(./bin/dfx canister id test)" ] && echo "OK" || exit 1 @@ -62,8 +47,8 @@ jq -r '.swap_canister_id' -e sns_canister_ids.json # Participate in SNS swap ./participate_sns_swap.sh -# Wait for the SNS swap lifecycle is in the COMPLETED state. -# This happens when the heartbeat of the SNS Swap canister is executed. +# Await Swap lifecycle to be in state 2 (OPEN). +# See https://github.com/dfinity/ic/blob/master/rs/sns/swap/proto/ic_sns_swap/pb/v1/swap.proto#L17 while [ "$(./get_sns_swap_state.sh | ./bin/idl2json | jq -r '.swap[0].lifecycle')" != "3" ]; do sleep 1; done # Upgrade test canister (II) diff --git a/settings.sh b/settings.sh index e29686c..b209588 100755 --- a/settings.sh +++ b/settings.sh @@ -31,7 +31,7 @@ export SNS_AGGREGATOR_RELEASE="proposal-129614-agg" # $ ./gitlab-ci/src/artifacts/newest_sha_with_disk_image.sh origin/master # from the IC monorepo: https://github.com/dfinity/ic # if you change IC_COMMIT, then you need to rerun `source install.sh` -export IC_COMMIT="2b3b69ee4bdad75776a0ed668aa53500600af044" +export IC_COMMIT="ce465b8bd96f7706b9480fdfc10cda0a67f5f0f7" export TESTNET="local" diff --git a/setup_locally.sh b/setup_locally.sh index fd78762..e51558a 100755 --- a/setup_locally.sh +++ b/setup_locally.sh @@ -9,7 +9,6 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" for canister in cycles-minting-canister genesis-token-canister governance-canister governance-canister_test ic-ckbtc-minter identity-canister ledger-canister_notify-method lifeline_canister nns-ui-canister registry-canister root-canister sns-wasm-canister sns-root-canister "sns-governance-canister${CANISTER_TEST}" sns-swap-canister ic-icrc1-ledger ic-icrc1-archive ic-icrc1-index-ng do curl -L "https://download.dfinity.systems/ic/${IC_COMMIT}/canisters/${canister}.wasm.gz" -o "${canister}.wasm" - # gzip -d "${canister}.wasm.gz" done mv "./ic-icrc1-index-ng.wasm" "ic-icrc1-index.wasm" diff --git a/test/Cargo.toml b/test/Cargo.toml index 17d4694..131330c 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] candid = "0.10.7" -ic-cdk = "0.13.2" +ic-cdk = "0.16.0" serde = "1" wee_alloc = "0.4.3" lazy_static = "1.4.0" diff --git a/upgrade_dapp.sh b/upgrade_dapp.sh index d573f18..cef40e3 100755 --- a/upgrade_dapp.sh +++ b/upgrade_dapp.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euo pipefail +set -xeuo pipefail CURRENTDIR="$(pwd)" From 2d578765b7b54e4fb410eec4671e6f75bf6ead7f Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 4 Dec 2024 11:18:49 +0000 Subject: [PATCH 04/13] save --- Cargo.lock | 39 ++++++-------------------------- README.md | 2 +- deploy_dapp.sh | 6 ++--- example_sns_init.yaml | 2 +- install.sh | 6 ++--- participate_sns_swap.sh | 8 +++---- run_basic_scenario.sh | 49 ++++++++++++++++++++++------------------- settings.sh | 6 +++-- test/Cargo.toml | 3 +-- upgrade_dapp.sh | 32 ++++++++++++++------------- 10 files changed, 67 insertions(+), 86 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2e9068..b8e02b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,12 +99,6 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -126,7 +120,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -179,9 +173,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "ic-cdk" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8ecacd682fa05a985253592963306cb9799622d7b1cce4b1edb89c6ec85be1" +checksum = "b2abdf9341da9f9f6b451a40609cb69645a05a8e9eb7784c16209f16f2c0f76f" dependencies = [ "candid", "ic-cdk-macros", @@ -192,9 +186,9 @@ dependencies = [ [[package]] name = "ic-cdk-macros" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4d857135deef20cc7ea8f3869a30cd9cfeb1392b3a81043790b2cd82adc3e0" +checksum = "b8df41980e95dead28735ab0f748c75477b0c5eab37a09a5641c78ec406a1db0" dependencies = [ "candid", "proc-macro2", @@ -241,12 +235,6 @@ version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "num-bigint" version = "0.4.3" @@ -375,7 +363,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -387,7 +375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" dependencies = [ "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "psm", "winapi", @@ -423,7 +411,6 @@ dependencies = [ "ic-cdk", "lazy_static", "serde", - "wee_alloc", ] [[package]] @@ -476,18 +463,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/README.md b/README.md index 6fff387..3854c8a 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ The `sns-testing` solution is based on Docker; however, there are subtle issues This should print the dashboard URL: ``` - Dashboard: http://localhost:8000/_/dashboard + Replica API running on 0.0.0.0:8000 ``` 5. Open another Bash console: diff --git a/deploy_dapp.sh b/deploy_dapp.sh index 43cc234..7e7c20e 100755 --- a/deploy_dapp.sh +++ b/deploy_dapp.sh @@ -10,12 +10,12 @@ export ARG="${3:-()}" . ./constants.sh normal -dfx --provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa-cai canister create "${NAME}" --network "${NETWORK}" --no-wallet +./bin/dfx --provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa-cai canister create "${NAME}" --network "${NETWORK}" --no-wallet if [[ -z "${WASM}" ]] then export WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}.wasm" - dfx build --network "${NETWORK}" "${NAME}" + ./bin/dfx build --network "${NETWORK}" "${NAME}" fi -dfx canister install "${NAME}" --network "${NETWORK}" --argument "${ARG}" --argument-type idl --wasm "${WASM}" +./bin/dfx canister install "${NAME}" --network "${NETWORK}" --argument "${ARG}" --argument-type idl --wasm "${WASM}" diff --git a/example_sns_init.yaml b/example_sns_init.yaml index e8a1b50..359a210 100644 --- a/example_sns_init.yaml +++ b/example_sns_init.yaml @@ -355,7 +355,7 @@ Distribution: # as the treasury. This is initialized in a special sub-account, as the # main account of Governance is the minting account of the SNS Ledger. # This field is specified as a token. For instance, "1 token". - treasury: 2_000_000 tokens + governance: 2_000_000 tokens # The initial SNS token balance of the Swap canister is what will be # available for the decentralization swap. These tokens will be swapped diff --git a/install.sh b/install.sh index 9fd2efe..abe259e 100755 --- a/install.sh +++ b/install.sh @@ -31,16 +31,16 @@ chmod +x dfx if [[ "${OS}" == "linux" ]] then - export QUILL="linux" + export QUILL_PLATFORM="linux" elif [[ "${OS}" == "darwin" ]] then - export QUILL="macos" + export QUILL_PLATFORM="macos" else echo "Unknown OS!" exit 1 fi -curl --fail -L "https://github.com/dfinity/quill/releases/download/v0.4.2/quill-${QUILL}-x86_64" -o quill +curl --fail -L "https://github.com/dfinity/quill/releases/download/v${QUILL_VERSION}/quill-${QUILL_PLATFORM}-x86_64" -o quill chmod +x quill if [[ "${OS}" == "linux" ]] diff --git a/participate_sns_swap.sh b/participate_sns_swap.sh index 2e7f324..bbd36a2 100755 --- a/participate_sns_swap.sh +++ b/participate_sns_swap.sh @@ -32,8 +32,8 @@ do export PEM_FILE="$(readlink -f ~/.config/dfx/identity/${NEW_DX_IDENT}/identity.pem)" # Get the ticket - quill sns new-sale-ticket --amount-icp-e8s "${ICP_PER_PARTICIPANT_E8S}" --canister-ids-file ./sns_canister_ids.json --pem-file "${PEM_FILE}" > msg.json - RESPONSE="$(quill --insecure-local-dev-mode send --yes msg.json)" + ./bin/quill sns new-sale-ticket --amount-icp-e8s "${ICP_PER_PARTICIPANT_E8S}" --canister-ids-file ./sns_canister_ids.json --pem-file "${PEM_FILE}" > msg.json + RESPONSE="$(./bin/quill --insecure-local-dev-mode send --yes msg.json)" if [[ "${RESPONSE}" == *"invalid_user_amount"* ]] then echo "ERROR: invalid_user_amount error; see full output from quill below this line" @@ -53,8 +53,8 @@ do fi # Use the ticket - quill sns pay --amount-icp-e8s "${ICP_PER_PARTICIPANT_E8S}" --ticket-creation-time "${TICKET_CREATION_TIME}" --ticket-id "${TICKET_ID}" --canister-ids-file ./sns_canister_ids.json --pem-file "${PEM_FILE}" > msg.json - quill --insecure-local-dev-mode send --yes msg.json + ./bin/quill sns pay --amount-icp-e8s "${ICP_PER_PARTICIPANT_E8S}" --ticket-creation-time "${TICKET_CREATION_TIME}" --ticket-id "${TICKET_ID}" --canister-ids-file ./sns_canister_ids.json --pem-file "${PEM_FILE}" > msg.json + ./bin/quill --insecure-local-dev-mode send --yes msg.json done diff --git a/run_basic_scenario.sh b/run_basic_scenario.sh index 67294f7..0eded61 100755 --- a/run_basic_scenario.sh +++ b/run_basic_scenario.sh @@ -47,32 +47,35 @@ done # Participate in SNS swap ./participate_sns_swap.sh -# Await Swap lifecycle to be in state 2 (OPEN). +# Await Swap lifecycle to be in state 3 (COMMITTED). # See https://github.com/dfinity/ic/blob/master/rs/sns/swap/proto/ic_sns_swap/pb/v1/swap.proto#L17 while [ "$(./get_sns_swap_state.sh | ./bin/idl2json | jq -r '.swap[0].lifecycle')" != "3" ]; do sleep 1; done -# Upgrade test canister (II) -./upgrade_test_canister.sh Welcome -# We expect that the canister has not been changed yet as we have now decentralized -# so we don't hold the majority of the voting power. -[ "$(./bin/dfx canister call test greet "M")" == '("Hello, M!")' ] && echo "OK" || exit 1 - -# Collect votes by the SNS developer neuron submitting the upgrade proposal and total number of votes. -YES="$(./get_last_sns_proposal.sh | ./bin/idl2json | jq -r '.proposals[0].latest_tally[0].yes')" -TOTAL="$(./get_last_sns_proposal.sh | ./bin/idl2json | jq -r '.proposals[0].latest_tally[0].total')" - -# Assert that the SNS developer neuron no longer holds voting majority after the SNS swap is completed. -[ "$((2 * ${YES}))" -lt "${TOTAL}" ] && echo "OK" || exit 1 - +# TODO[dfinity/sns-testing/issues/83]: Re-enable upgrading dapp canisters via SNS proposals. +# +# # Upgrade test canister (II) +# ./upgrade_test_canister.sh Welcome +# +# # We expect that the canister has not been changed yet as we have now decentralized +# # so we don't hold the majority of the voting power. +# [ "$(./bin/dfx canister call test greet "M")" == '("Hello, M!")' ] && echo "OK" || exit 1 +# +# # Collect votes by the SNS developer neuron submitting the upgrade proposal and total number of votes. +# YES="$(./get_last_sns_proposal.sh | ./bin/idl2json | jq -r '.proposals[0].latest_tally[0].yes')" +# TOTAL="$(./get_last_sns_proposal.sh | ./bin/idl2json | jq -r '.proposals[0].latest_tally[0].total')" +# +# # Assert that the SNS developer neuron no longer holds voting majority after the SNS swap is completed. +# [ "$((2 * ${YES}))" -lt "${TOTAL}" ] && echo "OK" || exit 1 +# # Vote on upgrade canister SNS proposal -./vote_on_sns_proposal.sh \ - 61 `# Simulate this number of SNS users' votes. TODO: determine the smallest possible value that will work here` \ - 2 `# Proposal ID` \ - y `# Vote to adopt this proposal` -./wait_for_last_sns_proposal.sh -./wait_for_canister_running.sh "$(./bin/dfx canister id test)" - -# Assert the new greeting text -[ "$(./bin/dfx canister call test greet "M")" == '("Welcome, M!")' ] && echo "OK" || exit 1 +#./vote_on_sns_proposal.sh \ +# 61 `# Simulate this number of SNS users' votes. TODO: determine the smallest possible value that will work here` \ +# 2 `# Proposal ID` \ +# y `# Vote to adopt this proposal` +#./wait_for_last_sns_proposal.sh +#./wait_for_canister_running.sh "$(./bin/dfx canister id test)" +# +# # Assert the new greeting text +# [ "$(./bin/dfx canister call test greet "M")" == '("Welcome, M!")' ] && echo "OK" || exit 1 echo "Basic scenario has successfully finished." diff --git a/settings.sh b/settings.sh index b209588..ee3ee8e 100755 --- a/settings.sh +++ b/settings.sh @@ -31,10 +31,12 @@ export SNS_AGGREGATOR_RELEASE="proposal-129614-agg" # $ ./gitlab-ci/src/artifacts/newest_sha_with_disk_image.sh origin/master # from the IC monorepo: https://github.com/dfinity/ic # if you change IC_COMMIT, then you need to rerun `source install.sh` -export IC_COMMIT="ce465b8bd96f7706b9480fdfc10cda0a67f5f0f7" +export IC_COMMIT="6a4eeb97fd93a5fc93d50b0e01ab24c6a7e72fae" export TESTNET="local" -export DFX_VERSION="0.22.0" +export DFX_VERSION="0.24.2" export DFX_SNS_VERSION="0.4.1" export DFX_NNS_VERSION="0.4.1" + +export QUILL_VERSION="0.5.1" \ No newline at end of file diff --git a/test/Cargo.toml b/test/Cargo.toml index 131330c..a585102 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -10,7 +10,6 @@ crate-type = ["cdylib"] [dependencies] candid = "0.10.7" -ic-cdk = "0.16.0" +ic-cdk = "0.17.0" serde = "1" -wee_alloc = "0.4.3" lazy_static = "1.4.0" diff --git a/upgrade_dapp.sh b/upgrade_dapp.sh index cef40e3..3b4edf2 100755 --- a/upgrade_dapp.sh +++ b/upgrade_dapp.sh @@ -14,7 +14,7 @@ export ARG="${3:-()}" . ./constants.sh normal -export DEVELOPER_NEURON_ID="$(dfx canister \ +export DEVELOPER_NEURON_ID="$(./bin/dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ @@ -33,22 +33,24 @@ fi if [[ -z "${WASM}" ]] then - dfx build --network "${NETWORK}" "${NAME}" - export WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}.wasm" + ./bin/dfx build --network "${NETWORK}" "${NAME}" + WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}" + ic-wasm "${WASM}.wasm" -o "${WASM}-s.wasm" shrink + gzip "${WASM}-s.wasm" + export WASM="${WASM}-s.wasm.gz" fi -export CID="$(dfx canister --network "${NETWORK}" id "${NAME}")" -quill sns \ - --canister-ids-file "${REPODIR}/sns_canister_ids.json" \ - --pem-file "${PEM_FILE}" \ - make-upgrade-canister-proposal \ - --summary "This proposal upgrades test canister" \ - --title "Upgrade test canister" \ - --url "https://example.com/" \ - --target-canister-id "${CID}" \ - --wasm-path "${WASM}" \ - "${ARGFLAG}" "${ARG}" \ +export CID="$(./bin/dfx canister --network "${NETWORK}" id "${NAME}")" +./bin/quill sns \ + --canister-ids-file "${REPODIR}/sns_canister_ids.json" \ + --pem-file "${PEM_FILE}" \ + make-upgrade-canister-proposal \ + --target-canister-id "${CID}" \ + --mode upgrade \ + --wasm-path "${WASM}" \ + "${ARGFLAG}" "${ARG}" \ "${DEVELOPER_NEURON_ID}" > msg.json -quill send \ + +./bin/quill send \ --insecure-local-dev-mode \ --yes msg.json | grep -v "new_canister_wasm" From 5241374d1491c7c0b0636e327d846273c6347f34 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 4 Dec 2024 11:38:54 +0000 Subject: [PATCH 05/13] Fix docker CI stuff --- .github/workflows/sns_lifecycle.yml | 2 +- README.md | 2 +- upgrade_dapp.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sns_lifecycle.yml b/.github/workflows/sns_lifecycle.yml index feed5b2..2328850 100644 --- a/.github/workflows/sns_lifecycle.yml +++ b/.github/workflows/sns_lifecycle.yml @@ -24,7 +24,7 @@ jobs: SNS_TESTING_INSTANCE=$( docker run -p 8000:8000 -p 8080:8080 -v "`pwd`":/dapp -d ghcr.io/dfinity/sns-testing dfx start --clean ) - while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Dashboard:' + while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Replica API running' do echo "Awaiting local replica ..." sleep 3 diff --git a/README.md b/README.md index 3854c8a..1e233d8 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ After getting familiar with the basic scenario, you may replace the test caniste SNS_TESTING_INSTANCE=$( docker run -p 8000:8000 -p 8080:8080 -v "`pwd`":/dapp -d ghcr.io/dfinity/sns-testing:main dfx start --clean ) - while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Dashboard:' + while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Replica API running' do echo "Awaiting local replica ..." sleep 3 diff --git a/upgrade_dapp.sh b/upgrade_dapp.sh index 3b4edf2..776f306 100755 --- a/upgrade_dapp.sh +++ b/upgrade_dapp.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -xeuo pipefail +set -euo pipefail CURRENTDIR="$(pwd)" From e756c4cc9427599f33346bfb1b3a8fc58f0841c4 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 4 Dec 2024 16:31:48 +0000 Subject: [PATCH 06/13] Bump Ubuntu version to get newer GLIBC required for ic-nns-init --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 330f4da..fb8722c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ From f92e7b99c16b900a38310a137544f51a9908b68e Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 4 Dec 2024 17:00:25 +0000 Subject: [PATCH 07/13] Attempt to fix the deployment script --- deploy_dapp.sh | 5 ++++- install.sh | 5 +++++ settings.sh | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/deploy_dapp.sh b/deploy_dapp.sh index 7e7c20e..5db933d 100755 --- a/deploy_dapp.sh +++ b/deploy_dapp.sh @@ -14,8 +14,11 @@ export ARG="${3:-()}" if [[ -z "${WASM}" ]] then - export WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}.wasm" ./bin/dfx build --network "${NETWORK}" "${NAME}" + WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}" + ic-wasm "${WASM}.wasm" -o "${WASM}-s.wasm" shrink + gzip "${WASM}-s.wasm" + export WASM="${WASM}-s.wasm.gz" fi ./bin/dfx canister install "${NAME}" --network "${NETWORK}" --argument "${ARG}" --argument-type idl --wasm "${WASM}" diff --git a/install.sh b/install.sh index abe259e..32db1cc 100755 --- a/install.sh +++ b/install.sh @@ -32,9 +32,11 @@ chmod +x dfx if [[ "${OS}" == "linux" ]] then export QUILL_PLATFORM="linux" + export IC_WASM_PLATFORM="linux64" elif [[ "${OS}" == "darwin" ]] then export QUILL_PLATFORM="macos" + export IC_WASM_PLATFORM="macos" else echo "Unknown OS!" exit 1 @@ -43,6 +45,9 @@ fi curl --fail -L "https://github.com/dfinity/quill/releases/download/v${QUILL_VERSION}/quill-${QUILL_PLATFORM}-x86_64" -o quill chmod +x quill +curl --fail -L "https://github.com/dfinity/ic-wasm/releases/download/${IC_WASM_VERSION}/ic-wasm-${IC_WASM_PLATFORM}" -o ic-wasm +chmod +x ic-wasm + if [[ "${OS}" == "linux" ]] then export DIDC="linux64" diff --git a/settings.sh b/settings.sh index ee3ee8e..ef09c72 100755 --- a/settings.sh +++ b/settings.sh @@ -39,4 +39,5 @@ export DFX_VERSION="0.24.2" export DFX_SNS_VERSION="0.4.1" export DFX_NNS_VERSION="0.4.1" -export QUILL_VERSION="0.5.1" \ No newline at end of file +export QUILL_VERSION="0.5.1" +export IC_WASM_VERSION="0.9.1" \ No newline at end of file From 2a64e8dddb4d1a0ca5196baa7eeacb980333fbb2 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 4 Dec 2024 20:50:31 +0000 Subject: [PATCH 08/13] tiny fix --- deploy_dapp.sh | 7 ++++++- example_sns_init.yaml | 2 +- upgrade_dapp.sh | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deploy_dapp.sh b/deploy_dapp.sh index 5db933d..d8412a9 100755 --- a/deploy_dapp.sh +++ b/deploy_dapp.sh @@ -10,10 +10,15 @@ export ARG="${3:-()}" . ./constants.sh normal -./bin/dfx --provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa-cai canister create "${NAME}" --network "${NETWORK}" --no-wallet +./bin/dfx \ + --provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa-cai \ + canister create "${NAME}" \ + --network "${NETWORK}" \ + --no-wallet if [[ -z "${WASM}" ]] then + rm -f "${WASM}-s.wasm.gz" ./bin/dfx build --network "${NETWORK}" "${NAME}" WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}" ic-wasm "${WASM}.wasm" -o "${WASM}-s.wasm" shrink diff --git a/example_sns_init.yaml b/example_sns_init.yaml index 359a210..e8a1b50 100644 --- a/example_sns_init.yaml +++ b/example_sns_init.yaml @@ -355,7 +355,7 @@ Distribution: # as the treasury. This is initialized in a special sub-account, as the # main account of Governance is the minting account of the SNS Ledger. # This field is specified as a token. For instance, "1 token". - governance: 2_000_000 tokens + treasury: 2_000_000 tokens # The initial SNS token balance of the Swap canister is what will be # available for the decentralization swap. These tokens will be swapped diff --git a/upgrade_dapp.sh b/upgrade_dapp.sh index 776f306..fad6101 100755 --- a/upgrade_dapp.sh +++ b/upgrade_dapp.sh @@ -33,6 +33,7 @@ fi if [[ -z "${WASM}" ]] then + rm -f "${WASM}-s.wasm.gz" ./bin/dfx build --network "${NETWORK}" "${NAME}" WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}" ic-wasm "${WASM}.wasm" -o "${WASM}-s.wasm" shrink From 5bb09c4db66556394c4ffc8b418a9ae45111129c Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 4 Dec 2024 21:31:44 +0000 Subject: [PATCH 09/13] Fix order of commands --- deploy_dapp.sh | 2 +- upgrade_dapp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_dapp.sh b/deploy_dapp.sh index d8412a9..1afeb56 100755 --- a/deploy_dapp.sh +++ b/deploy_dapp.sh @@ -18,9 +18,9 @@ export ARG="${3:-()}" if [[ -z "${WASM}" ]] then + WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}" rm -f "${WASM}-s.wasm.gz" ./bin/dfx build --network "${NETWORK}" "${NAME}" - WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}" ic-wasm "${WASM}.wasm" -o "${WASM}-s.wasm" shrink gzip "${WASM}-s.wasm" export WASM="${WASM}-s.wasm.gz" diff --git a/upgrade_dapp.sh b/upgrade_dapp.sh index fad6101..64b88dd 100755 --- a/upgrade_dapp.sh +++ b/upgrade_dapp.sh @@ -33,9 +33,9 @@ fi if [[ -z "${WASM}" ]] then + WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}" rm -f "${WASM}-s.wasm.gz" ./bin/dfx build --network "${NETWORK}" "${NAME}" - WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}" ic-wasm "${WASM}.wasm" -o "${WASM}-s.wasm" shrink gzip "${WASM}-s.wasm" export WASM="${WASM}-s.wasm.gz" From 24e88897f1db88990561044cb925b6b74ae2b70d Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 4 Dec 2024 21:45:59 +0000 Subject: [PATCH 10/13] Avoid upgrading Dapp via proposal in all cases (issues/83) --- run_basic_scenario.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/run_basic_scenario.sh b/run_basic_scenario.sh index 0eded61..90af5db 100755 --- a/run_basic_scenario.sh +++ b/run_basic_scenario.sh @@ -36,13 +36,15 @@ done # Assert that the test canister is indeed registered. [ "$(./get_sns_canisters.sh | ./bin/idl2json | jq -r '.dapps[0]')" == "$(./bin/dfx canister id test)" ] && echo "OK" || exit 1 +# TODO[dfinity/sns-testing/issues/83]: Re-enable upgrading dapp canisters via SNS proposals. +# # Upgrade test canister (I) -./upgrade_test_canister.sh Hello -./wait_for_last_sns_proposal.sh -./wait_for_canister_running.sh "$(./bin/dfx canister id test)" - -# assert the new greeting text -[ "$(./bin/dfx canister call test greet "M")" == '("Hello, M!")' ] && echo "OK" || exit 1 +# ./upgrade_test_canister.sh Hello +# ./wait_for_last_sns_proposal.sh +# ./wait_for_canister_running.sh "$(./bin/dfx canister id test)" +# +# # assert the new greeting text +# [ "$(./bin/dfx canister call test greet "M")" == '("Hello, M!")' ] && echo "OK" || exit 1 # Participate in SNS swap ./participate_sns_swap.sh From 05c11e14c06f6e4fbefcf97817a320d0e0fe8a99 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Wed, 4 Dec 2024 22:06:46 +0000 Subject: [PATCH 11/13] dbg ci --- participate_sns_swap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/participate_sns_swap.sh b/participate_sns_swap.sh index bbd36a2..80ca877 100755 --- a/participate_sns_swap.sh +++ b/participate_sns_swap.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euo pipefail +set -xeuo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")" From c4cfb311e383fa9a58b3e9b9040ed4434d7821b0 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Thu, 5 Dec 2024 22:02:40 +0000 Subject: [PATCH 12/13] Un-bump Ubuntu version, fix Quill, bumb quill, bump IC commit ID --- Dockerfile | 2 +- settings.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fb8722c..330f4da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:24.04 +FROM ubuntu:22.04 ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ diff --git a/settings.sh b/settings.sh index ef09c72..11b16a9 100755 --- a/settings.sh +++ b/settings.sh @@ -31,7 +31,7 @@ export SNS_AGGREGATOR_RELEASE="proposal-129614-agg" # $ ./gitlab-ci/src/artifacts/newest_sha_with_disk_image.sh origin/master # from the IC monorepo: https://github.com/dfinity/ic # if you change IC_COMMIT, then you need to rerun `source install.sh` -export IC_COMMIT="6a4eeb97fd93a5fc93d50b0e01ab24c6a7e72fae" +export IC_COMMIT="1f88ae12ac756a91901ec49b3506400ae55d6829" export TESTNET="local" @@ -39,5 +39,5 @@ export DFX_VERSION="0.24.2" export DFX_SNS_VERSION="0.4.1" export DFX_NNS_VERSION="0.4.1" -export QUILL_VERSION="0.5.1" +export QUILL_VERSION="0.5.2" export IC_WASM_VERSION="0.9.1" \ No newline at end of file From 4e2e514f1008da364a2d1f89190e4dfc22c77826 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Thu, 5 Dec 2024 23:19:57 +0100 Subject: [PATCH 13/13] Apply suggestions from code review --- participate_sns_swap.sh | 2 +- run_basic_scenario.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/participate_sns_swap.sh b/participate_sns_swap.sh index 80ca877..bbd36a2 100755 --- a/participate_sns_swap.sh +++ b/participate_sns_swap.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -xeuo pipefail +set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")" diff --git a/run_basic_scenario.sh b/run_basic_scenario.sh index 90af5db..2102ac8 100755 --- a/run_basic_scenario.sh +++ b/run_basic_scenario.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -xeuo pipefail +set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")"