@aztec/bb-prover 0.0.0-test.1 → 0.0.1-commit.21caa21
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/dest/avm_proving_tests/avm_proving_tester.d.ts +14 -18
- package/dest/avm_proving_tests/avm_proving_tester.d.ts.map +1 -1
- package/dest/avm_proving_tests/avm_proving_tester.js +130 -79
- package/dest/bb/cli.d.ts +1 -1
- package/dest/bb/execute.d.ts +14 -47
- package/dest/bb/execute.d.ts.map +1 -1
- package/dest/bb/execute.js +132 -236
- package/dest/bb/index.d.ts +1 -1
- package/dest/config.d.ts +3 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/honk.d.ts +3 -3
- package/dest/honk.d.ts.map +1 -1
- package/dest/honk.js +3 -2
- package/dest/index.d.ts +2 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -0
- package/dest/instrumentation.d.ts +3 -3
- package/dest/instrumentation.d.ts.map +1 -1
- package/dest/instrumentation.js +2 -4
- package/dest/prover/client/bb_private_kernel_prover.d.ts +32 -0
- package/dest/prover/client/bb_private_kernel_prover.d.ts.map +1 -0
- package/dest/prover/{bb_private_kernel_prover.js → client/bb_private_kernel_prover.js} +42 -20
- package/dest/prover/client/bundle.d.ts +6 -0
- package/dest/prover/client/bundle.d.ts.map +1 -0
- package/dest/prover/client/bundle.js +8 -0
- package/dest/prover/client/lazy.d.ts +6 -0
- package/dest/prover/client/lazy.d.ts.map +1 -0
- package/dest/prover/client/lazy.js +8 -0
- package/dest/prover/index.d.ts +3 -4
- package/dest/prover/index.d.ts.map +1 -1
- package/dest/prover/index.js +2 -3
- package/dest/prover/proof_utils.d.ts +19 -0
- package/dest/prover/proof_utils.d.ts.map +1 -0
- package/dest/prover/proof_utils.js +72 -0
- package/dest/prover/server/bb_prover.d.ts +100 -0
- package/dest/prover/server/bb_prover.d.ts.map +1 -0
- package/dest/prover/server/bb_prover.js +339 -0
- package/dest/test/delay_values.d.ts +1 -1
- package/dest/test/delay_values.d.ts.map +1 -1
- package/dest/test/delay_values.js +33 -21
- package/dest/test/index.d.ts +1 -1
- package/dest/test/test_circuit_prover.d.ts +25 -34
- package/dest/test/test_circuit_prover.d.ts.map +1 -1
- package/dest/test/test_circuit_prover.js +85 -59
- package/dest/test/test_verifier.d.ts +6 -3
- package/dest/test/test_verifier.d.ts.map +1 -1
- package/dest/test/test_verifier.js +23 -1
- package/dest/verification_key/verification_key_data.d.ts +7 -1
- package/dest/verification_key/verification_key_data.d.ts.map +1 -1
- package/dest/verification_key/verification_key_data.js +23 -29
- package/dest/verifier/bb_verifier.d.ts +6 -5
- package/dest/verifier/bb_verifier.d.ts.map +1 -1
- package/dest/verifier/bb_verifier.js +46 -25
- package/dest/verifier/index.d.ts +2 -1
- package/dest/verifier/index.d.ts.map +1 -1
- package/dest/verifier/index.js +1 -0
- package/dest/verifier/queued_chonk_verifier.d.ts +15 -0
- package/dest/verifier/queued_chonk_verifier.d.ts.map +1 -0
- package/dest/verifier/queued_chonk_verifier.js +132 -0
- package/package.json +35 -33
- package/src/avm_proving_tests/avm_proving_tester.ts +210 -104
- package/src/bb/execute.ts +103 -250
- package/src/config.ts +2 -0
- package/src/honk.ts +3 -2
- package/src/index.ts +1 -0
- package/src/instrumentation.ts +2 -4
- package/src/prover/{bb_private_kernel_prover.ts → client/bb_private_kernel_prover.ts} +78 -30
- package/src/prover/client/bundle.ts +11 -0
- package/src/prover/client/lazy.ts +11 -0
- package/src/prover/index.ts +2 -3
- package/src/prover/proof_utils.ts +115 -0
- package/src/prover/server/bb_prover.ts +733 -0
- package/src/test/delay_values.ts +33 -21
- package/src/test/test_circuit_prover.ts +260 -147
- package/src/test/test_verifier.ts +15 -3
- package/src/verification_key/verification_key_data.ts +29 -24
- package/src/verifier/bb_verifier.ts +63 -32
- package/src/verifier/index.ts +1 -0
- package/src/verifier/queued_chonk_verifier.ts +140 -0
- package/dest/prover/bb_native_private_kernel_prover.d.ts +0 -25
- package/dest/prover/bb_native_private_kernel_prover.d.ts.map +0 -1
- package/dest/prover/bb_native_private_kernel_prover.js +0 -69
- package/dest/prover/bb_private_kernel_prover.d.ts +0 -32
- package/dest/prover/bb_private_kernel_prover.d.ts.map +0 -1
- package/dest/prover/bb_prover.d.ts +0 -120
- package/dest/prover/bb_prover.d.ts.map +0 -1
- package/dest/prover/bb_prover.js +0 -423
- package/dest/prover/client_ivc_proof_utils.d.ts +0 -25
- package/dest/prover/client_ivc_proof_utils.d.ts.map +0 -1
- package/dest/prover/client_ivc_proof_utils.js +0 -43
- package/dest/stats.d.ts +0 -5
- package/dest/stats.d.ts.map +0 -1
- package/dest/stats.js +0 -62
- package/dest/wasm/bb_wasm_private_kernel_prover.d.ts +0 -17
- package/dest/wasm/bb_wasm_private_kernel_prover.d.ts.map +0 -1
- package/dest/wasm/bb_wasm_private_kernel_prover.js +0 -46
- package/dest/wasm/bundle.d.ts +0 -6
- package/dest/wasm/bundle.d.ts.map +0 -1
- package/dest/wasm/bundle.js +0 -8
- package/dest/wasm/lazy.d.ts +0 -6
- package/dest/wasm/lazy.d.ts.map +0 -1
- package/dest/wasm/lazy.js +0 -8
- package/src/prover/bb_native_private_kernel_prover.ts +0 -119
- package/src/prover/bb_prover.ts +0 -781
- package/src/prover/client_ivc_proof_utils.ts +0 -42
- package/src/stats.ts +0 -64
- package/src/wasm/bb_wasm_private_kernel_prover.ts +0 -55
- package/src/wasm/bundle.ts +0 -11
- package/src/wasm/lazy.ts +0 -11
package/src/test/delay_values.ts
CHANGED
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
2
2
|
|
|
3
3
|
export const WITGEN_DELAY_MS: Record<ProvingRequestType, number> = {
|
|
4
|
-
[ProvingRequestType.
|
|
5
|
-
[ProvingRequestType.BLOCK_MERGE_ROLLUP]:
|
|
6
|
-
[ProvingRequestType.
|
|
7
|
-
[ProvingRequestType.
|
|
8
|
-
[ProvingRequestType.
|
|
9
|
-
[ProvingRequestType.
|
|
10
|
-
[ProvingRequestType.
|
|
11
|
-
[ProvingRequestType.
|
|
12
|
-
[ProvingRequestType.
|
|
13
|
-
[ProvingRequestType.
|
|
14
|
-
[ProvingRequestType.
|
|
4
|
+
[ProvingRequestType.PARITY_BASE]: 2000,
|
|
5
|
+
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: 30,
|
|
6
|
+
[ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP]: 60_000,
|
|
7
|
+
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP]: 40_000,
|
|
8
|
+
[ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP]: 18,
|
|
9
|
+
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: 40_000,
|
|
10
|
+
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP]: 20_000,
|
|
11
|
+
[ProvingRequestType.CHECKPOINT_ROOT_ROLLUP]: 40_000,
|
|
12
|
+
[ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP]: 36_000,
|
|
13
|
+
[ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: 0,
|
|
14
|
+
[ProvingRequestType.CHECKPOINT_MERGE_ROLLUP]: 30,
|
|
15
|
+
[ProvingRequestType.TX_MERGE_ROLLUP]: 0,
|
|
16
|
+
[ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]: 400_000,
|
|
17
|
+
[ProvingRequestType.PUBLIC_TX_BASE_ROLLUP]: 470_000,
|
|
18
|
+
[ProvingRequestType.PARITY_ROOT]: 39,
|
|
19
|
+
[ProvingRequestType.ROOT_ROLLUP]: 35,
|
|
20
|
+
[ProvingRequestType.PUBLIC_CHONK_VERIFIER]: 0,
|
|
15
21
|
[ProvingRequestType.PUBLIC_VM]: 0,
|
|
16
22
|
};
|
|
17
23
|
|
|
18
24
|
export const PROOF_DELAY_MS: Record<ProvingRequestType, number> = {
|
|
19
|
-
[ProvingRequestType.
|
|
25
|
+
[ProvingRequestType.PARITY_BASE]: 14_000,
|
|
20
26
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: 15_000,
|
|
21
|
-
[ProvingRequestType.
|
|
22
|
-
[ProvingRequestType.
|
|
23
|
-
[ProvingRequestType.
|
|
24
|
-
[ProvingRequestType.
|
|
25
|
-
[ProvingRequestType.
|
|
26
|
-
[ProvingRequestType.
|
|
27
|
-
[ProvingRequestType.
|
|
28
|
-
[ProvingRequestType.
|
|
29
|
-
[ProvingRequestType.
|
|
27
|
+
[ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP]: 55_000,
|
|
28
|
+
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP]: 35_000,
|
|
29
|
+
[ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP]: 4_000,
|
|
30
|
+
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: 35_000,
|
|
31
|
+
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP]: 15_000,
|
|
32
|
+
[ProvingRequestType.CHECKPOINT_ROOT_ROLLUP]: 35_000,
|
|
33
|
+
[ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP]: 35_000,
|
|
34
|
+
[ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: 0,
|
|
35
|
+
[ProvingRequestType.CHECKPOINT_MERGE_ROLLUP]: 9_000,
|
|
36
|
+
[ProvingRequestType.TX_MERGE_ROLLUP]: 0,
|
|
37
|
+
[ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]: 145_000,
|
|
38
|
+
[ProvingRequestType.PUBLIC_TX_BASE_ROLLUP]: 160_000,
|
|
39
|
+
[ProvingRequestType.PARITY_ROOT]: 16_000,
|
|
40
|
+
[ProvingRequestType.ROOT_ROLLUP]: 140_000,
|
|
41
|
+
[ProvingRequestType.PUBLIC_CHONK_VERIFIER]: 30_000,
|
|
30
42
|
[ProvingRequestType.PUBLIC_VM]: 0,
|
|
31
43
|
};
|
|
@@ -1,40 +1,54 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
3
|
+
AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED,
|
|
4
4
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
5
5
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
6
6
|
RECURSIVE_PROOF_LENGTH,
|
|
7
|
-
TUBE_PROOF_LENGTH,
|
|
8
7
|
} from '@aztec/constants';
|
|
9
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
10
9
|
import { sleep } from '@aztec/foundation/sleep';
|
|
11
10
|
import { Timer } from '@aztec/foundation/timer';
|
|
12
11
|
import {
|
|
13
12
|
type ServerProtocolArtifact,
|
|
14
|
-
SimulatedServerCircuitArtifacts,
|
|
15
|
-
convertBaseParityInputsToWitnessMap,
|
|
16
|
-
convertBaseParityOutputsFromWitnessMap,
|
|
17
|
-
convertBlockMergeRollupInputsToWitnessMap,
|
|
18
13
|
convertBlockMergeRollupOutputsFromWitnessMap,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
convertBlockMergeRollupPrivateInputsToWitnessMap,
|
|
15
|
+
convertBlockRootEmptyTxFirstRollupOutputsFromWitnessMap,
|
|
16
|
+
convertBlockRootEmptyTxFirstRollupPrivateInputsToWitnessMap,
|
|
17
|
+
convertBlockRootFirstRollupOutputsFromWitnessMap,
|
|
18
|
+
convertBlockRootFirstRollupPrivateInputsToWitnessMap,
|
|
19
|
+
convertBlockRootRollupOutputsFromWitnessMap,
|
|
20
|
+
convertBlockRootRollupPrivateInputsToWitnessMap,
|
|
21
|
+
convertBlockRootSingleTxFirstRollupOutputsFromWitnessMap,
|
|
22
|
+
convertBlockRootSingleTxFirstRollupPrivateInputsToWitnessMap,
|
|
23
|
+
convertBlockRootSingleTxRollupOutputsFromWitnessMap,
|
|
24
|
+
convertBlockRootSingleTxRollupPrivateInputsToWitnessMap,
|
|
25
|
+
convertCheckpointMergeRollupOutputsFromWitnessMap,
|
|
26
|
+
convertCheckpointMergeRollupPrivateInputsToWitnessMap,
|
|
27
|
+
convertCheckpointPaddingRollupOutputsFromWitnessMap,
|
|
28
|
+
convertCheckpointPaddingRollupPrivateInputsToWitnessMap,
|
|
29
|
+
convertCheckpointRootRollupOutputsFromWitnessMap,
|
|
30
|
+
convertCheckpointRootRollupPrivateInputsToWitnessMap,
|
|
31
|
+
convertCheckpointRootSingleBlockRollupOutputsFromWitnessMap,
|
|
32
|
+
convertCheckpointRootSingleBlockRollupPrivateInputsToWitnessMap,
|
|
33
|
+
convertParityBaseOutputsFromWitnessMap,
|
|
34
|
+
convertParityBasePrivateInputsToWitnessMap,
|
|
35
|
+
convertParityRootOutputsFromWitnessMap,
|
|
36
|
+
convertParityRootPrivateInputsToWitnessMap,
|
|
37
|
+
convertPrivateTxBaseRollupOutputsFromWitnessMap,
|
|
38
|
+
convertPrivateTxBaseRollupPrivateInputsToWitnessMap,
|
|
39
|
+
convertPublicTxBaseRollupOutputsFromWitnessMap,
|
|
40
|
+
convertPublicTxBaseRollupPrivateInputsToWitnessMap,
|
|
26
41
|
convertRootRollupOutputsFromWitnessMap,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
convertSimulatedPublicBaseRollupOutputsFromWitnessMap,
|
|
33
|
-
convertSimulatedSingleTxBlockRootRollupInputsToWitnessMap,
|
|
34
|
-
convertSimulatedSingleTxBlockRootRollupOutputsFromWitnessMap,
|
|
42
|
+
convertRootRollupPrivateInputsToWitnessMap,
|
|
43
|
+
convertTxMergeRollupOutputsFromWitnessMap,
|
|
44
|
+
convertTxMergeRollupPrivateInputsToWitnessMap,
|
|
45
|
+
foreignCallHandler,
|
|
46
|
+
getSimulatedServerCircuitArtifact,
|
|
35
47
|
} from '@aztec/noir-protocol-circuits-types/server';
|
|
36
48
|
import { ProtocolCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
37
|
-
import {
|
|
49
|
+
import { mapProtocolArtifactNameToCircuitName } from '@aztec/noir-protocol-circuits-types/types';
|
|
50
|
+
import type { WitnessMap } from '@aztec/noir-types';
|
|
51
|
+
import { type CircuitSimulator, WASMSimulatorWithBlobs, emitCircuitSimulationStats } from '@aztec/simulator/server';
|
|
38
52
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
39
53
|
import {
|
|
40
54
|
type ProofAndVerificationKey,
|
|
@@ -43,29 +57,34 @@ import {
|
|
|
43
57
|
makeProofAndVerificationKey,
|
|
44
58
|
makePublicInputsAndRecursiveProof,
|
|
45
59
|
} from '@aztec/stdlib/interfaces/server';
|
|
46
|
-
import type {
|
|
60
|
+
import type { ParityBasePrivateInputs, ParityPublicInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
47
61
|
import { type Proof, ProvingRequestType, makeEmptyRecursiveProof, makeRecursiveProof } from '@aztec/stdlib/proofs';
|
|
48
|
-
import
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
import {
|
|
63
|
+
type BlockMergeRollupPrivateInputs,
|
|
64
|
+
type BlockRollupPublicInputs,
|
|
65
|
+
type BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
66
|
+
type BlockRootFirstRollupPrivateInputs,
|
|
67
|
+
type BlockRootRollupPrivateInputs,
|
|
68
|
+
type BlockRootSingleTxFirstRollupPrivateInputs,
|
|
69
|
+
type BlockRootSingleTxRollupPrivateInputs,
|
|
70
|
+
type CheckpointMergeRollupPrivateInputs,
|
|
71
|
+
type CheckpointPaddingRollupPrivateInputs,
|
|
72
|
+
type CheckpointRollupPublicInputs,
|
|
73
|
+
type CheckpointRootRollupPrivateInputs,
|
|
74
|
+
type CheckpointRootSingleBlockRollupPrivateInputs,
|
|
75
|
+
type PrivateTxBaseRollupPrivateInputs,
|
|
76
|
+
type PublicChonkVerifierPrivateInputs,
|
|
77
|
+
PublicChonkVerifierPublicInputs,
|
|
78
|
+
type PublicTxBaseRollupPrivateInputs,
|
|
79
|
+
type RootRollupPrivateInputs,
|
|
80
|
+
type RootRollupPublicInputs,
|
|
81
|
+
type TxMergeRollupPrivateInputs,
|
|
82
|
+
type TxRollupPublicInputs,
|
|
61
83
|
} from '@aztec/stdlib/rollup';
|
|
62
84
|
import { VerificationKeyData } from '@aztec/stdlib/vks';
|
|
63
85
|
import { type TelemetryClient, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
64
86
|
|
|
65
|
-
import type { WitnessMap } from '@noir-lang/types';
|
|
66
|
-
|
|
67
87
|
import { ProverInstrumentation } from '../instrumentation.js';
|
|
68
|
-
import { mapProtocolArtifactNameToCircuitName } from '../stats.js';
|
|
69
88
|
import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
|
|
70
89
|
|
|
71
90
|
type TestDelay =
|
|
@@ -88,7 +107,7 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
88
107
|
private logger = createLogger('bb-prover:test-prover');
|
|
89
108
|
|
|
90
109
|
constructor(
|
|
91
|
-
private
|
|
110
|
+
private simulator?: CircuitSimulator,
|
|
92
111
|
private opts: TestDelay = { proverTestDelayType: 'fixed', proverTestDelayMs: 0 },
|
|
93
112
|
telemetry: TelemetryClient = getTelemetryClient(),
|
|
94
113
|
) {
|
|
@@ -106,15 +125,15 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
106
125
|
*/
|
|
107
126
|
@trackSpan('TestCircuitProver.getBaseParityProof')
|
|
108
127
|
public getBaseParityProof(
|
|
109
|
-
inputs:
|
|
128
|
+
inputs: ParityBasePrivateInputs,
|
|
110
129
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>> {
|
|
111
|
-
return this.applyDelay(ProvingRequestType.
|
|
130
|
+
return this.applyDelay(ProvingRequestType.PARITY_BASE, () =>
|
|
112
131
|
this.simulate(
|
|
113
132
|
inputs,
|
|
114
|
-
'
|
|
133
|
+
'ParityBaseArtifact',
|
|
115
134
|
RECURSIVE_PROOF_LENGTH,
|
|
116
|
-
|
|
117
|
-
|
|
135
|
+
convertParityBasePrivateInputsToWitnessMap,
|
|
136
|
+
convertParityBaseOutputsFromWitnessMap,
|
|
118
137
|
),
|
|
119
138
|
);
|
|
120
139
|
}
|
|
@@ -126,55 +145,59 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
126
145
|
*/
|
|
127
146
|
@trackSpan('TestCircuitProver.getRootParityProof')
|
|
128
147
|
public getRootParityProof(
|
|
129
|
-
inputs:
|
|
148
|
+
inputs: ParityRootPrivateInputs,
|
|
130
149
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>> {
|
|
131
|
-
return this.applyDelay(ProvingRequestType.
|
|
150
|
+
return this.applyDelay(ProvingRequestType.PARITY_ROOT, () =>
|
|
132
151
|
this.simulate(
|
|
133
152
|
inputs,
|
|
134
|
-
'
|
|
153
|
+
'ParityRootArtifact',
|
|
135
154
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
136
|
-
|
|
137
|
-
|
|
155
|
+
convertParityRootPrivateInputsToWitnessMap,
|
|
156
|
+
convertParityRootOutputsFromWitnessMap,
|
|
138
157
|
),
|
|
139
158
|
);
|
|
140
159
|
}
|
|
141
160
|
|
|
142
|
-
public
|
|
143
|
-
|
|
144
|
-
|
|
161
|
+
public getPublicChonkVerifierProof(
|
|
162
|
+
inputs: PublicChonkVerifierPrivateInputs,
|
|
163
|
+
): Promise<
|
|
164
|
+
PublicInputsAndRecursiveProof<PublicChonkVerifierPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
165
|
+
> {
|
|
166
|
+
return this.applyDelay(ProvingRequestType.PUBLIC_CHONK_VERIFIER, () =>
|
|
167
|
+
makePublicInputsAndRecursiveProof(
|
|
168
|
+
new PublicChonkVerifierPublicInputs(inputs.hidingKernelProofData.publicInputs, inputs.proverId),
|
|
169
|
+
makeEmptyRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
170
|
+
ProtocolCircuitVks.PublicChonkVerifier,
|
|
171
|
+
),
|
|
145
172
|
);
|
|
146
173
|
}
|
|
147
174
|
|
|
148
|
-
@trackSpan('TestCircuitProver.
|
|
149
|
-
public
|
|
150
|
-
inputs:
|
|
151
|
-
): Promise<
|
|
152
|
-
|
|
153
|
-
> {
|
|
154
|
-
return this.applyDelay(ProvingRequestType.PRIVATE_BASE_ROLLUP, () =>
|
|
175
|
+
@trackSpan('TestCircuitProver.getPrivateTxBaseRollupProof')
|
|
176
|
+
public getPrivateTxBaseRollupProof(
|
|
177
|
+
inputs: PrivateTxBaseRollupPrivateInputs,
|
|
178
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
179
|
+
return this.applyDelay(ProvingRequestType.PRIVATE_TX_BASE_ROLLUP, () =>
|
|
155
180
|
this.simulate(
|
|
156
181
|
inputs,
|
|
157
|
-
'
|
|
182
|
+
'PrivateTxBaseRollupArtifact',
|
|
158
183
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
159
|
-
|
|
160
|
-
|
|
184
|
+
convertPrivateTxBaseRollupPrivateInputsToWitnessMap,
|
|
185
|
+
convertPrivateTxBaseRollupOutputsFromWitnessMap,
|
|
161
186
|
),
|
|
162
187
|
);
|
|
163
188
|
}
|
|
164
189
|
|
|
165
|
-
@trackSpan('TestCircuitProver.
|
|
166
|
-
public
|
|
167
|
-
inputs:
|
|
168
|
-
): Promise<
|
|
169
|
-
|
|
170
|
-
> {
|
|
171
|
-
return this.applyDelay(ProvingRequestType.PUBLIC_BASE_ROLLUP, () =>
|
|
190
|
+
@trackSpan('TestCircuitProver.getPublicTxBaseRollupProof')
|
|
191
|
+
public getPublicTxBaseRollupProof(
|
|
192
|
+
inputs: PublicTxBaseRollupPrivateInputs,
|
|
193
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
194
|
+
return this.applyDelay(ProvingRequestType.PUBLIC_TX_BASE_ROLLUP, () =>
|
|
172
195
|
this.simulate(
|
|
173
196
|
inputs,
|
|
174
|
-
'
|
|
197
|
+
'PublicTxBaseRollupArtifact',
|
|
175
198
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
176
|
-
|
|
177
|
-
|
|
199
|
+
convertPublicTxBaseRollupPrivateInputsToWitnessMap,
|
|
200
|
+
convertPublicTxBaseRollupOutputsFromWitnessMap,
|
|
178
201
|
),
|
|
179
202
|
);
|
|
180
203
|
}
|
|
@@ -184,102 +207,175 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
184
207
|
* @param input - Inputs to the circuit.
|
|
185
208
|
* @returns The public inputs as outputs of the simulation.
|
|
186
209
|
*/
|
|
187
|
-
@trackSpan('TestCircuitProver.
|
|
188
|
-
public
|
|
189
|
-
input:
|
|
190
|
-
): Promise<
|
|
191
|
-
|
|
192
|
-
> {
|
|
193
|
-
return this.applyDelay(ProvingRequestType.MERGE_ROLLUP, () =>
|
|
210
|
+
@trackSpan('TestCircuitProver.getTxMergeRollupProof')
|
|
211
|
+
public getTxMergeRollupProof(
|
|
212
|
+
input: TxMergeRollupPrivateInputs,
|
|
213
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
214
|
+
return this.applyDelay(ProvingRequestType.TX_MERGE_ROLLUP, () =>
|
|
194
215
|
this.simulate(
|
|
195
216
|
input,
|
|
196
|
-
'
|
|
217
|
+
'TxMergeRollupArtifact',
|
|
197
218
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
198
|
-
|
|
199
|
-
|
|
219
|
+
convertTxMergeRollupPrivateInputsToWitnessMap,
|
|
220
|
+
convertTxMergeRollupOutputsFromWitnessMap,
|
|
221
|
+
),
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@trackSpan('TestCircuitProver.getBlockRootFirstRollupProof')
|
|
226
|
+
public getBlockRootFirstRollupProof(
|
|
227
|
+
input: BlockRootFirstRollupPrivateInputs,
|
|
228
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
229
|
+
return this.applyDelay(ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP, () =>
|
|
230
|
+
this.simulate(
|
|
231
|
+
input,
|
|
232
|
+
'BlockRootFirstRollupArtifact',
|
|
233
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
234
|
+
convertBlockRootFirstRollupPrivateInputsToWitnessMap,
|
|
235
|
+
convertBlockRootFirstRollupOutputsFromWitnessMap,
|
|
236
|
+
),
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@trackSpan('TestCircuitProver.getBlockRootSingleTxFirstRollupProof')
|
|
241
|
+
public async getBlockRootSingleTxFirstRollupProof(
|
|
242
|
+
input: BlockRootSingleTxFirstRollupPrivateInputs,
|
|
243
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
244
|
+
return await this.applyDelay(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP, () =>
|
|
245
|
+
this.simulate(
|
|
246
|
+
input,
|
|
247
|
+
'BlockRootSingleTxFirstRollupArtifact',
|
|
248
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
249
|
+
convertBlockRootSingleTxFirstRollupPrivateInputsToWitnessMap,
|
|
250
|
+
convertBlockRootSingleTxFirstRollupOutputsFromWitnessMap,
|
|
251
|
+
),
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@trackSpan('TestCircuitProver.getBlockRootEmptyTxFirstRollupProof')
|
|
256
|
+
public getBlockRootEmptyTxFirstRollupProof(
|
|
257
|
+
input: BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
258
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
259
|
+
return this.applyDelay(ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP, () =>
|
|
260
|
+
this.simulate(
|
|
261
|
+
input,
|
|
262
|
+
'BlockRootEmptyTxFirstRollupArtifact',
|
|
263
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
264
|
+
convertBlockRootEmptyTxFirstRollupPrivateInputsToWitnessMap,
|
|
265
|
+
convertBlockRootEmptyTxFirstRollupOutputsFromWitnessMap,
|
|
200
266
|
),
|
|
201
267
|
);
|
|
202
268
|
}
|
|
203
269
|
|
|
204
|
-
/**
|
|
205
|
-
* Simulates the block root rollup circuit from its inputs.
|
|
206
|
-
* @param input - Inputs to the circuit.
|
|
207
|
-
* @returns The public inputs as outputs of the simulation.
|
|
208
|
-
*/
|
|
209
270
|
@trackSpan('TestCircuitProver.getBlockRootRollupProof')
|
|
210
271
|
public getBlockRootRollupProof(
|
|
211
|
-
input:
|
|
212
|
-
): Promise<
|
|
213
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
214
|
-
> {
|
|
272
|
+
input: BlockRootRollupPrivateInputs,
|
|
273
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
215
274
|
return this.applyDelay(ProvingRequestType.BLOCK_ROOT_ROLLUP, () =>
|
|
216
275
|
this.simulate(
|
|
217
276
|
input,
|
|
218
277
|
'BlockRootRollupArtifact',
|
|
219
278
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
220
|
-
|
|
221
|
-
|
|
279
|
+
convertBlockRootRollupPrivateInputsToWitnessMap,
|
|
280
|
+
convertBlockRootRollupOutputsFromWitnessMap,
|
|
281
|
+
),
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
@trackSpan('TestCircuitProver.getBlockRootSingleTxRollupProof')
|
|
286
|
+
public async getBlockRootSingleTxRollupProof(
|
|
287
|
+
input: BlockRootSingleTxRollupPrivateInputs,
|
|
288
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
289
|
+
return await this.applyDelay(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP, () =>
|
|
290
|
+
this.simulate(
|
|
291
|
+
input,
|
|
292
|
+
'BlockRootSingleTxRollupArtifact',
|
|
293
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
294
|
+
convertBlockRootSingleTxRollupPrivateInputsToWitnessMap,
|
|
295
|
+
convertBlockRootSingleTxRollupOutputsFromWitnessMap,
|
|
296
|
+
),
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
@trackSpan('TestCircuitProver.getBlockMergeRollupProof')
|
|
301
|
+
public getBlockMergeRollupProof(
|
|
302
|
+
input: BlockMergeRollupPrivateInputs,
|
|
303
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
304
|
+
return this.applyDelay(ProvingRequestType.BLOCK_MERGE_ROLLUP, () =>
|
|
305
|
+
this.simulate(
|
|
306
|
+
input,
|
|
307
|
+
'BlockMergeRollupArtifact',
|
|
308
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
309
|
+
convertBlockMergeRollupPrivateInputsToWitnessMap,
|
|
310
|
+
convertBlockMergeRollupOutputsFromWitnessMap,
|
|
222
311
|
),
|
|
223
312
|
);
|
|
224
313
|
}
|
|
225
314
|
|
|
226
|
-
@trackSpan('TestCircuitProver.
|
|
227
|
-
public
|
|
228
|
-
input:
|
|
315
|
+
@trackSpan('TestCircuitProver.getCheckpointRootRollupProof')
|
|
316
|
+
public getCheckpointRootRollupProof(
|
|
317
|
+
input: CheckpointRootRollupPrivateInputs,
|
|
229
318
|
): Promise<
|
|
230
|
-
PublicInputsAndRecursiveProof<
|
|
319
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
231
320
|
> {
|
|
232
|
-
return
|
|
321
|
+
return this.applyDelay(ProvingRequestType.CHECKPOINT_ROOT_ROLLUP, () =>
|
|
233
322
|
this.simulate(
|
|
234
323
|
input,
|
|
235
|
-
'
|
|
324
|
+
'CheckpointRootRollupArtifact',
|
|
236
325
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
237
|
-
|
|
238
|
-
|
|
326
|
+
convertCheckpointRootRollupPrivateInputsToWitnessMap,
|
|
327
|
+
convertCheckpointRootRollupOutputsFromWitnessMap,
|
|
239
328
|
),
|
|
240
329
|
);
|
|
241
330
|
}
|
|
242
331
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
* @returns The public inputs as outputs of the simulation.
|
|
247
|
-
*/
|
|
248
|
-
@trackSpan('TestCircuitProver.getEmptyBlockRootRollupProof')
|
|
249
|
-
public getEmptyBlockRootRollupProof(
|
|
250
|
-
input: EmptyBlockRootRollupInputs,
|
|
332
|
+
@trackSpan('TestCircuitProver.getCheckpointRootSingleBlockRollupProof')
|
|
333
|
+
public getCheckpointRootSingleBlockRollupProof(
|
|
334
|
+
input: CheckpointRootSingleBlockRollupPrivateInputs,
|
|
251
335
|
): Promise<
|
|
252
|
-
PublicInputsAndRecursiveProof<
|
|
336
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
253
337
|
> {
|
|
254
|
-
return this.applyDelay(ProvingRequestType.
|
|
338
|
+
return this.applyDelay(ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP, () =>
|
|
255
339
|
this.simulate(
|
|
256
340
|
input,
|
|
257
|
-
'
|
|
341
|
+
'CheckpointRootSingleBlockRollupArtifact',
|
|
258
342
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
259
|
-
|
|
260
|
-
|
|
343
|
+
convertCheckpointRootSingleBlockRollupPrivateInputsToWitnessMap,
|
|
344
|
+
convertCheckpointRootSingleBlockRollupOutputsFromWitnessMap,
|
|
261
345
|
),
|
|
262
346
|
);
|
|
263
347
|
}
|
|
264
348
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
* @returns The public inputs as outputs of the simulation.
|
|
269
|
-
*/
|
|
270
|
-
@trackSpan('TestCircuitProver.getBlockMergeRollupProof')
|
|
271
|
-
public getBlockMergeRollupProof(
|
|
272
|
-
input: BlockMergeRollupInputs,
|
|
349
|
+
@trackSpan('TestCircuitProver.getCheckpointPaddingRollupProof')
|
|
350
|
+
public getCheckpointPaddingRollupProof(
|
|
351
|
+
input: CheckpointPaddingRollupPrivateInputs,
|
|
273
352
|
): Promise<
|
|
274
|
-
PublicInputsAndRecursiveProof<
|
|
353
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
275
354
|
> {
|
|
276
|
-
return this.applyDelay(ProvingRequestType.
|
|
355
|
+
return this.applyDelay(ProvingRequestType.CHECKPOINT_PADDING_ROLLUP, () =>
|
|
277
356
|
this.simulate(
|
|
278
357
|
input,
|
|
279
|
-
'
|
|
358
|
+
'CheckpointPaddingRollupArtifact',
|
|
280
359
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
281
|
-
|
|
282
|
-
|
|
360
|
+
convertCheckpointPaddingRollupPrivateInputsToWitnessMap,
|
|
361
|
+
convertCheckpointPaddingRollupOutputsFromWitnessMap,
|
|
362
|
+
),
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
@trackSpan('TestCircuitProver.getCheckpointMergeRollupProof')
|
|
367
|
+
public getCheckpointMergeRollupProof(
|
|
368
|
+
input: CheckpointMergeRollupPrivateInputs,
|
|
369
|
+
): Promise<
|
|
370
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
371
|
+
> {
|
|
372
|
+
return this.applyDelay(ProvingRequestType.CHECKPOINT_MERGE_ROLLUP, () =>
|
|
373
|
+
this.simulate(
|
|
374
|
+
input,
|
|
375
|
+
'CheckpointMergeRollupArtifact',
|
|
376
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
377
|
+
convertCheckpointMergeRollupPrivateInputsToWitnessMap,
|
|
378
|
+
convertCheckpointMergeRollupOutputsFromWitnessMap,
|
|
283
379
|
),
|
|
284
380
|
);
|
|
285
381
|
}
|
|
@@ -290,26 +386,30 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
290
386
|
* @returns The public inputs as outputs of the simulation.
|
|
291
387
|
*/
|
|
292
388
|
@trackSpan('TestCircuitProver.getRootRollupProof')
|
|
293
|
-
public getRootRollupProof(
|
|
389
|
+
public getRootRollupProof(
|
|
390
|
+
input: RootRollupPrivateInputs,
|
|
391
|
+
): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs>> {
|
|
294
392
|
return this.applyDelay(ProvingRequestType.ROOT_ROLLUP, () =>
|
|
295
393
|
this.simulate(
|
|
296
394
|
input,
|
|
297
395
|
'RootRollupArtifact',
|
|
298
396
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
299
|
-
|
|
397
|
+
convertRootRollupPrivateInputsToWitnessMap,
|
|
300
398
|
convertRootRollupOutputsFromWitnessMap,
|
|
301
399
|
),
|
|
302
400
|
);
|
|
303
401
|
}
|
|
304
402
|
|
|
305
|
-
public getAvmProof(
|
|
403
|
+
public getAvmProof(
|
|
404
|
+
_inputs: AvmCircuitInputs,
|
|
405
|
+
): Promise<ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>> {
|
|
306
406
|
// We can't simulate the AVM because we don't have enough context to do so (e.g., DBs).
|
|
307
407
|
// We just return an empty proof and VK data.
|
|
308
408
|
this.logger.debug('Skipping AVM simulation in TestCircuitProver.');
|
|
309
409
|
return this.applyDelay(ProvingRequestType.PUBLIC_VM, () =>
|
|
310
410
|
makeProofAndVerificationKey(
|
|
311
|
-
makeEmptyRecursiveProof(
|
|
312
|
-
VerificationKeyData.makeFake(
|
|
411
|
+
makeEmptyRecursiveProof(AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED),
|
|
412
|
+
VerificationKeyData.makeFake(AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED),
|
|
313
413
|
),
|
|
314
414
|
);
|
|
315
415
|
}
|
|
@@ -341,25 +441,38 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
341
441
|
input: CircuitInputType,
|
|
342
442
|
artifactName: ServerProtocolArtifact,
|
|
343
443
|
proofLength: PROOF_LENGTH,
|
|
344
|
-
convertInput: (input: CircuitInputType) => WitnessMap,
|
|
345
|
-
convertOutput: (outputWitness: WitnessMap) => CircuitOutputType,
|
|
444
|
+
convertInput: (input: CircuitInputType, simulated?: boolean) => WitnessMap,
|
|
445
|
+
convertOutput: (outputWitness: WitnessMap, simulated?: boolean) => CircuitOutputType,
|
|
346
446
|
) {
|
|
347
447
|
const timer = new Timer();
|
|
348
|
-
const witnessMap = convertInput(input);
|
|
448
|
+
const witnessMap = convertInput(input, true /* simulated */);
|
|
349
449
|
const circuitName = mapProtocolArtifactNameToCircuitName(artifactName);
|
|
350
450
|
|
|
351
|
-
let
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
451
|
+
let witness: WitnessMap;
|
|
452
|
+
if (
|
|
453
|
+
['CheckpointRootRollupArtifact', 'CheckpointRootSingleBlockRollupArtifact'].includes(artifactName) ||
|
|
454
|
+
this.simulator == undefined
|
|
455
|
+
) {
|
|
456
|
+
// TODO(#10323): Native ACVM simulator does not support foreign call handler so we use the wasm simulator
|
|
457
|
+
// when simulating checkpoint root rollup circuits or when the native ACVM simulator is not provided.
|
|
458
|
+
witness = (
|
|
459
|
+
await this.wasmSimulator.executeProtocolCircuit(
|
|
460
|
+
witnessMap,
|
|
461
|
+
getSimulatedServerCircuitArtifact(artifactName),
|
|
462
|
+
foreignCallHandler,
|
|
463
|
+
)
|
|
464
|
+
).witness;
|
|
465
|
+
} else {
|
|
466
|
+
witness = (
|
|
467
|
+
await this.simulator.executeProtocolCircuit(
|
|
468
|
+
witnessMap,
|
|
469
|
+
getSimulatedServerCircuitArtifact(artifactName),
|
|
470
|
+
undefined, // Native ACM simulator does not support foreign call handler
|
|
471
|
+
)
|
|
472
|
+
).witness;
|
|
356
473
|
}
|
|
357
|
-
const witness = await simulationProvider.executeProtocolCircuit(
|
|
358
|
-
witnessMap,
|
|
359
|
-
SimulatedServerCircuitArtifacts[artifactName],
|
|
360
|
-
);
|
|
361
474
|
|
|
362
|
-
const result = convertOutput(witness);
|
|
475
|
+
const result = convertOutput(witness, true /* simulated */);
|
|
363
476
|
|
|
364
477
|
this.instrumentation.recordDuration('simulationDuration', circuitName, timer);
|
|
365
478
|
emitCircuitSimulationStats(circuitName, timer.ms(), input.toBuffer().length, result.toBuffer().length, this.logger);
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import type { ClientProtocolCircuitVerifier } from '@aztec/stdlib/interfaces/server';
|
|
1
|
+
import type { ClientProtocolCircuitVerifier, IVCProofVerificationResult } from '@aztec/stdlib/interfaces/server';
|
|
2
2
|
import type { Tx } from '@aztec/stdlib/tx';
|
|
3
3
|
|
|
4
4
|
export class TestCircuitVerifier implements ClientProtocolCircuitVerifier {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
constructor(private verificationDelayMs?: number) {}
|
|
6
|
+
verifyProof(_tx: Tx): Promise<IVCProofVerificationResult> {
|
|
7
|
+
if (this.verificationDelayMs !== undefined && this.verificationDelayMs > 0) {
|
|
8
|
+
return new Promise(resolve => {
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
resolve({ valid: true, durationMs: this.verificationDelayMs!, totalDurationMs: this.verificationDelayMs! });
|
|
11
|
+
}, this.verificationDelayMs);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return Promise.resolve({ valid: true, durationMs: 0, totalDurationMs: 0 });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public stop(): Promise<void> {
|
|
18
|
+
return Promise.resolve();
|
|
7
19
|
}
|
|
8
20
|
}
|