@aztec/bb-prover 3.0.0-canary.a9708bd → 3.0.0-devnet.2-patch.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 (90) hide show
  1. package/dest/avm_proving_tests/avm_proving_tester.d.ts +7 -6
  2. package/dest/avm_proving_tests/avm_proving_tester.d.ts.map +1 -1
  3. package/dest/avm_proving_tests/avm_proving_tester.js +33 -13
  4. package/dest/bb/cli.d.ts +1 -1
  5. package/dest/bb/execute.d.ts +5 -13
  6. package/dest/bb/execute.d.ts.map +1 -1
  7. package/dest/bb/execute.js +30 -92
  8. package/dest/bb/index.d.ts +1 -1
  9. package/dest/config.d.ts +1 -1
  10. package/dest/honk.d.ts +2 -2
  11. package/dest/honk.js +2 -2
  12. package/dest/index.d.ts +1 -1
  13. package/dest/instrumentation.d.ts +3 -3
  14. package/dest/instrumentation.d.ts.map +1 -1
  15. package/dest/prover/client/bb_private_kernel_prover.d.ts +12 -6
  16. package/dest/prover/client/bb_private_kernel_prover.d.ts.map +1 -1
  17. package/dest/prover/client/bb_private_kernel_prover.js +36 -7
  18. package/dest/prover/client/bundle.d.ts +6 -0
  19. package/dest/prover/client/bundle.d.ts.map +1 -0
  20. package/dest/prover/client/bundle.js +7 -0
  21. package/dest/prover/client/lazy.d.ts +6 -0
  22. package/dest/prover/client/lazy.d.ts.map +1 -0
  23. package/dest/prover/client/lazy.js +7 -0
  24. package/dest/prover/index.d.ts +1 -1
  25. package/dest/prover/proof_utils.d.ts +9 -9
  26. package/dest/prover/proof_utils.d.ts.map +1 -1
  27. package/dest/prover/proof_utils.js +42 -25
  28. package/dest/prover/server/bb_prover.d.ts +22 -42
  29. package/dest/prover/server/bb_prover.d.ts.map +1 -1
  30. package/dest/prover/server/bb_prover.js +66 -143
  31. package/dest/test/delay_values.d.ts +1 -1
  32. package/dest/test/delay_values.d.ts.map +1 -1
  33. package/dest/test/delay_values.js +33 -23
  34. package/dest/test/index.d.ts +1 -1
  35. package/dest/test/test_circuit_prover.d.ts +21 -31
  36. package/dest/test/test_circuit_prover.d.ts.map +1 -1
  37. package/dest/test/test_circuit_prover.js +74 -56
  38. package/dest/test/test_verifier.d.ts +3 -1
  39. package/dest/test/test_verifier.d.ts.map +1 -1
  40. package/dest/test/test_verifier.js +15 -0
  41. package/dest/verification_key/verification_key_data.d.ts +1 -1
  42. package/dest/verification_key/verification_key_data.js +1 -1
  43. package/dest/verifier/bb_verifier.d.ts +3 -5
  44. package/dest/verifier/bb_verifier.d.ts.map +1 -1
  45. package/dest/verifier/bb_verifier.js +24 -26
  46. package/dest/verifier/index.d.ts +2 -2
  47. package/dest/verifier/index.d.ts.map +1 -1
  48. package/dest/verifier/index.js +1 -1
  49. package/dest/verifier/queued_chonk_verifier.d.ts +15 -0
  50. package/dest/verifier/queued_chonk_verifier.d.ts.map +1 -0
  51. package/dest/verifier/{queued_ivc_verifier.js → queued_chonk_verifier.js} +3 -3
  52. package/package.json +23 -23
  53. package/src/avm_proving_tests/avm_proving_tester.ts +43 -19
  54. package/src/bb/execute.ts +20 -90
  55. package/src/honk.ts +1 -1
  56. package/src/instrumentation.ts +2 -2
  57. package/src/prover/client/bb_private_kernel_prover.ts +49 -10
  58. package/src/prover/client/bundle.ts +10 -0
  59. package/src/prover/client/lazy.ts +10 -0
  60. package/src/prover/proof_utils.ts +53 -31
  61. package/src/prover/server/bb_prover.ts +231 -288
  62. package/src/test/delay_values.ts +33 -23
  63. package/src/test/test_circuit_prover.ts +219 -142
  64. package/src/test/test_verifier.ts +8 -0
  65. package/src/verification_key/verification_key_data.ts +1 -1
  66. package/src/verifier/bb_verifier.ts +34 -33
  67. package/src/verifier/index.ts +1 -1
  68. package/src/verifier/{queued_ivc_verifier.ts → queued_chonk_verifier.ts} +3 -3
  69. package/dest/prover/client/native/bb_native_private_kernel_prover.d.ts +0 -23
  70. package/dest/prover/client/native/bb_native_private_kernel_prover.d.ts.map +0 -1
  71. package/dest/prover/client/native/bb_native_private_kernel_prover.js +0 -66
  72. package/dest/prover/client/wasm/bb_wasm_private_kernel_prover.d.ts +0 -15
  73. package/dest/prover/client/wasm/bb_wasm_private_kernel_prover.d.ts.map +0 -1
  74. package/dest/prover/client/wasm/bb_wasm_private_kernel_prover.js +0 -48
  75. package/dest/prover/client/wasm/bundle.d.ts +0 -6
  76. package/dest/prover/client/wasm/bundle.d.ts.map +0 -1
  77. package/dest/prover/client/wasm/bundle.js +0 -8
  78. package/dest/prover/client/wasm/lazy.d.ts +0 -6
  79. package/dest/prover/client/wasm/lazy.d.ts.map +0 -1
  80. package/dest/prover/client/wasm/lazy.js +0 -8
  81. package/dest/stats.d.ts +0 -4
  82. package/dest/stats.d.ts.map +0 -1
  83. package/dest/stats.js +0 -45
  84. package/dest/verifier/queued_ivc_verifier.d.ts +0 -15
  85. package/dest/verifier/queued_ivc_verifier.d.ts.map +0 -1
  86. package/src/prover/client/native/bb_native_private_kernel_prover.ts +0 -105
  87. package/src/prover/client/wasm/bb_wasm_private_kernel_prover.ts +0 -60
  88. package/src/prover/client/wasm/bundle.ts +0 -11
  89. package/src/prover/client/wasm/lazy.ts +0 -11
  90. package/src/stats.ts +0 -47
