Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ runs:
if: ${{ inputs.skip-compact != 'true' }}
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.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Generic badge](https://img.shields.io/badge/Compact%20Compiler-0.29.0-1abc9c.svg)](https://docs.midnight.network/relnotes/compact/)
[![Generic badge](https://img.shields.io/badge/Compact%20Compiler-0.31.0-1abc9c.svg)](https://docs.midnight.network/relnotes/compact/)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/OpenZeppelin/compact-tools/badge)](https://api.securityscorecards.dev/projects/github.com/OpenZeppelin/compact-tools)

Expand Down
4 changes: 2 additions & 2 deletions packages/simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"vitest": "^4.1.6"
},
"dependencies": {
"@midnight-ntwrk/compact-runtime": "0.14.0",
"@midnight-ntwrk/ledger-v7": "^7.0.0"
"@midnight-ntwrk/compact-runtime": "0.16.0",
"@midnight-ntwrk/ledger-v8": "8.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/simulator/test/fixtures/utils/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
convertFieldToBytes,
encodeCoinPublicKey,
} from '@midnight-ntwrk/compact-runtime';
import { encodeContractAddress } from '@midnight-ntwrk/ledger-v7';
import { encodeContractAddress } from '@midnight-ntwrk/ledger-v8';
import type * as Compact from '../artifacts/SampleZOwnable/contract/index.js';

const PREFIX_ADDRESS = '0200';
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -166,28 +166,28 @@ __metadata:
languageName: node
linkType: hard

"@midnight-ntwrk/compact-runtime@npm:0.14.0":
version: 0.14.0
resolution: "@midnight-ntwrk/compact-runtime@npm:0.14.0"
"@midnight-ntwrk/compact-runtime@npm:0.16.0":
version: 0.16.0
resolution: "@midnight-ntwrk/compact-runtime@npm:0.16.0"
dependencies:
"@midnight-ntwrk/onchain-runtime-v2": "npm:^2.0.0"
"@midnight-ntwrk/onchain-runtime-v3": "npm:^3.0.0"
"@types/object-inspect": "npm:^1.8.1"
object-inspect: "npm:^1.12.3"
checksum: 10/bba44d09770b172b7a5ba193f59d2ec57ca0dff2e3fd538326942e102e8cbe0b0cc1cb736e1f469afc74258517e7d25fc4dfa7f89a299aed900efc89f1eed3a7
checksum: 10/ef0c68d53bba6a04f336094c82c26b781082d7ce4ee09f0539009fb108776b36ea24b9a774292d9bbf9722b8a78d47254b5f80a613d4010a7f7d108514243023
languageName: node
linkType: hard

"@midnight-ntwrk/ledger-v7@npm:^7.0.0":
version: 7.0.3
resolution: "@midnight-ntwrk/ledger-v7@npm:7.0.3"
checksum: 10/49f59fa611996a1514f3143828e240cff7d34db7cdaf76b2131b346687139b81dc9ecd7870b29103962cf3c296cd0d11aebf1cc7b2bf0f6a3bf9263d3af19815
"@midnight-ntwrk/ledger-v8@npm:8.1.0":
version: 8.1.0
resolution: "@midnight-ntwrk/ledger-v8@npm:8.1.0"
checksum: 10/10d56076b0333a502f157c816f8cfebefc8d50221cb20c6db15abcbf2d0092bdaf7e9bc1bd19a6d9f51455547c713c916cb16d4a7d18e83cba0e172ad6e2a507
languageName: node
linkType: hard

"@midnight-ntwrk/onchain-runtime-v2@npm:^2.0.0":
version: 2.0.1
resolution: "@midnight-ntwrk/onchain-runtime-v2@npm:2.0.1"
checksum: 10/40ffba7809ecbf9e7e4fd98e7e025922ba72ff667d15f7737b9a2b913558688f19552ef40a63a1379b348a4e5c85e4257f6f485d6b09d15c2b5e4ca0149613b0
"@midnight-ntwrk/onchain-runtime-v3@npm:^3.0.0":
version: 3.0.0
resolution: "@midnight-ntwrk/onchain-runtime-v3@npm:3.0.0"
checksum: 10/873aeb9e631c3678373c62b5aef847de454de94427028fb3d3f28bfdc8b2c02a3c770bd79d9bfef183eb9db6fb8c23e6826636f2e512ffd6eacbcf7cc0651c5d
languageName: node
linkType: hard

Expand Down Expand Up @@ -240,8 +240,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@openzeppelin/compact-simulator@workspace:packages/simulator"
dependencies:
"@midnight-ntwrk/compact-runtime": "npm:0.14.0"
"@midnight-ntwrk/ledger-v7": "npm:^7.0.0"
"@midnight-ntwrk/compact-runtime": "npm:0.16.0"
"@midnight-ntwrk/ledger-v8": "npm:8.1.0"
"@tsconfig/node24": "npm:^24.0.3"
"@types/node": "npm:25.9.1"
fast-check: "npm:^4.5.2"
Expand Down
Loading