Skip to content

Commit

Permalink
fix: Use lower case for Wasm persistence modes (#3479)
Browse files Browse the repository at this point in the history
Change variant names for the Wasm memory persistence to lower case in
line with the IC specification, i.e. using `keep` and `replace` instead
of `Keep` and `Replace`. The Wasm memory persistence option is used for
Motoko's enhanced orthogonal persistence, which is currently still in
beta testing.

The following components need to be updated once these changes are
released on IC mainnet and `dfx`:
* The Motoko compiler (dfinity/motoko#4854)
* The Motoko playground
(dfinity/motoko-playground#275)

No change is needed for `dfx`.

For installed Motoko programs using enhanced orthogonal persistence, the
change only affects the programmatic upgrades of Motoko actor class
instances. Existing such programs would need to be recompiled with a new
Motoko compiler and upgraded. The IC detects mismatching variant names
of Wasm memory persistence by raising an error while still preserving
persistent memory.
  • Loading branch information
luc-blaeser authored Jan 17, 2025
1 parent cf94f35 commit a587858
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rs/types/management_canister_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,9 +1220,11 @@ pub enum CanisterInstallMode {
pub enum WasmMemoryPersistence {
/// Retain the main memory across upgrades.
/// Used for enhanced orthogonal persistence, as implemented in Motoko
#[serde(rename = "keep")]
Keep,
/// Reinitialize the main memory on upgrade.
/// Default behavior without enhanced orthogonal persistence.
#[serde(rename = "replace")]
Replace,
}

Expand Down

0 comments on commit a587858

Please sign in to comment.