Skip to content

Commit 8358e9b

Browse files
authored
fix(deployer): pin ledger-v8 to the version midnight-js requires (#171)
midnight-js-protocol 4.1.1 depends on ledger-v8 8.1.0 exactly. With the deployer on 8.1.2 an npm install of the published package nests a second ledger WASM and every deploy fails with "expected instance of DustParameters". The workspace never hit it because the root resolutions force one copy, and those do not ship.
1 parent 971666c commit 8358e9b

5 files changed

Lines changed: 28 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"vitest": "^4.1.9"
3838
},
3939
"resolutions": {
40-
"@midnight-ntwrk/ledger-v8": "8.1.2",
40+
"@midnight-ntwrk/ledger-v8": "8.1.0",
4141
"@midnight-ntwrk/wallet-sdk-address-format": "3.1.2",
4242
"@midnight-ntwrk/wallet-sdk-dust-wallet": "4.1.0",
4343
"@midnight-ntwrk/wallet-sdk-facade": "4.0.1",

packages/deployer/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## Unreleased
1010

11+
### Fixed
12+
13+
- `@midnight-ntwrk/ledger-v8` is pinned to 8.1.0, the exact version `midnight-js-protocol` 4.1.1 requires, so an npm install of the package holds one ledger copy. With 8.1.2 a second copy was nested and every deploy failed with `expected instance of DustParameters`. yarn and pnpm users add the resolutions listed in the README's "Supported stack" section (#171)
14+
1115
### Added
1216

1317
- Initial package. `Deployer` and `runDeploy` build and submit a Compact deploy transaction from a `compact.toml` profile, resolving the artifact, constructor args, initial private state, and contract signing key, then record the result in `<deployments_dir>/<network>.json` (#86)
1418
- Wallet support: seed-file / `MN_DEPLOYER_SEED` / keystore / prefunded-local seed resolution, a per-seed on-disk sync cache under `.states/`, and a `proof_server = "auto"` mode that boots a testkit-js proof-server container for the run (#86)
15-
- Supported deploy stack is `@midnight-ntwrk/compact-runtime` 0.16.0 and `@midnight-ntwrk/ledger-v8` 8.1.2; artifacts must be compiled with `compact compile +0.31.1`. See the README's "Supported stack" section (#86)
19+
- Supported deploy stack is `@midnight-ntwrk/compact-runtime` 0.16.0 and `@midnight-ntwrk/ledger-v8` 8.1.0; artifacts must be compiled with `compact compile +0.31.1`. See the README's "Supported stack" section (#86)
1620
- A packaged `proof-server.yml`, pinning `midnightntwrk/proof-server:8.0.3`, is what `proof_server = "auto"` boots. `auto` no longer depends on a compose file in the working directory, though one there still wins (#165)

packages/deployer/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,27 @@ The deployer pins one Midnight stack, and artifacts have to be compiled against
4242
| Component | Version |
4343
|---|---|
4444
| `@midnight-ntwrk/compact-runtime` | 0.16.0 |
45-
| `@midnight-ntwrk/ledger-v8` | 8.1.2 |
45+
| `@midnight-ntwrk/ledger-v8` | 8.1.0 |
4646
| `@midnight-ntwrk/midnight-js-*` | 4.1.1 |
4747
| `@midnight-ntwrk/testkit-js` | 4.1.1 |
4848
| `@midnight-ntwrk/wallet-sdk-facade` | 4.0.1 |
4949
| Compact compiler | 0.31.1 |
5050

51+
`ledger-v8` is pinned to 8.1.0 because `midnight-js-protocol` 4.1.1 requires exactly that version. A second copy of the ledger WASM in the tree fails a deploy with `expected instance of DustParameters`. npm dedupes to the single pinned copy on its own. yarn and pnpm resolve each range to the newest version, so a project using them adds the same pins as this repo's root `package.json`:
52+
53+
```json
54+
"resolutions": {
55+
"@midnight-ntwrk/ledger-v8": "8.1.0",
56+
"@midnight-ntwrk/wallet-sdk-address-format": "3.1.2",
57+
"@midnight-ntwrk/wallet-sdk-dust-wallet": "4.1.0",
58+
"@midnight-ntwrk/wallet-sdk-facade": "4.0.1",
59+
"@midnight-ntwrk/wallet-sdk-shielded": "3.0.1",
60+
"@midnight-ntwrk/wallet-sdk-unshielded-wallet": "3.1.0"
61+
}
62+
```
63+
64+
(`pnpm.overrides` for pnpm.)
65+
5166
Compile with the pinned compiler: `compact compile +0.31.1`. The current default compactc (0.34.x) emits code for compact-runtime 0.19.0, and the deploy then fails with a `Version mismatch` runtime error.
5267

5368
- As of 2026-09, `OpenZeppelin/compact-contracts` `main` is on compact-runtime 0.19.0 / ledger-v9 1.0.0-rc.3, so contracts built there are not deployable with this tool today.

packages/deployer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"dependencies": {
109109
"@midnight-ntwrk/compact-js": "2.5.1",
110110
"@midnight-ntwrk/compact-runtime": "0.16.0",
111-
"@midnight-ntwrk/ledger-v8": "8.1.2",
111+
"@midnight-ntwrk/ledger-v8": "8.1.0",
112112
"@midnight-ntwrk/midnight-js-contracts": "4.1.1",
113113
"@midnight-ntwrk/midnight-js-http-client-proof-provider": "4.1.1",
114114
"@midnight-ntwrk/midnight-js-indexer-public-data-provider": "4.1.1",

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,10 @@ __metadata:
451451
languageName: node
452452
linkType: hard
453453

454-
"@midnight-ntwrk/ledger-v8@npm:8.1.2":
455-
version: 8.1.2
456-
resolution: "@midnight-ntwrk/ledger-v8@npm:8.1.2"
457-
checksum: 10/f27243ebce72d2e8177245ee0aade6430fdb2bdfd51c4f43394e174f935c655efc4850c76bf1eb015303f366257c0c902da58a94621fde04109e6d03a84970d2
454+
"@midnight-ntwrk/ledger-v8@npm:8.1.0":
455+
version: 8.1.0
456+
resolution: "@midnight-ntwrk/ledger-v8@npm:8.1.0"
457+
checksum: 10/10d56076b0333a502f157c816f8cfebefc8d50221cb20c6db15abcbf2d0092bdaf7e9bc1bd19a6d9f51455547c713c916cb16d4a7d18e83cba0e172ad6e2a507
458458
languageName: node
459459
linkType: hard
460460

@@ -1152,7 +1152,7 @@ __metadata:
11521152
dependencies:
11531153
"@midnight-ntwrk/compact-js": "npm:2.5.1"
11541154
"@midnight-ntwrk/compact-runtime": "npm:0.16.0"
1155-
"@midnight-ntwrk/ledger-v8": "npm:8.1.2"
1155+
"@midnight-ntwrk/ledger-v8": "npm:8.1.0"
11561156
"@midnight-ntwrk/midnight-js-contracts": "npm:4.1.1"
11571157
"@midnight-ntwrk/midnight-js-http-client-proof-provider": "npm:4.1.1"
11581158
"@midnight-ntwrk/midnight-js-indexer-public-data-provider": "npm:4.1.1"

0 commit comments

Comments
 (0)