How to check for enhanced orthogonal persistence? (bug?)

How to check whether a canister was compiled with enhanced orthogonal persistence?

I see errors like:

Invalid upgrade option: The `wasm_memory_persistence: opt Keep` upgrade option requires that the new canister module supports enhanced orthogonal persistence.

even despite I have in dfx.json:

  "defaults": {
    "build": {
      "args": "--enhanced-orthogonal-persistence",
      "packtool": "mops sources"
    }
  },

So, it seems EOP doesn’t work for me.

I do upgrades by CyclesLedger.install_code:

            let newCanisterId = switch (canister_id) {
                case (?canister_id) {
                    let mode2 = if (wasmModule.forceReinstall) {
                        #reinstall
                    } else {
                        #upgrade (?{ wasm_memory_persistence = ?#keep; skip_pre_upgrade = ?false }); // TODO: Check modes carefully.
                    };
                    // TODO: consider invoking user's callback if needed.
                    let simple: SimpleIndirect.SimpleIndirect = actor(Principal.toText(simpleIndirect));
                    await simple.install_code({
                        sender_canister_version = null; // TODO: set appropriate value if needed.
                        arg = to_candid({
                            packageManagerOrBootstrapper;
                            mainIndirect;
                            simpleIndirect;
                            user;
                            installationId;
                            upgradeId;
                            userArg = ?upgradeArg;
                        });
                        wasm_module;
                        mode = mode2;
                        canister_id;
                    }, 1000_000_000_000); // TODO
                    canister_id;
                };
...

I use today versions of DFX and moc.

Also, it’s unclear, how to upgrade from 32 bit to EOP.

this needs to go in canisters.<canister name>.args for every canister. E.g. like this:

{
  "canisters": {
    "backend": {
      "main": "backend/app.mo",
      "type": "motoko",
      "args": "--enhanced-orthogonal-persistence"
    }
}

A wasm file was compiled with EOP if the enhanced-orthogonal-persistence metadata section is set in the WASM.

You can just dfx deploy over the existing wasm

Does it mean that defaults.build.args does not work? I wonder why it’s not highlighted as a wrong syntax in MS Code with the ICP extension.

It is a valid field, but I don’t remember what it is used for

1 Like