-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'luc/ic-keep-main-memory-option' into 'master'
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
- Loading branch information
Showing
20 changed files
with
701 additions
and
60 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
Oops, something went wrong.