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

**URL:** <https://forum.midnight.network/t/systemic-toolchain-issues-runtime-mismatch-deploy-failure-after-fix-contractmaintenanceauthority-error/1095>\
**Category:** Technical Questions\
**Tags:** compact\
**Created:** [March 23, 2026, 7:44am UTC](https://forum.midnight.network/t/systemic-toolchain-issues-runtime-mismatch-deploy-failure-after-fix-contractmaintenanceauthority-error/1095 "2026-03-23T07:44:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tusharpamnani](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/tusharpamnani/32/498_2.png) [@tusharpamnani](https://forum.midnight.network/u/tusharpamnani)\
**Post date:** [March 23, 2026, 7:44am UTC](https://forum.midnight.network/t/systemic-toolchain-issues-runtime-mismatch-deploy-failure-after-fix-contractmaintenanceauthority-error/1095/1 "2026-03-23T07:44:23Z")

</div>

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:

```auto
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:

```auto
@midnight-ntwrk/compact-runtime → 0.15.0

```

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

```auto
Error: Unexpected error: Error: expected instance of ContractMaintenanceAuthority

```

### Stack trace (excerpt)

```auto
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 → ❌ fails

- Manual fix → ❌ 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”.

* * *

---

<div class="post-metadata">

**Author:** ![barnazaka](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/barnazaka/32/542_2.png) [@barnazaka](https://forum.midnight.network/u/barnazaka)\
**Post date:** [March 27, 2026, 3:29pm UTC](https://forum.midnight.network/t/systemic-toolchain-issues-runtime-mismatch-deploy-failure-after-fix-contractmaintenanceauthority-error/1095/2 "2026-03-27T15:29:50Z")

</div>

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:

3. Run `npm install` after clearing old modules.

4. Verify versions with:

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.

---

<div class="post-metadata">

**Author:** ![tusharpamnani](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/tusharpamnani/32/498_2.png) [@tusharpamnani](https://forum.midnight.network/u/tusharpamnani)\
**Post date:** [March 27, 2026, 7:13pm UTC](https://forum.midnight.network/t/systemic-toolchain-issues-runtime-mismatch-deploy-failure-after-fix-contractmaintenanceauthority-error/1095/3 "2026-03-27T19:13:06Z")

</div>

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

```json
"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"
  }

```

---

<div class="post-metadata">

**Author:** ![doctorvenables](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/doctorvenables/32/560_2.png) [@doctorvenables](https://forum.midnight.network/u/doctorvenables)\
**Post date:** [April 11, 2026, 11:13am UTC](https://forum.midnight.network/t/systemic-toolchain-issues-runtime-mismatch-deploy-failure-after-fix-contractmaintenanceauthority-error/1095/4 "2026-04-11T11:13:14Z")

</div>

Neither of these fixes ‘fixed’ the issues the OP had which I have reproduced.

@barnazaka - there is no clear way to do this in the package.json. Simply adding them to the package.json causes installation failure.

@tusharpamnani - this approach means you have to change the docker-compose so that the docker image for the proofserver version number has to match i.e. here proofserver 8.0.3. Which still doesn’t work. One of those wallet-sdk-\* package versions doesn’t exist…

---

<div class="post-metadata">

**Author:** ![tusharpamnani](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/tusharpamnani/32/498_2.png) [@tusharpamnani](https://forum.midnight.network/u/tusharpamnani)\
**Post date:** [April 11, 2026, 11:26am UTC](https://forum.midnight.network/t/systemic-toolchain-issues-runtime-mismatch-deploy-failure-after-fix-contractmaintenanceauthority-error/1095/5 "2026-04-11T11:26:04Z")

</div>

hey, you can refer to the implementation here: [tusharpamnani/midnight-hello-world](https://github.com/tusharpamnani/midnight-hello-world)  
it has a fully fixed working example of the hello world contract

---

<div class="post-metadata">

**Author:** ![doctorvenables](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/doctorvenables/32/560_2.png) [@doctorvenables](https://forum.midnight.network/u/doctorvenables)\
**Post date:** [April 11, 2026, 11:38am UTC](https://forum.midnight.network/t/systemic-toolchain-issues-runtime-mismatch-deploy-failure-after-fix-contractmaintenanceauthority-error/1095/6 "2026-04-11T11:38:41Z")

</div>

Hi - thanks for that! I’ll give that a go this afternoon.

I’m interested - what changes to the original code did you make or was it simply the dependencies that needed aligning?
