@tokamak-private-dapps/private-state-cli 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +6 -1
- package/package.json +5 -5
- package/private-state-bridge-cli.mjs +118 -53
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.8 - 2026-04-30
|
|
4
|
+
|
|
5
|
+
- Reused common proof backend version helpers for Tokamak and Groth16 compatibility checks.
|
|
6
|
+
- Reused common npm registry metadata lookup during proof backend runtime installation.
|
|
7
|
+
|
|
8
|
+
## 0.1.7 - 2026-04-29
|
|
9
|
+
|
|
10
|
+
- Required Groth16 channel verifier and installed CRS compatibility versions to use canonical major.minor form.
|
|
11
|
+
- Matched Groth16 channel verifier compatibility against the installed CRS major.minor compatibility version.
|
|
12
|
+
- Required the Groth16 package version with verified public CRS archive selection.
|
|
13
|
+
- Required Tokamak zk-EVM channel verifier and CLI package compatibility versions to use canonical major.minor form.
|
|
14
|
+
|
|
3
15
|
## 0.1.6 - 2026-04-29
|
|
4
16
|
|
|
5
17
|
- Added `--groth16-cli-version` and `--tokamak-zk-evm-cli-version` install options with npm latest defaults.
|
package/README.md
CHANGED
|
@@ -22,7 +22,10 @@ the npm registry. To pin exact proof backend versions for a channel, pass explic
|
|
|
22
22
|
private-state-cli --install --tokamak-zk-evm-cli-version 2.0.8 --groth16-cli-version 0.1.1
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
The Groth16 installer downloads the public Google Drive CRS archive
|
|
25
|
+
The Groth16 installer downloads the public Google Drive CRS archive whose major.minor compatibility version matches the
|
|
26
|
+
selected Groth16 CLI package version.
|
|
27
|
+
The Tokamak zk-EVM installer requires the selected CLI package to declare
|
|
28
|
+
`tokamakZkEvm.compatibleBackendVersion` as a canonical major.minor version matching the selected package version.
|
|
26
29
|
|
|
27
30
|
`--install` downloads public deployment artifacts from the configured artifact index. It does not read repository-local
|
|
28
31
|
`deployment/` outputs by default. Repository development workflows that need local anvil artifacts can opt in explicitly:
|
|
@@ -147,6 +150,8 @@ using bridge-facing commands on a new machine.
|
|
|
147
150
|
Channel balance commands such as `deposit-channel` and `withdraw-channel` use the installed Groth16 runtime workspace
|
|
148
151
|
directly. Proof generation writes to the fixed workspace paths under `~/tokamak-private-channels/groth16/proof`; the CLI
|
|
149
152
|
does not pass custom `--zkey`, proof-output, or public-output paths to the Groth16 prover.
|
|
153
|
+
Before proof generation, the CLI compares the target channel's verifier compatibility versions with the installed
|
|
154
|
+
Tokamak zk-EVM and Groth16 major.minor compatibility versions.
|
|
150
155
|
|
|
151
156
|
Release order matters for npm publication. `@tokamak-private-dapps/common-library` and
|
|
152
157
|
`@tokamak-private-dapps/groth16` must be published before this package version.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokamak-private-dapps/private-state-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Command-line client for the Tokamak private-state DApp.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": "Tokamak Network",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@ethereumjs/util": "^10.1.1",
|
|
44
|
-
"@noble/curves": "
|
|
45
|
-
"@tokamak-private-dapps/common-library": "^0.1.
|
|
46
|
-
"@tokamak-private-dapps/groth16": "^0.1.
|
|
47
|
-
"@tokamak-zk-evm/cli": "^2.0.
|
|
44
|
+
"@noble/curves": "1.9.7",
|
|
45
|
+
"@tokamak-private-dapps/common-library": "^0.1.1",
|
|
46
|
+
"@tokamak-private-dapps/groth16": "^0.1.4",
|
|
47
|
+
"@tokamak-zk-evm/cli": "^2.0.13",
|
|
48
48
|
"ethers": "^6.14.1",
|
|
49
49
|
"tokamak-l2js": "^0.1.3"
|
|
50
50
|
},
|
|
@@ -44,6 +44,13 @@ import {
|
|
|
44
44
|
hexToBytes,
|
|
45
45
|
} from "@ethereumjs/util";
|
|
46
46
|
import { deriveRpcUrl, resolveCliNetwork } from "@tokamak-private-dapps/common-library/network-config";
|
|
47
|
+
import { fetchNpmPackageMetadata } from "@tokamak-private-dapps/common-library/npm-registry";
|
|
48
|
+
import {
|
|
49
|
+
normalizePackageVersionToCompatibleBackendVersion,
|
|
50
|
+
readTokamakZkEvmCompatibleBackendVersionFromPackageJson,
|
|
51
|
+
requireCanonicalCompatibleBackendVersion,
|
|
52
|
+
requireExactSemverVersion,
|
|
53
|
+
} from "@tokamak-private-dapps/common-library/proof-backend-versioning";
|
|
47
54
|
import {
|
|
48
55
|
resolveTokamakBlockInputConfig,
|
|
49
56
|
resolveTokamakCliEntryPath,
|
|
@@ -65,6 +72,8 @@ import {
|
|
|
65
72
|
PUBLIC_GROTH16_MPC_DRIVE_FOLDER_ID,
|
|
66
73
|
downloadLatestPublicGroth16MpcArtifacts,
|
|
67
74
|
downloadPublicGroth16MpcArtifactsByVersion,
|
|
75
|
+
readGroth16CompatibleBackendVersionFromPackageJson,
|
|
76
|
+
requireCanonicalGroth16CompatibleBackendVersion,
|
|
68
77
|
} from "@tokamak-private-dapps/groth16/public-drive-crs";
|
|
69
78
|
import {
|
|
70
79
|
CHANNEL_BOUND_L2_DERIVATION_MODE,
|
|
@@ -967,7 +976,7 @@ async function handleInstallZkEvm({ args }) {
|
|
|
967
976
|
const deploymentArtifacts = await installPrivateStateCliArtifacts({
|
|
968
977
|
dappName: PRIVATE_STATE_DAPP_LABEL,
|
|
969
978
|
localDeploymentBaseRoot,
|
|
970
|
-
groth16CrsVersion:
|
|
979
|
+
groth16CrsVersion: groth16Runtime.compatibleBackendVersion,
|
|
971
980
|
});
|
|
972
981
|
const installManifest = writePrivateStateCliInstallManifest({
|
|
973
982
|
dockerRequested: Boolean(args.docker),
|
|
@@ -3445,14 +3454,22 @@ async function assertChannelProofBackendVersionCompatibility({ context, operatio
|
|
|
3445
3454
|
{
|
|
3446
3455
|
label: "Groth16",
|
|
3447
3456
|
packageName: GROTH16_PACKAGE_NAME,
|
|
3448
|
-
|
|
3449
|
-
|
|
3457
|
+
versionKind: "compatible backend version",
|
|
3458
|
+
channelVersion: requireCanonicalGroth16CompatibleBackendVersion(
|
|
3459
|
+
channelVersions.groth16,
|
|
3460
|
+
"channel Groth16 verifier compatibleBackendVersion",
|
|
3461
|
+
),
|
|
3462
|
+
localVersion: localVersions.groth16.compatibleBackendVersion,
|
|
3450
3463
|
},
|
|
3451
3464
|
{
|
|
3452
3465
|
label: "Tokamak zk-EVM",
|
|
3453
3466
|
packageName: TOKAMAK_ZKEVM_CLI_PACKAGE_NAME,
|
|
3454
|
-
|
|
3455
|
-
|
|
3467
|
+
versionKind: "compatible backend version",
|
|
3468
|
+
channelVersion: requireCanonicalCompatibleBackendVersion(
|
|
3469
|
+
channelVersions.tokamak,
|
|
3470
|
+
"channel Tokamak verifier compatibleBackendVersion",
|
|
3471
|
+
),
|
|
3472
|
+
localVersion: localVersions.tokamak.compatibleBackendVersion,
|
|
3456
3473
|
},
|
|
3457
3474
|
];
|
|
3458
3475
|
const mismatches = checks.filter(({ channelVersion, localVersion }) => channelVersion !== localVersion);
|
|
@@ -3464,10 +3481,11 @@ async function assertChannelProofBackendVersionCompatibility({ context, operatio
|
|
|
3464
3481
|
[
|
|
3465
3482
|
`Channel proof backend version mismatch before ${operationName} proof generation.`,
|
|
3466
3483
|
`Channel: ${context.workspace.channelName ?? context.workspaceName ?? context.workspace.channelId}.`,
|
|
3467
|
-
...mismatches.map(({ label, packageName, channelVersion, localVersion }) => (
|
|
3468
|
-
`${label} verifier expects ${packageName} ${
|
|
3484
|
+
...mismatches.map(({ label, packageName, versionKind, channelVersion, localVersion }) => (
|
|
3485
|
+
`${label} verifier expects ${packageName} ${versionKind} ${channelVersion}, `
|
|
3486
|
+
+ `but the local installed ${versionKind} is ${localVersion ?? "<missing>"}.`
|
|
3469
3487
|
)),
|
|
3470
|
-
"Install
|
|
3488
|
+
"Install proof backend runtimes compatible with this channel before generating proofs.",
|
|
3471
3489
|
].join(" "),
|
|
3472
3490
|
);
|
|
3473
3491
|
}
|
|
@@ -3500,28 +3518,44 @@ async function readChannelVerifierCompatibleBackendVersions(context) {
|
|
|
3500
3518
|
}
|
|
3501
3519
|
|
|
3502
3520
|
function readLocalProofBackendPackageVersions() {
|
|
3521
|
+
const groth16Runtime = inspectGroth16Runtime();
|
|
3522
|
+
const tokamakPackageReport = readTokamakCliPackageReport();
|
|
3503
3523
|
return {
|
|
3504
|
-
groth16:
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3524
|
+
groth16: {
|
|
3525
|
+
packageVersion: groth16Runtime.packageVersion,
|
|
3526
|
+
compatibleBackendVersion: groth16Runtime.crsCompatibleBackendVersion
|
|
3527
|
+
?? groth16Runtime.compatibleBackendVersion,
|
|
3528
|
+
},
|
|
3529
|
+
tokamak: {
|
|
3530
|
+
packageVersion: requirePackageReportVersion(tokamakPackageReport),
|
|
3531
|
+
compatibleBackendVersion: requirePackageReportCompatibleBackendVersion(tokamakPackageReport),
|
|
3532
|
+
},
|
|
3511
3533
|
};
|
|
3512
3534
|
}
|
|
3513
3535
|
|
|
3514
|
-
function readTokamakCliPackageReport() {
|
|
3536
|
+
function readTokamakCliPackageReport(packageRoot = null) {
|
|
3515
3537
|
try {
|
|
3516
|
-
|
|
3538
|
+
const resolvedPackageRoot = packageRoot ?? resolveActiveTokamakCliPackageRoot();
|
|
3539
|
+
const packageJsonPath = path.join(resolvedPackageRoot, "package.json");
|
|
3540
|
+
const packageJson = readJson(packageJsonPath);
|
|
3541
|
+
const report = readPackageReport({
|
|
3517
3542
|
name: TOKAMAK_ZKEVM_CLI_PACKAGE_NAME,
|
|
3518
|
-
packageJsonPath
|
|
3543
|
+
packageJsonPath,
|
|
3544
|
+
packageJson,
|
|
3519
3545
|
});
|
|
3546
|
+
return {
|
|
3547
|
+
...report,
|
|
3548
|
+
compatibleBackendVersion: readTokamakZkEvmCompatibleBackendVersionFromPackageJson(
|
|
3549
|
+
packageJson,
|
|
3550
|
+
TOKAMAK_ZKEVM_CLI_PACKAGE_NAME,
|
|
3551
|
+
),
|
|
3552
|
+
};
|
|
3520
3553
|
} catch (error) {
|
|
3521
3554
|
return {
|
|
3522
3555
|
name: TOKAMAK_ZKEVM_CLI_PACKAGE_NAME,
|
|
3523
3556
|
version: null,
|
|
3524
3557
|
packageRoot: null,
|
|
3558
|
+
compatibleBackendVersion: null,
|
|
3525
3559
|
error: error.message,
|
|
3526
3560
|
ok: false,
|
|
3527
3561
|
};
|
|
@@ -3537,6 +3571,15 @@ function requirePackageReportVersion(report) {
|
|
|
3537
3571
|
return requireVersionString(report.version, `${report.name} package version`);
|
|
3538
3572
|
}
|
|
3539
3573
|
|
|
3574
|
+
function requirePackageReportCompatibleBackendVersion(report) {
|
|
3575
|
+
if (!report.compatibleBackendVersion) {
|
|
3576
|
+
throw new Error(
|
|
3577
|
+
`Unable to determine local ${report.name} compatible backend version${report.error ? `: ${report.error}` : "."}`,
|
|
3578
|
+
);
|
|
3579
|
+
}
|
|
3580
|
+
return requireVersionString(report.compatibleBackendVersion, `${report.name} compatible backend version`);
|
|
3581
|
+
}
|
|
3582
|
+
|
|
3540
3583
|
function requireVersionString(value, label) {
|
|
3541
3584
|
const normalized = String(value ?? "").trim();
|
|
3542
3585
|
expect(normalized.length > 0, `${label} is missing.`);
|
|
@@ -3864,10 +3907,6 @@ function normalizeBytes16Hex(value) {
|
|
|
3864
3907
|
return normalizeBytesHex(value, 16);
|
|
3865
3908
|
}
|
|
3866
3909
|
|
|
3867
|
-
function normalizeBytes20Hex(value) {
|
|
3868
|
-
return normalizeBytesHex(value, 20);
|
|
3869
|
-
}
|
|
3870
|
-
|
|
3871
3910
|
function normalizeBytes32Hex(hexValue) {
|
|
3872
3911
|
return normalizeBytesHex(hexValue, 32);
|
|
3873
3912
|
}
|
|
@@ -5198,11 +5237,7 @@ function expect(condition, message) {
|
|
|
5198
5237
|
}
|
|
5199
5238
|
|
|
5200
5239
|
function requireSemverVersion(value, label) {
|
|
5201
|
-
|
|
5202
|
-
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.]+)?(?:\+[0-9A-Za-z.]+)?$/.test(normalized)) {
|
|
5203
|
-
throw new Error(`${label} must be an exact semantic version. Received: ${normalized}`);
|
|
5204
|
-
}
|
|
5205
|
-
return normalized;
|
|
5240
|
+
return requireExactSemverVersion(value, label);
|
|
5206
5241
|
}
|
|
5207
5242
|
|
|
5208
5243
|
function resolveArtifactCacheBaseRoot(
|
|
@@ -5386,22 +5421,41 @@ function buildDoctorReport() {
|
|
|
5386
5421
|
|
|
5387
5422
|
function buildSelectedRuntimeVersionCheck({ installManifest, tokamakCli, groth16Runtime }) {
|
|
5388
5423
|
const selectedVersions = installManifest?.install?.selectedVersions ?? null;
|
|
5424
|
+
const selectedTokamakCompatibleBackendVersion = selectedVersions?.tokamak
|
|
5425
|
+
? normalizePackageVersionToCompatibleBackendVersion(
|
|
5426
|
+
selectedVersions.tokamak,
|
|
5427
|
+
"selected Tokamak zk-EVM CLI version",
|
|
5428
|
+
)
|
|
5429
|
+
: null;
|
|
5430
|
+
const selectedGroth16CompatibleBackendVersion = selectedVersions?.groth16
|
|
5431
|
+
? normalizePackageVersionToCompatibleBackendVersion(selectedVersions.groth16, "selected Groth16 CLI version")
|
|
5432
|
+
: null;
|
|
5389
5433
|
const details = [
|
|
5390
5434
|
{
|
|
5391
5435
|
name: TOKAMAK_ZKEVM_CLI_PACKAGE_NAME,
|
|
5392
5436
|
selectedVersion: selectedVersions?.tokamak ?? null,
|
|
5437
|
+
selectedCompatibleBackendVersion: selectedTokamakCompatibleBackendVersion,
|
|
5393
5438
|
installedVersion: tokamakCli.packageVersion ?? null,
|
|
5394
|
-
|
|
5439
|
+
compatibleBackendVersion: tokamakCli.compatibleBackendVersion ?? null,
|
|
5440
|
+
ok: !selectedVersions?.tokamak
|
|
5441
|
+
|| (
|
|
5442
|
+
selectedVersions.tokamak === tokamakCli.packageVersion
|
|
5443
|
+
&& selectedTokamakCompatibleBackendVersion === tokamakCli.compatibleBackendVersion
|
|
5444
|
+
),
|
|
5395
5445
|
},
|
|
5396
5446
|
{
|
|
5397
5447
|
name: GROTH16_PACKAGE_NAME,
|
|
5398
5448
|
selectedVersion: selectedVersions?.groth16 ?? null,
|
|
5449
|
+
selectedCompatibleBackendVersion: selectedGroth16CompatibleBackendVersion,
|
|
5399
5450
|
installedVersion: groth16Runtime.packageVersion ?? null,
|
|
5451
|
+
compatibleBackendVersion: groth16Runtime.compatibleBackendVersion ?? null,
|
|
5400
5452
|
crsVersion: groth16Runtime.crsVersion ?? null,
|
|
5453
|
+
crsCompatibleBackendVersion: groth16Runtime.crsCompatibleBackendVersion ?? null,
|
|
5401
5454
|
ok: !selectedVersions?.groth16
|
|
5402
5455
|
|| (
|
|
5403
5456
|
selectedVersions.groth16 === groth16Runtime.packageVersion
|
|
5404
|
-
&&
|
|
5457
|
+
&& selectedGroth16CompatibleBackendVersion === groth16Runtime.compatibleBackendVersion
|
|
5458
|
+
&& selectedGroth16CompatibleBackendVersion === groth16Runtime.crsCompatibleBackendVersion
|
|
5405
5459
|
),
|
|
5406
5460
|
},
|
|
5407
5461
|
];
|
|
@@ -5441,20 +5495,6 @@ async function resolveRequestedNpmPackageVersion({ packageName, requestedVersion
|
|
|
5441
5495
|
return normalizedVersion;
|
|
5442
5496
|
}
|
|
5443
5497
|
|
|
5444
|
-
async function fetchNpmPackageMetadata(packageName) {
|
|
5445
|
-
const normalizedPackageName = requireNonEmptyString(packageName, "packageName");
|
|
5446
|
-
const registryUrl = `https://registry.npmjs.org/${encodeURIComponent(normalizedPackageName)}`;
|
|
5447
|
-
const response = await fetch(registryUrl, { redirect: "follow" });
|
|
5448
|
-
if (!response.ok) {
|
|
5449
|
-
throw new Error(`Failed to read npm package metadata for ${normalizedPackageName}: HTTP ${response.status}.`);
|
|
5450
|
-
}
|
|
5451
|
-
try {
|
|
5452
|
-
return await response.json();
|
|
5453
|
-
} catch (error) {
|
|
5454
|
-
throw new Error(`npm package metadata for ${normalizedPackageName} is not valid JSON: ${error.message}`);
|
|
5455
|
-
}
|
|
5456
|
-
}
|
|
5457
|
-
|
|
5458
5498
|
async function installTokamakCliRuntimeForPrivateState({ version, docker }) {
|
|
5459
5499
|
const packageInstall = installManagedNpmPackage({
|
|
5460
5500
|
packageName: TOKAMAK_ZKEVM_CLI_PACKAGE_NAME,
|
|
@@ -5471,6 +5511,7 @@ async function installTokamakCliRuntimeForPrivateState({ version, docker }) {
|
|
|
5471
5511
|
});
|
|
5472
5512
|
const doctorOutput = stripAnsi(`${doctor.stdout}${doctor.stderr}`);
|
|
5473
5513
|
const runtimeRoot = parseRuntimeRootFromTokamakDoctorOutput(doctorOutput);
|
|
5514
|
+
const compatibleBackendVersion = readTokamakCliPackageCompatibleBackendVersion(packageInstall.packageRoot);
|
|
5474
5515
|
expect(
|
|
5475
5516
|
doctor.status === 0 && runtimeRoot,
|
|
5476
5517
|
[
|
|
@@ -5481,6 +5522,7 @@ async function installTokamakCliRuntimeForPrivateState({ version, docker }) {
|
|
|
5481
5522
|
return {
|
|
5482
5523
|
packageName: TOKAMAK_ZKEVM_CLI_PACKAGE_NAME,
|
|
5483
5524
|
packageVersion: version,
|
|
5525
|
+
compatibleBackendVersion,
|
|
5484
5526
|
packageRoot: packageInstall.packageRoot,
|
|
5485
5527
|
entryPath: invocation.entryPath,
|
|
5486
5528
|
installPrefix: packageInstall.installPrefix,
|
|
@@ -5501,13 +5543,15 @@ async function installGroth16RuntimeForPrivateState({ version, docker }) {
|
|
|
5501
5543
|
args.push("--docker");
|
|
5502
5544
|
}
|
|
5503
5545
|
run(process.execPath, args, { cwd: packageRoot });
|
|
5504
|
-
const
|
|
5546
|
+
const compatibleBackendVersion = readGroth16PackageCompatibleBackendVersion(packageRoot);
|
|
5547
|
+
const crsInstall = await installGroth16CrsForPrivateStateVersion(compatibleBackendVersion);
|
|
5505
5548
|
const runtime = inspectGroth16Runtime({ packageRoot });
|
|
5506
5549
|
expect(runtime.installed, "Groth16 runtime install completed, but tokamak-groth16 --doctor still reports an unhealthy runtime.");
|
|
5507
5550
|
return {
|
|
5508
5551
|
...runtime,
|
|
5509
5552
|
packageName: GROTH16_PACKAGE_NAME,
|
|
5510
5553
|
packageVersion: version,
|
|
5554
|
+
compatibleBackendVersion,
|
|
5511
5555
|
packageRoot,
|
|
5512
5556
|
entryPath,
|
|
5513
5557
|
installPrefix: packageInstall.installPrefix,
|
|
@@ -5625,15 +5669,15 @@ function collectDependencyPackageReports(installManifest = null) {
|
|
|
5625
5669
|
});
|
|
5626
5670
|
}
|
|
5627
5671
|
|
|
5628
|
-
function readPackageReport({ name, packageJsonPath = null, resolveTarget = null }) {
|
|
5672
|
+
function readPackageReport({ name, packageJsonPath = null, packageJson = null, resolveTarget = null }) {
|
|
5629
5673
|
try {
|
|
5630
5674
|
const resolvedPackageJsonPath = packageJsonPath
|
|
5631
5675
|
? path.resolve(packageJsonPath)
|
|
5632
5676
|
: findPackageJsonForName(path.dirname(require.resolve(resolveTarget ?? name)), name);
|
|
5633
|
-
const
|
|
5677
|
+
const resolvedPackageJson = packageJson ?? readJson(resolvedPackageJsonPath);
|
|
5634
5678
|
return {
|
|
5635
|
-
name:
|
|
5636
|
-
version:
|
|
5679
|
+
name: resolvedPackageJson.name ?? name,
|
|
5680
|
+
version: resolvedPackageJson.version ?? null,
|
|
5637
5681
|
packageRoot: path.dirname(resolvedPackageJsonPath),
|
|
5638
5682
|
error: null,
|
|
5639
5683
|
};
|
|
@@ -5668,6 +5712,20 @@ function resolveGroth16PackageRoot() {
|
|
|
5668
5712
|
return path.dirname(findPackageJsonForName(path.dirname(publicDriveCrsPath), "@tokamak-private-dapps/groth16"));
|
|
5669
5713
|
}
|
|
5670
5714
|
|
|
5715
|
+
function readGroth16PackageCompatibleBackendVersion(packageRoot = resolveActiveGroth16PackageRoot()) {
|
|
5716
|
+
return readGroth16CompatibleBackendVersionFromPackageJson(
|
|
5717
|
+
readJson(path.join(packageRoot, "package.json")),
|
|
5718
|
+
GROTH16_PACKAGE_NAME,
|
|
5719
|
+
);
|
|
5720
|
+
}
|
|
5721
|
+
|
|
5722
|
+
function readTokamakCliPackageCompatibleBackendVersion(packageRoot = resolveActiveTokamakCliPackageRoot()) {
|
|
5723
|
+
return readTokamakZkEvmCompatibleBackendVersionFromPackageJson(
|
|
5724
|
+
readJson(path.join(packageRoot, "package.json")),
|
|
5725
|
+
TOKAMAK_ZKEVM_CLI_PACKAGE_NAME,
|
|
5726
|
+
);
|
|
5727
|
+
}
|
|
5728
|
+
|
|
5671
5729
|
function resolveActiveGroth16PackageRoot() {
|
|
5672
5730
|
const manifestPackageRoot = readPrivateStateCliInstallManifest()?.install?.groth16Runtime?.packageRoot;
|
|
5673
5731
|
if (manifestPackageRoot && fs.existsSync(path.join(manifestPackageRoot, "package.json"))) {
|
|
@@ -5692,17 +5750,24 @@ function inspectGroth16Runtime({ packageRoot = resolveActiveGroth16PackageRoot()
|
|
|
5692
5750
|
const report = parseJsonReport(stdout);
|
|
5693
5751
|
const workspaceRoot = report?.workspaceRoot ?? defaultGroth16WorkspaceRoot();
|
|
5694
5752
|
const workspaceManifest = readJsonIfExists(path.join(workspaceRoot, "install-manifest.json"));
|
|
5753
|
+
const crsVersion = workspaceManifest?.crs?.version ?? null;
|
|
5695
5754
|
const packageReport = readPackageReport({
|
|
5696
5755
|
name: GROTH16_PACKAGE_NAME,
|
|
5697
5756
|
packageJsonPath: path.join(packageRoot, "package.json"),
|
|
5698
5757
|
});
|
|
5758
|
+
const compatibleBackendVersion = readGroth16PackageCompatibleBackendVersion(packageRoot);
|
|
5759
|
+
const crsCompatibleBackendVersion = crsVersion
|
|
5760
|
+
? requireCanonicalGroth16CompatibleBackendVersion(crsVersion, "installed Groth16 CRS version")
|
|
5761
|
+
: null;
|
|
5699
5762
|
return {
|
|
5700
5763
|
installed: doctor.status === 0 && report?.ok === true,
|
|
5701
5764
|
packageVersion: packageReport.version,
|
|
5765
|
+
compatibleBackendVersion,
|
|
5702
5766
|
packageRoot,
|
|
5703
5767
|
entryPath,
|
|
5704
5768
|
workspaceRoot: report?.workspaceRoot ?? null,
|
|
5705
|
-
crsVersion
|
|
5769
|
+
crsVersion,
|
|
5770
|
+
crsCompatibleBackendVersion,
|
|
5706
5771
|
crs: workspaceManifest?.crs ?? null,
|
|
5707
5772
|
checks: report?.checks ?? [],
|
|
5708
5773
|
doctor: {
|
|
@@ -5746,6 +5811,7 @@ function requireActiveTokamakCliRuntimeRoot() {
|
|
|
5746
5811
|
|
|
5747
5812
|
function inspectTokamakCliRuntime({ packageRoot = resolveActiveTokamakCliPackageRoot() } = {}) {
|
|
5748
5813
|
const invocation = buildTokamakCliInvocationForPackageRoot(packageRoot);
|
|
5814
|
+
const packageReport = readTokamakCliPackageReport(invocation.packageRoot);
|
|
5749
5815
|
const doctor = runCaptured(invocation.command, [...invocation.args, "--doctor"], {
|
|
5750
5816
|
cwd: invocation.packageRoot,
|
|
5751
5817
|
});
|
|
@@ -5762,10 +5828,9 @@ function inspectTokamakCliRuntime({ packageRoot = resolveActiveTokamakCliPackage
|
|
|
5762
5828
|
entryPath: invocation.entryPath,
|
|
5763
5829
|
cacheRoot,
|
|
5764
5830
|
runtimeRoot,
|
|
5765
|
-
packageVersion:
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
}).version,
|
|
5831
|
+
packageVersion: packageReport.version,
|
|
5832
|
+
compatibleBackendVersion: packageReport.compatibleBackendVersion,
|
|
5833
|
+
packageError: packageReport.error,
|
|
5769
5834
|
dockerModeInstalled,
|
|
5770
5835
|
cudaCompatible,
|
|
5771
5836
|
doctor: {
|