@nite-framework/nite-zk-profiler 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. package/README.md +13 -11
  2. package/dist/cli.js +5 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -38,13 +38,14 @@ It reports the cost class of every circuit in your contract.
38
38
  ```text
39
39
  $ nite-zk profile Sample.compact
40
40
 
41
- circuit rows k capacity cost
42
- bump 24 5 32 1x
43
- balanceOf 305 9 512 16x
44
- register 368 9 512 16x
45
- insert32 2299 13 8192 256x
46
-
47
- 4 circuits, toolchain 0.31.1, zkir 2.1.0, 0.4s
41
+ circuit rows k capacity cost est. prove
42
+ bump 24 5 32 1x ~10ms
43
+ balanceOf 305 9 512 16x ~165ms
44
+ register 368 9 512 16x ~165ms
45
+ insert32 2299 13 8192 256x ~2.6s
46
+
47
+ 4 circuits, toolchain 0.31.1, midnight-zkir 2.1.0, 0.9s
48
+ est. prove is modelled as 2^k on an uncalibrated default. Run `nite-zk calibrate` to anchor it.
48
49
  ```
49
50
 
50
51
  `k` is the number that matters. `cost` is `2^k` expressed relative to the cheapest circuit in the contract, so you can see at a glance which circuits dominate your proving budget.
@@ -370,14 +371,14 @@ Anything outside this range is rejected with a clear error naming the version fo
370
371
  ## Command line surface
371
372
 
372
373
  ```text
373
- nite-zk profile <source...> Report rows, k and relative cost per circuit
374
+ nite-zk profile <source...> Report rows, k, cost and estimated proving time
374
375
  nite-zk save <source...> Write zk-budget.json from current measurements
375
376
  nite-zk check [<source...>] Compare against zk-budget.json
376
377
  nite-zk diff <ref> [<source>] Compare a contract against a git ref
377
378
  nite-zk calibrate --observed <ms> --at-k <k>
378
379
  Anchor proving estimates to a real proof
379
380
 
380
- --estimate Show modelled proving time per circuit
381
+ --no-estimate Hide the modelled proving time column
381
382
  --deep Also generate real proving keys, and report
382
383
  measured setup time and prover key size
383
384
  --json Machine readable output
@@ -420,8 +421,9 @@ check without committing a budget file first.
420
421
 
421
422
  ### Estimated proving time
422
423
 
423
- `--estimate` models proving time as `time = rate * 2^k`, since a Halo2 proof is
424
- dominated by work over the full `2^k` domain.
424
+ `profile` shows an estimated proving time by default, modelled as
425
+ `time = rate * 2^k`, since a Halo2 proof is dominated by work over the full
426
+ `2^k` domain. `--no-estimate` hides the column.
425
427
 
426
428
  The rate is machine specific, so the shipped default is only an order of
427
429
  magnitude. Time one real proof and record it, and every estimate becomes
package/dist/cli.js CHANGED
@@ -17,7 +17,7 @@ import { toolVersion } from "./version.js";
17
17
  const USAGE = `nite-zk - see what a Compact circuit costs to prove
18
18
 
19
19
  Usage:
20
- nite-zk profile <source...> Report rows, k and relative cost per circuit
20
+ nite-zk profile <source...> Report rows, k, cost and estimated proving time
21
21
  nite-zk save <source...> Write zk-budget.json from current measurements
22
22
  nite-zk check [<source...>] Compare against zk-budget.json
23
23
  Sources are optional once saved, since the
@@ -27,7 +27,7 @@ Usage:
27
27
  Anchor proving estimates to a real proof
28
28
 
29
29
  Options:
30
- --estimate Show modelled proving time per circuit
30
+ --no-estimate Hide the modelled proving time column
31
31
  --deep Also generate real proving keys and report
32
32
  measured setup time and prover key size
33
33
  --json Machine readable output
@@ -48,7 +48,7 @@ export function parseArgs(argv) {
48
48
  json: false,
49
49
  strict: false,
50
50
  deep: false,
51
- estimate: false,
51
+ estimate: true,
52
52
  noColor: false,
53
53
  noCache: false,
54
54
  budget: DEFAULT_BUDGET_PATH,
@@ -65,6 +65,8 @@ export function parseArgs(argv) {
65
65
  opts.deep = true;
66
66
  else if (arg === "--estimate")
67
67
  opts.estimate = true;
68
+ else if (arg === "--no-estimate")
69
+ opts.estimate = false;
68
70
  else if (arg === "--no-color")
69
71
  opts.noColor = true;
70
72
  else if (arg === "--no-cache")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nite-framework/nite-zk-profiler",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "See what a Compact circuit costs to prove, without generating proving keys",
5
5
  "type": "module",
6
6
  "bin": {