Skip to content

Commit 21fa73e

Browse files
test(governance): Move WASM size limits of Governance canisters to Governance directories. (dfinity#3676)
This way, we do not need IDX to approve when we slightly increase size limits.
1 parent 056a8e0 commit 21fa73e

File tree

5 files changed

+50
-28
lines changed

5 files changed

+50
-28
lines changed

publish/canisters/BUILD.bazel

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
22
load("//ci/src/artifacts:upload.bzl", "upload_artifacts")
3+
load("//rs/nns:nns.bzl", NNS_CANISTER_NAME_TO_MAX_COMPRESSED_WASM_SIZE_E5_BYTES = "CANISTER_NAME_TO_MAX_COMPRESSED_WASM_SIZE_E5_BYTES")
4+
load("//rs/sns:sns.bzl", SNS_CANISTER_NAME_TO_MAX_COMPRESSED_WASM_SIZE_E5_BYTES = "CANISTER_NAME_TO_MAX_COMPRESSED_WASM_SIZE_E5_BYTES")
35

46
# The list of canisters that are being published/uploaded as artifacts to our CDN (download.dfinity.systems) include
57
# 1. Officially released canisters that can be downloaded/verified by 3rd parties - https://github.com/dfinity/ic/blob/master/.github/workflows/tag-release.yml
@@ -86,35 +88,9 @@ CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES = {
8688
"rate-limit-canister.wasm.gz": "7",
8789
}
8890

89-
# How these limits were chosen:
90-
#
91-
# 1. Temporarily set value to "0".
92-
# 2. Run the test: bazel test //publish/canisters:all
93-
# 3. Fail message reports size it sees.
94-
# 4. Pick a number that gives at least 20% headroom.
95-
#
96-
# This way, there is some room to grow, but an alarm eventually gets triggered after a "significant"
97-
# amount of growth happens.
98-
99-
NNS_CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES = {
100-
"cycles-minting-canister.wasm.gz": "6",
101-
"genesis-token-canister.wasm.gz": "3",
102-
"governance-canister.wasm.gz": "17",
103-
"governance-canister_test.wasm.gz": "17",
104-
"registry-canister.wasm.gz": "14",
105-
"root-canister.wasm.gz": "4",
106-
}
107-
108-
SNS_CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES = {
109-
"sns-governance-canister.wasm.gz": "13",
110-
"sns-governance-canister_test.wasm.gz": "13",
111-
"sns-root-canister.wasm.gz": "4",
112-
"sns-swap-canister.wasm.gz": "7",
113-
}
114-
115-
CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES.update(NNS_CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES)
91+
CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES.update(NNS_CANISTER_NAME_TO_MAX_COMPRESSED_WASM_SIZE_E5_BYTES)
11692

117-
CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES.update(SNS_CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES)
93+
CANISTERS_MAX_SIZE_COMPRESSED_E5_BYTES.update(SNS_CANISTER_NAME_TO_MAX_COMPRESSED_WASM_SIZE_E5_BYTES)
11894

11995
[
12096
sh_test(

rs/nns/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file intentionally left blank.

rs/nns/nns.bzl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
For now, this just defines how large compressed NNS canister WASMs are allowed to be,
3+
but other things could be added here later.
4+
"""
5+
6+
# How these limits were chosen:
7+
#
8+
# 1. Temporarily set value to "0".
9+
# 2. Run the test: bazel test //publish/canisters:all
10+
# 3. Fail message reports size it sees.
11+
# 4. Pick a number that gives at least 20% headroom.
12+
#
13+
# This way, there is some room to grow, but an alarm eventually gets triggered after a "significant"
14+
# amount of growth happens.
15+
16+
CANISTER_NAME_TO_MAX_COMPRESSED_WASM_SIZE_E5_BYTES = {
17+
"cycles-minting-canister.wasm.gz": "6",
18+
"genesis-token-canister.wasm.gz": "3",
19+
"governance-canister.wasm.gz": "17",
20+
"governance-canister_test.wasm.gz": "17",
21+
"registry-canister.wasm.gz": "14",
22+
"root-canister.wasm.gz": "4",
23+
}

rs/sns/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file intentionally left blank.

rs/sns/sns.bzl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
For now, this just defines how large compressed SNS canister WASMs are allowed to be,
3+
but other things could be added here later.
4+
"""
5+
6+
# How these limits were chosen:
7+
#
8+
# 1. Temporarily set value to "0".
9+
# 2. Run the test: bazel test //publish/canisters:all
10+
# 3. Fail message reports size it sees.
11+
# 4. Pick a number that gives at least 20% headroom.
12+
#
13+
# This way, there is some room to grow, but an alarm eventually gets triggered after a "significant"
14+
# amount of growth happens.
15+
16+
CANISTER_NAME_TO_MAX_COMPRESSED_WASM_SIZE_E5_BYTES = {
17+
"sns-governance-canister.wasm.gz": "13",
18+
"sns-governance-canister_test.wasm.gz": "13",
19+
"sns-root-canister.wasm.gz": "4",
20+
"sns-swap-canister.wasm.gz": "7",
21+
}

0 commit comments

Comments
 (0)