From 40ef57a2d3689740bf0c6fa47938e52948252179 Mon Sep 17 00:00:00 2001 From: liyukun Date: Tue, 23 Jan 2024 14:19:06 +0800 Subject: [PATCH 01/13] chore: deploy spore and cluster to mainnet --- deployment/deploy.sh | 13 ++++-- .../mainnet/cluster/2024-01-23-061641.json | 13 ++++++ .../mainnet/spore/2024-01-23-060050.json | 13 ++++++ .../cluster/2024-01-19-aa7ae614.json | 0 .../cluster_agent/2024-01-19-aa7ae614.json | 0 .../cluster_proxy/2024-01-19-aa7ae614.json | 0 .../spore/2024-01-19-aa7ae614.json | 0 .../2024-01-19-aa7ae614.json | 0 deployment/toml/cluster.toml | 2 +- deployment/toml/spore.toml | 2 +- docs/VERSIONS.md | 44 +++++++++++++++++++ lib/build/src/lib.rs | 2 +- 12 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 deployment/migration/mainnet/cluster/2024-01-23-061641.json create mode 100644 deployment/migration/mainnet/spore/2024-01-23-060050.json rename deployment/migration/{ => testnet}/cluster/2024-01-19-aa7ae614.json (100%) rename deployment/migration/{ => testnet}/cluster_agent/2024-01-19-aa7ae614.json (100%) rename deployment/migration/{ => testnet}/cluster_proxy/2024-01-19-aa7ae614.json (100%) rename deployment/migration/{ => testnet}/spore/2024-01-19-aa7ae614.json (100%) rename deployment/migration/{ => testnet}/spore_extension_lua/2024-01-19-aa7ae614.json (100%) diff --git a/deployment/deploy.sh b/deployment/deploy.sh index 482d401..5f33d8e 100755 --- a/deployment/deploy.sh +++ b/deployment/deploy.sh @@ -1,13 +1,20 @@ #!/usr/bin/env bash -echo "deploying $1 from $3 to $2" +export network=$4 + +if [ -z $network ] +then + export network="testnet" +fi + +echo "deploying $1 from $3 to $2 on $network" ckb-cli --url $2 deploy gen-txs --from-address $3 --fee-rate 1000 --deployment-config ./toml/$1.toml \ - --info-file ./$1.json --migration-dir ./migration/$1 --sign-now + --info-file ./$1.json --migration-dir ./migration/$network/$1 --sign-now echo "ckb transacion file '$1.json' has generated" -ckb-cli --url $2 deploy apply-txs --info-file ./$1.json --migration-dir ./migration/$1 +ckb-cli --url $2 deploy apply-txs --info-file ./$1.json --migration-dir ./migration/$network/$1 rm ./$1.json diff --git a/deployment/migration/mainnet/cluster/2024-01-23-061641.json b/deployment/migration/mainnet/cluster/2024-01-23-061641.json new file mode 100644 index 0000000..351f212 --- /dev/null +++ b/deployment/migration/mainnet/cluster/2024-01-23-061641.json @@ -0,0 +1,13 @@ +{ + "cell_recipes": [ + { + "name": "cluster", + "tx_hash": "0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938", + "index": 0, + "occupied_capacity": 4690900000000, + "data_hash": "0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075", + "type_id": null + } + ], + "dep_group_recipes": [] +} \ No newline at end of file diff --git a/deployment/migration/mainnet/spore/2024-01-23-060050.json b/deployment/migration/mainnet/spore/2024-01-23-060050.json new file mode 100644 index 0000000..990af2f --- /dev/null +++ b/deployment/migration/mainnet/spore/2024-01-23-060050.json @@ -0,0 +1,13 @@ +{ + "cell_recipes": [ + { + "name": "spore", + "tx_hash": "0xcb67e11a39594a183eae50664073a85fa0140ae25480df61114aca0e47726d38", + "index": 0, + "occupied_capacity": 7679700000000, + "data_hash": "0x9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c", + "type_id": null + } + ], + "dep_group_recipes": [] +} \ No newline at end of file diff --git a/deployment/migration/cluster/2024-01-19-aa7ae614.json b/deployment/migration/testnet/cluster/2024-01-19-aa7ae614.json similarity index 100% rename from deployment/migration/cluster/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/cluster/2024-01-19-aa7ae614.json diff --git a/deployment/migration/cluster_agent/2024-01-19-aa7ae614.json b/deployment/migration/testnet/cluster_agent/2024-01-19-aa7ae614.json similarity index 100% rename from deployment/migration/cluster_agent/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/cluster_agent/2024-01-19-aa7ae614.json diff --git a/deployment/migration/cluster_proxy/2024-01-19-aa7ae614.json b/deployment/migration/testnet/cluster_proxy/2024-01-19-aa7ae614.json similarity index 100% rename from deployment/migration/cluster_proxy/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/cluster_proxy/2024-01-19-aa7ae614.json diff --git a/deployment/migration/spore/2024-01-19-aa7ae614.json b/deployment/migration/testnet/spore/2024-01-19-aa7ae614.json similarity index 100% rename from deployment/migration/spore/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/spore/2024-01-19-aa7ae614.json diff --git a/deployment/migration/spore_extension_lua/2024-01-19-aa7ae614.json b/deployment/migration/testnet/spore_extension_lua/2024-01-19-aa7ae614.json similarity index 100% rename from deployment/migration/spore_extension_lua/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/spore_extension_lua/2024-01-19-aa7ae614.json diff --git a/deployment/toml/cluster.toml b/deployment/toml/cluster.toml index 6a4cf37..a3e9b1f 100644 --- a/deployment/toml/cluster.toml +++ b/deployment/toml/cluster.toml @@ -8,5 +8,5 @@ location = { file = "../build/release/cluster" } # The lock script set to output cells [lock] code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" -args = "0x470dcdc5e44064909650113a274b3b36aecb6dc7" +args = "0x20da6b70dfe59586e89635dbb3adc7aa998e7189" hash_type = "type" diff --git a/deployment/toml/spore.toml b/deployment/toml/spore.toml index e685c2b..3be33ef 100644 --- a/deployment/toml/spore.toml +++ b/deployment/toml/spore.toml @@ -8,5 +8,5 @@ location = { file = "../build/release/spore" } # The lock script set to output cells [lock] code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" -args = "0x470dcdc5e44064909650113a274b3b36aecb6dc7" +args = "0x20da6b70dfe59586e89635dbb3adc7aa998e7189" hash_type = "type" diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 68e7f40..00cc133 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -1 +1,45 @@ # Historical Versions + +## tag 0.2.1 (testnet) +spore: +| | | +|---|---| +|tx_hash|0x06995b9fc19461a2bf9933e57b69af47a20bf0a5bc6c0ffcb85567a2c733f0a1| +|index|0| +|code_hash|0x5e063b4c0e7abeaa6a428df3b693521a3050934cf3b0ae97a800d1bc31449398| + +cluster: +| | | +|---|---| +|tx_hash|0xfbceb70b2e683ef3a97865bb88e082e3e5366ee195a9c826e3c07d1026792fcd| +|index|0| +|code_hash|0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075| + +cluster_agent: +| | | +|---|---| +|tx_hash|0x53fdb9366637434ff685d0aca5e2a68a859b6fcaa4b608a7ecca0713fed0f5b7| +|index|0| +|code_hash|0xc986099b41d79ca1b2a56ce5874bcda8175440a17298ea5e2bbc3897736b8c21| + +cluster_proxy: +| | | +|---|---| +|tx_hash|0x0231ea581bbc38965e10a2659da326ae840c038a9d0d6849f458b51d94870104| +|index|0| +|code_hash|0xbe8b9ce3d05a32c4bb26fe71cd5fc1407ce91e3a8b9e8719be2ab072cef1454b| + +## tag 0.2.1 (mainnet) +spore: +| | | +|---|---| +|tx_hash|0xcb67e11a39594a183eae50664073a85fa0140ae25480df61114aca0e47726d38| +|index|0| +|code_hash|0x9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c| + +cluster: +| | | +|---|---| +|tx_hash|0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938| +|index|0| +|code_hash|0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075| diff --git a/lib/build/src/lib.rs b/lib/build/src/lib.rs index 19f30c5..790d769 100644 --- a/lib/build/src/lib.rs +++ b/lib/build/src/lib.rs @@ -10,7 +10,7 @@ pub struct FrozenVersions { #[derive(serde::Deserialize)] pub struct PublishedCodeHash { #[serde(rename(deserialize = "commit_hash"))] - _commit_hash: String, + _commit_hash: Option, #[serde(default)] spore: String, #[serde(default)] From 0040857da171664b273567a47fdd96fbea6df723 Mon Sep 17 00:00:00 2001 From: liyukun Date: Tue, 23 Jan 2024 14:22:32 +0800 Subject: [PATCH 02/13] chore: update commit hash records --- ...23-061641.json => 2024-01-23-40ef57a2.json} | 0 ...23-060050.json => 2024-01-23-40ef57a2.json} | 0 docs/VERSIONS.md | 18 ++++++++++++------ 3 files changed, 12 insertions(+), 6 deletions(-) rename deployment/migration/mainnet/cluster/{2024-01-23-061641.json => 2024-01-23-40ef57a2.json} (100%) rename deployment/migration/mainnet/spore/{2024-01-23-060050.json => 2024-01-23-40ef57a2.json} (100%) diff --git a/deployment/migration/mainnet/cluster/2024-01-23-061641.json b/deployment/migration/mainnet/cluster/2024-01-23-40ef57a2.json similarity index 100% rename from deployment/migration/mainnet/cluster/2024-01-23-061641.json rename to deployment/migration/mainnet/cluster/2024-01-23-40ef57a2.json diff --git a/deployment/migration/mainnet/spore/2024-01-23-060050.json b/deployment/migration/mainnet/spore/2024-01-23-40ef57a2.json similarity index 100% rename from deployment/migration/mainnet/spore/2024-01-23-060050.json rename to deployment/migration/mainnet/spore/2024-01-23-40ef57a2.json diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 00cc133..0900c90 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -1,28 +1,31 @@ # Historical Versions ## tag 0.2.1 (testnet) -spore: + +commit hash: 53bfd4d4bbbee773ca10c1181982d9a27718826d + +**spore**: | | | |---|---| |tx_hash|0x06995b9fc19461a2bf9933e57b69af47a20bf0a5bc6c0ffcb85567a2c733f0a1| |index|0| |code_hash|0x5e063b4c0e7abeaa6a428df3b693521a3050934cf3b0ae97a800d1bc31449398| -cluster: +**cluster**: | | | |---|---| |tx_hash|0xfbceb70b2e683ef3a97865bb88e082e3e5366ee195a9c826e3c07d1026792fcd| |index|0| |code_hash|0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075| -cluster_agent: +**cluster_agent**: | | | |---|---| |tx_hash|0x53fdb9366637434ff685d0aca5e2a68a859b6fcaa4b608a7ecca0713fed0f5b7| |index|0| |code_hash|0xc986099b41d79ca1b2a56ce5874bcda8175440a17298ea5e2bbc3897736b8c21| -cluster_proxy: +**cluster_proxy**: | | | |---|---| |tx_hash|0x0231ea581bbc38965e10a2659da326ae840c038a9d0d6849f458b51d94870104| @@ -30,14 +33,17 @@ cluster_proxy: |code_hash|0xbe8b9ce3d05a32c4bb26fe71cd5fc1407ce91e3a8b9e8719be2ab072cef1454b| ## tag 0.2.1 (mainnet) -spore: + +commit hash: 40ef57a2d3689740bf0c6fa47938e52948252179 + +**spore**: | | | |---|---| |tx_hash|0xcb67e11a39594a183eae50664073a85fa0140ae25480df61114aca0e47726d38| |index|0| |code_hash|0x9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c| -cluster: +**cluster**: | | | |---|---| |tx_hash|0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938| From 000ccfb04aeae3c722911eb0e6fa50aac92b46f0 Mon Sep 17 00:00:00 2001 From: liyukun Date: Tue, 23 Jan 2024 14:36:39 +0800 Subject: [PATCH 03/13] chore: update frozen versions --- deployment/frozen/mainnet.toml | 4 ++++ deployment/frozen/testnet.toml | 10 +++++++++- docs/VERSIONS.md | 18 ++++++------------ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/deployment/frozen/mainnet.toml b/deployment/frozen/mainnet.toml index 787fcd4..c99580e 100644 --- a/deployment/frozen/mainnet.toml +++ b/deployment/frozen/mainnet.toml @@ -1 +1,5 @@ +# version v0.2.1 [[code_hash_list]] +commit_hash = "40ef57a2d3689740bf0c6fa47938e52948252179" +cluster = "7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075" +spore = "9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c" diff --git a/deployment/frozen/testnet.toml b/deployment/frozen/testnet.toml index 2251e1b..e8f4166 100644 --- a/deployment/frozen/testnet.toml +++ b/deployment/frozen/testnet.toml @@ -1,5 +1,13 @@ -# version v1 +# version v0.1.0 [[code_hash_list]] commit_hash = "457e32d23b5f401cad837e52a568281784943e18" cluster = "598d793defef36e2eeba54a9b45130e4ca92822e1d193671f490950c3b856080" spore = "bbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494" + +# version v0.2.1 +[[code_hash_list]] +commit_hash = "53bfd4d4bbbee773ca10c1181982d9a27718826d" +cluster = "7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075" +spore = "5e063b4c0e7abeaa6a428df3b693521a3050934cf3b0ae97a800d1bc31449398" +cluster_agent = "c986099b41d79ca1b2a56ce5874bcda8175440a17298ea5e2bbc3897736b8c21" +cluster_proxy = "be8b9ce3d05a32c4bb26fe71cd5fc1407ce91e3a8b9e8719be2ab072cef1454b" diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 0900c90..2d92c45 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -5,30 +5,26 @@ commit hash: 53bfd4d4bbbee773ca10c1181982d9a27718826d **spore**: -| | | -|---|---| |tx_hash|0x06995b9fc19461a2bf9933e57b69af47a20bf0a5bc6c0ffcb85567a2c733f0a1| +|---|---| |index|0| |code_hash|0x5e063b4c0e7abeaa6a428df3b693521a3050934cf3b0ae97a800d1bc31449398| **cluster**: -| | | -|---|---| |tx_hash|0xfbceb70b2e683ef3a97865bb88e082e3e5366ee195a9c826e3c07d1026792fcd| +|---|---| |index|0| |code_hash|0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075| **cluster_agent**: -| | | -|---|---| |tx_hash|0x53fdb9366637434ff685d0aca5e2a68a859b6fcaa4b608a7ecca0713fed0f5b7| +|---|---| |index|0| |code_hash|0xc986099b41d79ca1b2a56ce5874bcda8175440a17298ea5e2bbc3897736b8c21| **cluster_proxy**: -| | | -|---|---| |tx_hash|0x0231ea581bbc38965e10a2659da326ae840c038a9d0d6849f458b51d94870104| +|---|---| |index|0| |code_hash|0xbe8b9ce3d05a32c4bb26fe71cd5fc1407ce91e3a8b9e8719be2ab072cef1454b| @@ -37,15 +33,13 @@ commit hash: 53bfd4d4bbbee773ca10c1181982d9a27718826d commit hash: 40ef57a2d3689740bf0c6fa47938e52948252179 **spore**: -| | | -|---|---| |tx_hash|0xcb67e11a39594a183eae50664073a85fa0140ae25480df61114aca0e47726d38| +|---|---| |index|0| |code_hash|0x9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c| **cluster**: -| | | -|---|---| |tx_hash|0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938| +|---|---| |index|0| |code_hash|0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075| From 7867692a0e26b08cc713ece96cfb054b92a47337 Mon Sep 17 00:00:00 2001 From: liyukun Date: Tue, 23 Jan 2024 19:02:32 +0800 Subject: [PATCH 04/13] chore: bump tag version --- deployment/frozen/mainnet.toml | 2 +- docs/VERSIONS.md | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/deployment/frozen/mainnet.toml b/deployment/frozen/mainnet.toml index c99580e..19da0de 100644 --- a/deployment/frozen/mainnet.toml +++ b/deployment/frozen/mainnet.toml @@ -1,4 +1,4 @@ -# version v0.2.1 +# version v0.2.2 [[code_hash_list]] commit_hash = "40ef57a2d3689740bf0c6fa47938e52948252179" cluster = "7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075" diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 2d92c45..7547920 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -5,41 +5,47 @@ commit hash: 53bfd4d4bbbee773ca10c1181982d9a27718826d **spore**: +| | | +|-|-| |tx_hash|0x06995b9fc19461a2bf9933e57b69af47a20bf0a5bc6c0ffcb85567a2c733f0a1| -|---|---| |index|0| |code_hash|0x5e063b4c0e7abeaa6a428df3b693521a3050934cf3b0ae97a800d1bc31449398| **cluster**: +| | | +|-|-| |tx_hash|0xfbceb70b2e683ef3a97865bb88e082e3e5366ee195a9c826e3c07d1026792fcd| -|---|---| |index|0| |code_hash|0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075| **cluster_agent**: +| | | +|-|-| |tx_hash|0x53fdb9366637434ff685d0aca5e2a68a859b6fcaa4b608a7ecca0713fed0f5b7| -|---|---| |index|0| |code_hash|0xc986099b41d79ca1b2a56ce5874bcda8175440a17298ea5e2bbc3897736b8c21| **cluster_proxy**: +| | | +|-|-| |tx_hash|0x0231ea581bbc38965e10a2659da326ae840c038a9d0d6849f458b51d94870104| -|---|---| |index|0| |code_hash|0xbe8b9ce3d05a32c4bb26fe71cd5fc1407ce91e3a8b9e8719be2ab072cef1454b| -## tag 0.2.1 (mainnet) +## tag 0.2.2 (mainnet) commit hash: 40ef57a2d3689740bf0c6fa47938e52948252179 **spore**: +| | | +|-|-| |tx_hash|0xcb67e11a39594a183eae50664073a85fa0140ae25480df61114aca0e47726d38| -|---|---| |index|0| |code_hash|0x9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c| **cluster**: +| | | +|-|-| |tx_hash|0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938| -|---|---| |index|0| |code_hash|0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075| From b2e9bdf6d2cc30336746031f58485613fae6c024 Mon Sep 17 00:00:00 2001 From: liyukun Date: Tue, 23 Jan 2024 19:05:12 +0800 Subject: [PATCH 05/13] chore: update commit hash --- docs/VERSIONS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 7547920..52027fc 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -34,7 +34,7 @@ commit hash: 53bfd4d4bbbee773ca10c1181982d9a27718826d ## tag 0.2.2 (mainnet) -commit hash: 40ef57a2d3689740bf0c6fa47938e52948252179 +commit hash: 7867692a0e26b08cc713ece96cfb054b92a47337 **spore**: | | | From b562411fe3082d1362bae7a0d15c32ff94f80e0f Mon Sep 17 00:00:00 2001 From: liyukun Date: Tue, 23 Jan 2024 19:20:32 +0800 Subject: [PATCH 06/13] chore: replace commit hash with tag name --- README.md | 23 +---------------------- deployment/frozen/mainnet.toml | 1 - deployment/frozen/testnet.toml | 2 -- docs/VERSIONS.md | 4 ---- lib/build/src/lib.rs | 2 -- 5 files changed, 1 insertion(+), 31 deletions(-) diff --git a/README.md b/README.md index fafdc64..b8c4533 100644 --- a/README.md +++ b/README.md @@ -54,28 +54,7 @@ The versioning philosophy is **"Using code_hash as version"** for Spore Protocol Make sure you are using the proper version you want, because there's no such an "upgrade/downgrade" method but we suggest to use "destroy/reconstruct" method instead, which requires no modification of any fields in Spore cell. -Our `forzen` versions of contract, which are our prior versions, can be found in [directory](https://github.com/sporeprotocol/spore-contract/tree/master/deployment/frozen) `./deployment/frozen`. To describe more clearly, the `frozen` information contains each avaliable `code_hash` generated from Spore contracts with corresponding commit hash for the rolling back help. - -`./deployment/migration` recorded the deployment detail for each Spore contract. Here's a list about the newest versions: - -#### Spore -Pudge Testnet: -- data_hash: `0xa32df38d2de1da82cbcb9e4467f8c18479596394eea977e471b75be5fe3e9c67` - -#### Cluster -Pudge Testnet: -- data_hash: `0x5203a3baf931c15a809c4a0bb7041aebb73118281e31e8d104d926b8523977b1` - -#### Cluster Proxy -Pudge Testnet: -- data_hash: `0x08e5cecab2bbdea9139534a822d46b82929e06f12f00c68343a88a58827cd3db` - -#### Cluster Agent -- data_hash: `0x88850ac632eed604f0ad784394004db384d0eea8038a24eee83439687d79343f` - -#### Mutant (Lua Extension) -Pudge Testnet: -- data_hash: `0x94a9b875911ace20f1f0d063a26495d14e4b04e32fd218261bb747f34e71ae47` +Our `forzen` versions of contract, which are our prior versions, can be found in [directory](https://github.com/sporeprotocol/spore-contract/tree/master/deployment/frozen) `./deployment/frozen`. To describe more clearly, the `frozen` information contains each avaliable `code_hash` generated from Spore contracts. Historical version refers to [here](https://github.com/sporeprotocol/spore-contract/blob/master/docs/VERSIONS.md). In addition, using Mutant contract requires the binary of Lua library. Information are recorded [here](https://github.com/sporeprotocol/spore-contract/tree/master/contracts/spore_extension_lua/lua). For simplicity, it's already deployed in the Pudge Testnet: diff --git a/deployment/frozen/mainnet.toml b/deployment/frozen/mainnet.toml index 19da0de..4cd9b29 100644 --- a/deployment/frozen/mainnet.toml +++ b/deployment/frozen/mainnet.toml @@ -1,5 +1,4 @@ # version v0.2.2 [[code_hash_list]] -commit_hash = "40ef57a2d3689740bf0c6fa47938e52948252179" cluster = "7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075" spore = "9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c" diff --git a/deployment/frozen/testnet.toml b/deployment/frozen/testnet.toml index e8f4166..c73dd2f 100644 --- a/deployment/frozen/testnet.toml +++ b/deployment/frozen/testnet.toml @@ -1,12 +1,10 @@ # version v0.1.0 [[code_hash_list]] -commit_hash = "457e32d23b5f401cad837e52a568281784943e18" cluster = "598d793defef36e2eeba54a9b45130e4ca92822e1d193671f490950c3b856080" spore = "bbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494" # version v0.2.1 [[code_hash_list]] -commit_hash = "53bfd4d4bbbee773ca10c1181982d9a27718826d" cluster = "7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075" spore = "5e063b4c0e7abeaa6a428df3b693521a3050934cf3b0ae97a800d1bc31449398" cluster_agent = "c986099b41d79ca1b2a56ce5874bcda8175440a17298ea5e2bbc3897736b8c21" diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index 52027fc..facfaa7 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -2,8 +2,6 @@ ## tag 0.2.1 (testnet) -commit hash: 53bfd4d4bbbee773ca10c1181982d9a27718826d - **spore**: | | | |-|-| @@ -34,8 +32,6 @@ commit hash: 53bfd4d4bbbee773ca10c1181982d9a27718826d ## tag 0.2.2 (mainnet) -commit hash: 7867692a0e26b08cc713ece96cfb054b92a47337 - **spore**: | | | |-|-| diff --git a/lib/build/src/lib.rs b/lib/build/src/lib.rs index 790d769..a2d6a72 100644 --- a/lib/build/src/lib.rs +++ b/lib/build/src/lib.rs @@ -9,8 +9,6 @@ pub struct FrozenVersions { #[derive(serde::Deserialize)] pub struct PublishedCodeHash { - #[serde(rename(deserialize = "commit_hash"))] - _commit_hash: Option, #[serde(default)] spore: String, #[serde(default)] From f4d8f90a52fae3267442b3beaf14fda5c633b279 Mon Sep 17 00:00:00 2001 From: liyukun Date: Wed, 24 Jan 2024 11:36:13 +0800 Subject: [PATCH 07/13] chore: rollback frozen versions --- deployment/frozen/mainnet.toml | 3 --- deployment/frozen/testnet.toml | 7 ------- 2 files changed, 10 deletions(-) diff --git a/deployment/frozen/mainnet.toml b/deployment/frozen/mainnet.toml index 4cd9b29..787fcd4 100644 --- a/deployment/frozen/mainnet.toml +++ b/deployment/frozen/mainnet.toml @@ -1,4 +1 @@ -# version v0.2.2 [[code_hash_list]] -cluster = "7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075" -spore = "9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c" diff --git a/deployment/frozen/testnet.toml b/deployment/frozen/testnet.toml index c73dd2f..33948fd 100644 --- a/deployment/frozen/testnet.toml +++ b/deployment/frozen/testnet.toml @@ -2,10 +2,3 @@ [[code_hash_list]] cluster = "598d793defef36e2eeba54a9b45130e4ca92822e1d193671f490950c3b856080" spore = "bbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494" - -# version v0.2.1 -[[code_hash_list]] -cluster = "7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075" -spore = "5e063b4c0e7abeaa6a428df3b693521a3050934cf3b0ae97a800d1bc31449398" -cluster_agent = "c986099b41d79ca1b2a56ce5874bcda8175440a17298ea5e2bbc3897736b8c21" -cluster_proxy = "be8b9ce3d05a32c4bb26fe71cd5fc1407ce91e3a8b9e8719be2ab072cef1454b" From 92d479d9dc88436b8b2c3c1a8f8464426418efea Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:20:49 +0000 Subject: [PATCH 08/13] chore: record code_hash of contracts in CI --- .github/workflows/capsule.yaml | 68 ++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/.github/workflows/capsule.yaml b/.github/workflows/capsule.yaml index fbd465f..ed2c610 100644 --- a/.github/workflows/capsule.yaml +++ b/.github/workflows/capsule.yaml @@ -1,5 +1,6 @@ name: Capsule build/test on: + push: pull_request: paths: - contracts/** @@ -7,14 +8,27 @@ on: - tests/** jobs: - capsule: + capsule-build-and-test: + strategy: + fail-fast: false + matrix: + include: + - target: debug + cargo-option: "" + target-dir: "build/debug" + - target: testnet + cargo-option: "--release" + target-dir: "build/release" + - target: mainnet + cargo-option: "--release -- --features release_export" + target-dir: "build/release" runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: stable - override: true + toolchain: stable + override: true - name: Prepare capsule v0.10.2 run: | @@ -28,10 +42,48 @@ jobs: run: cargo install cross --git https://github.com/cross-rs/cross - name: Capsule build - run: capsule build + run: capsule build ${{ matrix.cargo-option }} - - name: Capsule test -- --nocapture - run: capsule test + - name: Capsule test + run: capsule test ${{ matrix.cargo-option }} - - \ No newline at end of file + - name: List all the contract binaries of ${{ github.ref }} + run: ls -l ${{ matrix.target-dir }} + + - name: Archive the contract binaries + uses: actions/upload-artifact@v4 + with: + name: contract-binaries-${{ matrix.target }} + path: ${{ matrix.target-dir }} + + record-code-hash: + needs: capsule-build-and-test + strategy: + matrix: + target: [debug, testnet, mainnet] + runs-on: ubuntu-20.04 + steps: + # TODO: add this codehash util into the `tests` directory + - name: Checkout a code_hash tool + uses: actions/checkout@v4 + with: + repository: Flouse/spore-contract + ref: codehash-tool + + - uses: actions/download-artifact@v4 + with: + name: contract-binaries-${{ matrix.target }} + + - run: | + pwd + ls build + ls + ls /home/runner/work/spore-contract/spore-contract + + - name: Build codehash-tool + working-directory: build + run: cargo build + + - name: Record code_hash of contract binaries + working-directory: build + run: ./target/debug/code_hash From a1644283dfe9b7389c29a6a36b81bf55f1dc12b0 Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:24:13 +0000 Subject: [PATCH 09/13] chore: remove useless actions-rs/toolchain --- .github/workflows/capsule.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/capsule.yaml b/.github/workflows/capsule.yaml index ed2c610..e8a6129 100644 --- a/.github/workflows/capsule.yaml +++ b/.github/workflows/capsule.yaml @@ -24,11 +24,7 @@ jobs: target-dir: "build/release" runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + - uses: actions/checkout@v4 - name: Prepare capsule v0.10.2 run: | From f831812b088c17713b04610ae667ec95f6a157fd Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:37:33 +0000 Subject: [PATCH 10/13] chore: add github.ref to the name of the contract binary archive --- .github/workflows/capsule.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/capsule.yaml b/.github/workflows/capsule.yaml index e8a6129..71a87bb 100644 --- a/.github/workflows/capsule.yaml +++ b/.github/workflows/capsule.yaml @@ -46,11 +46,13 @@ jobs: - name: List all the contract binaries of ${{ github.ref }} run: ls -l ${{ matrix.target-dir }} - - name: Archive the contract binaries + - name: Archive the contract binaries ${{ github.sha }} uses: actions/upload-artifact@v4 with: - name: contract-binaries-${{ matrix.target }} + name: contract-binaries-${{ matrix.target }}-${{ github.sha }} path: ${{ matrix.target-dir }} + outputs: + spore-contract-ref: ${{ github.sha }} record-code-hash: needs: capsule-build-and-test @@ -60,6 +62,7 @@ jobs: runs-on: ubuntu-20.04 steps: # TODO: add this codehash util into the `tests` directory + # or, simply use `ckb-cli util blake2b --binary-path ...` to get the codehash - name: Checkout a code_hash tool uses: actions/checkout@v4 with: @@ -68,13 +71,7 @@ jobs: - uses: actions/download-artifact@v4 with: - name: contract-binaries-${{ matrix.target }} - - - run: | - pwd - ls build - ls - ls /home/runner/work/spore-contract/spore-contract + name: contract-binaries-${{ matrix.target }}-${{ needs.capsule-build-and-test.outputs.spore-contract-ref }} - name: Build codehash-tool working-directory: build @@ -82,4 +79,6 @@ jobs: - name: Record code_hash of contract binaries working-directory: build - run: ./target/debug/code_hash + run: | + echo "spore-contract-commit: ${{ needs.capsule-build-and-test.outputs.spore-contract-ref }}\n" + ./target/debug/code_hash From fcd3282cca4620b310e920613941a7f1327d55e5 Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:49:36 +0000 Subject: [PATCH 11/13] chore: fix the path of contract binary archive --- .github/workflows/capsule.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/capsule.yaml b/.github/workflows/capsule.yaml index 71a87bb..7f25b15 100644 --- a/.github/workflows/capsule.yaml +++ b/.github/workflows/capsule.yaml @@ -50,7 +50,9 @@ jobs: uses: actions/upload-artifact@v4 with: name: contract-binaries-${{ matrix.target }}-${{ github.sha }} - path: ${{ matrix.target-dir }} + path: | + build/debug + build/release outputs: spore-contract-ref: ${{ github.sha }} @@ -72,6 +74,7 @@ jobs: - uses: actions/download-artifact@v4 with: name: contract-binaries-${{ matrix.target }}-${{ needs.capsule-build-and-test.outputs.spore-contract-ref }} + path: build - name: Build codehash-tool working-directory: build From ab786b7e6fe64a850c54a9ab807da6bc1f9afa00 Mon Sep 17 00:00:00 2001 From: liyukun Date: Thu, 25 Jan 2024 11:12:58 +0800 Subject: [PATCH 12/13] chore: rename deployment artifacts with related tag name --- .../{2024-01-23-40ef57a2.json => 2024-01-23-0.2.2-beta.1.json} | 0 .../cluster/{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} | 0 .../{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} | 0 .../{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} | 0 .../spore/{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} | 0 .../{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename deployment/migration/mainnet/cluster/{2024-01-23-40ef57a2.json => 2024-01-23-0.2.2-beta.1.json} (100%) rename deployment/migration/testnet/cluster/{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} (100%) rename deployment/migration/testnet/cluster_agent/{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} (100%) rename deployment/migration/testnet/cluster_proxy/{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} (100%) rename deployment/migration/testnet/spore/{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} (100%) rename deployment/migration/testnet/spore_extension_lua/{2024-01-19-aa7ae614.json => 2024-01-19-0.2.1.json} (100%) diff --git a/deployment/migration/mainnet/cluster/2024-01-23-40ef57a2.json b/deployment/migration/mainnet/cluster/2024-01-23-0.2.2-beta.1.json similarity index 100% rename from deployment/migration/mainnet/cluster/2024-01-23-40ef57a2.json rename to deployment/migration/mainnet/cluster/2024-01-23-0.2.2-beta.1.json diff --git a/deployment/migration/testnet/cluster/2024-01-19-aa7ae614.json b/deployment/migration/testnet/cluster/2024-01-19-0.2.1.json similarity index 100% rename from deployment/migration/testnet/cluster/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/cluster/2024-01-19-0.2.1.json diff --git a/deployment/migration/testnet/cluster_agent/2024-01-19-aa7ae614.json b/deployment/migration/testnet/cluster_agent/2024-01-19-0.2.1.json similarity index 100% rename from deployment/migration/testnet/cluster_agent/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/cluster_agent/2024-01-19-0.2.1.json diff --git a/deployment/migration/testnet/cluster_proxy/2024-01-19-aa7ae614.json b/deployment/migration/testnet/cluster_proxy/2024-01-19-0.2.1.json similarity index 100% rename from deployment/migration/testnet/cluster_proxy/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/cluster_proxy/2024-01-19-0.2.1.json diff --git a/deployment/migration/testnet/spore/2024-01-19-aa7ae614.json b/deployment/migration/testnet/spore/2024-01-19-0.2.1.json similarity index 100% rename from deployment/migration/testnet/spore/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/spore/2024-01-19-0.2.1.json diff --git a/deployment/migration/testnet/spore_extension_lua/2024-01-19-aa7ae614.json b/deployment/migration/testnet/spore_extension_lua/2024-01-19-0.2.1.json similarity index 100% rename from deployment/migration/testnet/spore_extension_lua/2024-01-19-aa7ae614.json rename to deployment/migration/testnet/spore_extension_lua/2024-01-19-0.2.1.json From 4406467d306bad791b139b12293ac2d64ab19dde Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:32:49 +0800 Subject: [PATCH 13/13] chore: remove incorrect mainnet deployment info --- docs/VERSIONS.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/VERSIONS.md b/docs/VERSIONS.md index facfaa7..201e7d5 100644 --- a/docs/VERSIONS.md +++ b/docs/VERSIONS.md @@ -32,12 +32,6 @@ ## tag 0.2.2 (mainnet) -**spore**: -| | | -|-|-| -|tx_hash|0xcb67e11a39594a183eae50664073a85fa0140ae25480df61114aca0e47726d38| -|index|0| -|code_hash|0x9cb02fa8621d79fff300b910d52665f594d3ad468142a66213cfaaca0409502c| **cluster**: | | |