This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
[FINAL] feat: wasm_memory_persistence option for canister upgrades #281
Merged
Conversation
This file contains 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
mraszyk
commented
Mar 12, 2024
mraszyk
changed the title
feat: keep_main_memory option for canister upgrades
feat: wasm_memory_persistence option for canister upgrades
Mar 12, 2024
luc-blaeser
reviewed
Mar 12, 2024
luc-blaeser
reviewed
Mar 12, 2024
luc-blaeser
reviewed
Mar 12, 2024
luc-blaeser
reviewed
Mar 12, 2024
luc-blaeser
reviewed
Mar 12, 2024
crusso
reviewed
Mar 12, 2024
crusso
reviewed
Mar 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
luc-blaeser
approved these changes
Mar 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot Martin. This looks good.
Redirecting the review to @eust-dfinity and @alexandru-uta |
ulan
requested review from
alexandru-uta and
a user
and removed request for
ulan
March 13, 2024 09:21
mraszyk
commented
Mar 14, 2024
ghost
approved these changes
Mar 15, 2024
crusso
reviewed
Mar 18, 2024
crusso
reviewed
Mar 26, 2024
crusso
reviewed
Mar 26, 2024
crusso
reviewed
Mar 26, 2024
crusso
reviewed
Mar 26, 2024
crusso
reviewed
Mar 26, 2024
crusso
reviewed
Mar 26, 2024
Co-authored-by: Claudio Russo <claudio@dfinity.org>
crusso
reviewed
Apr 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Dfinity-Bjoern
approved these changes
Apr 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense thanks for the update @mraszyk
Dfinity-Bjoern
changed the title
feat: wasm_memory_persistence option for canister upgrades
[FINAL] feat: wasm_memory_persistence option for canister upgrades
Apr 23, 2024
luc-blaeser
added a commit
to luc-blaeser/ic
that referenced
this pull request
Apr 29, 2024
feat(IC-1635): Keep main memory on upgrade option Introducing a new upgrade option `wasm_memory_persistence` to retain the main memory on a canister upgrade. This is part of the required IC extension to support Motoko's enhanced orthogonal persistence (IC-1635, cf. dfinity/motoko#4225) and requires support for passive data segments (cf. https://gitlab.com/dfinity-lab/public/ic/-/merge_requests/17892). See dfinity/interface-spec#281 for the corresponding IC specification extension. Specific design aspects: * The option `wasm_memory_persistence` can be omitted for backwards compatibility. * A variant type has been chosen for `wasm_memory_persistence` to allow extendibility in the future, e.g. if multiple Wasm memories would be supported. * When set to `opt keep`, the upgrade retains both main memory and stable memory. Otherwise, the existing behavior of only retaining the stable memory and reinitializing the main memory is applied. * As a safety guard, programs with enhanced orthogonal persistence (i.e. Motoko) can add a custom section `enhanced-orthogonal-persistence` into the Wasm. When this is specified, the runtime system checks that the `wasm_memory_persistence` option is not omitted in error. This is to prevent accidental data loss for enhanced orthogonal persistence. Moreover, the system checks that `wasm_memory_persistence: opt keep` is only applied to canisters with enhanced orthogonal persistence. * For convenience, `drun` is adjusted to automatically apply `wasm_memory_persistence: opt keep` for canisters that have the `enhanced-orthogonal-persistence` section specified. See merge request dfinity-lab/public/ic!17893
gitlab-dfinity
pushed a commit
to dfinity/ic
that referenced
this pull request
Apr 30, 2024
feat(IC-1635): Keep main memory on upgrade option Introducing a new upgrade option `wasm_memory_persistence` to retain the main memory on a canister upgrade. This is part of the required IC extension to support Motoko's enhanced orthogonal persistence (IC-1635, cf. dfinity/motoko#4225) and requires support for passive data segments (cf. https://gitlab.com/dfinity-lab/public/ic/-/merge_requests/17892). See dfinity/interface-spec#281 for the corresponding IC specification extension. Specific design aspects: * The option `wasm_memory_persistence` can be omitted for backwards compatibility. * A variant type has been chosen for `wasm_memory_persistence` to allow extendibility in the future, e.g. if multiple Wasm memories would be supported. * When set to `opt keep`, the upgrade retains both main memory and stable memory. Otherwise, the existing behavior of only retaining the stable memory and reinitializing the main memory is applied. * As a safety guard, programs with enhanced orthogonal persistence (i.e. Motoko) can add a custom section `enhanced-orthogonal-persistence` into the Wasm. When this is specified, the runtime system checks that the `wasm_memory_persistence` option is not omitted in error. This is to prevent accidental data loss for enhanced orthogonal persistence. Moreover, the system checks that `wasm_memory_persistence: opt keep` is only applied to canisters with enhanced orthogonal persistence. * For convenience, `drun` is adjusted to automatically apply `wasm_memory_persistence: opt keep` for canisters that have the `enhanced-orthogonal-persistence` section specified. See merge request dfinity-lab/public/ic!17893
mraszyk
commented
May 7, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR adds an option (called
wasm_memory_persistence
) for canister upgrades. If this option is set, then the WebAssembly memory of the old canister is preserved across the upgrade.