-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FINAL] feat: on low wasm memory hook #3761
base: master
Are you sure you want to change the base?
Conversation
This property is not established by the implementation. |
The implementation only considers stable memory and ignores, e.g., the chunk store and snapshot size, when deriving the wasm memory capacity. |
The hook should not run after an upgrade/reinstall/uninstall/install if the condition is not satisfied after the upgrade (although the condition was satisfied before the upgrade and the hook did not execute yet). |
🤖 Here's your preview: https://xaml7-fiaaa-aaaam-abdka-cai.icp0.io |
Regarding the point: |
Yes, e.g., if the canister does not have any pre- and post-upgrade hooks (in which case there's no wasm execution during canister installation). |
…#2864) To support `on_low_wasm_memory` hook we are adding `wasm_memory_threshold` to `NNS` so it allows users to update its value using `NNS` proposal. We are as well adding `wasm_memory_threshold` to canister settings to canisters in `IC` repo. The `wasm_memory_threshold` will be added to the interface specification in dfinity/portal#3761 --------- Co-authored-by: Andre Popovitch <[email protected]> Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
This proposal is based on this forum post and has already been approved by motion proposal 106146.
Canister developers have to actively monitor their canisters to know if they are low on wasm memory. If detected too late, a canister can be completely stuck and forever un-upgradable.
To address this, we introduce a hook called on_low_wasm_memory. When defined, it is triggered whenever the canister's memory usage exceeds some developer-defined threshold.