Dear SNS Communities,
TL;DR: In the coming weeks, DFINITY’s Governance team plans to submit NNS proposals to upgrade the oldest Swap canisters. If adopted, these upgrades will enhance Swaps in several key ways, as outlined below.
Currently, the Swap canister is the only component within the SNS framework that is upgraded by the NNS (rather than an SNS) community. Since the primary purpose of a Swap canister is fulfilled once an SNS is decentralized, SNS communities typically do not upgrade their Swaps. As a result, some SNSs still operate on very outdated Swap versions (dating back to early 2023) that haven’t been updated since.
Meanwhile, numerous improvements have been made to the Swap canister code in recent months. These include upgrading the CDK, moving periodic tasks from heartbeats to ic-cdk timers, and stopping these tasks after a swap completes (which wasn’t feasible with heartbeats).
The API has also been enhanced, adding fields like direct_participation_icp_e8s
and neurons_fund_participation_icp_e8s
. For existing Swaps, these API changes enable more systematic audits, bringing them in line with the more recently launched SNSs.
Upgrading Swaps to the Latest Version
Each Swap canister can be upgraded to the latest version with just one NNS proposal. It is not necessary to run all intermediate upgrades — our testing indicates that simply populating the two new fields with existing data allows for a safe upgrade of older Swaps. We verified this by comparing the Swap.get_state responses before and after the upgrade, covering both post-upgrade hooks and migrations, and ensuring that a subsequent upgrade functions correctly (covering pre-upgrade hooks).
Periodic Tasks in Swap
Swaps rely on periodic tasks for two main purposes:
- Advancing the Swap state machine before the SNS is launched, including transitions such as Adopted → Open, Open → Committed, or Open → Aborted.
- Automatically finalizing the swap process once the state reaches Committed or Aborted.
These periodic tasks are no longer necessary after the SNS is launched. Therefore, we propose to stop them for all launched SNSs. For upcoming SNSs, this will happen automatically (more details can be found here: SNS Updates, October 11, 2024).
Further information about the Swap canister is available here: Swap.proto.
Next steps
The Governance team has already proposed publishing a new version of Swap ( SNS Updates 2024-11-24) which includes the necessary data migration for upgrading older Swaps. Our next step will be to propose upgrading the oldest Swap canister (from Dragginz) to this newly published version.
To maintain a steady pace of NNS proposals, we plan to limit the number of Swap upgrade proposals to approximately 10 per week, continuing this process until all remaining Swaps have been updated to the desired version with the more efficient implementation of periodic tasks.
Planned upgrade order of existing Swap canisters
No | SNS | Swap Release date | Swap canister ID | Swap Module hash | Swap git_commit_id |
---|---|---|---|---|---|
1 | Dragginz | 2023-02-23 | zcdfx-6iaaa-aaaaq-aaagq-cai | 6e6ac7ca6bce8f24524ba131a852637e10e711cddeb25e6be9f9ab1b0af4c611 | 9bb8f35cccd013b38657c67964c39d48fac6353f |
2 | OpenChat | 2023-03-03 | 2hx64-daaaa-aaaaq-aaana-cai | 028aa2d9817903fe8c5b94f2f31c596b682b013d4ac8acbb74d5a91ac56bc0b7 | 932c1bfc04728783a815e0867b579c1eb26df99d |
3 | ICGhost | 2023-05-24 | 4f5dx-pyaaa-aaaaq-aaa3q-cai | 9ed73e1547a29255d28878f40da303b9069119e4c8d73ac5e8295b300777f358 | a1f503d20b7846375c74ce5f7d0f8f6620ab7511 |
4 | Kinic | 2023-05-24 | 7sppf-6aaaa-aaaaq-aaata-cai | 9ed73e1547a29255d28878f40da303b9069119e4c8d73ac5e8295b300777f358 | a1f503d20b7846375c74ce5f7d0f8f6620ab7511 |
5 | YRAL | 2023-05-24 | 6eexo-lqaaa-aaaaq-aaawa-cai | 9ed73e1547a29255d28878f40da303b9069119e4c8d73ac5e8295b300777f358 | a1f503d20b7846375c74ce5f7d0f8f6620ab7511 |
6 | BOOM DAO | 2023-07-24 | vuqiy-liaaa-aaaaq-aabiq-cai | 4d020100fd96d39d1429dee74a8032e0acbc1a6343e540a2ceb6f6da79f9f2dc | af4f0fc316a5b607365253fb67026a34412c208e |
7 | Catalyze | 2023-07-24 | uc3qt-6yaaa-aaaaq-aabnq-cai | 4d020100fd96d39d1429dee74a8032e0acbc1a6343e540a2ceb6f6da79f9f2dc | af4f0fc316a5b607365253fb67026a34412c208e |
8 | DecideAI DAO | 2023-07-24 | xhply-dqaaa-aaaaq-aabga-cai | 4d020100fd96d39d1429dee74a8032e0acbc1a6343e540a2ceb6f6da79f9f2dc | af4f0fc316a5b607365253fb67026a34412c208e |
9 | Nuance | 2023-08-21 | q2nfe-mqaaa-aaaaq-aabua-cai | 0575c056225b15465f11ca79f7297335f7a264e9498c7464ae1c0ac5bd96f921 | d7024323737506a270ad2c4d4872eb8e77effb54 |
10 | Seers | 2023-08-21 | rmg5p-zaaaa-aaaaq-aabra-cai | 0575c056225b15465f11ca79f7297335f7a264e9498c7464ae1c0ac5bd96f921 | d7024323737506a270ad2c4d4872eb8e77effb54 |
11 | SONIC | 2023-08-21 | qils5-aaaaa-aaaaq-aabxa-cai | 0575c056225b15465f11ca79f7297335f7a264e9498c7464ae1c0ac5bd96f921 | d7024323737506a270ad2c4d4872eb8e77effb54 |
12 | Gold DAO | 2023-12-08 | t7z6p-ryaaa-aaaaq-aab7q-cai | 1ffb5738c9c9acde14c5fd83395579665cb41829f7819acf87feb66d3c2caf4e | d1315a1b9b002f177526faa5ee6d7e1e1aa3a22a |
13 | Neutrinite | 2023-12-08 | f25or-jiaaa-aaaaq-aaceq-cai | 1ffb5738c9c9acde14c5fd83395579665cb41829f7819acf87feb66d3c2caf4e | d1315a1b9b002f177526faa5ee6d7e1e1aa3a22a |
14 | TRAX | 2023-12-08 | ezrhx-5qaaa-aaaaq-aacca-cai | 1ffb5738c9c9acde14c5fd83395579665cb41829f7819acf87feb66d3c2caf4e | d1315a1b9b002f177526faa5ee6d7e1e1aa3a22a |
15 | ICLighthouse DAO | 2024-01-12 | habgn-xyaaa-aaaaq-aaclq-cai | f1414b67ca335d15a7d9fc021f6afa9002143af3c7ce10edf48d4ccd9b9d1703 | 6ed74ab9788e4601bbbf02ae1ce92b7f480387df |
16 | Sneed | 2024-01-12 | hshru-3iaaa-aaaaq-aaciq-cai | f1414b67ca335d15a7d9fc021f6afa9002143af3c7ce10edf48d4ccd9b9d1703 | 6ed74ab9788e4601bbbf02ae1ce92b7f480387df |
17 | ICPanda DAO | 2024-02-22 | c424i-4qaaa-aaaaq-aacua-cai | 9531eafc54069e835636011e17a19a4709a3123c6a4d2f56c58a44c3cc31e1d6 | 48e7e1f072c259810236488ff770c809f362fb63 |
18 | ELNA AI | 2024-02-22 | grlys-pqaaa-aaaaq-aacoa-cai | 9531eafc54069e835636011e17a19a4709a3123c6a4d2f56c58a44c3cc31e1d6 | 48e7e1f072c259810236488ff770c809f362fb63 |
19 | OpenFPL | 2024-02-22 | dkred-jaaaa-aaaaq-aacra-cai | 9531eafc54069e835636011e17a19a4709a3123c6a4d2f56c58a44c3cc31e1d6 | 48e7e1f072c259810236488ff770c809f362fb63 |
20 | ICPSwap | 2024-02-22 | ch7an-giaaa-aaaaq-aacwq-cai | 9531eafc54069e835636011e17a19a4709a3123c6a4d2f56c58a44c3cc31e1d6 | 48e7e1f072c259810236488ff770c809f362fb63 |
21 | Yuku DAO | 2024-02-22 | a2cof-vaaaa-aaaaq-aacza-cai | 9531eafc54069e835636011e17a19a4709a3123c6a4d2f56c58a44c3cc31e1d6 | 48e7e1f072c259810236488ff770c809f362fb63 |
22 | EstateDAO | 2024-03-28 | bcl3g-3aaaa-aaaaq-aac5a-cai | a76073744c6ff5e4e4f0bb0d5f8589abd9b70e4123cceb75d27171d3f209993f | 300dc603a92b5f70dae79229793c902f346af3cc |
23 | ICPCC DAO LLC | 2024-04-12 | lwslc-cyaaa-aaaaq-aadfq-cai | a4b4008c9ae41e3a06cd0a81b74542270184024d8ca5d71a7f71137aa7e575e5 | d7ddd2969837fc6c9c0b86d331f7bc61e9e78bd1 |
24 | Motoko | 2024-04-12 | kv6ce-waaaa-aaaaq-aadda-cai | a4b4008c9ae41e3a06cd0a81b74542270184024d8ca5d71a7f71137aa7e575e5 | d7ddd2969837fc6c9c0b86d331f7bc61e9e78bd1 |
25 | ORIGYN | 2024-04-12 | jxl73-gqaaa-aaaaq-aadia-cai | a4b4008c9ae41e3a06cd0a81b74542270184024d8ca5d71a7f71137aa7e575e5 | d7ddd2969837fc6c9c0b86d331f7bc61e9e78bd1 |
26 | WaterNeuron | 2024-05-24 | ipcky-iqaaa-aaaaq-aadma-cai | 59ec188507b12fcb6e579db7b570a59f2a7236e80c46494a6ef228ef8acd1ef5 | d1504fc4265703c5c6a73098732a4256ea8ff6bf |
27 | CYCLES-TRANSFER-STATION | 2024-06-21 | iuhw5-siaaa-aaaaq-aadoq-cai | 67f64e705afd70c0de03529a8b914f122b3fb8920d9e9d81e357b8b5e2a4d10a | b39f782ae9e976f6f25c8f1d75b977bd22c81507 |
28 | DOGMI | 2024-06-21 | n223b-vqaaa-aaaaq-aadsa-cai | 67f64e705afd70c0de03529a8b914f122b3fb8920d9e9d81e357b8b5e2a4d10a | b39f782ae9e976f6f25c8f1d75b977bd22c81507 |
29 | ICVC | 2024-06-21 | mzwsh-biaaa-aaaaq-aaduq-cai | 67f64e705afd70c0de03529a8b914f122b3fb8920d9e9d81e357b8b5e2a4d10a | b39f782ae9e976f6f25c8f1d75b977bd22c81507 |