chore: sync midnight deps and compiler to latest#108
Conversation
The deployer (#86) moved to the midnight-js 4.1 / ledger-v8 / compact-runtime 0.16 stack, but the simulator and the repo-wide compiler pin were left behind on three different versions. * simulator: bump @midnight-ntwrk/compact-runtime 0.14.0 -> 0.16.0 and replace @midnight-ntwrk/ledger-v7 with ledger-v8 8.1.0. The v7->v8 API is signature-identical for every symbol the simulator uses, so the only source change is one test-fixture import path. * CI: bump the compiler pin 0.28.0 -> 0.31.0 in the setup action so the freshly compiled fixtures target runtime 0.16.0. * README: bump the compiler badge 0.29.0 -> 0.31.0. Verified locally: fixtures recompile to runtime-version 0.16.0 / compiler-version 0.31.0, and build, types, lint, and all 56 simulator tests pass. Refs: #107
WalkthroughThis PR synchronizes the repository versions to match the latest Midnight and Compact Compiler releases: Compact Compiler 0.31.0, compact-runtime 0.16.0, and ledger-v8 8.1.0. Changes span CI configuration, README documentation, simulator dependencies, and fixture imports. ChangesMidnight and Compact Compiler Version Synchronization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
57-58:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate example output to match the new compiler version.
The badge at the top of the README was updated to show version 0.31.0, but the example output in the "Confirm your Compact toolchain" section still displays version 0.29.0. This inconsistency should be corrected to maintain accurate documentation.
📝 Proposed fix to update example output
$ compact compile --version -Compactc version: 0.29.0 -0.29.0 +Compactc version: 0.31.0 +0.31.0🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@README.md` around lines 57 - 58, Update the example output lines that currently show "Compactc version: 0.29.0" and the standalone "0.29.0" in the "Confirm your Compact toolchain" section of README.md to the new compiler version "0.31.0" so the README example matches the badge; locate the example block containing the literal strings "Compactc version: 0.29.0" and "0.29.0" and replace them with "0.31.0".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/actions/setup/action.yml:
- Line 46: Update the CI action to ensure the selected compact toolchain
"compact-version" (currently "0.31.0") is actually installed with its compatible
runtime and note the breaking API change: ensure CI installs the matching
Compact runtime (e.g., runtime v0.16.0) and any companion Ledger versions per
the support matrix, and recompile contracts so code using the runtime API
(notably the changed function signature convertBytesToUint) is built against the
new runtime; specifically, adjust the setup step that references compact-version
and the contracts/build step to pin/verify Compact runtime version and trigger a
full recompile to avoid mismatched generated runtime/API.
---
Outside diff comments:
In `@README.md`:
- Around line 57-58: Update the example output lines that currently show
"Compactc version: 0.29.0" and the standalone "0.29.0" in the "Confirm your
Compact toolchain" section of README.md to the new compiler version "0.31.0" so
the README example matches the badge; locate the example block containing the
literal strings "Compactc version: 0.29.0" and "0.29.0" and replace them with
"0.31.0".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3f0d8d42-d7a3-40bf-a6a0-0ddc6cca34f2
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (4)
.github/actions/setup/action.ymlREADME.mdpackages/simulator/package.jsonpackages/simulator/test/fixtures/utils/address.ts
| uses: midnightntwrk/setup-compact-action@4130145456ad3f45934788dd4a65647eb283e658 # loose commit/not released | ||
| with: | ||
| compact-version: "0.28.0" | ||
| compact-version: "0.31.0" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify Compact Compiler 0.31.0 availability and check release notes
# Check if the version is documented in release notes
echo "Checking Midnight Compact compiler release notes..."
curl -s "https://docs.midnight.network/relnotes/compact/" | grep -i "0.31.0" || echo "Version 0.31.0 not found in release notes page"
# Check GitHub releases for midnightntwrk/compact if public
gh api repos/midnightntwrk/compact/releases --jq '.[] | select(.tag_name | contains("0.31") or contains("0.30") or contains("0.29")) | {tag_name, name, published_at}' 2>/dev/null || echo "Unable to fetch GitHub releases (repo may be private)"Repository: OpenZeppelin/compact-tools
Length of output: 7868
🌐 Web query:
Midnight Network Compact Compiler version 0.31.0 release notes and breaking changes
💡 Result:
As of June 8, 2026, Compact Compiler version 0.31.0 is the current version used in the Midnight Network ecosystem [1][2]. It utilizes Compact language version 0.23.0 [3]. Release Notes and Breaking Changes The official Midnight documentation provides a centralized location for release notes at https://docs.midnight.network/relnotes/compact [1]. While specific, granular breaking changes for the 0.31.0 release are bundled within the release artifacts themselves [4], developers are strongly advised to consult the Compatibility Matrix to ensure version alignment across the toolchain, runtime libraries, and SDKs [5][2]. Critical Integration Requirements For Compact Compiler 0.31.0, the following dependency versions are verified for compatibility [2]: - Compact Runtime: 0.16.0 - Ledger Version: 8.0.3 (Preprod/Mainnet) or 8.1.0 (Preview) - On-chain Runtime: 3.0.0 - Midnight.js: 4.1.1 Developers frequently encounter runtime errors when the generated contract code, the compiler version, and the runtime libraries (e.g., @midnight-ntwrk/compact-runtime) do not align [6][7]. To mitigate these issues: 1. Always verify your current version using the command compact --version [8]. 2. Align your package.json dependencies with the values specified in the official Compatibility Matrix [5][2]. 3. If errors persist, recompile your contracts using the specific compiler version that matches your environment's runtime [7]. You can manage your compiler version via the Compact toolchain CLI using compact update to fetch the latest version or compact update <version> for specific historical releases [1][8].
Citations:
- 1: https://docs.midnight.network/relnotes/compact
- 2: https://docs.midnight.network/relnotes/support-matrix
- 3: https://docs.midnight.network/compact/reference/ledger-adt
- 4: https://docs.midnight.network/relnotes/compact/toolchain-0.30.0
- 5: https://docs.midnight.network/how-to/fix-version-mismatches
- 6: https://dev.to/marmar9615cloud/building-private-signal-board-a-full-stack-midnight-dapp-with-compact-witnesses-react-and-41cm
- 7: https://docs.midnight.network/troubleshoot/compiler-errors
- 8: https://docs.midnight.network/getting-started/installation
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== toolchain-0.31.0 release notes (breaking/migration keywords) =="
curl -s "https://docs.midnight.network/relnotes/compact/toolchain-0.31.0" \
| rg -ni "breaking|migration|compat|upgrade|deprecat|breaking changes|breaking-change" \
|| echo "No breaking/migration keywords found by keyword scan."
echo
echo "== toolchain-0.28.0 release notes (breaking/migration keywords) =="
curl -s "https://docs.midnight.network/relnotes/compact/toolchain-0.28.0" \
| rg -ni "breaking|migration|compat|upgrade|deprecat|breaking changes|breaking-change" \
|| echo "No breaking/migration keywords found by keyword scan."
echo
echo "== support matrix: look for compiler/toolchain 0.31.0 compatibility entries =="
curl -s "https://docs.midnight.network/relnotes/support-matrix" \
| rg -ni "0\.31\.0|compactc-v0\.31\.0|0\.30\.0|0\.29\.0|0\.28\.0" \
| head -n 50Repository: OpenZeppelin/compact-tools
Length of output: 15489
Confirm Compact toolchain 0.31.0 exists and highlight the breaking change to account for in CI
File: .github/actions/setup/action.yml (line 46)
compact-version: "0.31.0"
- Midnight’s documentation includes a dedicated toolchain-0.31.0 / compactc-v0.31.0 release, so 0.31.0 is available for the toolchain/CI.
- toolchain-0.31.0 release notes list a breaking change: the Compact runtime function
convertBytesToUintsignature changed (breaking API). CI/tests that depend on generated output and/or the runtime API should ensure the matching runtime is used and contracts are recompiled with 0.31.0. - Midnight’s support matrix specifies companion versions for toolchain 0.31.0 (notably Compact runtime 0.16.0, plus Ledger 8.0.3 on Preprod/Mainnet or 8.1.0 on Preview); verify CI installs these compatible dependencies.
- A keyword scan of toolchain-0.28.0 didn’t surface obvious breaking/migration text, but 0.31.0’s documented breaking change still means the 0.28.0 → 0.31.0 upgrade path should be treated as breaking for runtime/API alignment.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/actions/setup/action.yml at line 46, Update the CI action to ensure
the selected compact toolchain "compact-version" (currently "0.31.0") is
actually installed with its compatible runtime and note the breaking API change:
ensure CI installs the matching Compact runtime (e.g., runtime v0.16.0) and any
companion Ledger versions per the support matrix, and recompile contracts so
code using the runtime API (notably the changed function signature
convertBytesToUint) is built against the new runtime; specifically, adjust the
setup step that references compact-version and the contracts/build step to
pin/verify Compact runtime version and trigger a full recompile to avoid
mismatched generated runtime/API.
What
Brings the monorepo up to the latest published Midnight + Compact compiler versions, following the deployer in #86.
@midnight-ntwrk/compact-runtime0.14.0 → 0.16.0,@midnight-ntwrk/ledger-v7→@midnight-ntwrk/ledger-v88.1.0.github/actions/setup/action.yml)Why
The deployer (#86) moved to the new stack, but the simulator stayed on compact-runtime 0.14 / ledger-v7, and the compiler version was inconsistent across the repo (CI 0.28.0, README 0.29.0, local toolchain 0.31.0).
Notes
QueryContext,CostModel,ChargedState,StateValue,ContractState,encodeContractAddress, …), so the only source change is one test-fixture import path.runtime-version: 0.16.0/compiler-version: 0.31.0, and build, types, lint, and all 56 simulator tests pass.Out of scope (follow-up in #86)
The deployer's own bump (midnight-js 4.1.0 → 4.1.1, ledger-v8 8.0.3 → 8.1.0) and the root
resolutionsrefresh land in #86, since neitherpackages/deployernor the resolutions block exists onmainyet.Closes #107
Summary by CodeRabbit