@aztec/bb-prover 2.1.0-rc.9 → 3.0.0-devnet.2

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 (49) hide show
  1. package/dest/avm_proving_tests/avm_proving_tester.d.ts +6 -4
  2. package/dest/avm_proving_tests/avm_proving_tester.d.ts.map +1 -1
  3. package/dest/avm_proving_tests/avm_proving_tester.js +18 -12
  4. package/dest/bb/execute.d.ts +1 -9
  5. package/dest/bb/execute.d.ts.map +1 -1
  6. package/dest/bb/execute.js +11 -77
  7. package/dest/honk.d.ts +1 -1
  8. package/dest/honk.js +2 -2
  9. package/dest/instrumentation.d.ts +2 -2
  10. package/dest/instrumentation.d.ts.map +1 -1
  11. package/dest/prover/client/bb_private_kernel_prover.d.ts +3 -3
  12. package/dest/prover/client/bb_private_kernel_prover.d.ts.map +1 -1
  13. package/dest/prover/client/bb_private_kernel_prover.js +1 -1
  14. package/dest/prover/client/native/bb_native_private_kernel_prover.d.ts +2 -2
  15. package/dest/prover/client/native/bb_native_private_kernel_prover.d.ts.map +1 -1
  16. package/dest/prover/client/wasm/bb_wasm_private_kernel_prover.d.ts +2 -2
  17. package/dest/prover/client/wasm/bb_wasm_private_kernel_prover.d.ts.map +1 -1
  18. package/dest/prover/client/wasm/bb_wasm_private_kernel_prover.js +3 -5
  19. package/dest/prover/proof_utils.d.ts +4 -4
  20. package/dest/prover/proof_utils.d.ts.map +1 -1
  21. package/dest/prover/proof_utils.js +36 -19
  22. package/dest/prover/server/bb_prover.d.ts +21 -32
  23. package/dest/prover/server/bb_prover.d.ts.map +1 -1
  24. package/dest/prover/server/bb_prover.js +64 -141
  25. package/dest/test/delay_values.d.ts.map +1 -1
  26. package/dest/test/delay_values.js +30 -20
  27. package/dest/test/test_circuit_prover.d.ts +20 -30
  28. package/dest/test/test_circuit_prover.d.ts.map +1 -1
  29. package/dest/test/test_circuit_prover.js +74 -56
  30. package/dest/verifier/bb_verifier.d.ts +2 -4
  31. package/dest/verifier/bb_verifier.d.ts.map +1 -1
  32. package/dest/verifier/bb_verifier.js +19 -24
  33. package/package.json +17 -18
  34. package/src/avm_proving_tests/avm_proving_tester.ts +26 -16
  35. package/src/bb/execute.ts +8 -75
  36. package/src/honk.ts +1 -1
  37. package/src/instrumentation.ts +2 -2
  38. package/src/prover/client/bb_private_kernel_prover.ts +7 -5
  39. package/src/prover/client/native/bb_native_private_kernel_prover.ts +5 -3
  40. package/src/prover/client/wasm/bb_wasm_private_kernel_prover.ts +6 -6
  41. package/src/prover/proof_utils.ts +47 -25
  42. package/src/prover/server/bb_prover.ts +229 -288
  43. package/src/test/delay_values.ts +30 -20
  44. package/src/test/test_circuit_prover.ts +217 -142
  45. package/src/verifier/bb_verifier.ts +31 -30
  46. package/dest/stats.d.ts +0 -4
  47. package/dest/stats.d.ts.map +0 -1
  48. package/dest/stats.js +0 -45
  49. package/src/stats.ts +0 -47
@@ -1,10 +1,10 @@
1
- import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH, TUBE_PROOF_LENGTH } from '@aztec/constants';
1
+ import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH } from '@aztec/constants';
2
2
  import { type ServerProtocolArtifact } from '@aztec/noir-protocol-circuits-types/server';
3
3
  import type { AvmCircuitInputs, AvmCircuitPublicInputs } from '@aztec/stdlib/avm';
4
4
  import { type ProofAndVerificationKey, type PublicInputsAndRecursiveProof, type ServerCircuitProver } from '@aztec/stdlib/interfaces/server';
5
- import type { BaseParityInputs, ParityPublicInputs, RootParityInputs } from '@aztec/stdlib/parity';
5
+ import type { ParityBasePrivateInputs, ParityPublicInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
6
6
  import { Proof } from '@aztec/stdlib/proofs';
7
- import { type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, type BlockRootOrBlockMergePublicInputs, type BlockRootRollupInputs, type EmptyBlockRootRollupInputs, type MergeRollupInputs, PaddingBlockRootRollupInputs, type PrivateBaseRollupInputs, PublicBaseRollupInputs, type RootRollupInputs, type RootRollupPublicInputs, type SingleTxBlockRootRollupInputs, type TubeInputs } from '@aztec/stdlib/rollup';
7
+ import { BlockMergeRollupPrivateInputs, BlockRollupPublicInputs, BlockRootEmptyTxFirstRollupPrivateInputs, BlockRootFirstRollupPrivateInputs, BlockRootRollupPrivateInputs, BlockRootSingleTxFirstRollupPrivateInputs, BlockRootSingleTxRollupPrivateInputs, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, CheckpointRootRollupPrivateInputs, CheckpointRootSingleBlockRollupPrivateInputs, type PrivateTxBaseRollupPrivateInputs, PublicTubePrivateInputs, PublicTubePublicInputs, PublicTxBaseRollupPrivateInputs, type RootRollupPrivateInputs, type RootRollupPublicInputs, type TxMergeRollupPrivateInputs, type TxRollupPublicInputs } from '@aztec/stdlib/rollup';
8
8
  import type { VerificationKeyData } from '@aztec/stdlib/vks';
9
9
  import { type TelemetryClient } from '@aztec/telemetry-client';
10
10
  import type { ACVMConfig, BBConfig } from '../../config.js';
@@ -26,69 +26,58 @@ export declare class BBNativeRollupProver implements ServerCircuitProver {
26
26
  * @param inputs - Inputs to the circuit.
27
27
  * @returns The public inputs of the parity circuit.
28
28
  */
29
- getBaseParityProof(inputs: BaseParityInputs): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>>;
29
+ getBaseParityProof(inputs: ParityBasePrivateInputs): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>>;
30
30
  /**
31
31
  * Simulates the root parity circuit from its inputs.
32
32
  * @param inputs - Inputs to the circuit.
33
33
  * @returns The public inputs of the parity circuit.
34
34
  */
35
- getRootParityProof(inputs: RootParityInputs): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
35
+ getRootParityProof(inputs: ParityRootPrivateInputs): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
36
36
  /**
37
37
  * Creates an AVM proof and verifies it.
38
38
  * @param inputs - The inputs to the AVM circuit.
39
39
  * @returns The proof.
40
40
  */
41
41
  getAvmProof(inputs: AvmCircuitInputs, skipPublicInputsValidation?: boolean): Promise<ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>>;
42
+ getPublicTubeProof(inputs: PublicTubePrivateInputs): Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
42
43
  /**
43
44
  * Simulates the base rollup circuit from its inputs.
44
45
  * @param inputs - Inputs to the circuit.
45
46
  * @returns The public inputs as outputs of the simulation.
46
47
  */
47
- getPrivateBaseRollupProof(inputs: PrivateBaseRollupInputs): Promise<PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
48
+ getPrivateTxBaseRollupProof(inputs: PrivateTxBaseRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
48
49
  /**
49
50
  * Requests that the public kernel tail circuit be executed and the proof generated
50
51
  * @param kernelRequest - The object encapsulating the request for a proof
51
52
  * @returns The requested circuit's public inputs and proof
52
53
  */
53
- getPublicBaseRollupProof(inputs: PublicBaseRollupInputs): Promise<PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
54
+ getPublicTxBaseRollupProof(inputs: PublicTxBaseRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
54
55
  /**
55
56
  * Simulates the merge rollup circuit from its inputs.
56
57
  * @param input - Inputs to the circuit.
57
58
  * @returns The public inputs as outputs of the simulation.
58
59
  */
59
- getMergeRollupProof(input: MergeRollupInputs): Promise<PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
60
- /**
61
- * Simulates the block root rollup circuit from its inputs.
62
- * @param input - Inputs to the circuit.
63
- * @returns The public inputs as outputs of the simulation.
64
- */
65
- getBlockRootRollupProof(input: BlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
66
- getSingleTxBlockRootRollupProof(input: SingleTxBlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
67
- /**
68
- * Simulates the empty block root rollup circuit from its inputs.
69
- * @param input - Inputs to the circuit.
70
- * @returns The public inputs as outputs of the simulation.
71
- */
72
- getEmptyBlockRootRollupProof(input: EmptyBlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
73
- getPaddingBlockRootRollupProof(input: PaddingBlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
74
- /**
75
- * Simulates the block merge rollup circuit from its inputs.
76
- * @param input - Inputs to the circuit.
77
- * @returns The public inputs as outputs of the simulation.
78
- */
79
- getBlockMergeRollupProof(input: BlockMergeRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
60
+ getTxMergeRollupProof(input: TxMergeRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
61
+ getBlockRootFirstRollupProof(input: BlockRootFirstRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
62
+ getBlockRootSingleTxFirstRollupProof(input: BlockRootSingleTxFirstRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
63
+ getBlockRootEmptyTxFirstRollupProof(input: BlockRootEmptyTxFirstRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
64
+ getBlockRootRollupProof(input: BlockRootRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
65
+ getBlockRootSingleTxRollupProof(input: BlockRootSingleTxRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
66
+ getBlockMergeRollupProof(input: BlockMergeRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
67
+ getCheckpointRootRollupProof(input: CheckpointRootRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
68
+ getCheckpointRootSingleBlockRollupProof(input: CheckpointRootSingleBlockRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
69
+ getCheckpointPaddingRollupProof(input: CheckpointPaddingRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
70
+ getCheckpointMergeRollupProof(input: CheckpointMergeRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
80
71
  /**
81
72
  * Simulates the root rollup circuit from its inputs.
82
73
  * @param input - Inputs to the circuit.
83
74
  * @returns The public inputs as outputs of the simulation.
84
75
  */
85
- getRootRollupProof(input: RootRollupInputs): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs>>;
76
+ getRootRollupProof(input: RootRollupPrivateInputs): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
77
+ private createRecursiveProofAndVerify;
86
78
  private generateProofWithBB;
87
- private createProof;
88
79
  private generateAvmProofWithBB;
89
- private generateTubeProofWithBB;
90
80
  private createAvmProof;
91
- getTubeProof(input: TubeInputs): Promise<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>>;
92
81
  /**
93
82
  * Executes a circuit and returns its outputs and corresponding proof with embedded aggregation object
94
83
  * @param witnessMap - The input witness
@@ -1 +1 @@
1
- {"version":3,"file":"bb_prover.d.ts","sourceRoot":"","sources":["../../../src/prover/server/bb_prover.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EACpC,6BAA6B,EAC7B,yCAAyC,EAEzC,sBAAsB,EACtB,iBAAiB,EAElB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,KAAK,sBAAsB,EAwB5B,MAAM,4CAA4C,CAAC;AAIpD,OAAO,K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BAAqB;IA2BnC;;;;OAIG;IACH,OAAO,CAAC,gCAAgC;YAQ1B,oBAAoB;IAuBlC,OAAO,CAAC,cAAc;CAYvB"}
@@ -4,29 +4,27 @@ 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, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, PAIRING_POINTS_SIZE, RECURSIVE_PROOF_LENGTH, TUBE_PROOF_LENGTH, ULTRA_KECCAK_PROOF_LENGTH } from '@aztec/constants';
7
+ import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, PAIRING_POINTS_SIZE, RECURSIVE_PROOF_LENGTH, ULTRA_KECCAK_PROOF_LENGTH } from '@aztec/constants';
8
8
  import { Fr } from '@aztec/foundation/fields';
9
9
  import { runInDirectory } from '@aztec/foundation/fs';
10
10
  import { createLogger } from '@aztec/foundation/log';
11
11
  import { BufferReader } from '@aztec/foundation/serialize';
12
- import { convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap, convertBlockMergeRollupInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap, convertBlockRootRollupInputsToWitnessMap, convertBlockRootRollupOutputsFromWitnessMap, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap, convertPaddingBlockRootRollupInputsToWitnessMap, convertPaddingBlockRootRollupOutputsFromWitnessMap, convertPrivateBaseRollupInputsToWitnessMap, convertPrivateBaseRollupOutputsFromWitnessMap, convertPublicBaseRollupInputsToWitnessMap, convertPublicBaseRollupOutputsFromWitnessMap, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap, convertRootRollupInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap, convertSingleTxBlockRootRollupInputsToWitnessMap, convertSingleTxBlockRootRollupOutputsFromWitnessMap, getServerCircuitArtifact } from '@aztec/noir-protocol-circuits-types/server';
12
+ 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, convertPublicTubeOutputsFromWitnessMap, convertPublicTubePrivateInputsToWitnessMap, convertPublicTxBaseRollupOutputsFromWitnessMap, convertPublicTxBaseRollupPrivateInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap, convertRootRollupPrivateInputsToWitnessMap, convertTxMergeRollupOutputsFromWitnessMap, convertTxMergeRollupPrivateInputsToWitnessMap, getServerCircuitArtifact } from '@aztec/noir-protocol-circuits-types/server';
13
13
  import { ServerCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
14
+ import { mapProtocolArtifactNameToCircuitName } from '@aztec/noir-protocol-circuits-types/types';
14
15
  import { NativeACVMSimulator } from '@aztec/simulator/server';
15
16
  import { ProvingError } from '@aztec/stdlib/errors';
16
17
  import { makeProofAndVerificationKey, makePublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
17
18
  import { Proof, RecursiveProof, makeRecursiveProofFromBinary } from '@aztec/stdlib/proofs';
18
19
  import { enhanceProofWithPiValidationFlag } from '@aztec/stdlib/rollup';
19
20
  import { Attributes, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
20
- import crypto from 'crypto';
21
21
  import { promises as fs } from 'fs';
22
22
  import * as path from 'path';
23
- import { BB_RESULT, PROOF_FILENAME, PUBLIC_INPUTS_FILENAME, VK_FILENAME, generateAvmProof, generateProof, generateTubeProof, verifyAvmProof, verifyProof } from '../../bb/execute.js';
23
+ import { BB_RESULT, PROOF_FILENAME, PUBLIC_INPUTS_FILENAME, VK_FILENAME, generateAvmProof, generateProof, verifyAvmProof, verifyProof } from '../../bb/execute.js';
24
24
  import { getUltraHonkFlavorForCircuit } from '../../honk.js';
25
25
  import { ProverInstrumentation } from '../../instrumentation.js';
26
- import { mapProtocolArtifactNameToCircuitName } from '../../stats.js';
27
- import { extractAvmVkData, extractVkData } from '../../verification_key/verification_key_data.js';
28
- import { PRIVATE_TAIL_CIVC_VK, PUBLIC_TAIL_CIVC_VK } from '../../verifier/bb_verifier.js';
29
- import { readProofAsFields, writeClientIVCProofToOutputDirectory } from '../proof_utils.js';
26
+ import { extractAvmVkData } from '../../verification_key/verification_key_data.js';
27
+ import { readProofsFromOutputDirectory } from '../proof_utils.js';
30
28
  const logger = createLogger('bb-prover');
31
29
  /**
32
30
  * Prover implementation that uses barretenberg native proving
@@ -57,21 +55,15 @@ const logger = createLogger('bb-prover');
57
55
  * Simulates the base parity circuit from its inputs.
58
56
  * @param inputs - Inputs to the circuit.
59
57
  * @returns The public inputs of the parity circuit.
60
- */ async getBaseParityProof(inputs) {
61
- const { circuitOutput, proof } = await this.createRecursiveProof(inputs, 'BaseParityArtifact', RECURSIVE_PROOF_LENGTH, convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap);
62
- const verificationKey = this.getVerificationKeyDataForCircuit('BaseParityArtifact');
63
- await this.verifyProof('BaseParityArtifact', proof.binaryProof);
64
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
58
+ */ getBaseParityProof(inputs) {
59
+ return this.createRecursiveProofAndVerify(inputs, 'ParityBaseArtifact', RECURSIVE_PROOF_LENGTH, convertParityBasePrivateInputsToWitnessMap, convertParityBaseOutputsFromWitnessMap);
65
60
  }
66
61
  /**
67
62
  * Simulates the root parity circuit from its inputs.
68
63
  * @param inputs - Inputs to the circuit.
69
64
  * @returns The public inputs of the parity circuit.
70
- */ async getRootParityProof(inputs) {
71
- const { circuitOutput, proof } = await this.createRecursiveProof(inputs, 'RootParityArtifact', NESTED_RECURSIVE_PROOF_LENGTH, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap);
72
- const verificationKey = this.getVerificationKeyDataForCircuit('RootParityArtifact');
73
- await this.verifyProof('RootParityArtifact', proof.binaryProof);
74
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
65
+ */ getRootParityProof(inputs) {
66
+ return this.createRecursiveProofAndVerify(inputs, 'ParityRootArtifact', NESTED_RECURSIVE_PROOF_LENGTH, convertParityRootPrivateInputsToWitnessMap, convertParityRootOutputsFromWitnessMap);
75
67
  }
76
68
  /**
77
69
  * Creates an AVM proof and verifies it.
@@ -84,92 +76,83 @@ const logger = createLogger('bb-prover');
84
76
  proofAndVk.proof.proof = enhanceProofWithPiValidationFlag(proofAndVk.proof.proof, skipPublicInputsValidation);
85
77
  return proofAndVk;
86
78
  }
79
+ async getPublicTubeProof(inputs) {
80
+ const artifactName = 'PublicTube';
81
+ const { circuitOutput, proof } = await this.createRecursiveProof(inputs, artifactName, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPublicTubePrivateInputsToWitnessMap, convertPublicTubeOutputsFromWitnessMap);
82
+ const verificationKey = this.getVerificationKeyDataForCircuit(artifactName);
83
+ await this.verifyProof(artifactName, proof.binaryProof);
84
+ return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
85
+ }
87
86
  /**
88
87
  * Simulates the base rollup circuit from its inputs.
89
88
  * @param inputs - Inputs to the circuit.
90
89
  * @returns The public inputs as outputs of the simulation.
91
- */ async getPrivateBaseRollupProof(inputs) {
92
- const artifactName = 'PrivateBaseRollupArtifact';
93
- const { circuitOutput, proof } = await this.createRecursiveProof(inputs, artifactName, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPrivateBaseRollupInputsToWitnessMap, convertPrivateBaseRollupOutputsFromWitnessMap);
94
- const verificationKey = this.getVerificationKeyDataForCircuit(artifactName);
95
- await this.verifyProof(artifactName, proof.binaryProof);
96
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
90
+ */ getPrivateTxBaseRollupProof(inputs) {
91
+ return this.createRecursiveProofAndVerify(inputs, 'PrivateTxBaseRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPrivateTxBaseRollupPrivateInputsToWitnessMap, convertPrivateTxBaseRollupOutputsFromWitnessMap);
97
92
  }
98
93
  /**
99
94
  * Requests that the public kernel tail circuit be executed and the proof generated
100
95
  * @param kernelRequest - The object encapsulating the request for a proof
101
96
  * @returns The requested circuit's public inputs and proof
102
- */ async getPublicBaseRollupProof(inputs) {
103
- const artifactName = 'PublicBaseRollupArtifact';
104
- const { circuitOutput, proof } = await this.createRecursiveProof(inputs, artifactName, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPublicBaseRollupInputsToWitnessMap, convertPublicBaseRollupOutputsFromWitnessMap);
105
- const verificationKey = this.getVerificationKeyDataForCircuit(artifactName);
106
- await this.verifyProof(artifactName, proof.binaryProof);
107
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
97
+ */ getPublicTxBaseRollupProof(inputs) {
98
+ return this.createRecursiveProofAndVerify(inputs, 'PublicTxBaseRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPublicTxBaseRollupPrivateInputsToWitnessMap, convertPublicTxBaseRollupOutputsFromWitnessMap);
108
99
  }
109
100
  /**
110
101
  * Simulates the merge rollup circuit from its inputs.
111
102
  * @param input - Inputs to the circuit.
112
103
  * @returns The public inputs as outputs of the simulation.
113
- */ async getMergeRollupProof(input) {
114
- const { circuitOutput, proof } = await this.createRecursiveProof(input, 'MergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap);
115
- const verificationKey = this.getVerificationKeyDataForCircuit('MergeRollupArtifact');
116
- await this.verifyProof('MergeRollupArtifact', proof.binaryProof);
117
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
104
+ */ getTxMergeRollupProof(input) {
105
+ return this.createRecursiveProofAndVerify(input, 'TxMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertTxMergeRollupPrivateInputsToWitnessMap, convertTxMergeRollupOutputsFromWitnessMap);
118
106
  }
119
- /**
120
- * Simulates the block root rollup circuit from its inputs.
121
- * @param input - Inputs to the circuit.
122
- * @returns The public inputs as outputs of the simulation.
123
- */ async getBlockRootRollupProof(input) {
124
- const { circuitOutput, proof } = await this.createRecursiveProof(input, 'BlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootRollupInputsToWitnessMap, convertBlockRootRollupOutputsFromWitnessMap);
125
- const verificationKey = this.getVerificationKeyDataForCircuit('BlockRootRollupArtifact');
126
- await this.verifyProof('BlockRootRollupArtifact', proof.binaryProof);
127
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
107
+ getBlockRootFirstRollupProof(input) {
108
+ return this.createRecursiveProofAndVerify(input, 'BlockRootFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootFirstRollupPrivateInputsToWitnessMap, convertBlockRootFirstRollupOutputsFromWitnessMap);
128
109
  }
129
- async getSingleTxBlockRootRollupProof(input) {
130
- const { circuitOutput, proof } = await this.createRecursiveProof(input, 'SingleTxBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertSingleTxBlockRootRollupInputsToWitnessMap, convertSingleTxBlockRootRollupOutputsFromWitnessMap);
131
- const verificationKey = this.getVerificationKeyDataForCircuit('SingleTxBlockRootRollupArtifact');
132
- await this.verifyProof('SingleTxBlockRootRollupArtifact', proof.binaryProof);
133
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
110
+ getBlockRootSingleTxFirstRollupProof(input) {
111
+ return this.createRecursiveProofAndVerify(input, 'BlockRootSingleTxFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootSingleTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxFirstRollupOutputsFromWitnessMap);
134
112
  }
135
- /**
136
- * Simulates the empty block root rollup circuit from its inputs.
137
- * @param input - Inputs to the circuit.
138
- * @returns The public inputs as outputs of the simulation.
139
- */ async getEmptyBlockRootRollupProof(input) {
140
- const { circuitOutput, proof } = await this.createRecursiveProof(input, 'EmptyBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap);
141
- const verificationKey = this.getVerificationKeyDataForCircuit('EmptyBlockRootRollupArtifact');
142
- await this.verifyProof('EmptyBlockRootRollupArtifact', proof.binaryProof);
143
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
113
+ getBlockRootEmptyTxFirstRollupProof(input) {
114
+ return this.createRecursiveProofAndVerify(input, 'BlockRootEmptyTxFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootEmptyTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootEmptyTxFirstRollupOutputsFromWitnessMap);
144
115
  }
145
- async getPaddingBlockRootRollupProof(input) {
146
- const { circuitOutput, proof } = await this.createRecursiveProof(input, 'PaddingBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPaddingBlockRootRollupInputsToWitnessMap, convertPaddingBlockRootRollupOutputsFromWitnessMap);
147
- const verificationKey = this.getVerificationKeyDataForCircuit('PaddingBlockRootRollupArtifact');
148
- await this.verifyProof('PaddingBlockRootRollupArtifact', proof.binaryProof);
149
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
116
+ getBlockRootRollupProof(input) {
117
+ return this.createRecursiveProofAndVerify(input, 'BlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootRollupPrivateInputsToWitnessMap, convertBlockRootRollupOutputsFromWitnessMap);
150
118
  }
151
- /**
152
- * Simulates the block merge rollup circuit from its inputs.
153
- * @param input - Inputs to the circuit.
154
- * @returns The public inputs as outputs of the simulation.
155
- */ async getBlockMergeRollupProof(input) {
156
- const { circuitOutput, proof } = await this.createRecursiveProof(input, 'BlockMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockMergeRollupInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap);
157
- const verificationKey = this.getVerificationKeyDataForCircuit('BlockMergeRollupArtifact');
158
- await this.verifyProof('BlockMergeRollupArtifact', proof.binaryProof);
159
- return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
119
+ getBlockRootSingleTxRollupProof(input) {
120
+ return this.createRecursiveProofAndVerify(input, 'BlockRootSingleTxRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootSingleTxRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxRollupOutputsFromWitnessMap);
121
+ }
122
+ getBlockMergeRollupProof(input) {
123
+ return this.createRecursiveProofAndVerify(input, 'BlockMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockMergeRollupPrivateInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap);
124
+ }
125
+ getCheckpointRootRollupProof(input) {
126
+ return this.createRecursiveProofAndVerify(input, 'CheckpointRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointRootRollupPrivateInputsToWitnessMap, convertCheckpointRootRollupOutputsFromWitnessMap);
127
+ }
128
+ getCheckpointRootSingleBlockRollupProof(input) {
129
+ return this.createRecursiveProofAndVerify(input, 'CheckpointRootSingleBlockRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointRootSingleBlockRollupPrivateInputsToWitnessMap, convertCheckpointRootSingleBlockRollupOutputsFromWitnessMap);
130
+ }
131
+ getCheckpointPaddingRollupProof(input) {
132
+ return this.createRecursiveProofAndVerify(input, 'CheckpointPaddingRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointPaddingRollupPrivateInputsToWitnessMap, convertCheckpointPaddingRollupOutputsFromWitnessMap);
133
+ }
134
+ getCheckpointMergeRollupProof(input) {
135
+ return this.createRecursiveProofAndVerify(input, 'CheckpointMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointMergeRollupPrivateInputsToWitnessMap, convertCheckpointMergeRollupOutputsFromWitnessMap);
160
136
  }
161
137
  /**
162
138
  * Simulates the root rollup circuit from its inputs.
163
139
  * @param input - Inputs to the circuit.
164
140
  * @returns The public inputs as outputs of the simulation.
165
141
  */ async getRootRollupProof(input) {
166
- const { circuitOutput, proof } = await this.createProof(input, 'RootRollupArtifact', convertRootRollupInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap);
167
- const recursiveProof = makeRecursiveProofFromBinary(proof, NESTED_RECURSIVE_PROOF_LENGTH);
168
- const verificationKey = this.getVerificationKeyDataForCircuit('RootRollupArtifact');
169
- await this.verifyProof('RootRollupArtifact', proof);
142
+ const { proof, ...output } = await this.createRecursiveProofAndVerify(input, 'RootRollupArtifact', ULTRA_KECCAK_PROOF_LENGTH, convertRootRollupPrivateInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap);
143
+ const recursiveProof = makeRecursiveProofFromBinary(proof.binaryProof, NESTED_RECURSIVE_PROOF_LENGTH);
170
144
  // TODO(https://github.com/AztecProtocol/aztec-packages/issues/13188): Remove this hack.
171
145
  recursiveProof.binaryProof.numPublicInputs += PAIRING_POINTS_SIZE;
172
- return makePublicInputsAndRecursiveProof(circuitOutput, recursiveProof, verificationKey);
146
+ return {
147
+ ...output,
148
+ proof: recursiveProof
149
+ };
150
+ }
151
+ async createRecursiveProofAndVerify(input, artifactName, proofLength, convertInput, convertOutput) {
152
+ const { circuitOutput, proof } = await this.createRecursiveProof(input, artifactName, proofLength, convertInput, convertOutput);
153
+ await this.verifyProof(artifactName, proof.binaryProof);
154
+ const verificationKey = this.getVerificationKeyDataForCircuit(artifactName);
155
+ return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
173
156
  }
174
157
  async generateProofWithBB(input, circuitType, convertInput, convertOutput, workingDirectory) {
175
158
  // Have the ACVM write the partial witness here
@@ -196,7 +179,7 @@ const logger = createLogger('bb-prover');
196
179
  });
197
180
  // Now prove the circuit from the generated witness
198
181
  logger.debug(`Proving ${circuitType}...`);
199
- const provingResult = await generateProof(this.config.bbBinaryPath, workingDirectory, circuitType, Buffer.from(artifact.bytecode, 'base64'), outputWitnessFile, getUltraHonkFlavorForCircuit(circuitType), logger);
182
+ const provingResult = await generateProof(this.config.bbBinaryPath, workingDirectory, circuitType, Buffer.from(artifact.bytecode, 'base64'), this.getVerificationKeyDataForCircuit(circuitType).keyAsBytes, outputWitnessFile, getUltraHonkFlavorForCircuit(circuitType), logger);
200
183
  if (provingResult.status === BB_RESULT.FAILURE) {
201
184
  logger.error(`Failed to generate proof for ${circuitType}: ${provingResult.reason}`);
202
185
  throw new ProvingError(provingResult.reason, provingResult, provingResult.retry);
@@ -206,35 +189,6 @@ const logger = createLogger('bb-prover');
206
189
  provingResult
207
190
  };
208
191
  }
209
- async createProof(input, circuitType, convertInput, convertOutput) {
210
- const operation = async (bbWorkingDirectory)=>{
211
- const { provingResult, circuitOutput: output } = await this.generateProofWithBB(input, circuitType, convertInput, convertOutput, bbWorkingDirectory);
212
- const vkData = this.getVerificationKeyDataForCircuit(circuitType);
213
- const PROOF_LENGTH = circuitType == 'RootRollupArtifact' ? ULTRA_KECCAK_PROOF_LENGTH : RECURSIVE_PROOF_LENGTH;
214
- const proof = await readProofAsFields(provingResult.proofPath, vkData, PROOF_LENGTH, logger);
215
- const circuitName = mapProtocolArtifactNameToCircuitName(circuitType);
216
- this.instrumentation.recordDuration('provingDuration', circuitName, provingResult.durationMs);
217
- this.instrumentation.recordSize('proofSize', circuitName, proof.binaryProof.buffer.length);
218
- this.instrumentation.recordSize('circuitPublicInputCount', circuitName, vkData.numPublicInputs);
219
- this.instrumentation.recordSize('circuitSize', circuitName, vkData.circuitSize);
220
- logger.info(`Generated proof for ${circuitType} in ${Math.ceil(provingResult.durationMs)} ms`, {
221
- circuitName,
222
- // does not include reading the proof from disk
223
- duration: provingResult.durationMs,
224
- proofSize: proof.binaryProof.buffer.length,
225
- eventName: 'circuit-proving',
226
- // circuitOutput is the partial witness that became the input to the proof
227
- inputSize: output.toBuffer().length,
228
- circuitSize: vkData.circuitSize,
229
- numPublicInputs: vkData.numPublicInputs
230
- });
231
- return {
232
- circuitOutput: output,
233
- proof: proof.binaryProof
234
- };
235
- };
236
- return await this.runInDirectory(operation);
237
- }
238
192
  async generateAvmProofWithBB(input, workingDirectory) {
239
193
  logger.info(`Proving avm-circuit for TX ${input.hints.tx.hash}...`);
240
194
  const provingResult = await generateAvmProof(this.config.bbBinaryPath, workingDirectory, input, logger);
@@ -244,18 +198,6 @@ const logger = createLogger('bb-prover');
244
198
  }
245
199
  return provingResult;
246
200
  }
247
- async generateTubeProofWithBB(bbWorkingDirectory, input) {
248
- logger.debug(`Proving tube...`);
249
- const hasher = crypto.createHash('sha256');
250
- hasher.update(input.toBuffer());
251
- await writeClientIVCProofToOutputDirectory(input.clientIVCData, bbWorkingDirectory);
252
- const provingResult = await generateTubeProof(this.config.bbBinaryPath, bbWorkingDirectory, input.usePublicTailVk ? PUBLIC_TAIL_CIVC_VK : PRIVATE_TAIL_CIVC_VK, logger.verbose);
253
- if (provingResult.status === BB_RESULT.FAILURE) {
254
- logger.error(`Failed to generate proof for tube circuit: ${provingResult.reason}`);
255
- throw new ProvingError(provingResult.reason, provingResult, provingResult.retry);
256
- }
257
- return provingResult;
258
- }
259
201
  async createAvmProof(input) {
260
202
  const operation = async (bbWorkingDirectory)=>{
261
203
  const provingResult = await this.generateAvmProofWithBB(input, bbWorkingDirectory);
@@ -280,25 +222,6 @@ const logger = createLogger('bb-prover');
280
222
  };
281
223
  return await this.runInDirectory(operation);
282
224
  }
283
- async getTubeProof(input) {
284
- const operation = async (bbWorkingDirectory)=>{
285
- logger.debug(`createTubeProof: ${bbWorkingDirectory}`);
286
- const provingResult = await this.generateTubeProofWithBB(bbWorkingDirectory, input);
287
- // Read the proof as fields
288
- // TODO(AD): this is the only remaining use of extractVkData.
289
- const tubeVK = await extractVkData(provingResult.vkDirectoryPath);
290
- const tubeProof = await readProofAsFields(provingResult.proofPath, tubeVK, TUBE_PROOF_LENGTH, logger);
291
- this.instrumentation.recordDuration('provingDuration', 'tubeCircuit', provingResult.durationMs);
292
- this.instrumentation.recordSize('proofSize', 'tubeCircuit', tubeProof.binaryProof.buffer.length);
293
- this.instrumentation.recordSize('circuitPublicInputCount', 'tubeCircuit', tubeVK.numPublicInputs);
294
- this.instrumentation.recordSize('circuitSize', 'tubeCircuit', tubeVK.circuitSize);
295
- // Sanity check the tube proof (can be removed later)
296
- await this.verifyWithKey('ultra_rollup_honk', tubeVK, tubeProof.binaryProof);
297
- logger.info(`Generated proof for tubeCircuit in ${Math.ceil(provingResult.durationMs)} ms, size: ${tubeProof.proof.length} fields`);
298
- return makeProofAndVerificationKey(tubeProof, tubeVK);
299
- };
300
- return await this.runInDirectory(operation);
301
- }
302
225
  /**
303
226
  * Executes a circuit and returns its outputs and corresponding proof with embedded aggregation object
304
227
  * @param witnessMap - The input witness
@@ -313,7 +236,7 @@ const logger = createLogger('bb-prover');
313
236
  const { provingResult, circuitOutput: output } = await this.generateProofWithBB(input, circuitType, convertInput, convertOutput, bbWorkingDirectory);
314
237
  const vkData = this.getVerificationKeyDataForCircuit(circuitType);
315
238
  // Read the proof as fields
316
- const proof = await readProofAsFields(provingResult.proofPath, vkData, proofLength, logger);
239
+ const proof = await readProofsFromOutputDirectory(provingResult.proofPath, vkData, proofLength, logger);
317
240
  const circuitName = mapProtocolArtifactNameToCircuitName(circuitType);
318
241
  this.instrumentation.recordDuration('provingDuration', circuitName, provingResult.durationMs);
319
242
  this.instrumentation.recordSize('proofSize', circuitName, proof.binaryProof.buffer.length);
@@ -401,12 +324,12 @@ const logger = createLogger('bb-prover');
401
324
  }
402
325
  _ts_decorate([
403
326
  trackSpan('BBNativeRollupProver.getBaseParityProof', {
404
- [Attributes.PROTOCOL_CIRCUIT_NAME]: 'base-parity'
327
+ [Attributes.PROTOCOL_CIRCUIT_NAME]: 'parity-base'
405
328
  })
406
329
  ], BBNativeRollupProver.prototype, "getBaseParityProof", null);
407
330
  _ts_decorate([
408
331
  trackSpan('BBNativeRollupProver.getRootParityProof', {
409
- [Attributes.PROTOCOL_CIRCUIT_NAME]: 'root-parity'
332
+ [Attributes.PROTOCOL_CIRCUIT_NAME]: 'parity-root'
410
333
  })
411
334
  ], BBNativeRollupProver.prototype, "getRootParityProof", null);
412
335
  _ts_decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"delay_values.d.ts","sourceRoot":"","sources":["../../src/test/delay_values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAc9D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAc7D,CAAC"}
1
+ {"version":3,"file":"delay_values.d.ts","sourceRoot":"","sources":["../../src/test/delay_values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAmB9D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAmB7D,CAAC"}
@@ -1,31 +1,41 @@
1
1
  import { ProvingRequestType } from '@aztec/stdlib/proofs';
2
2
  export const WITGEN_DELAY_MS = {
3
- [ProvingRequestType.BASE_PARITY]: 60,
3
+ [ProvingRequestType.PARITY_BASE]: 60,
4
4
  [ProvingRequestType.BLOCK_MERGE_ROLLUP]: 650,
5
- [ProvingRequestType.BLOCK_ROOT_ROLLUP]: 60_000,
6
- [ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP]: 0,
7
- [ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP]: 0,
8
- [ProvingRequestType.MERGE_ROLLUP]: 0,
9
- [ProvingRequestType.PRIVATE_BASE_ROLLUP]: 400_000,
10
- [ProvingRequestType.SINGLE_TX_BLOCK_ROOT_ROLLUP]: 0,
11
- [ProvingRequestType.PUBLIC_BASE_ROLLUP]: 470_000,
12
- [ProvingRequestType.ROOT_PARITY]: 100,
5
+ [ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP]: 60_000,
6
+ [ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP]: 40_000,
7
+ [ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP]: 20_000,
8
+ [ProvingRequestType.BLOCK_ROOT_ROLLUP]: 40_000,
9
+ [ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP]: 20_000,
10
+ [ProvingRequestType.CHECKPOINT_ROOT_ROLLUP]: 40_000,
11
+ [ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP]: 20_000,
12
+ [ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: 0,
13
+ [ProvingRequestType.CHECKPOINT_MERGE_ROLLUP]: 650,
14
+ [ProvingRequestType.TX_MERGE_ROLLUP]: 0,
15
+ [ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]: 400_000,
16
+ [ProvingRequestType.PUBLIC_TX_BASE_ROLLUP]: 470_000,
17
+ [ProvingRequestType.PARITY_ROOT]: 100,
13
18
  [ProvingRequestType.ROOT_ROLLUP]: 650,
14
- [ProvingRequestType.TUBE_PROOF]: 0,
19
+ [ProvingRequestType.PUBLIC_TUBE]: 0,
15
20
  [ProvingRequestType.PUBLIC_VM]: 0
16
21
  };
17
22
  export const PROOF_DELAY_MS = {
18
- [ProvingRequestType.BASE_PARITY]: 3_000,
23
+ [ProvingRequestType.PARITY_BASE]: 3_000,
19
24
  [ProvingRequestType.BLOCK_MERGE_ROLLUP]: 15_000,
20
- [ProvingRequestType.BLOCK_ROOT_ROLLUP]: 55_000,
21
- [ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP]: 0,
22
- [ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP]: 0,
23
- [ProvingRequestType.MERGE_ROLLUP]: 0,
24
- [ProvingRequestType.PRIVATE_BASE_ROLLUP]: 145_000,
25
- [ProvingRequestType.SINGLE_TX_BLOCK_ROOT_ROLLUP]: 0,
26
- [ProvingRequestType.PUBLIC_BASE_ROLLUP]: 160_000,
27
- [ProvingRequestType.ROOT_PARITY]: 30_000,
25
+ [ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP]: 55_000,
26
+ [ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP]: 35_000,
27
+ [ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP]: 15_000,
28
+ [ProvingRequestType.BLOCK_ROOT_ROLLUP]: 35_000,
29
+ [ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP]: 15_000,
30
+ [ProvingRequestType.CHECKPOINT_ROOT_ROLLUP]: 35_000,
31
+ [ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP]: 15_000,
32
+ [ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: 0,
33
+ [ProvingRequestType.CHECKPOINT_MERGE_ROLLUP]: 15_000,
34
+ [ProvingRequestType.TX_MERGE_ROLLUP]: 0,
35
+ [ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]: 145_000,
36
+ [ProvingRequestType.PUBLIC_TX_BASE_ROLLUP]: 160_000,
37
+ [ProvingRequestType.PARITY_ROOT]: 30_000,
28
38
  [ProvingRequestType.ROOT_ROLLUP]: 15_000,
29
- [ProvingRequestType.TUBE_PROOF]: 30_000,
39
+ [ProvingRequestType.PUBLIC_TUBE]: 30_000,
30
40
  [ProvingRequestType.PUBLIC_VM]: 0
31
41
  };