Systemic toolchain issues: runtime mismatch + deploy failure after fix (ContractMaintenanceAuthority error)

I’m running into a blocking issue across all Midnight contracts, and it seems like a broader toolchain inconsistency rather than a local setup problem.


1) Runtime Version Mismatch (default state)

Out of the box, all contracts fail with:

CompactError: Version mismatch: compiled code expects 0.15.0, runtime is 0.14.0

Observations

  • Contracts appear to be compiled against compact 0.15.0

  • But dependency resolution installs @midnight-ntwrk/compact-runtime 0.14.0

  • Happens across fresh installs and multiple example repos


2) After Manually Fixing Runtime → New Failure

If I manually upgrade:

@midnight-ntwrk/compact-runtime → 0.15.0

The version mismatch is resolved, but deployment still fails, now with:

Error: Unexpected error: Error: expected instance of ContractMaintenanceAuthority

Stack trace (excerpt)

at set maintenanceAuthority (.../midnight_onchain_runtime_wasm_bg.js:1365:9)
at ContractExecutableImpl.<anonymous> (.../ContractExecutable.ts:337:49)


Environment

  • Node.js: v24.14.0

  • Clean install (rm -rf node_modules && npm install)

  • Reproducible across multiple contracts (e.g. hello-world)

  • Using preprod + proof server (working correctly)


Key Insight

There seems to be no version alignment across the stack, specifically between:

  • compact

  • @midnight-ntwrk/compact-runtime

  • @midnight-ntwrk/compact-js

  • @midnight-ntwrk/onchain-runtime-v3

  • @midnight-ntwrk/midnight-js-*

Fixing one layer (runtime) exposes incompatibility in another (onchain runtime / contract execution).


Questions

  1. Is there an official version matrix for the full toolchain?

  2. Are the current example repos out of sync with the latest releases?

  3. What is the correct set of versions that actually works end-to-end?

  4. Is this related to a recent upgrade to 0.15.x that hasn’t been propagated fully?


Why this matters

Right now:

  • Default setup → :cross_mark: fails

  • Manual fix → :cross_mark: still fails differently

This effectively blocks:

  • New developers onboarding

  • Contract deployment even for basic examples


Happy to help debug further or test fixes, but would really appreciate clarity on the correct version alignment.


At the moment, the toolchain feels internally inconsistent — fixing one layer just exposes another break. Would be great to get a canonical “known working setup”.


1 Like

Hi,

The issue is caused by a mismatch across the Midnight toolchain packages. Here’s a step-by-step fix that should unblock you:

  1. Delete your node_modules and package-lock.json to start fresh.

  2. Ensure all key packages are aligned to version 0.15.0:

    • compact → 0.15.0

    • @midnight-ntwrk/compact-runtime → 0.15.0

    • @midnight-ntwrk/compact-js → 0.15.0

    • @midnight-ntwrk/onchain-runtime-v3 → 0.15.0

    • @midnight-ntwrk/midnight-js-* → 0.15.0

  3. Run npm install after clearing old modules.

  4. Verify versions with:

    npm list @midnight-ntwrk/compact-runtime
    npm list @midnight-ntwrk/onchain-runtime-v3
    
    
  5. Deploy your contract again. Ensure the ContractMaintenanceAuthority instance exists in the runtime before calling any maintenance functions.

This setup should resolve both the runtime mismatch and the ContractMaintenanceAuthority error.

Let me know how it goes and if the deployment works, so we can confirm the fix.

hey, i figured out the list of compatible dependencies. sharing here so that everyone could refer it:

"dependencies": {
    "@midnight-ntwrk/compact-runtime": "0.15.0",
    "@midnight-ntwrk/ledger-v8": "8.0.3",
    "@midnight-ntwrk/midnight-js-contracts": "4.0.2",
    "@midnight-ntwrk/midnight-js-http-client-proof-provider": "4.0.2",
    "@midnight-ntwrk/midnight-js-indexer-public-data-provider": "4.0.2",
    "@midnight-ntwrk/midnight-js-level-private-state-provider": "4.0.2",
    "@midnight-ntwrk/midnight-js-network-id": "4.0.2",
    "@midnight-ntwrk/midnight-js-node-zk-config-provider": "4.0.2",
    "@midnight-ntwrk/midnight-js-types": "4.0.2",
    "@midnight-ntwrk/midnight-js-utils": "4.0.2",
    "@midnight-ntwrk/wallet-sdk-address-format": "3.1.0",
    "@midnight-ntwrk/wallet-sdk-dust-wallet": "3.0.0",
    "@midnight-ntwrk/wallet-sdk-facade": "3.0.0",
    "@midnight-ntwrk/wallet-sdk-hd": "3.0.1",
    "@midnight-ntwrk/wallet-sdk-shielded": "2.1.0",
    "@midnight-ntwrk/wallet-sdk-unshielded-wallet": "2.1.0",
    "ws": "^8.19.0"
  }