You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 01edb5d
Browse filesBrowse the repository at this point in the historyBrowse files
chore(motoko): bump dev-env to v2.0.0, moc to 1.14.1, mo:core to 2.6.1 (#1476)
dfinity/icp-dev-env v2.0.0 bundles mops-cli 3.1.0, which the mops-cli and
writing-motoko skills now assume as a floor (moc >= 1.11.2, core >= 2.5.0).
Every motoko example was below that floor (mostly moc 1.8.2-1.13.0).
- Bump the dev-env container image pin (v1.2.0 -> v2.0.0) in both guarded
locations: .devcontainer/devcontainer.json and _run-example.yml.
- Bump moc to 1.14.1 and mo:core to 2.6.1 across all ~30 motoko mops.toml
files via `mops toolchain use`/`mops add` (never hand-edited).
- Fix the new compiler warnings the bump surfaced, per the writing-motoko
skill: deprecated Blob/Array/Nat conversions replaced with dot-notation
equivalents (.toBlob(), .toArray(), .toNat64()/.toNat8(), .toText()),
redundant `persistent` on actor classes removed (verified empirically on
canister_factory and composite_query that --default-persistent-actors now
covers spawned actor-class sub-WASMs too, under moc 1.14.1 - state survives
upgrade without the keyword), unused HTTP-outcall `context` params
underscore-prefixed, `var` map bindings that are never reassigned changed
to `let`, and redundant `ignore` removed from Map.remove calls (which
return unit, unlike Map.insert).
- Correct the AGENTS.md actor-class persistence caveat to match the verified
moc 1.14.1 behavior.
Left as-is (not fixed): a few `operator may trap for Nat` warnings on
subtractions that are already correctly guarded by a preceding bounds check
(icrc2-swap, random_maze, threshold-ecdsa/SHA256.mo) - the compiler's flow
analysis can't see across the branch, but the code is safe; and an
"importing Candid service constructor as instantiated service" warning on
three vendored third-party .did files (icp_ledger, icrc1_ledger, evm_rpc)
used via --actor-id-alias/--actor-env-alias - editing a vendored interface
file to silence a new moc parsing nuance was judged out of scope here.
Verified: `mops check` and `mops build` pass clean (bar the above) across
all 34 motoko canisters, and full local test.sh runs pass for
canister_factory and composite_query (the two actor-class-persistence
examples) confirming no upgrade-state regression.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
`--default-persistent-actors`makes the **main actor** persistent by default, so the `persistent` keyword is omitted on the top-level `actor` declaration. `persistent actor class` declarations holding mutable state must still carry the keyword explicitly — the flag does not propagate into actor class sub-WASMs.
260
+
`--default-persistent-actors` makes every actor persistent by default, including spawned `actor class` sub-WASMs — so the `persistent` keyword is omitted everywhere: on the top-level `actor` declaration and on `actor class` declarations alike (verified with `moc` 1.14.1: an `actor class` holding mutable `var` fields compiles and preserves state across `#upgrade` without the keyword, under this flag). If `moc` warns `M0217` ("the `persistent` keyword is redundant") on an `actor class`, remove it rather than keeping it "to be safe" — it is genuinely redundant.
0 commit comments