@@ -4,19 +4,20 @@ function _ts_decorate(decorators, target, key, desc) {
4
4
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  }
7
- import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH, TUBE_PROOF_LENGTH } from '@aztec/constants';
7
+ import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH } from '@aztec/constants';
8
8
  import { createLogger } from '@aztec/foundation/log';
9
9
  import { sleep } from '@aztec/foundation/sleep';
10
10
  import { Timer } from '@aztec/foundation/timer';
11
- import { convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap, convertBlockMergeRollupInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap, convertPaddingBlockRootRollupInputsToWitnessMap, convertPaddingBlockRootRollupOutputsFromWitnessMap, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap, convertRootRollupInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap, convertSimulatedBlockRootRollupInputsToWitnessMap, convertSimulatedBlockRootRollupOutputsFromWitnessMap, convertSimulatedPrivateBaseRollupInputsToWitnessMap, convertSimulatedPrivateBaseRollupOutputsFromWitnessMap, convertSimulatedPublicBaseRollupInputsToWitnessMap, convertSimulatedPublicBaseRollupOutputsFromWitnessMap, convertSimulatedSingleTxBlockRootRollupInputsToWitnessMap, convertSimulatedSingleTxBlockRootRollupOutputsFromWitnessMap, foreignCallHandler, getSimulatedServerCircuitArtifact } from '@aztec/noir-protocol-circuits-types/server';
11
+ import { convertBlockMergeRollupOutputsFromWitnessMap, convertBlockMergeRollupPrivateInputsToWitnessMap, convertBlockRootEmptyTxFirstRollupOutputsFromWitnessMap, convertBlockRootEmptyTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootFirstRollupOutputsFromWitnessMap, convertBlockRootFirstRollupPrivateInputsToWitnessMap, convertBlockRootRollupOutputsFromWitnessMap, convertBlockRootRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxFirstRollupOutputsFromWitnessMap, convertBlockRootSingleTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxRollupOutputsFromWitnessMap, convertBlockRootSingleTxRollupPrivateInputsToWitnessMap, convertCheckpointMergeRollupOutputsFromWitnessMap, convertCheckpointMergeRollupPrivateInputsToWitnessMap, convertCheckpointPaddingRollupOutputsFromWitnessMap, convertCheckpointPaddingRollupPrivateInputsToWitnessMap, convertCheckpointRootRollupOutputsFromWitnessMap, convertCheckpointRootRollupPrivateInputsToWitnessMap, convertCheckpointRootSingleBlockRollupOutputsFromWitnessMap, convertCheckpointRootSingleBlockRollupPrivateInputsToWitnessMap, convertParityBaseOutputsFromWitnessMap, convertParityBasePrivateInputsToWitnessMap, convertParityRootOutputsFromWitnessMap, convertParityRootPrivateInputsToWitnessMap, convertPrivateTxBaseRollupOutputsFromWitnessMap, convertPrivateTxBaseRollupPrivateInputsToWitnessMap, convertPublicTxBaseRollupOutputsFromWitnessMap, convertPublicTxBaseRollupPrivateInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap, convertRootRollupPrivateInputsToWitnessMap, convertTxMergeRollupOutputsFromWitnessMap, convertTxMergeRollupPrivateInputsToWitnessMap, foreignCallHandler, getSimulatedServerCircuitArtifact } from '@aztec/noir-protocol-circuits-types/server';
12
12
  import { ProtocolCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
13
+ import { mapProtocolArtifactNameToCircuitName } from '@aztec/noir-protocol-circuits-types/types';
13
14
  import { WASMSimulatorWithBlobs, emitCircuitSimulationStats } from '@aztec/simulator/server';
14
15
  import { makeProofAndVerificationKey, makePublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
15
16
  import { ProvingRequestType, makeEmptyRecursiveProof, makeRecursiveProof } from '@aztec/stdlib/proofs';
17
+ import { PublicChonkVerifierPublicInputs } from '@aztec/stdlib/rollup';
16
18
  import { VerificationKeyData } from '@aztec/stdlib/vks';
17
19
  import { getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
18
20
  import { ProverInstrumentation } from '../instrumentation.js';
19
- import { mapProtocolArtifactNameToCircuitName } from '../stats.js';
20
21
  import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
21
22
  /**
22
23
  * A class for use in testing situations (e2e, unit test, etc) and temporarily for assembling a block in the sequencer.
@@ -45,64 +46,67 @@ import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
45
46
  * @param inputs - Inputs to the circuit.
46
47
  * @returns The public inputs of the parity circuit.
47
48
  */ getBaseParityProof(inputs) {
48
- return this.applyDelay(ProvingRequestType.BASE_PARITY, ()=>this.simulate(inputs, 'BaseParityArtifact', RECURSIVE_PROOF_LENGTH, convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap));
49
+ return this.applyDelay(ProvingRequestType.PARITY_BASE, ()=>this.simulate(inputs, 'ParityBaseArtifact', RECURSIVE_PROOF_LENGTH, convertParityBasePrivateInputsToWitnessMap, convertParityBaseOutputsFromWitnessMap));
49
50
  }
50
51
  /**
51
52
  * Simulates the root parity circuit from its inputs.
52
53
  * @param inputs - Inputs to the circuit.
53
54
  * @returns The public inputs of the parity circuit.
54
55
  */ getRootParityProof(inputs) {
55
- return this.applyDelay(ProvingRequestType.ROOT_PARITY, ()=>this.simulate(inputs, 'RootParityArtifact', NESTED_RECURSIVE_PROOF_LENGTH, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap));
56
+ return this.applyDelay(ProvingRequestType.PARITY_ROOT, ()=>this.simulate(inputs, 'ParityRootArtifact', NESTED_RECURSIVE_PROOF_LENGTH, convertParityRootPrivateInputsToWitnessMap, convertParityRootOutputsFromWitnessMap));
56
57
  }
57
- getTubeProof(_tubeInput) {
58
- return this.applyDelay(ProvingRequestType.TUBE_PROOF, ()=>makeProofAndVerificationKey(makeEmptyRecursiveProof(TUBE_PROOF_LENGTH), VerificationKeyData.makeFakeRollupHonk()));
58
+ getPublicChonkVerifierProof(inputs) {
59
+ return this.applyDelay(ProvingRequestType.PUBLIC_CHONK_VERIFIER, ()=>makePublicInputsAndRecursiveProof(new PublicChonkVerifierPublicInputs(inputs.hidingKernelProofData.publicInputs, inputs.proverId), makeEmptyRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH), ProtocolCircuitVks.PublicChonkVerifier));
59
60
  }
60
- getPrivateBaseRollupProof(inputs) {
61
- return this.applyDelay(ProvingRequestType.PRIVATE_BASE_ROLLUP, ()=>this.simulate(inputs, 'PrivateBaseRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertSimulatedPrivateBaseRollupInputsToWitnessMap, convertSimulatedPrivateBaseRollupOutputsFromWitnessMap));
61
+ getPrivateTxBaseRollupProof(inputs) {
62
+ return this.applyDelay(ProvingRequestType.PRIVATE_TX_BASE_ROLLUP, ()=>this.simulate(inputs, 'PrivateTxBaseRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPrivateTxBaseRollupPrivateInputsToWitnessMap, convertPrivateTxBaseRollupOutputsFromWitnessMap));
62
63
  }
63
- getPublicBaseRollupProof(inputs) {
64
- return this.applyDelay(ProvingRequestType.PUBLIC_BASE_ROLLUP, ()=>this.simulate(inputs, 'PublicBaseRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertSimulatedPublicBaseRollupInputsToWitnessMap, convertSimulatedPublicBaseRollupOutputsFromWitnessMap));
64
+ getPublicTxBaseRollupProof(inputs) {
65
+ return this.applyDelay(ProvingRequestType.PUBLIC_TX_BASE_ROLLUP, ()=>this.simulate(inputs, 'PublicTxBaseRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPublicTxBaseRollupPrivateInputsToWitnessMap, convertPublicTxBaseRollupOutputsFromWitnessMap));
65
66
  }
66
67
  /**
67
68
  * Simulates the merge rollup circuit from its inputs.
68
69
  * @param input - Inputs to the circuit.
69
70
  * @returns The public inputs as outputs of the simulation.
70
- */ getMergeRollupProof(input) {
71
- return this.applyDelay(ProvingRequestType.MERGE_ROLLUP, ()=>this.simulate(input, 'MergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap));
71
+ */ getTxMergeRollupProof(input) {
72
+ return this.applyDelay(ProvingRequestType.TX_MERGE_ROLLUP, ()=>this.simulate(input, 'TxMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertTxMergeRollupPrivateInputsToWitnessMap, convertTxMergeRollupOutputsFromWitnessMap));
72
73
  }
73
- /**
74
- * Simulates the block root rollup circuit from its inputs.
75
- * @param input - Inputs to the circuit.
76
- * @returns The public inputs as outputs of the simulation.
77
- */ getBlockRootRollupProof(input) {
78
- return this.applyDelay(ProvingRequestType.BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'BlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertSimulatedBlockRootRollupInputsToWitnessMap, convertSimulatedBlockRootRollupOutputsFromWitnessMap));
74
+ getBlockRootFirstRollupProof(input) {
75
+ return this.applyDelay(ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP, ()=>this.simulate(input, 'BlockRootFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootFirstRollupPrivateInputsToWitnessMap, convertBlockRootFirstRollupOutputsFromWitnessMap));
79
76
  }
80
- async getSingleTxBlockRootRollupProof(input) {
81
- return await this.applyDelay(ProvingRequestType.SINGLE_TX_BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'SingleTxBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertSimulatedSingleTxBlockRootRollupInputsToWitnessMap, convertSimulatedSingleTxBlockRootRollupOutputsFromWitnessMap));
77
+ async getBlockRootSingleTxFirstRollupProof(input) {
78
+ return await this.applyDelay(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP, ()=>this.simulate(input, 'BlockRootSingleTxFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootSingleTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxFirstRollupOutputsFromWitnessMap));
82
79
  }
83
- /**
84
- * Simulates the empty block root rollup circuit from its inputs.
85
- * @param input - Inputs to the circuit.
86
- * @returns The public inputs as outputs of the simulation.
87
- */ getEmptyBlockRootRollupProof(input) {
88
- return this.applyDelay(ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'EmptyBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap));
80
+ getBlockRootEmptyTxFirstRollupProof(input) {
81
+ return this.applyDelay(ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP, ()=>this.simulate(input, 'BlockRootEmptyTxFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootEmptyTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootEmptyTxFirstRollupOutputsFromWitnessMap));
89
82
  }
90
- getPaddingBlockRootRollupProof(input) {
91
- return this.applyDelay(ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'PaddingBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPaddingBlockRootRollupInputsToWitnessMap, convertPaddingBlockRootRollupOutputsFromWitnessMap));
83
+ getBlockRootRollupProof(input) {
84
+ return this.applyDelay(ProvingRequestType.BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'BlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootRollupPrivateInputsToWitnessMap, convertBlockRootRollupOutputsFromWitnessMap));
92
85
  }
93
- /**
94
- * Simulates the block merge rollup circuit from its inputs.
95
- * @param input - Inputs to the circuit.
96
- * @returns The public inputs as outputs of the simulation.
97
- */ getBlockMergeRollupProof(input) {
98
- return this.applyDelay(ProvingRequestType.BLOCK_MERGE_ROLLUP, ()=>this.simulate(input, 'BlockMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockMergeRollupInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap));
86
+ async getBlockRootSingleTxRollupProof(input) {
87
+ return await this.applyDelay(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP, ()=>this.simulate(input, 'BlockRootSingleTxRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootSingleTxRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxRollupOutputsFromWitnessMap));
88
+ }
89
+ getBlockMergeRollupProof(input) {
90
+ return this.applyDelay(ProvingRequestType.BLOCK_MERGE_ROLLUP, ()=>this.simulate(input, 'BlockMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockMergeRollupPrivateInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap));
91
+ }
92
+ getCheckpointRootRollupProof(input) {
93
+ return this.applyDelay(ProvingRequestType.CHECKPOINT_ROOT_ROLLUP, ()=>this.simulate(input, 'CheckpointRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointRootRollupPrivateInputsToWitnessMap, convertCheckpointRootRollupOutputsFromWitnessMap));
94
+ }
95
+ getCheckpointRootSingleBlockRollupProof(input) {
96
+ return this.applyDelay(ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP, ()=>this.simulate(input, 'CheckpointRootSingleBlockRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointRootSingleBlockRollupPrivateInputsToWitnessMap, convertCheckpointRootSingleBlockRollupOutputsFromWitnessMap));
97
+ }
98
+ getCheckpointPaddingRollupProof(input) {
99
+ return this.applyDelay(ProvingRequestType.CHECKPOINT_PADDING_ROLLUP, ()=>this.simulate(input, 'CheckpointPaddingRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointPaddingRollupPrivateInputsToWitnessMap, convertCheckpointPaddingRollupOutputsFromWitnessMap));
100
+ }
101
+ getCheckpointMergeRollupProof(input) {
102
+ return this.applyDelay(ProvingRequestType.CHECKPOINT_MERGE_ROLLUP, ()=>this.simulate(input, 'CheckpointMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointMergeRollupPrivateInputsToWitnessMap, convertCheckpointMergeRollupOutputsFromWitnessMap));
99
103
  }
100
104
  /**
101
105
  * Simulates the root rollup circuit from its inputs.
102
106
  * @param input - Inputs to the circuit.
103
107
  * @returns The public inputs as outputs of the simulation.
104
108
  */ getRootRollupProof(input) {
105
- return this.applyDelay(ProvingRequestType.ROOT_ROLLUP, ()=>this.simulate(input, 'RootRollupArtifact', NESTED_RECURSIVE_PROOF_LENGTH, convertRootRollupInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap));
109
+ return this.applyDelay(ProvingRequestType.ROOT_ROLLUP, ()=>this.simulate(input, 'RootRollupArtifact', NESTED_RECURSIVE_PROOF_LENGTH, convertRootRollupPrivateInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap));
106
110
  }
107
111
  getAvmProof(_inputs) {
108
112
  // We can't simulate the AVM because we don't have enough context to do so (e.g., DBs).
@@ -128,21 +132,20 @@ import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
128
132
  }
129
133
  async simulate(input, artifactName, proofLength, convertInput, convertOutput) {
130
134
  const timer = new Timer();
131
- const witnessMap = convertInput(input);
135
+ const witnessMap = convertInput(input, true);
132
136
  const circuitName = mapProtocolArtifactNameToCircuitName(artifactName);
133
137
  let witness;
134
138
  if ([
135
- 'BlockRootRollupArtifact',
136
- 'SingleTxBlockRootRollupArtifact'
139
+ 'CheckpointRootRollupArtifact',
140
+ 'CheckpointRootSingleBlockRollupArtifact'
137
141
  ].includes(artifactName) || this.simulator == undefined) {
138
142
  // TODO(#10323): Native ACVM simulator does not support foreign call handler so we use the wasm simulator
139
- // when simulating block root rollup and single tx block root rollup circuits or when the native ACVM simulator
140
- // is not provided.
143
+ // when simulating checkpoint root rollup circuits or when the native ACVM simulator is not provided.
141
144
  witness = (await this.wasmSimulator.executeProtocolCircuit(witnessMap, getSimulatedServerCircuitArtifact(artifactName), foreignCallHandler)).witness;
142
145
  } else {
143
146
  witness = (await this.simulator.executeProtocolCircuit(witnessMap, getSimulatedServerCircuitArtifact(artifactName), undefined)).witness;
144
147
  }
145
- const result = convertOutput(witness);
148
+ const result = convertOutput(witness, true);
146
149
  this.instrumentation.recordDuration('simulationDuration', circuitName, timer);
147
150
  emitCircuitSimulationStats(circuitName, timer.ms(), input.toBuffer().length, result.toBuffer().length, this.logger);
148
151
  return makePublicInputsAndRecursiveProof(result, makeRecursiveProof(proofLength), ProtocolCircuitVks[artifactName]);
@@ -155,29 +158,44 @@ _ts_decorate([
155
158
  trackSpan('TestCircuitProver.getRootParityProof')
156
159
  ], TestCircuitProver.prototype, "getRootParityProof", null);
157
160
  _ts_decorate([
158
- trackSpan('TestCircuitProver.getPrivateBaseRollupProof')
159
- ], TestCircuitProver.prototype, "getPrivateBaseRollupProof", null);
161
+ trackSpan('TestCircuitProver.getPrivateTxBaseRollupProof')
162
+ ], TestCircuitProver.prototype, "getPrivateTxBaseRollupProof", null);
160
163
  _ts_decorate([
161
- trackSpan('TestCircuitProver.getPublicBaseRollupProof')
162
- ], TestCircuitProver.prototype, "getPublicBaseRollupProof", null);
164
+ trackSpan('TestCircuitProver.getPublicTxBaseRollupProof')
165
+ ], TestCircuitProver.prototype, "getPublicTxBaseRollupProof", null);
163
166
  _ts_decorate([
164
- trackSpan('TestCircuitProver.getMergeRollupProof')
165
- ], TestCircuitProver.prototype, "getMergeRollupProof", null);
167
+ trackSpan('TestCircuitProver.getTxMergeRollupProof')
168
+ ], TestCircuitProver.prototype, "getTxMergeRollupProof", null);
166
169
  _ts_decorate([
167
- trackSpan('TestCircuitProver.getBlockRootRollupProof')
168
- ], TestCircuitProver.prototype, "getBlockRootRollupProof", null);
170
+ trackSpan('TestCircuitProver.getBlockRootFirstRollupProof')
171
+ ], TestCircuitProver.prototype, "getBlockRootFirstRollupProof", null);
169
172
  _ts_decorate([
170
- trackSpan('TestCircuitProver.getSingleTxBlockRootRollupProof')
171
- ], TestCircuitProver.prototype, "getSingleTxBlockRootRollupProof", null);
173
+ trackSpan('TestCircuitProver.getBlockRootSingleTxFirstRollupProof')
174
+ ], TestCircuitProver.prototype, "getBlockRootSingleTxFirstRollupProof", null);
172
175
  _ts_decorate([
173
- trackSpan('TestCircuitProver.getEmptyBlockRootRollupProof')
174
- ], TestCircuitProver.prototype, "getEmptyBlockRootRollupProof", null);
176
+ trackSpan('TestCircuitProver.getBlockRootEmptyTxFirstRollupProof')
177
+ ], TestCircuitProver.prototype, "getBlockRootEmptyTxFirstRollupProof", null);
175
178
  _ts_decorate([
176
- trackSpan('TestCircuitProver.getPaddingBlockRootRollupProof')
177
- ], TestCircuitProver.prototype, "getPaddingBlockRootRollupProof", null);
179
+ trackSpan('TestCircuitProver.getBlockRootRollupProof')
180
+ ], TestCircuitProver.prototype, "getBlockRootRollupProof", null);
181
+ _ts_decorate([
182
+ trackSpan('TestCircuitProver.getBlockRootSingleTxRollupProof')
183
+ ], TestCircuitProver.prototype, "getBlockRootSingleTxRollupProof", null);
178
184
  _ts_decorate([
179
185
  trackSpan('TestCircuitProver.getBlockMergeRollupProof')
180
186
  ], TestCircuitProver.prototype, "getBlockMergeRollupProof", null);
187
+ _ts_decorate([
188
+ trackSpan('TestCircuitProver.getCheckpointRootRollupProof')
189
+ ], TestCircuitProver.prototype, "getCheckpointRootRollupProof", null);
190
+ _ts_decorate([
191
+ trackSpan('TestCircuitProver.getCheckpointRootSingleBlockRollupProof')
192
+ ], TestCircuitProver.prototype, "getCheckpointRootSingleBlockRollupProof", null);
193
+ _ts_decorate([
194
+ trackSpan('TestCircuitProver.getCheckpointPaddingRollupProof')
195
+ ], TestCircuitProver.prototype, "getCheckpointPaddingRollupProof", null);
196
+ _ts_decorate([
197
+ trackSpan('TestCircuitProver.getCheckpointMergeRollupProof')
198
+ ], TestCircuitProver.prototype, "getCheckpointMergeRollupProof", null);
181
199
  _ts_decorate([
182
200
  trackSpan('TestCircuitProver.getRootRollupProof')
183
201
  ], TestCircuitProver.prototype, "getRootRollupProof", null);
@@ -1,7 +1,9 @@
1
1
  import type { ClientProtocolCircuitVerifier, IVCProofVerificationResult } from '@aztec/stdlib/interfaces/server';
2
2
  import type { Tx } from '@aztec/stdlib/tx';
3
3
  export declare class TestCircuitVerifier implements ClientProtocolCircuitVerifier {
4
+ private verificationDelayMs?;
5
+ constructor(verificationDelayMs?: number | undefined);
4
6
  verifyProof(_tx: Tx): Promise<IVCProofVerificationResult>;
5
7
  stop(): Promise<void>;
6
8
  }
7
- //# sourceMappingURL=test_verifier.d.ts.map
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdF92ZXJpZmllci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3QvdGVzdF92ZXJpZmllci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSw2QkFBNkIsRUFBRSwwQkFBMEIsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pILE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRTNDLHFCQUFhLG1CQUFvQixZQUFXLDZCQUE2QjtJQUMzRCxPQUFPLENBQUMsbUJBQW1CLENBQUM7SUFBeEMsWUFBb0IsbUJBQW1CLENBQUMsb0JBQVEsRUFBSTtJQUNwRCxXQUFXLENBQUMsR0FBRyxFQUFFLEVBQUUsR0FBRyxPQUFPLENBQUMsMEJBQTBCLENBQUMsQ0FTeEQ7SUFFTSxJQUFJLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUUzQjtDQUNGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"test_verifier.d.ts","sourceRoot":"","sources":["../../src/test/test_verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AACjH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,qBAAa,mBAAoB,YAAW,6BAA6B;IACvE,WAAW,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAIlD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
1
+ {"version":3,"file":"test_verifier.d.ts","sourceRoot":"","sources":["../../src/test/test_verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AACjH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,qBAAa,mBAAoB,YAAW,6BAA6B;IAC3D,OAAO,CAAC,mBAAmB,CAAC;IAAxC,YAAoB,mBAAmB,CAAC,oBAAQ,EAAI;IACpD,WAAW,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC,CASxD;IAEM,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;CACF"}
@@ -1,5 +1,20 @@
1
1
  export class TestCircuitVerifier {
2
+ verificationDelayMs;
3
+ constructor(verificationDelayMs){
4
+ this.verificationDelayMs = verificationDelayMs;
5
+ }
2
6
  verifyProof(_tx) {
7
+ if (this.verificationDelayMs !== undefined && this.verificationDelayMs > 0) {
8
+ return new Promise((resolve)=>{
9
+ setTimeout(()=>{
10
+ resolve({
11
+ valid: true,
12
+ durationMs: this.verificationDelayMs,
13
+ totalDurationMs: this.verificationDelayMs
14
+ });
15
+ }, this.verificationDelayMs);
16
+ });
17
+ }
3
18
  return Promise.resolve({
4
19
  valid: true,
5
20
  durationMs: 0,
@@ -12,4 +12,4 @@ export declare function extractVkData(vkDirectoryPath: string): Promise<Verifica
12
12
  * @returns The verification key data
13
13
  */
14
14
  export declare function extractAvmVkData(vkDirectoryPath: string): Promise<VerificationKeyData>;
15
- //# sourceMappingURL=verification_key_data.d.ts.map
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyaWZpY2F0aW9uX2tleV9kYXRhLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdmVyaWZpY2F0aW9uX2tleS92ZXJpZmljYXRpb25fa2V5X2RhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsT0FBTyxFQUEyQixtQkFBbUIsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBUWpGOzs7O0dBSUc7QUFDSCx3QkFBc0IsYUFBYSxDQUFDLGVBQWUsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLG1CQUFtQixDQUFDLENBVXpGO0FBRUQ7Ozs7O0dBS0c7QUFDSCx3QkFBc0IsZ0JBQWdCLENBQUMsZUFBZSxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsbUJBQW1CLENBQUMsQ0FlNUYifQ==
@@ -1,5 +1,5 @@
1
1
  import { AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { BufferReader } from '@aztec/foundation/serialize';
4
4
  import { VerificationKeyAsFields, VerificationKeyData } from '@aztec/stdlib/vks';
5
5
  import { strict as assert } from 'assert';
@@ -1,20 +1,18 @@
1
1
  import { type Logger } from '@aztec/foundation/log';
2
- import type { ServerProtocolArtifact } from '@aztec/noir-protocol-circuits-types/types';
2
+ import { type ProtocolArtifact, type ServerProtocolArtifact } from '@aztec/noir-protocol-circuits-types/types';
3
3
  import type { ClientProtocolCircuitVerifier, IVCProofVerificationResult } from '@aztec/stdlib/interfaces/server';
4
4
  import type { Proof } from '@aztec/stdlib/proofs';
5
5
  import { Tx } from '@aztec/stdlib/tx';
6
6
  import type { VerificationKeyData } from '@aztec/stdlib/vks';
7
7
  import type { BBConfig } from '../config.js';
8
- export declare const PRIVATE_TAIL_CIVC_VK: string;
9
- export declare const PUBLIC_TAIL_CIVC_VK: string;
10
8
  export declare class BBCircuitVerifier implements ClientProtocolCircuitVerifier {
11
9
  private config;
12
10
  private logger;
13
11
  private constructor();
14
12
  stop(): Promise<void>;
15
13
  static new(config: BBConfig, logger?: Logger): Promise<BBCircuitVerifier>;
16
- getVerificationKeyData(circuitType: ServerProtocolArtifact): VerificationKeyData;
14
+ getVerificationKeyData(circuit: ProtocolArtifact): VerificationKeyData;
17
15
  verifyProofForCircuit(circuit: ServerProtocolArtifact, proof: Proof): Promise<void>;
18
16
  verifyProof(tx: Tx): Promise<IVCProofVerificationResult>;
19
17
  }
20
- //# sourceMappingURL=bb_verifier.d.ts.map
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmJfdmVyaWZpZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZmllci9iYl92ZXJpZmllci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFHbEUsT0FBTyxFQUVMLEtBQUssZ0JBQWdCLEVBQ3JCLEtBQUssc0JBQXNCLEVBRTVCLE1BQU0sMkNBQTJDLENBQUM7QUFDbkQsT0FBTyxLQUFLLEVBQUUsNkJBQTZCLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqSCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUVsRCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDdEMsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQWE3RCxPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFJN0MscUJBQWEsaUJBQWtCLFlBQVcsNkJBQTZCO0lBRW5FLE9BQU8sQ0FBQyxNQUFNO0lBQ2QsT0FBTyxDQUFDLE1BQU07SUFGaEIsT0FBTyxlQUdIO0lBRUcsSUFBSSxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFM0I7SUFFRCxPQUFvQixHQUFHLENBQUMsTUFBTSxFQUFFLFFBQVEsRUFBRSxNQUFNLFNBQXFDLDhCQU1wRjtJQUVNLHNCQUFzQixDQUFDLE9BQU8sRUFBRSxnQkFBZ0IsR0FBRyxtQkFBbUIsQ0FNNUU7SUFFWSxxQkFBcUIsQ0FBQyxPQUFPLEVBQUUsc0JBQXNCLEVBQUUsS0FBSyxFQUFFLEtBQUssaUJBbUMvRTtJQUVZLFdBQVcsQ0FBQyxFQUFFLEVBQUUsRUFBRSxHQUFHLE9BQU8sQ0FBQywwQkFBMEIsQ0FBQyxDQWlEcEU7Q0FDRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"bb_verifier.d.ts","sourceRoot":"","sources":["../../src/verifier/bb_verifier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,KAAK,EAA0B,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAChH,OAAO,KAAK,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AACjH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAc7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQ7C,eAAO,MAAM,oBAAoB,QAA0D,CAAC;AAC5F,eAAO,MAAM,mBAAmB,QAAyD,CAAC;AAE1F,qBAAa,iBAAkB,YAAW,6BAA6B;IAEnE,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IAFhB,OAAO;IAKA,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;WAIR,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAqC;IAK9E,sBAAsB,CAAC,WAAW,EAAE,sBAAsB,GAAG,mBAAmB;IAQ1E,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAE,KAAK;IAqCnE,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAiDtE"}
1
+ {"version":3,"file":"bb_verifier.d.ts","sourceRoot":"","sources":["../../src/verifier/bb_verifier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAE5B,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AACjH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAa7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI7C,qBAAa,iBAAkB,YAAW,6BAA6B;IAEnE,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IAFhB,OAAO,eAGH;IAEG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;IAED,OAAoB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAqC,8BAMpF;IAEM,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,CAM5E;IAEY,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAE,KAAK,iBAmC/E;IAEY,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAiDpE;CACF"}
@@ -1,18 +1,13 @@
1
1
  import { runInDirectory } from '@aztec/foundation/fs';
2
2
  import { createLogger } from '@aztec/foundation/log';
3
3
  import { Timer } from '@aztec/foundation/timer';
4
- import { ServerCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
4
+ import { ProtocolCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
5
+ import { mapProtocolArtifactNameToCircuitName } from '@aztec/noir-protocol-circuits-types/types';
5
6
  import { promises as fs } from 'fs';
6
7
  import * as path from 'path';
7
- import { fileURLToPath } from 'url';
8
- import { BB_RESULT, PROOF_FILENAME, PUBLIC_INPUTS_FILENAME, VK_FILENAME, verifyClientIvcProof, verifyProof } from '../bb/execute.js';
8
+ import { BB_RESULT, PROOF_FILENAME, PUBLIC_INPUTS_FILENAME, VK_FILENAME, verifyChonkProof, verifyProof } from '../bb/execute.js';
9
9
  import { getUltraHonkFlavorForCircuit } from '../honk.js';
10
- import { writeClientIVCProofToOutputDirectory } from '../prover/proof_utils.js';
11
- import { mapProtocolArtifactNameToCircuitName } from '../stats.js';
12
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
13
- // Built by yarn generate
14
- export const PRIVATE_TAIL_CIVC_VK = path.join(__dirname, '../../artifacts/private-civc-vk');
15
- export const PUBLIC_TAIL_CIVC_VK = path.join(__dirname, '../../artifacts/public-civc-vk');
10
+ import { writeChonkProofToPath } from '../prover/proof_utils.js';
16
11
  export class BBCircuitVerifier {
17
12
  config;
18
13
  logger;
@@ -24,15 +19,18 @@ export class BBCircuitVerifier {
24
19
  return Promise.resolve();
25
20
  }
26
21
  static async new(config, logger = createLogger('bb-prover:verifier')) {
22
+ if (!config.bbWorkingDirectory) {
23
+ throw new Error(`Barretenberg working directory (BB_WORKING_DIRECTORY) is not set`);
24
+ }
27
25
  await fs.mkdir(config.bbWorkingDirectory, {
28
26
  recursive: true
29
27
  });
30
28
  return new BBCircuitVerifier(config, logger);
31
29
  }
32
- getVerificationKeyData(circuitType) {
33
- const vk = ServerCircuitVks[circuitType];
30
+ getVerificationKeyData(circuit) {
31
+ const vk = ProtocolCircuitVks[circuit];
34
32
  if (vk === undefined) {
35
- throw new Error('Could not find VK for server artifact ' + circuitType);
33
+ throw new Error(`Could not find VK for artifact ${circuit}`);
36
34
  }
37
35
  return vk;
38
36
  }
@@ -62,33 +60,33 @@ export class BBCircuitVerifier {
62
60
  await runInDirectory(this.config.bbWorkingDirectory, operation, this.config.bbSkipCleanup, this.logger);
63
61
  }
64
62
  async verifyProof(tx) {
63
+ const proofType = 'Chonk';
65
64
  try {
66
65
  const totalTimer = new Timer();
67
66
  let verificationDuration = 0;
68
- // TODO(#7370) The verification keys should be supplied separately and based on the expectedCircuit
69
- // rather than read from the tx object itself. We also need the vks for the translator and ecc, which
70
- // are not being saved along the other vks yet. Reuse the 'verifyProofForCircuit' method above once
71
- // we have all the verification keys available.
72
- const expectedCircuit = tx.data.forPublic ? 'PrivateKernelTailToPublicArtifact' : 'PrivateKernelTailArtifact';
73
- const circuit = 'ClientIVC';
67
+ const circuit = tx.data.forPublic ? 'HidingKernelToPublic' : 'HidingKernelToRollup';
74
68
  // Block below is almost copy-pasted from verifyProofForCircuit
75
69
  const operation = async (bbWorkingDirectory)=>{
76
70
  const logFunction = (message)=>{
77
- this.logger.debug(`${circuit} BB out - ${message}`);
71
+ this.logger.debug(`${proofType} BB out - ${message}`);
78
72
  };
79
- await writeClientIVCProofToOutputDirectory(tx.clientIvcProof, bbWorkingDirectory);
73
+ const proofPath = path.join(bbWorkingDirectory, PROOF_FILENAME);
74
+ await writeChonkProofToPath(tx.chonkProof.attachPublicInputs(tx.data.publicInputs().toFields()), proofPath);
75
+ const verificationKeyPath = path.join(bbWorkingDirectory, VK_FILENAME);
76
+ const verificationKey = this.getVerificationKeyData(circuit);
77
+ await fs.writeFile(verificationKeyPath, verificationKey.keyAsBytes);
80
78
  const timer = new Timer();
81
- const result = await verifyClientIvcProof(this.config.bbBinaryPath, bbWorkingDirectory.concat('/proof'), tx.data.forPublic ? PUBLIC_TAIL_CIVC_VK : PRIVATE_TAIL_CIVC_VK, logFunction, this.config.bbIVCConcurrency);
79
+ const result = await verifyChonkProof(this.config.bbBinaryPath, proofPath, verificationKeyPath, logFunction, this.config.bbIVCConcurrency);
82
80
  verificationDuration = timer.ms();
83
81
  if (result.status === BB_RESULT.FAILURE) {
84
- const errorMessage = `Failed to verify ${circuit} proof for ${expectedCircuit}!`;
82
+ const errorMessage = `Failed to verify ${proofType} proof for ${circuit}!`;
85
83
  throw new Error(errorMessage);
86
84
  }
87
- this.logger.debug(`${circuit} verification successful`, {
88
- circuitName: mapProtocolArtifactNameToCircuitName(expectedCircuit),
85
+ this.logger.debug(`${proofType} verification successful`, {
86
+ circuitName: mapProtocolArtifactNameToCircuitName(circuit),
89
87
  duration: result.durationMs,
90
88
  eventName: 'circuit-verification',
91
- proofType: 'client-ivc'
89
+ proofType: 'chonk'
92
90
  });
93
91
  };
94
92
  await runInDirectory(this.config.bbWorkingDirectory, operation, this.config.bbSkipCleanup, this.logger);
@@ -98,7 +96,7 @@ export class BBCircuitVerifier {
98
96
  totalDurationMs: totalTimer.ms()
99
97
  };
100
98
  } catch (err) {
101
- this.logger.warn(`Failed to verify ClientIVC proof for tx ${tx.getTxHash().toString()}: ${String(err)}`);
99
+ this.logger.warn(`Failed to verify ${proofType} proof for tx ${tx.getTxHash().toString()}: ${String(err)}`);
102
100
  return {
103
101
  valid: false,
104
102
  durationMs: 0,
@@ -1,3 +1,3 @@
1
1
  export * from './bb_verifier.js';
2
- export * from './queued_ivc_verifier.js';
3
- //# sourceMappingURL=index.d.ts.map
2
+ export * from './queued_chonk_verifier.js';
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92ZXJpZmllci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsNEJBQTRCLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/verifier/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/verifier/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export * from './bb_verifier.js';
2
- export * from './queued_ivc_verifier.js';
2
+ export * from './queued_chonk_verifier.js';
@@ -0,0 +1,15 @@
1
+ import type { ClientProtocolCircuitVerifier, IVCProofVerificationResult } from '@aztec/stdlib/interfaces/server';
2
+ import type { Tx } from '@aztec/stdlib/tx';
3
+ import { type TelemetryClient } from '@aztec/telemetry-client';
4
+ import type { BBConfig } from '../config.js';
5
+ export declare class QueuedIVCVerifier implements ClientProtocolCircuitVerifier {
6
+ private verifier;
7
+ private telemetry;
8
+ private logger;
9
+ private queue;
10
+ private metrics;
11
+ constructor(config: BBConfig, verifier: ClientProtocolCircuitVerifier, telemetry?: TelemetryClient, logger?: import("@aztec/foundation/log").Logger);
12
+ verifyProof(tx: Tx): Promise<IVCProofVerificationResult>;
13
+ stop(): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVldWVkX2Nob25rX3ZlcmlmaWVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdmVyaWZpZXIvcXVldWVkX2Nob25rX3ZlcmlmaWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLDZCQUE2QixFQUFFLDBCQUEwQixFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakgsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDM0MsT0FBTyxFQU1MLEtBQUssZUFBZSxFQUlyQixNQUFNLHlCQUF5QixDQUFDO0FBSWpDLE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQWdHN0MscUJBQWEsaUJBQWtCLFlBQVcsNkJBQTZCO0lBTW5FLE9BQU8sQ0FBQyxRQUFRO0lBQ2hCLE9BQU8sQ0FBQyxTQUFTO0lBQ2pCLE9BQU8sQ0FBQyxNQUFNO0lBUGhCLE9BQU8sQ0FBQyxLQUFLLENBQWM7SUFDM0IsT0FBTyxDQUFDLE9BQU8sQ0FBcUI7SUFFcEMsWUFDRSxNQUFNLEVBQUUsUUFBUSxFQUNSLFFBQVEsRUFBRSw2QkFBNkIsRUFDdkMsU0FBUyxHQUFFLGVBQXNDLEVBQ2pELE1BQU0seUNBQWtELEVBTWpFO0lBRVksV0FBVyxDQUFDLEVBQUUsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLDBCQUEwQixDQUFDLENBSXBFO0lBRUQsSUFBSSxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFcEI7Q0FDRiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queued_chonk_verifier.d.ts","sourceRoot":"","sources":["../../src/verifier/queued_chonk_verifier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AACjH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAML,KAAK,eAAe,EAIrB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAgG7C,qBAAa,iBAAkB,YAAW,6BAA6B;IAMnE,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IAPhB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,OAAO,CAAqB;IAEpC,YACE,MAAM,EAAE,QAAQ,EACR,QAAQ,EAAE,6BAA6B,EACvC,SAAS,GAAE,eAAsC,EACjD,MAAM,yCAAkD,EAMjE;IAEY,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAIpE;IAED,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpB;CACF"}
@@ -19,12 +19,12 @@ class IVCVerifierMetrics {
19
19
  const meter = client.getMeter(name);
20
20
  this.ivcVerificationHistogram = meter.createHistogram(Metrics.IVC_VERIFIER_TIME, {
21
21
  unit: 'ms',
22
- description: 'Duration to verify client IVC proofs',
22
+ description: 'Duration to verify chonk proofs',
23
23
  valueType: ValueType.INT
24
24
  });
25
25
  this.ivcTotalVerificationHistogram = meter.createHistogram(Metrics.IVC_VERIFIER_TOTAL_TIME, {
26
26
  unit: 'ms',
27
- description: 'Total duration to verify client IVC proofs, including serde',
27
+ description: 'Total duration to verify chonk proofs, including serde',
28
28
  valueType: ValueType.INT
29
29
  });
30
30
  this.ivcFailureCount = meter.createUpDownCounter(Metrics.IVC_VERIFIER_FAILURE_COUNT, {
@@ -112,7 +112,7 @@ export class QueuedIVCVerifier {
112
112
  logger;
113
113
  queue;
114
114
  metrics;
115
- constructor(config, verifier, telemetry = getTelemetryClient(), logger = createLogger('bb-prover:queued_ivc_verifier')){
115
+ constructor(config, verifier, telemetry = getTelemetryClient(), logger = createLogger('bb-prover:queued_chonk_verifier')){
116
116
  this.verifier = verifier;
117
117
  this.telemetry = telemetry;
118
118
  this.logger = logger;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@aztec/bb-prover",
3
- "version": "3.0.0-canary.a9708bd",
3
+ "version": "3.0.0-devnet.2-patch.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
7
- "./client/wasm/bundle": "./dest/prover/client/wasm/bundle.js",
8
- "./client/wasm/lazy": "./dest/prover/client/wasm/lazy.js",
9
- "./client/native": "./dest/prover/client/native/bb_native_private_kernel_prover.js",
7
+ "./client/bundle": "./dest/prover/client/bundle.js",
8
+ "./client/lazy": "./dest/prover/client/lazy.js",
9
+ "./client": "./dest/prover/client/bb_private_kernel_prover.js",
10
10
  "./verifier": "./dest/verifier/index.js",
11
11
  "./test": "./dest/test/index.js",
12
12
  "./config": "./dest/config.js"
@@ -25,10 +25,9 @@
25
25
  "../package.common.json"
26
26
  ],
27
27
  "scripts": {
28
- "build": "yarn clean && tsc -b",
29
- "build:dev": "tsc -b --watch",
28
+ "build": "yarn clean && ../scripts/tsc.sh",
29
+ "build:dev": "../scripts/tsc.sh --watch",
30
30
  "clean": "rm -rf ./dest .tsbuildinfo",
31
- "generate": "scripts/copy_ivc_hiding_circuit_vks.sh",
32
31
  "bb": "node --no-warnings ./dest/bb/index.js",
33
32
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
34
33
  },
@@ -70,36 +69,37 @@
70
69
  ]
71
70
  },
72
71
  "dependencies": {
73
- "@aztec/bb.js": "3.0.0-canary.a9708bd",
74
- "@aztec/constants": "3.0.0-canary.a9708bd",
75
- "@aztec/foundation": "3.0.0-canary.a9708bd",
76
- "@aztec/noir-noirc_abi": "3.0.0-canary.a9708bd",
77
- "@aztec/noir-protocol-circuits-types": "3.0.0-canary.a9708bd",
78
- "@aztec/noir-types": "3.0.0-canary.a9708bd",
79
- "@aztec/simulator": "3.0.0-canary.a9708bd",
80
- "@aztec/stdlib": "3.0.0-canary.a9708bd",
81
- "@aztec/telemetry-client": "3.0.0-canary.a9708bd",
82
- "@aztec/world-state": "3.0.0-canary.a9708bd",
72
+ "@aztec/bb.js": "3.0.0-devnet.2-patch.1",
73
+ "@aztec/constants": "3.0.0-devnet.2-patch.1",
74
+ "@aztec/foundation": "3.0.0-devnet.2-patch.1",
75
+ "@aztec/noir-noirc_abi": "3.0.0-devnet.2-patch.1",
76
+ "@aztec/noir-protocol-circuits-types": "3.0.0-devnet.2-patch.1",
77
+ "@aztec/noir-types": "3.0.0-devnet.2-patch.1",
78
+ "@aztec/simulator": "3.0.0-devnet.2-patch.1",
79
+ "@aztec/stdlib": "3.0.0-devnet.2-patch.1",
80
+ "@aztec/telemetry-client": "3.0.0-devnet.2-patch.1",
81
+ "@aztec/world-state": "3.0.0-devnet.2-patch.1",
83
82
  "commander": "^12.1.0",
84
83
  "pako": "^2.1.0",
85
84
  "source-map-support": "^0.5.21",
86
85
  "tslib": "^2.4.0"
87
86
  },
88
87
  "devDependencies": {
89
- "@aztec/ethereum": "3.0.0-canary.a9708bd",
90
- "@aztec/kv-store": "3.0.0-canary.a9708bd",
91
- "@aztec/noir-contracts.js": "3.0.0-canary.a9708bd",
92
- "@aztec/noir-test-contracts.js": "3.0.0-canary.a9708bd",
93
- "@aztec/protocol-contracts": "3.0.0-canary.a9708bd",
88
+ "@aztec/ethereum": "3.0.0-devnet.2-patch.1",
89
+ "@aztec/kv-store": "3.0.0-devnet.2-patch.1",
90
+ "@aztec/noir-contracts.js": "3.0.0-devnet.2-patch.1",
91
+ "@aztec/noir-test-contracts.js": "3.0.0-devnet.2-patch.1",
92
+ "@aztec/protocol-contracts": "3.0.0-devnet.2-patch.1",
94
93
  "@jest/globals": "^30.0.0",
95
94
  "@types/jest": "^30.0.0",
96
95
  "@types/node": "^22.15.17",
97
96
  "@types/source-map-support": "^0.5.10",
97
+ "@typescript/native-preview": "7.0.0-dev.20251126.1",
98
98
  "jest": "^30.0.0",
99
99
  "jest-mock-extended": "^4.0.0",
100
100
  "ts-node": "^10.9.1",
101
101
  "typescript": "^5.3.3",
102
- "viem": "2.23.7"
102
+ "viem": "npm:@aztec/viem@2.38.2"
103
103
  },
104
104
  "files": [
105
105
  "dest",