@aztec/bb-prover 1.0.0-staging.0 → 1.0.0-staging.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/prover/server/bb_prover.d.ts +2 -1
- package/dest/prover/server/bb_prover.d.ts.map +1 -1
- package/dest/prover/server/bb_prover.js +7 -1
- package/dest/stats.d.ts +0 -1
- package/dest/stats.d.ts.map +1 -1
- package/dest/stats.js +2 -23
- package/dest/test/delay_values.d.ts.map +1 -1
- package/dest/test/delay_values.js +2 -0
- package/dest/test/test_circuit_prover.d.ts +2 -1
- package/dest/test/test_circuit_prover.d.ts.map +1 -1
- package/dest/test/test_circuit_prover.js +7 -1
- package/dest/verification_key/verification_key_data.d.ts.map +1 -1
- package/dest/verification_key/verification_key_data.js +2 -6
- package/package.json +16 -16
- package/src/prover/server/bb_prover.ts +23 -0
- package/src/stats.ts +2 -23
- package/src/test/delay_values.ts +2 -0
- package/src/test/test_circuit_prover.ts +20 -0
- package/src/verification_key/verification_key_data.ts +2 -6
|
@@ -4,7 +4,7 @@ import type { AvmCircuitInputs, AvmCircuitPublicInputs } from '@aztec/stdlib/avm
|
|
|
4
4
|
import { type ProofAndVerificationKey, type PublicInputsAndRecursiveProof, type ServerCircuitProver } from '@aztec/stdlib/interfaces/server';
|
|
5
5
|
import type { BaseParityInputs, ParityPublicInputs, RootParityInputs } 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, type PrivateBaseRollupInputs, PublicBaseRollupInputs, type RootRollupInputs, type RootRollupPublicInputs, type SingleTxBlockRootRollupInputs, type TubeInputs } from '@aztec/stdlib/rollup';
|
|
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';
|
|
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';
|
|
@@ -70,6 +70,7 @@ export declare class BBNativeRollupProver implements ServerCircuitProver {
|
|
|
70
70
|
* @returns The public inputs as outputs of the simulation.
|
|
71
71
|
*/
|
|
72
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>>;
|
|
73
74
|
/**
|
|
74
75
|
* Simulates the block merge rollup circuit from its inputs.
|
|
75
76
|
* @param input - Inputs to the circuit.
|
|
@@ -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,EAClB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,KAAK,sBAAsB,
|
|
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,sBAA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O,yCAAyC,CAAC,CACnH;IAgBY,8BAA8B,CACzC,KAAK,EAAE,4BAA4B,GAClC,OAAO,CACR,6BAA6B,CAAC,iCAAiC,EAAE,OAAO,yCAAyC,CAAC,CACnH;IAgBD;;;;OAIG;IACU,wBAAwB,CACnC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CACR,6BAA6B,CAAC,iCAAiC,EAAE,OAAO,yCAAyC,CAAC,CACnH;IAgBD;;;;OAIG;IACU,kBAAkB,CAC7B,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,6BAA6B,CAAC,sBAAsB,CAAC,CAAC;YAkBnD,mBAAmB;YAoEnB,WAAW;YAyCX,sBAAsB;YAatB,uBAAuB;YAsBvB,cAAc;IAsCf,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,uBAAuB,CAAC,OAAO,iBAAiB,CAAC,CAAC;IA6BxG;;;;;;;;OAQG;YACW,oBAAoB;IAqDlC;;;;OAIG;IACU,WAAW,CAAC,WAAW,EAAE,sBAAsB,EAAE,KAAK,EAAE,KAAK;IAK7D,cAAc,CACzB,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,mBAAmB,EACpC,YAAY,EAAE,sBAAsB;IAOzB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK;YAMxF,qBAAqB;IA2BnC;;;;OAIG;IACH,OAAO,CAAC,gCAAgC;YAQ1B,oBAAoB;IAwBlC,OAAO,CAAC,cAAc;CAYvB"}
|
|
@@ -9,7 +9,7 @@ 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, convertPrivateBaseRollupInputsToWitnessMap, convertPrivateBaseRollupOutputsFromWitnessMap, convertPublicBaseRollupInputsToWitnessMap, convertPublicBaseRollupOutputsFromWitnessMap, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap, convertRootRollupInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap, convertSingleTxBlockRootRollupInputsToWitnessMap, convertSingleTxBlockRootRollupOutputsFromWitnessMap, getServerCircuitArtifact } from '@aztec/noir-protocol-circuits-types/server';
|
|
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';
|
|
13
13
|
import { ServerCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
14
14
|
import { NativeACVMSimulator } from '@aztec/simulator/server';
|
|
15
15
|
import { ProvingError } from '@aztec/stdlib/errors';
|
|
@@ -144,6 +144,12 @@ const SERVER_CIRCUIT_RECURSIVE = true;
|
|
|
144
144
|
await this.verifyProof('EmptyBlockRootRollupArtifact', proof.binaryProof);
|
|
145
145
|
return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
|
|
146
146
|
}
|
|
147
|
+
async getPaddingBlockRootRollupProof(input) {
|
|
148
|
+
const { circuitOutput, proof } = await this.createRecursiveProof(input, 'PaddingBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPaddingBlockRootRollupInputsToWitnessMap, convertPaddingBlockRootRollupOutputsFromWitnessMap);
|
|
149
|
+
const verificationKey = this.getVerificationKeyDataForCircuit('PaddingBlockRootRollupArtifact');
|
|
150
|
+
await this.verifyProof('PaddingBlockRootRollupArtifact', proof.binaryProof);
|
|
151
|
+
return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
|
|
152
|
+
}
|
|
147
153
|
/**
|
|
148
154
|
* Simulates the block merge rollup circuit from its inputs.
|
|
149
155
|
* @param input - Inputs to the circuit.
|
package/dest/stats.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ProtocolArtifact } from '@aztec/noir-protocol-circuits-types/types';
|
|
2
2
|
import type { CircuitName } from '@aztec/stdlib/stats';
|
|
3
3
|
export declare function mapProtocolArtifactNameToCircuitName(artifact: ProtocolArtifact): CircuitName;
|
|
4
|
-
export declare function isProtocolArtifactRecursive(artifact: ProtocolArtifact): boolean;
|
|
5
4
|
//# sourceMappingURL=stats.d.ts.map
|
package/dest/stats.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../src/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,gBAAgB,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../src/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,gBAAgB,GAAG,WAAW,CAuC5F"}
|
package/dest/stats.js
CHANGED
|
@@ -16,6 +16,8 @@ export function mapProtocolArtifactNameToCircuitName(artifact) {
|
|
|
16
16
|
return 'single-tx-block-root-rollup';
|
|
17
17
|
case 'EmptyBlockRootRollupArtifact':
|
|
18
18
|
return 'empty-block-root-rollup';
|
|
19
|
+
case 'PaddingBlockRootRollupArtifact':
|
|
20
|
+
return 'padding-block-root-rollup';
|
|
19
21
|
case 'BlockMergeRollupArtifact':
|
|
20
22
|
return 'block-merge-rollup';
|
|
21
23
|
case 'RootRollupArtifact':
|
|
@@ -37,26 +39,3 @@ export function mapProtocolArtifactNameToCircuitName(artifact) {
|
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
export function isProtocolArtifactRecursive(artifact) {
|
|
41
|
-
switch(artifact){
|
|
42
|
-
case 'BaseParityArtifact':
|
|
43
|
-
case 'RootParityArtifact':
|
|
44
|
-
case 'PrivateBaseRollupArtifact':
|
|
45
|
-
case 'PublicBaseRollupArtifact':
|
|
46
|
-
case 'MergeRollupArtifact':
|
|
47
|
-
case 'BlockRootRollupArtifact':
|
|
48
|
-
case 'SingleTxBlockRootRollupArtifact':
|
|
49
|
-
case 'EmptyBlockRootRollupArtifact':
|
|
50
|
-
case 'BlockMergeRollupArtifact':
|
|
51
|
-
case 'RootRollupArtifact':
|
|
52
|
-
return true;
|
|
53
|
-
default:
|
|
54
|
-
{
|
|
55
|
-
if (artifact.startsWith('PrivateKernel')) {
|
|
56
|
-
// The kernel prover, where these are used, eventually calls `createClientIvcProof`, which is recursive.
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
throw new Error(`Unknown circuit type: ${artifact}`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -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,
|
|
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"}
|
|
@@ -4,6 +4,7 @@ export const WITGEN_DELAY_MS = {
|
|
|
4
4
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: 650,
|
|
5
5
|
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: 60_000,
|
|
6
6
|
[ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP]: 0,
|
|
7
|
+
[ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP]: 0,
|
|
7
8
|
[ProvingRequestType.MERGE_ROLLUP]: 0,
|
|
8
9
|
[ProvingRequestType.PRIVATE_BASE_ROLLUP]: 400_000,
|
|
9
10
|
[ProvingRequestType.SINGLE_TX_BLOCK_ROOT_ROLLUP]: 0,
|
|
@@ -18,6 +19,7 @@ export const PROOF_DELAY_MS = {
|
|
|
18
19
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: 15_000,
|
|
19
20
|
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: 55_000,
|
|
20
21
|
[ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP]: 0,
|
|
22
|
+
[ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP]: 0,
|
|
21
23
|
[ProvingRequestType.MERGE_ROLLUP]: 0,
|
|
22
24
|
[ProvingRequestType.PRIVATE_BASE_ROLLUP]: 145_000,
|
|
23
25
|
[ProvingRequestType.SINGLE_TX_BLOCK_ROOT_ROLLUP]: 0,
|
|
@@ -5,7 +5,7 @@ import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
|
5
5
|
import { type ProofAndVerificationKey, type PublicInputsAndRecursiveProof, type ServerCircuitProver } from '@aztec/stdlib/interfaces/server';
|
|
6
6
|
import type { BaseParityInputs, ParityPublicInputs, RootParityInputs } from '@aztec/stdlib/parity';
|
|
7
7
|
import { type Proof } from '@aztec/stdlib/proofs';
|
|
8
|
-
import type { BaseOrMergeRollupPublicInputs, BlockMergeRollupInputs, BlockRootOrBlockMergePublicInputs, BlockRootRollupInputs, EmptyBlockRootRollupInputs, MergeRollupInputs, PrivateBaseRollupInputs, PublicBaseRollupInputs, RootRollupInputs, RootRollupPublicInputs, SingleTxBlockRootRollupInputs, TubeInputs } from '@aztec/stdlib/rollup';
|
|
8
|
+
import type { BaseOrMergeRollupPublicInputs, BlockMergeRollupInputs, BlockRootOrBlockMergePublicInputs, BlockRootRollupInputs, EmptyBlockRootRollupInputs, MergeRollupInputs, PaddingBlockRootRollupInputs, PrivateBaseRollupInputs, PublicBaseRollupInputs, RootRollupInputs, RootRollupPublicInputs, SingleTxBlockRootRollupInputs, TubeInputs } from '@aztec/stdlib/rollup';
|
|
9
9
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
10
10
|
type TestDelay = {
|
|
11
11
|
proverTestDelayType: 'fixed';
|
|
@@ -60,6 +60,7 @@ export declare class TestCircuitProver implements ServerCircuitProver {
|
|
|
60
60
|
* @returns The public inputs as outputs of the simulation.
|
|
61
61
|
*/
|
|
62
62
|
getEmptyBlockRootRollupProof(input: EmptyBlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
63
|
+
getPaddingBlockRootRollupProof(input: PaddingBlockRootRollupInputs): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
63
64
|
/**
|
|
64
65
|
* Simulates the block merge rollup circuit from its inputs.
|
|
65
66
|
* @param input - Inputs to the circuit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_circuit_prover.d.ts","sourceRoot":"","sources":["../../src/test/test_circuit_prover.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EAEpC,6BAA6B,EAC7B,yCAAyC,EACzC,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EACL,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"test_circuit_prover.d.ts","sourceRoot":"","sources":["../../src/test/test_circuit_prover.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EAEpC,6BAA6B,EAC7B,yCAAyC,EACzC,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EACL,KAAK,sBAAsB,EAyB5B,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EAAE,KAAK,gBAAgB,EAAsD,MAAM,yBAAyB,CAAC;AACpH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EAGzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB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AAW,CAAC,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;YAI1D,QAAQ;CA8CvB"}
|
|
@@ -8,7 +8,7 @@ import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN
|
|
|
8
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
9
|
import { sleep } from '@aztec/foundation/sleep';
|
|
10
10
|
import { Timer } from '@aztec/foundation/timer';
|
|
11
|
-
import { convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap, convertBlockMergeRollupInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap, convertRootRollupInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap, convertSimulatedBlockRootRollupInputsToWitnessMap, convertSimulatedBlockRootRollupOutputsFromWitnessMap, convertSimulatedPrivateBaseRollupInputsToWitnessMap, convertSimulatedPrivateBaseRollupOutputsFromWitnessMap, convertSimulatedPublicBaseRollupInputsToWitnessMap, convertSimulatedPublicBaseRollupOutputsFromWitnessMap, convertSimulatedSingleTxBlockRootRollupInputsToWitnessMap, convertSimulatedSingleTxBlockRootRollupOutputsFromWitnessMap, foreignCallHandler, getSimulatedServerCircuitArtifact } from '@aztec/noir-protocol-circuits-types/server';
|
|
11
|
+
import { convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap, convertBlockMergeRollupInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap, convertPaddingBlockRootRollupInputsToWitnessMap, convertPaddingBlockRootRollupOutputsFromWitnessMap, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap, convertRootRollupInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap, convertSimulatedBlockRootRollupInputsToWitnessMap, convertSimulatedBlockRootRollupOutputsFromWitnessMap, convertSimulatedPrivateBaseRollupInputsToWitnessMap, convertSimulatedPrivateBaseRollupOutputsFromWitnessMap, convertSimulatedPublicBaseRollupInputsToWitnessMap, convertSimulatedPublicBaseRollupOutputsFromWitnessMap, convertSimulatedSingleTxBlockRootRollupInputsToWitnessMap, convertSimulatedSingleTxBlockRootRollupOutputsFromWitnessMap, foreignCallHandler, getSimulatedServerCircuitArtifact } from '@aztec/noir-protocol-circuits-types/server';
|
|
12
12
|
import { ProtocolCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
13
13
|
import { WASMSimulatorWithBlobs, emitCircuitSimulationStats } from '@aztec/simulator/server';
|
|
14
14
|
import { makeProofAndVerificationKey, makePublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
@@ -87,6 +87,9 @@ import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
|
|
|
87
87
|
*/ getEmptyBlockRootRollupProof(input) {
|
|
88
88
|
return this.applyDelay(ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'EmptyBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap));
|
|
89
89
|
}
|
|
90
|
+
getPaddingBlockRootRollupProof(input) {
|
|
91
|
+
return this.applyDelay(ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'PaddingBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPaddingBlockRootRollupInputsToWitnessMap, convertPaddingBlockRootRollupOutputsFromWitnessMap));
|
|
92
|
+
}
|
|
90
93
|
/**
|
|
91
94
|
* Simulates the block merge rollup circuit from its inputs.
|
|
92
95
|
* @param input - Inputs to the circuit.
|
|
@@ -169,6 +172,9 @@ _ts_decorate([
|
|
|
169
172
|
_ts_decorate([
|
|
170
173
|
trackSpan('TestCircuitProver.getEmptyBlockRootRollupProof')
|
|
171
174
|
], TestCircuitProver.prototype, "getEmptyBlockRootRollupProof", null);
|
|
175
|
+
_ts_decorate([
|
|
176
|
+
trackSpan('TestCircuitProver.getPaddingBlockRootRollupProof')
|
|
177
|
+
], TestCircuitProver.prototype, "getPaddingBlockRootRollupProof", null);
|
|
172
178
|
_ts_decorate([
|
|
173
179
|
trackSpan('TestCircuitProver.getBlockMergeRollupProof')
|
|
174
180
|
], TestCircuitProver.prototype, "getBlockMergeRollupProof", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification_key_data.d.ts","sourceRoot":"","sources":["../../src/verification_key/verification_key_data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verification_key_data.d.ts","sourceRoot":"","sources":["../../src/verification_key/verification_key_data.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAQjF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CASzF;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAc5F"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
|
-
import { hashVK } from '@aztec/stdlib/hash';
|
|
5
4
|
import { VerificationKeyAsFields, VerificationKeyData } from '@aztec/stdlib/vks';
|
|
6
5
|
import { strict as assert } from 'assert';
|
|
7
6
|
import { promises as fs } from 'fs';
|
|
@@ -20,9 +19,7 @@ import { VK_FIELDS_FILENAME, VK_FILENAME } from '../bb/execute.js';
|
|
|
20
19
|
]);
|
|
21
20
|
const fieldsJson = JSON.parse(rawFields);
|
|
22
21
|
const fields = fieldsJson.map(Fr.fromHexString);
|
|
23
|
-
|
|
24
|
-
const vkHash = await hashVK(fields);
|
|
25
|
-
const vkAsFields = new VerificationKeyAsFields(fields, vkHash);
|
|
22
|
+
const vkAsFields = await VerificationKeyAsFields.fromKey(fields);
|
|
26
23
|
return new VerificationKeyData(vkAsFields, rawBinary);
|
|
27
24
|
}
|
|
28
25
|
/**
|
|
@@ -37,8 +34,7 @@ import { VK_FIELDS_FILENAME, VK_FILENAME } from '../bb/execute.js';
|
|
|
37
34
|
const reader = BufferReader.asReader(rawBinary);
|
|
38
35
|
const fieldsArray = reader.readArray(numFields, Fr);
|
|
39
36
|
const fieldsArrayPadded = fieldsArray.concat(Array(AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED - fieldsArray.length).fill(new Fr(0)));
|
|
40
|
-
|
|
41
|
-
const vkAsFields = new VerificationKeyAsFields(fieldsArrayPadded, new Fr(0));
|
|
37
|
+
const vkAsFields = await VerificationKeyAsFields.fromKey(fieldsArrayPadded);
|
|
42
38
|
const vk = new VerificationKeyData(vkAsFields, rawBinary);
|
|
43
39
|
return vk;
|
|
44
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/bb-prover",
|
|
3
|
-
"version": "1.0.0-staging.
|
|
3
|
+
"version": "1.0.0-staging.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -70,27 +70,27 @@
|
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@aztec/bb.js": "1.0.0-staging.
|
|
74
|
-
"@aztec/constants": "1.0.0-staging.
|
|
75
|
-
"@aztec/foundation": "1.0.0-staging.
|
|
76
|
-
"@aztec/noir-noirc_abi": "1.0.0-staging.
|
|
77
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-staging.
|
|
78
|
-
"@aztec/noir-types": "1.0.0-staging.
|
|
79
|
-
"@aztec/simulator": "1.0.0-staging.
|
|
80
|
-
"@aztec/stdlib": "1.0.0-staging.
|
|
81
|
-
"@aztec/telemetry-client": "1.0.0-staging.
|
|
82
|
-
"@aztec/world-state": "1.0.0-staging.
|
|
73
|
+
"@aztec/bb.js": "1.0.0-staging.1",
|
|
74
|
+
"@aztec/constants": "1.0.0-staging.1",
|
|
75
|
+
"@aztec/foundation": "1.0.0-staging.1",
|
|
76
|
+
"@aztec/noir-noirc_abi": "1.0.0-staging.1",
|
|
77
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-staging.1",
|
|
78
|
+
"@aztec/noir-types": "1.0.0-staging.1",
|
|
79
|
+
"@aztec/simulator": "1.0.0-staging.1",
|
|
80
|
+
"@aztec/stdlib": "1.0.0-staging.1",
|
|
81
|
+
"@aztec/telemetry-client": "1.0.0-staging.1",
|
|
82
|
+
"@aztec/world-state": "1.0.0-staging.1",
|
|
83
83
|
"commander": "^12.1.0",
|
|
84
84
|
"pako": "^2.1.0",
|
|
85
85
|
"source-map-support": "^0.5.21",
|
|
86
86
|
"tslib": "^2.4.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@aztec/ethereum": "1.0.0-staging.
|
|
90
|
-
"@aztec/kv-store": "1.0.0-staging.
|
|
91
|
-
"@aztec/noir-contracts.js": "1.0.0-staging.
|
|
92
|
-
"@aztec/noir-test-contracts.js": "1.0.0-staging.
|
|
93
|
-
"@aztec/protocol-contracts": "1.0.0-staging.
|
|
89
|
+
"@aztec/ethereum": "1.0.0-staging.1",
|
|
90
|
+
"@aztec/kv-store": "1.0.0-staging.1",
|
|
91
|
+
"@aztec/noir-contracts.js": "1.0.0-staging.1",
|
|
92
|
+
"@aztec/noir-test-contracts.js": "1.0.0-staging.1",
|
|
93
|
+
"@aztec/protocol-contracts": "1.0.0-staging.1",
|
|
94
94
|
"@jest/globals": "^30.0.0",
|
|
95
95
|
"@types/jest": "^30.0.0",
|
|
96
96
|
"@types/node": "^22.15.17",
|
|
@@ -22,6 +22,8 @@ import {
|
|
|
22
22
|
convertEmptyBlockRootRollupOutputsFromWitnessMap,
|
|
23
23
|
convertMergeRollupInputsToWitnessMap,
|
|
24
24
|
convertMergeRollupOutputsFromWitnessMap,
|
|
25
|
+
convertPaddingBlockRootRollupInputsToWitnessMap,
|
|
26
|
+
convertPaddingBlockRootRollupOutputsFromWitnessMap,
|
|
25
27
|
convertPrivateBaseRollupInputsToWitnessMap,
|
|
26
28
|
convertPrivateBaseRollupOutputsFromWitnessMap,
|
|
27
29
|
convertPublicBaseRollupInputsToWitnessMap,
|
|
@@ -55,6 +57,7 @@ import {
|
|
|
55
57
|
type BlockRootRollupInputs,
|
|
56
58
|
type EmptyBlockRootRollupInputs,
|
|
57
59
|
type MergeRollupInputs,
|
|
60
|
+
PaddingBlockRootRollupInputs,
|
|
58
61
|
type PrivateBaseRollupInputs,
|
|
59
62
|
PublicBaseRollupInputs,
|
|
60
63
|
type RootRollupInputs,
|
|
@@ -345,6 +348,26 @@ export class BBNativeRollupProver implements ServerCircuitProver {
|
|
|
345
348
|
return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
|
|
346
349
|
}
|
|
347
350
|
|
|
351
|
+
public async getPaddingBlockRootRollupProof(
|
|
352
|
+
input: PaddingBlockRootRollupInputs,
|
|
353
|
+
): Promise<
|
|
354
|
+
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
355
|
+
> {
|
|
356
|
+
const { circuitOutput, proof } = await this.createRecursiveProof(
|
|
357
|
+
input,
|
|
358
|
+
'PaddingBlockRootRollupArtifact',
|
|
359
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
360
|
+
convertPaddingBlockRootRollupInputsToWitnessMap,
|
|
361
|
+
convertPaddingBlockRootRollupOutputsFromWitnessMap,
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
const verificationKey = this.getVerificationKeyDataForCircuit('PaddingBlockRootRollupArtifact');
|
|
365
|
+
|
|
366
|
+
await this.verifyProof('PaddingBlockRootRollupArtifact', proof.binaryProof);
|
|
367
|
+
|
|
368
|
+
return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
|
|
369
|
+
}
|
|
370
|
+
|
|
348
371
|
/**
|
|
349
372
|
* Simulates the block merge rollup circuit from its inputs.
|
|
350
373
|
* @param input - Inputs to the circuit.
|
package/src/stats.ts
CHANGED
|
@@ -19,6 +19,8 @@ export function mapProtocolArtifactNameToCircuitName(artifact: ProtocolArtifact)
|
|
|
19
19
|
return 'single-tx-block-root-rollup';
|
|
20
20
|
case 'EmptyBlockRootRollupArtifact':
|
|
21
21
|
return 'empty-block-root-rollup';
|
|
22
|
+
case 'PaddingBlockRootRollupArtifact':
|
|
23
|
+
return 'padding-block-root-rollup';
|
|
22
24
|
case 'BlockMergeRollupArtifact':
|
|
23
25
|
return 'block-merge-rollup';
|
|
24
26
|
case 'RootRollupArtifact':
|
|
@@ -39,26 +41,3 @@ export function mapProtocolArtifactNameToCircuitName(artifact: ProtocolArtifact)
|
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
export function isProtocolArtifactRecursive(artifact: ProtocolArtifact): boolean {
|
|
44
|
-
switch (artifact) {
|
|
45
|
-
case 'BaseParityArtifact':
|
|
46
|
-
case 'RootParityArtifact':
|
|
47
|
-
case 'PrivateBaseRollupArtifact':
|
|
48
|
-
case 'PublicBaseRollupArtifact':
|
|
49
|
-
case 'MergeRollupArtifact':
|
|
50
|
-
case 'BlockRootRollupArtifact':
|
|
51
|
-
case 'SingleTxBlockRootRollupArtifact':
|
|
52
|
-
case 'EmptyBlockRootRollupArtifact':
|
|
53
|
-
case 'BlockMergeRollupArtifact':
|
|
54
|
-
case 'RootRollupArtifact':
|
|
55
|
-
return true;
|
|
56
|
-
default: {
|
|
57
|
-
if (artifact.startsWith('PrivateKernel')) {
|
|
58
|
-
// The kernel prover, where these are used, eventually calls `createClientIvcProof`, which is recursive.
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
throw new Error(`Unknown circuit type: ${artifact}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
package/src/test/delay_values.ts
CHANGED
|
@@ -5,6 +5,7 @@ export const WITGEN_DELAY_MS: Record<ProvingRequestType, number> = {
|
|
|
5
5
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: 650,
|
|
6
6
|
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: 60_000,
|
|
7
7
|
[ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP]: 0,
|
|
8
|
+
[ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP]: 0,
|
|
8
9
|
[ProvingRequestType.MERGE_ROLLUP]: 0,
|
|
9
10
|
[ProvingRequestType.PRIVATE_BASE_ROLLUP]: 400_000,
|
|
10
11
|
[ProvingRequestType.SINGLE_TX_BLOCK_ROOT_ROLLUP]: 0, // TBD
|
|
@@ -20,6 +21,7 @@ export const PROOF_DELAY_MS: Record<ProvingRequestType, number> = {
|
|
|
20
21
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: 15_000,
|
|
21
22
|
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: 55_000,
|
|
22
23
|
[ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP]: 0,
|
|
24
|
+
[ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP]: 0,
|
|
23
25
|
[ProvingRequestType.MERGE_ROLLUP]: 0,
|
|
24
26
|
[ProvingRequestType.PRIVATE_BASE_ROLLUP]: 145_000,
|
|
25
27
|
[ProvingRequestType.SINGLE_TX_BLOCK_ROOT_ROLLUP]: 0, // TBD
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
convertEmptyBlockRootRollupOutputsFromWitnessMap,
|
|
20
20
|
convertMergeRollupInputsToWitnessMap,
|
|
21
21
|
convertMergeRollupOutputsFromWitnessMap,
|
|
22
|
+
convertPaddingBlockRootRollupInputsToWitnessMap,
|
|
23
|
+
convertPaddingBlockRootRollupOutputsFromWitnessMap,
|
|
22
24
|
convertRootParityInputsToWitnessMap,
|
|
23
25
|
convertRootParityOutputsFromWitnessMap,
|
|
24
26
|
convertRootRollupInputsToWitnessMap,
|
|
@@ -54,6 +56,7 @@ import type {
|
|
|
54
56
|
BlockRootRollupInputs,
|
|
55
57
|
EmptyBlockRootRollupInputs,
|
|
56
58
|
MergeRollupInputs,
|
|
59
|
+
PaddingBlockRootRollupInputs,
|
|
57
60
|
PrivateBaseRollupInputs,
|
|
58
61
|
PublicBaseRollupInputs,
|
|
59
62
|
RootRollupInputs,
|
|
@@ -262,6 +265,23 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
262
265
|
);
|
|
263
266
|
}
|
|
264
267
|
|
|
268
|
+
@trackSpan('TestCircuitProver.getPaddingBlockRootRollupProof')
|
|
269
|
+
public getPaddingBlockRootRollupProof(
|
|
270
|
+
input: PaddingBlockRootRollupInputs,
|
|
271
|
+
): Promise<
|
|
272
|
+
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
273
|
+
> {
|
|
274
|
+
return this.applyDelay(ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP, () =>
|
|
275
|
+
this.simulate(
|
|
276
|
+
input,
|
|
277
|
+
'PaddingBlockRootRollupArtifact',
|
|
278
|
+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
279
|
+
convertPaddingBlockRootRollupInputsToWitnessMap,
|
|
280
|
+
convertPaddingBlockRootRollupOutputsFromWitnessMap,
|
|
281
|
+
),
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
|
|
265
285
|
/**
|
|
266
286
|
* Simulates the block merge rollup circuit from its inputs.
|
|
267
287
|
* @param input - Inputs to the circuit.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
|
-
import { hashVK } from '@aztec/stdlib/hash';
|
|
5
4
|
import { VerificationKeyAsFields, VerificationKeyData } from '@aztec/stdlib/vks';
|
|
6
5
|
|
|
7
6
|
import { strict as assert } from 'assert';
|
|
@@ -22,9 +21,7 @@ export async function extractVkData(vkDirectoryPath: string): Promise<Verificati
|
|
|
22
21
|
]);
|
|
23
22
|
const fieldsJson = JSON.parse(rawFields);
|
|
24
23
|
const fields = fieldsJson.map(Fr.fromHexString);
|
|
25
|
-
|
|
26
|
-
const vkHash = await hashVK(fields);
|
|
27
|
-
const vkAsFields = new VerificationKeyAsFields(fields, vkHash);
|
|
24
|
+
const vkAsFields = await VerificationKeyAsFields.fromKey(fields);
|
|
28
25
|
return new VerificationKeyData(vkAsFields, rawBinary);
|
|
29
26
|
}
|
|
30
27
|
|
|
@@ -45,8 +42,7 @@ export async function extractAvmVkData(vkDirectoryPath: string): Promise<Verific
|
|
|
45
42
|
const fieldsArrayPadded = fieldsArray.concat(
|
|
46
43
|
Array(AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED - fieldsArray.length).fill(new Fr(0)),
|
|
47
44
|
);
|
|
48
|
-
|
|
49
|
-
const vkAsFields = new VerificationKeyAsFields(fieldsArrayPadded, new Fr(0));
|
|
45
|
+
const vkAsFields = await VerificationKeyAsFields.fromKey(fieldsArrayPadded);
|
|
50
46
|
const vk = new VerificationKeyData(vkAsFields, rawBinary);
|
|
51
47
|
return vk;
|
|
52
48
|
}
|