chore(motoko): bump dev-env to v2.0.0, moc to 1.14.1, mo:core to 2.6.1 - #1476
Merged
Conversation
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>
marc0olo
marked this pull request as ready for review
August 24, 2026 16:57
raymondk
approved these changes
Aug 24, 2026
mbjorkqvist
approved these changes
Aug 25, 2026
eichhorl
approved these changes
Aug 25, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
dfinity/icp-dev-envv2.0.0 bundlesmops-cli3.1.0 (and Rust 1.98.0). Themops-cliandwriting-motokoICP skills now state a compatibility floor ofmops >= 3.1.0,moc >= 1.11.2,core >= 2.5.0— every motoko example here was below that (mostlymoc1.8.2–1.13.0).v1.2.0→v2.0.0) in both guarded locations:.devcontainer/devcontainer.jsonand_run-example.yml.mocto1.14.1andmo:coreto2.6.1across all ~30 motokomops.tomlfiles, viamops toolchain use/mops add(never hand-edited).writing-motokoskill: deprecatedBlob/Array/Natconversions replaced with dot-notation equivalents (.toBlob(),.toArray(),.toNat64()/.toNat8(),.toText()); redundantpersistentremoved from actor classes (verified empirically — see below); unused HTTP-outcallcontextparams underscore-prefixed;varmap bindings that are never reassigned changed tolet; redundantignoreremoved fromMap.removecalls.AGENTS.mdcaveat about actor-class persistence that turned out to be stale (see below).Actor-class persistence finding:
AGENTS.mdused to say--default-persistent-actorsdoes not propagate into spawnedactor classsub-WASMs (e.g.canister_factory'sCounter), so those neededpersistentkept explicit. Undermoc1.14.1,mocitself now flags thatpersistentas redundant (M0217). I verified empirically rather than trust the warning blindly: dropped the keyword and rancanister_factory's fulltest.sh, including the test that adds to a spawned counter's value, upgrades it, and asserts the value survived — it passed. Same check oncomposite_query'sBucket. So the flag now covers actor classes too, andAGENTS.mdhas been updated to match.Left as-is (not "fixed"):
operator may trap for Nat(M0155) warnings on subtractions that are already correctly guarded by an immediately-preceding bounds check (icrc2-swap,random_maze,threshold-ecdsa/SHA256.mo) — moc's flow analysis can't see across the branch, but the code is safe and in one case already has a comment saying so. Rewriting a hand-rolled SHA256 or a balance-debit path to silence an advisory warning felt like the wrong risk/reward trade.importing Candid service constructor as instantiated servicewarning (M0185) on three vendored third-party.didfiles (icp_ledger.did,icrc1_ledger.did,evm_rpc.did) used via--actor-id-alias/--actor-env-alias. Editing a vendored candid interface to satisfy a new moc parsing nuance seemed out of scope for this PR.On ICP Ninja compatibility
None of this relies on any mops-v3-specific feature —
[toolchain]pinning,[dependencies],[moc] args, and[canisters.<name>]are all mops CLI ≥2.2.0 syntax, and the moc/core version bump is orthogonal to the mops CLI major version. So this isn't gated on Ninja's build backend supporting mops v3 in particular. The residual, ordinary question — whether Ninja's backend (which doesn't use this repo's devcontainer/CI image at all) resolvesmoc1.14.1 /core2.6.1 cleanly — is a normal toolchain-bump consideration, not a blocker specific to this change.Test plan
mops checkpasses clean (bar the two categories of accepted warnings noted above) on all 34 motoko canisters across ~30 examplesmops buildsucceeds on all 34 motoko canisterscanister_factory's fulltest.shpasses locally, including the upgrade-preserves-state / reinstall-resets-state assertionscomposite_query's fulltest.shpasses locally (itsBucketactor class also lost its explicitpersistent)🤖 Generated with Claude Code