Update example-bboard for the current Midnight compatibility matrix#1358
Update example-bboard for the current Midnight compatibility matrix#1358jmaciaal wants to merge 5 commits intomidnightntwrk:mainfrom
Conversation
JAlbertCode
left a comment
There was a problem hiding this comment.
The following changes are required before it can be merged. The ui is dependent on the same packages and libraries, so those files need to be updated too.
.github/workflows/ci.yaml
Two updates needed to align CI with the package changes in this PR:
compact-version: '0.30.0' # was 0.29.0 — must match compact-runtime 0.15.0 / compact-js 2.5.0
node-version: "24" # was 22 — required by the engines field added to package.jsonbboard-cli/tsconfig.json
"moduleResolution": "Bundler" // is currently set to "node"bboard-ui/tsconfig.json
"moduleResolution": "Bundler" // is currently set to "Node"bboard-ui/vite.config.ts
Three references to @midnight-ntwrk/onchain-runtime-v2 need to be updated to onchain-runtime-v3. The installed package is v3.
bboard-ui/src/in-memory-private-state-provider.ts
Two changes required:
ContractAddressis imported from@midnight-ntwrk/ledger-v7which is no longer installed, move to@midnight-ntwrk/compact-runtimePrivateStateProviderinmidnight-js-typesv4 adds five new required interface members:setContractAddress,exportPrivateStates,importPrivateStates,exportSigningKeys,importSigningKeys. The in-memory provider must implement all five.
bboard-ui/src/contexts/BrowserDeployedBoardManager.ts
ledger-v7 is no longer installed. The five transaction types (Binding, FinalizedTransaction, Proof, SignatureEnabled, Transaction, TransactionId) must be imported from @midnight-ntwrk/ledger-v8. Additionally, UnboundTransaction should be imported as a type from @midnight-ntwrk/midnight-js-types rather than from ledger-v7.
README.md
Outdated
| This fork is aligned to the Midnight compatibility matrix published on March 26, 2026: | ||
|
|
||
| - `compact 0.5.0` | ||
| - `compactc 0.30.0` | ||
| - `Compact Runtime 0.15.0` | ||
| - `Compact JS 2.5.0` | ||
| - `Midnight.js 4.0.2` | ||
| - `testkit-js 4.0.2` | ||
| - `Ledger 8.0.3` | ||
| - `DApp Connector API 4.0.1` | ||
| - `Proof Server 8.0.3` | ||
|
|
There was a problem hiding this comment.
This section should be removed. The packages are constantly being updated and this is extra maintenance. Devs can check the package if they need the versions.
api/tsconfig.json
Outdated
| @@ -8,6 +8,7 @@ | |||
| "target": "ES2022", | |||
| "module": "ESNext", | |||
| "moduleResolution": "node", | |||
There was a problem hiding this comment.
The modeResolution should be updated to "Bundler"
package.json
Outdated
| "@midnight-ntwrk/dapp-connector-api": "4.0.1", | ||
| "@midnight-ntwrk/ledger-v8": "8.0.3", | ||
| "@midnight-ntwrk/midnight-js-compact": "4.0.2", | ||
| "@midnight-ntwrk/midnight-js-contracts": "4.0.2", | ||
| "@midnight-ntwrk/midnight-js-fetch-zk-config-provider": "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/testkit-js": "4.0.2", | ||
| "@midnight-ntwrk/wallet-sdk-abstractions": "2.0.0", | ||
| "@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", |
There was a problem hiding this comment.
We want to stick to the major updates for our packages to reduce the number of updates we need to make. Please update this to the following packages:
"@midnight-ntwrk/dapp-connector-api": "^4.0.0",
"@midnight-ntwrk/ledger-v8": "^8.0.0",
"@midnight-ntwrk/midnight-js-compact": "^4.0.0",
"@midnight-ntwrk/midnight-js-contracts": "^4.0.0",
"@midnight-ntwrk/midnight-js-fetch-zk-config-provider": "^4.0.0",
"@midnight-ntwrk/midnight-js-http-client-proof-provider": "^4.0.0",
"@midnight-ntwrk/midnight-js-indexer-public-data-provider": "^4.0.0",
"@midnight-ntwrk/midnight-js-level-private-state-provider": "^4.0.0",
"@midnight-ntwrk/midnight-js-network-id": "^4.0.0",
"@midnight-ntwrk/midnight-js-node-zk-config-provider": "^4.0.0",
"@midnight-ntwrk/midnight-js-types": "^4.0.0",
"@midnight-ntwrk/midnight-js-utils": "^4.0.0",
"@midnight-ntwrk/testkit-js": "^4.0.0",
"@midnight-ntwrk/wallet-sdk-abstractions": "^2.0.0",
"@midnight-ntwrk/wallet-sdk-address-format": "^3.0.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.0",
"@midnight-ntwrk/wallet-sdk-shielded": "^2.0.0",
"@midnight-ntwrk/wallet-sdk-unshielded-wallet": "^2.0.0",
package.json
Outdated
| "@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", | ||
| "axios": "^1.13.6", |
There was a problem hiding this comment.
Update this to "axios": "1.13.6"
There was an exploit discovered with axios 1.14.1 and we want to prevent users from downloading it.
| - **Transaction fee configuration** | ||
| The default `additionalFeeOverhead` value (`500_000_000_000_000_000n`) from 'midnight-testkit-js' is required on the Undeployed network (lower values fail with `BalanceCheckOverspend` on the `midnight-node` side). On the Preview network, that high overhead prevents transaction creation because it requires a large amount of dust, so it is overridden and set to `1_000n`. The root cause is not yet clear. | ||
|
|
||
| - **LevelDB private state provider** |
There was a problem hiding this comment.
I believe this is still relevant and should be kept in here.
README.md
Outdated
| Some of the tooling used in `midnight-testkit-js`, `midnight-js` and `midnight-wallet` is not currently well suited for direct application use. Significant wiring and integration logic is required, parts of which are copied into this repository. | ||
| More flexible and composable APIs would reduce the need for copying and modification, allowing consumers to extend functionality rather than patch or fork existing implementations. | ||
| - CLI private state is now stored per contract address, matching the `Midnight.js 4.x` private-state provider model. | ||
| - The supported deployment target for this fork is `Preprod` through the CLI flow. |
There was a problem hiding this comment.
There should be no mention of a fork since this will be merged to main.
README.md
Outdated
| More flexible and composable APIs would reduce the need for copying and modification, allowing consumers to extend functionality rather than patch or fork existing implementations. | ||
| - CLI private state is now stored per contract address, matching the `Midnight.js 4.x` private-state provider model. | ||
| - The supported deployment target for this fork is `Preprod` through the CLI flow. | ||
| - `standalone` is kept in the repository but is not the primary acceptance path for this migration. |
|
@jmaciaal, please review the requested changes and make the update by the end of the week so we can keep our examples up to date. If you are unable to get to it by the end of the week, I will make a PR with the changes needed so we can move forward. Keep me posted on your progress. |
|
Hey, sorry I missed this. I’ll push the requested updates today. Thanks for the patience. |
|
I pushed the requested follow-up updates.
Re-ran the local checks:
And manually re-validated the CLI flow on Preprod, and verified the UI locally after the updated build. |
JAlbertCode
left a comment
There was a problem hiding this comment.
These changes work. The network is taking a bit longer to sync than usual, so I will make another PR to address timeout issues, but everything in this PR works and gets the repo up to date.
|
@jmaciaal commits require verified signatures. Please re-sign your commits so we can merge. |
Summary
This PR updates
example-bboardto the current Midnight compatibility matrix and fixes the CLI flow so the example can be built and exercised successfully on Preprod.Changes
ledger-v7toledger-v88.0.324.11.1guidance and.nvmrcWhy
The repository was still pinned to an older Midnight stack and no longer matched the current support matrix. In practice this caused compatibility drift across dependencies, proof server setup, private state handling, and the CLI transaction flow.
Validation
npm installcd contract && npm run compact && npm run build && npm run testcd api && npm run typecheck && npm run buildcd bboard-cli && npm run typecheck && npm run buildManual Preprod validation: