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