Skip to content

chore: sync midnight deps and compiler to latest#108

Merged
0xisk merged 1 commit into
mainfrom
chore/sync-midnight-compiler-versions
Jun 8, 2026
Merged

chore: sync midnight deps and compiler to latest#108
0xisk merged 1 commit into
mainfrom
chore/sync-midnight-compiler-versions

Conversation

@0xisk

@0xisk 0xisk commented Jun 8, 2026

Copy link
Copy Markdown
Member

What

Brings the monorepo up to the latest published Midnight + Compact compiler versions, following the deployer in #86.

  • simulator: @midnight-ntwrk/compact-runtime 0.14.0 → 0.16.0, @midnight-ntwrk/ledger-v7@midnight-ntwrk/ledger-v8 8.1.0
  • CI: compiler pin 0.28.0 → 0.31.0 (.github/actions/setup/action.yml)
  • README: compiler badge 0.29.0 → 0.31.0

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

  • The v7→v8 ledger API is signature-identical for every symbol the simulator uses (QueryContext, CostModel, ChargedState, StateValue, ContractState, encodeContractAddress, …), so the only source change is one test-fixture import path.
  • Simulator fixtures are gitignored and recompiled at test time, so they pick up runtime 0.16.0 automatically. Verified locally: regenerated artifacts report 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 resolutions refresh land in #86, since neither packages/deployer nor the resolutions block exists on main yet.

Closes #107

Summary by CodeRabbit

  • Chores
    • Updated Compact Compiler to version 0.31.0
    • Upgraded compact-runtime dependency to version 0.16.0
    • Updated ledger dependency to the latest v8 version (8.1.0)
    • Updated documentation and setup configurations to reflect new tool versions

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
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This 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.

Changes

Midnight and Compact Compiler Version Synchronization

Layer / File(s) Summary
Compiler version pinning and documentation
.github/actions/setup/action.yml, README.md
CI action installs Compact Compiler 0.31.0 instead of 0.28.0; README badge and example output updated from 0.29.0 to 0.31.0.
Simulator dependency and import updates
packages/simulator/package.json, packages/simulator/test/fixtures/utils/address.ts
Simulator dependencies bumped: @midnight-ntwrk/compact-runtime to 0.16.0 and @midnight-ntwrk/ledger-v7 replaced by @midnight-ntwrk/ledger-v8 8.1.0; fixture import for encodeContractAddress updated to use ledger-v8 source.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 The versions march onward, each number precise,
From 0.28 to 0.31, spiced with spice!
Ledger leaps forward, from v7 to v8,
Runtime revised—no breaking fate,
One import adjusted, and all is aligned.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: sync midnight deps and compiler to latest' accurately describes the main objective of updating Midnight dependencies and Compact compiler versions across the monorepo.
Linked Issues check ✅ Passed All coding requirements from issue #107 are met: simulator dependencies (@midnight-ntwrk/compact-runtime 0.14.0→0.16.0, ledger-v7→v8), single fixture import path update, CI compiler pin (0.28.0→0.31.0), and README badge (0.29.0→0.31.0) are all implemented.
Out of Scope Changes check ✅ Passed All changes are scoped to issue #107 requirements: simulator dependencies, fixture imports, CI compiler version, and documentation updates. Deployer-specific changes are correctly deferred to issue #86 as intended.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sync-midnight-compiler-versions

Comment @coderabbitai help to get the list of available commands and usage tips.

@0xisk 0xisk self-assigned this Jun 8, 2026
@0xisk 0xisk added the enhancement New feature or request label Jun 8, 2026
@0xisk 0xisk marked this pull request as ready for review June 8, 2026 11:07
@0xisk 0xisk requested review from a team as code owners June 8, 2026 11:07

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Update 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

📥 Commits

Reviewing files that changed from the base of the PR and between 52509e1 and a0612d8.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • .github/actions/setup/action.yml
  • README.md
  • packages/simulator/package.json
  • packages/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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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:


🏁 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 50

Repository: 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 convertBytesToUint signature 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.

@0xisk 0xisk merged commit 8492388 into main Jun 8, 2026
10 checks passed
@0xisk 0xisk deleted the chore/sync-midnight-compiler-versions branch June 8, 2026 11:36
@github-project-automation github-project-automation Bot moved this from Backlog to Complete/Stable Release in OZ Development for Midnight Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Complete/Stable Release

Development

Successfully merging this pull request may close these issues.

Sync monorepo to latest Midnight + Compact compiler versions

2 participants