Skip to content

Commit a0bbab3

Browse files
authored
fix: wasm_memory_threshold is now bounded by 256TiB (#304)
This PR updates the maximum allowed value for wasm_memory_threshold to match that of wasm_memory_limit which also restricts (with a different semantics) wasm memory usage and thus using the same maximum allowed value makes sense. Both values are now specified to be up to `2^{48}` bytes (256 TiB), reflecting the replica [PR](dfinity/ic#10574) for `wasm_memory_threshold` and the actual maximum allowed value for `wasm_memory_limit` already in place (`2^{48}` bytes rather than `2^{48}-1` bytes).
1 parent 9460269 commit a0bbab3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

docs/references/ic-interface-spec/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ sidebar:
1515
delegations are not accepted; the value `"all"` permits all kinds of requests, same as
1616
omitting the field. Requests of any kind carrying a delegation with any other value of
1717
the `permissions` field are not accepted.
18+
* `wasm_memory_threshold` in canister settings is now bounded by 2<sup>48</sup>, analogously to `wasm_memory_limit`.
1819

1920
### 0.63.0 (2026-06-29) {$0_63_0}
2021
* Support for the HTTP method `PATCH` in canister `http_request` in non-replicated mode.

docs/references/ic-interface-spec/management-canister.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The optional `settings` parameter can be used to set the following settings:
7979

8080
- `wasm_memory_limit` (`nat`)
8181

82-
Must be a number between 0 and 2<sup>48</sup>-1 (i.e., 256TB), inclusively, and indicates the upper limit on the WASM heap memory consumption of the canister in bytes.
82+
Must be a number between 0 and 2<sup>48</sup>, inclusively, and indicates the upper limit on the WASM heap memory consumption of the canister in bytes.
8383

8484
An operation (update method, canister init, canister post_upgrade) that causes the WASM heap memory consumption to exceed this limit will trap.
8585
The WASM heap memory limit is ignored for query methods, response callback handlers, global timers, heartbeats, and canister pre_upgrade.
@@ -115,7 +115,7 @@ The optional `settings` parameter can be used to set the following settings:
115115

116116
- `wasm_memory_threshold` (`nat`)
117117

118-
Must be a number between 0 and 2<sup>64</sup>-1, inclusively, and indicates the threshold on the remaining wasm memory size of the canister in bytes:
118+
Must be a number between 0 and 2<sup>48</sup>, inclusively, and indicates the threshold on the remaining wasm memory size of the canister in bytes:
119119
if the remaining wasm memory size of the canister is below the threshold, execution of the ["on low wasm memory" hook](./canister-interface.md#on-low-wasm-memory) is scheduled.
120120

121121
Default value: 0 (i.e., the "on low wasm memory" hook is never scheduled).

0 commit comments

Comments
 (0)