Draft
Conversation
Contributor
|
🤖 Here's your preview: https://uy5c7-yiaaa-aaaam-abxxa-cai.icp0.io |
|
|
||
| - 1 : The [instruction limit per update message](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/settings#wasm-memory-limit). | ||
|
|
||
| - 2 : The [instruction limit per upgrade message](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/settings#wasm-memory-limit). |
Contributor
There was a problem hiding this comment.
We should explain in more detail what we mean here – sum of pre_upgrade and post_upgrade?
|
|
||
| - 3 : The [maximum number of stable memory Wasm pages that can be accessed per update message](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/settings#wasm-memory-limit). | ||
|
|
||
| - 4 : The [maximum number of stable memory Wasm pages that can be accessed per upgrade message](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/settings#wasm-memory-limit). |
Contributor
There was a problem hiding this comment.
See above, "upgrade message" is not a term we use elsewhere.
|
|
||
| ### Canister limit {#system-api-canister-limit} | ||
|
|
||
| The canister can query one of the "canister limits", which denotes a resource limit of the canister imposed by the current configuration of the IC and/or canister. This allows runtime logic, such garbage collector or persistence mechanism, to adapt to the system limits without recompilation and redeployment. |
Contributor
There was a problem hiding this comment.
Do we return the limit (meaning: the constant) or the remaining budget in the current execution?
|
|
||
| `ic0.canister_limit : (limit_type : i32) -> i64` | ||
|
|
||
| The argument `limit_type` determines which resource limit to return: |
Contributor
There was a problem hiding this comment.
Should we add a limit for the remaining memory (heap or stable) pages that could still be allocated by the canister?
mraszyk
commented
Nov 19, 2024
|
|
||
| The argument `limit_type` determines which resource limit to return: | ||
|
|
||
| - 0 : The [soft Wasm heap memory limit](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/settings#wasm-memory-limit), or the IC-defined [hard Wasm memory limit](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/resource-limits#resource-constraints-and-limits), whatever is smaller. The limit is specific to the canister, depending on the canister configuration (for the soft limit) and on whether it uses 32-bit or 64-bit Wasm memory. |
Contributor
Author
There was a problem hiding this comment.
Should this also consider the subnet available memory?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add function to query current resource limit for the canister.