@aztec/bb-prover 3.0.0-nightly.20250906 → 3.0.0-nightly.20250910
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/bb/execute.d.ts +1 -9
- package/dest/bb/execute.d.ts.map +1 -1
- package/dest/bb/execute.js +9 -75
- package/dest/instrumentation.d.ts +2 -2
- package/dest/instrumentation.d.ts.map +1 -1
- package/dest/prover/client/wasm/bb_wasm_private_kernel_prover.d.ts.map +1 -1
- package/dest/prover/client/wasm/bb_wasm_private_kernel_prover.js +2 -4
- package/dest/prover/proof_utils.d.ts +2 -2
- package/dest/prover/proof_utils.d.ts.map +1 -1
- package/dest/prover/proof_utils.js +35 -18
- package/dest/prover/server/bb_prover.d.ts +4 -4
- package/dest/prover/server/bb_prover.d.ts.map +1 -1
- package/dest/prover/server/bb_prover.js +15 -41
- package/dest/stats.d.ts.map +1 -1
- package/dest/stats.js +2 -0
- package/dest/test/delay_values.js +2 -2
- package/dest/test/test_circuit_prover.d.ts +4 -3
- package/dest/test/test_circuit_prover.d.ts.map +1 -1
- package/dest/test/test_circuit_prover.js +3 -3
- package/dest/verifier/bb_verifier.d.ts +2 -4
- package/dest/verifier/bb_verifier.d.ts.map +1 -1
- package/dest/verifier/bb_verifier.js +18 -23
- package/package.json +16 -17
- package/src/bb/execute.ts +6 -73
- package/src/instrumentation.ts +2 -2
- package/src/prover/client/wasm/bb_wasm_private_kernel_prover.ts +2 -4
- package/src/prover/proof_utils.ts +46 -24
- package/src/prover/server/bb_prover.ts +34 -60
- package/src/stats.ts +2 -0
- package/src/test/delay_values.ts +2 -2
- package/src/test/test_circuit_prover.ts +16 -5
- package/src/verifier/bb_verifier.ts +27 -29
package/dest/bb/execute.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export declare const PROOF_FILENAME = "proof";
|
|
|
7
7
|
export declare const AVM_INPUTS_FILENAME = "avm_inputs.bin";
|
|
8
8
|
export declare const AVM_BYTECODE_FILENAME = "avm_bytecode.bin";
|
|
9
9
|
export declare const AVM_PUBLIC_INPUTS_FILENAME = "avm_public_inputs.bin";
|
|
10
|
-
export declare const CLIENT_IVC_PROOF_FILE_NAME = "proof";
|
|
11
10
|
export declare enum BB_RESULT {
|
|
12
11
|
SUCCESS = 0,
|
|
13
12
|
FAILURE = 1,
|
|
@@ -61,14 +60,7 @@ export declare function executeBbClientIvcProof(pathToBB: string, workingDirecto
|
|
|
61
60
|
* @param log - A logging function
|
|
62
61
|
* @returns An object containing a result indication, the location of the proof and the duration taken
|
|
63
62
|
*/
|
|
64
|
-
export declare function generateProof(pathToBB: string, workingDirectory: string, circuitName: string, bytecode: Buffer, inputWitnessFile: string, flavor: UltraHonkFlavor, log: Logger): Promise<BBFailure | BBSuccess>;
|
|
65
|
-
/**
|
|
66
|
-
* Used for generating proofs of the tube circuit
|
|
67
|
-
* It is assumed that the working directory is a temporary and/or random directory used solely for generating this proof.
|
|
68
|
-
*
|
|
69
|
-
* @returns An object containing a result indication, the location of the proof and the duration taken
|
|
70
|
-
*/
|
|
71
|
-
export declare function generateTubeProof(pathToBB: string, workingDirectory: string, vkPath: string, log: LogFn): Promise<BBFailure | BBSuccess>;
|
|
63
|
+
export declare function generateProof(pathToBB: string, workingDirectory: string, circuitName: string, bytecode: Buffer, verificationKey: Buffer, inputWitnessFile: string, flavor: UltraHonkFlavor, log: Logger): Promise<BBFailure | BBSuccess>;
|
|
72
64
|
/**
|
|
73
65
|
* Used for generating AVM proofs.
|
|
74
66
|
* It is assumed that the working directory is a temporary and/or random directory used solely for generating this proof.
|
package/dest/bb/execute.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/bb/execute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,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GED
|
@@ -9,7 +9,6 @@ export const PROOF_FILENAME = 'proof';
|
|
|
9
9
|
export const AVM_INPUTS_FILENAME = 'avm_inputs.bin';
|
|
10
10
|
export const AVM_BYTECODE_FILENAME = 'avm_bytecode.bin';
|
|
11
11
|
export const AVM_PUBLIC_INPUTS_FILENAME = 'avm_public_inputs.bin';
|
|
12
|
-
export const CLIENT_IVC_PROOF_FILE_NAME = 'proof';
|
|
13
12
|
export var BB_RESULT = /*#__PURE__*/ function(BB_RESULT) {
|
|
14
13
|
BB_RESULT[BB_RESULT["SUCCESS"] = 0] = "SUCCESS";
|
|
15
14
|
BB_RESULT[BB_RESULT["FAILURE"] = 1] = "FAILURE";
|
|
@@ -203,7 +202,7 @@ function getArgs(flavor) {
|
|
|
203
202
|
* @param inputWitnessFile - The circuit input witness
|
|
204
203
|
* @param log - A logging function
|
|
205
204
|
* @returns An object containing a result indication, the location of the proof and the duration taken
|
|
206
|
-
*/ export async function generateProof(pathToBB, workingDirectory, circuitName, bytecode, inputWitnessFile, flavor, log) {
|
|
205
|
+
*/ export async function generateProof(pathToBB, workingDirectory, circuitName, bytecode, verificationKey, inputWitnessFile, flavor, log) {
|
|
207
206
|
// Check that the working directory exists
|
|
208
207
|
try {
|
|
209
208
|
await fs.access(workingDirectory);
|
|
@@ -215,6 +214,7 @@ function getArgs(flavor) {
|
|
|
215
214
|
}
|
|
216
215
|
// The bytecode is written to e.g. /workingDirectory/BaseParityArtifact-bytecode
|
|
217
216
|
const bytecodePath = `${workingDirectory}/${circuitName}-bytecode`;
|
|
217
|
+
const vkPath = `${workingDirectory}/${circuitName}-vk`;
|
|
218
218
|
// The proof is written to e.g. /workingDirectory/ultra_honk/proof
|
|
219
219
|
const outputPath = `${workingDirectory}`;
|
|
220
220
|
const binaryPresent = await fs.access(pathToBB, fs.constants.R_OK).then((_)=>true).catch((_)=>false);
|
|
@@ -225,16 +225,19 @@ function getArgs(flavor) {
|
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
try {
|
|
228
|
-
// Write the bytecode to the working directory
|
|
229
|
-
await
|
|
230
|
-
|
|
228
|
+
// Write the bytecode and vk to the working directory
|
|
229
|
+
await Promise.all([
|
|
230
|
+
fs.writeFile(bytecodePath, bytecode),
|
|
231
|
+
fs.writeFile(vkPath, verificationKey)
|
|
232
|
+
]);
|
|
231
233
|
const args = getArgs(flavor).concat([
|
|
232
234
|
'--disable_zk',
|
|
233
|
-
'--write_vk',
|
|
234
235
|
'-o',
|
|
235
236
|
outputPath,
|
|
236
237
|
'-b',
|
|
237
238
|
bytecodePath,
|
|
239
|
+
'-k',
|
|
240
|
+
vkPath,
|
|
238
241
|
'-w',
|
|
239
242
|
inputWitnessFile,
|
|
240
243
|
'-v'
|
|
@@ -271,75 +274,6 @@ function getArgs(flavor) {
|
|
|
271
274
|
};
|
|
272
275
|
}
|
|
273
276
|
}
|
|
274
|
-
/**
|
|
275
|
-
* Used for generating proofs of the tube circuit
|
|
276
|
-
* It is assumed that the working directory is a temporary and/or random directory used solely for generating this proof.
|
|
277
|
-
*
|
|
278
|
-
* @returns An object containing a result indication, the location of the proof and the duration taken
|
|
279
|
-
*/ export async function generateTubeProof(pathToBB, workingDirectory, vkPath, log) {
|
|
280
|
-
// Check that the working directory exists
|
|
281
|
-
try {
|
|
282
|
-
await fs.access(workingDirectory);
|
|
283
|
-
} catch {
|
|
284
|
-
return {
|
|
285
|
-
status: 1,
|
|
286
|
-
reason: `Working directory ${workingDirectory} does not exist`
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
// Paths for the inputs
|
|
290
|
-
const proofPath = join(workingDirectory, CLIENT_IVC_PROOF_FILE_NAME);
|
|
291
|
-
// The proof is written to e.g. /workingDirectory/proof
|
|
292
|
-
const outputPath = workingDirectory;
|
|
293
|
-
const filePresent = async (file)=>await fs.access(file, fs.constants.R_OK).then((_)=>true).catch((_)=>false);
|
|
294
|
-
const binaryPresent = await filePresent(pathToBB);
|
|
295
|
-
if (!binaryPresent) {
|
|
296
|
-
return {
|
|
297
|
-
status: 1,
|
|
298
|
-
reason: `Failed to find bb binary at ${pathToBB}`
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
try {
|
|
302
|
-
if (!await filePresent(proofPath)) {
|
|
303
|
-
return {
|
|
304
|
-
status: 1,
|
|
305
|
-
reason: `Client IVC input files not present in ${workingDirectory}`
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
const args = [
|
|
309
|
-
'-o',
|
|
310
|
-
outputPath,
|
|
311
|
-
'-k',
|
|
312
|
-
vkPath,
|
|
313
|
-
'-v'
|
|
314
|
-
];
|
|
315
|
-
const timer = new Timer();
|
|
316
|
-
const logFunction = (message)=>{
|
|
317
|
-
log(`TubeCircuit (prove) BB out - ${message}`);
|
|
318
|
-
};
|
|
319
|
-
const result = await executeBB(pathToBB, 'prove_tube', args, logFunction);
|
|
320
|
-
const durationMs = timer.ms();
|
|
321
|
-
if (result.status == 0) {
|
|
322
|
-
return {
|
|
323
|
-
status: 0,
|
|
324
|
-
durationMs,
|
|
325
|
-
proofPath: outputPath,
|
|
326
|
-
pkPath: undefined,
|
|
327
|
-
vkDirectoryPath: outputPath
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
// Not a great error message here but it is difficult to decipher what comes from bb
|
|
331
|
-
return {
|
|
332
|
-
status: 1,
|
|
333
|
-
reason: `Failed to generate proof. Exit code ${result.exitCode}. Signal ${result.signal}.`,
|
|
334
|
-
retry: !!result.signal
|
|
335
|
-
};
|
|
336
|
-
} catch (error) {
|
|
337
|
-
return {
|
|
338
|
-
status: 1,
|
|
339
|
-
reason: `${error}`
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
277
|
/**
|
|
344
278
|
* Used for generating AVM proofs.
|
|
345
279
|
* It is assumed that the working directory is a temporary and/or random directory used solely for generating this proof.
|
|
@@ -21,7 +21,7 @@ export declare class ProverInstrumentation {
|
|
|
21
21
|
* @param circuitName - The name of the circuit
|
|
22
22
|
* @param timerOrMS - The duration
|
|
23
23
|
*/
|
|
24
|
-
recordDuration(metric: 'simulationDuration' | 'witGenDuration' | 'provingDuration', circuitName: CircuitName
|
|
24
|
+
recordDuration(metric: 'simulationDuration' | 'witGenDuration' | 'provingDuration', circuitName: CircuitName, timerOrMS: Timer | number): void;
|
|
25
25
|
/**
|
|
26
26
|
* Records the duration of an AVM circuit operation.
|
|
27
27
|
* @param metric - The metric to record
|
|
@@ -35,7 +35,7 @@ export declare class ProverInstrumentation {
|
|
|
35
35
|
* @param circuitName - The name of the circuit
|
|
36
36
|
* @param size - The size
|
|
37
37
|
*/
|
|
38
|
-
recordSize(metric: 'witGenInputSize' | 'witGenOutputSize' | 'proofSize' | 'circuitSize' | 'circuitPublicInputCount', circuitName: CircuitName
|
|
38
|
+
recordSize(metric: 'witGenInputSize' | 'witGenOutputSize' | 'proofSize' | 'circuitSize' | 'circuitPublicInputCount', circuitName: CircuitName, size: number): void;
|
|
39
39
|
/**
|
|
40
40
|
* Records the size of an AVM circuit operation.
|
|
41
41
|
* @param metric - The metric to record
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../src/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,MAAM,EAEZ,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,kBAAkB,CAAY;IACtC,OAAO,CAAC,cAAc,CAAY;IAClC,OAAO,CAAC,eAAe,CAAY;IAEnC,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,gBAAgB,CAAQ;IAEhC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CA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GAAG,aAAa,GAAG,yBAAyB,EACxG,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,MAAM;IAOd;;;;;OAKG;IACH,aAAa,CACX,MAAM,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,WAAW,GAAG,aAAa,GAAG,yBAAyB,EACxG,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM;CAMf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bb_wasm_private_kernel_prover.d.ts","sourceRoot":"","sources":["../../../../src/prover/client/wasm/bb_wasm_private_kernel_prover.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,8BAAsB,yBAA0B,SAAQ,qBAAqB;cAEtD,gBAAgB,EAAE,gBAAgB;cAClC,SAAS,EAAE,gBAAgB;IAC9C,OAAO,CAAC,OAAO;cACI,GAAG;gBAHH,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,gBAAgB,EACtC,OAAO,GAAE,MAAU,EACR,GAAG,yCAAiC;IAKnC,oBAAoB,CAAC,cAAc,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"bb_wasm_private_kernel_prover.d.ts","sourceRoot":"","sources":["../../../../src/prover/client/wasm/bb_wasm_private_kernel_prover.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,8BAAsB,yBAA0B,SAAQ,qBAAqB;cAEtD,gBAAgB,EAAE,gBAAgB;cAClC,SAAS,EAAE,gBAAgB;IAC9C,OAAO,CAAC,OAAO;cACI,GAAG;gBAHH,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,gBAAgB,EACtC,OAAO,GAAE,MAAU,EACR,GAAG,yCAAiC;IAKnC,oBAAoB,CAAC,cAAc,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAqBrF,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAa3G"}
|
|
@@ -21,16 +21,14 @@ export class BBWASMPrivateKernelProver extends BBPrivateKernelProver {
|
|
|
21
21
|
logger: this.log.verbose,
|
|
22
22
|
wasmPath: process.env.BB_WASM_PATH
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
// Move this sanity check inside the wasm code and remove the vk from the return value.
|
|
26
|
-
const [proof, _vk] = await backend.prove(executionSteps.map((step)=>ungzip(serializeWitness(step.witness))), executionSteps.map((step)=>step.vk));
|
|
24
|
+
const [proof] = await backend.prove(executionSteps.map((step)=>ungzip(serializeWitness(step.witness))), executionSteps.map((step)=>step.vk));
|
|
27
25
|
await backend.destroy();
|
|
28
26
|
this.log.info(`Generated ClientIVC proof`, {
|
|
29
27
|
eventName: 'client-ivc-proof-generation',
|
|
30
28
|
duration: timer.ms(),
|
|
31
29
|
proofSize: proof.length
|
|
32
30
|
});
|
|
33
|
-
return
|
|
31
|
+
return ClientIvcProof.fromBufferArray(proof);
|
|
34
32
|
}
|
|
35
33
|
async computeGateCountForCircuit(_bytecode, _circuitName) {
|
|
36
34
|
// Note we do not pass the vk to the backend. This is unneeded for gate counts.
|
|
@@ -14,6 +14,6 @@ export declare function readClientIVCProofFromOutputDirectory(directory: string)
|
|
|
14
14
|
* @param proof the ClientIvcProof from object
|
|
15
15
|
* @param directory the directory to write in
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
18
|
-
export declare function
|
|
17
|
+
export declare function writeClientIVCProofToPath(clientIvcProof: ClientIvcProof, outputPath: string): Promise<void>;
|
|
18
|
+
export declare function readProofsFromOutputDirectory<PROOF_LENGTH extends number>(directory: string, vkData: VerificationKeyData, proofLength: PROOF_LENGTH, logger: Logger): Promise<RecursiveProof<PROOF_LENGTH>>;
|
|
19
19
|
//# sourceMappingURL=proof_utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof_utils.d.ts","sourceRoot":"","sources":["../../src/prover/proof_utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proof_utils.d.ts","sourceRoot":"","sources":["../../src/prover/proof_utils.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAS,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAQ7D;;;;;GAKG;AACH,wBAAsB,qCAAqC,CAAC,SAAS,EAAE,MAAM,2BAK5E;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAIjG;AAuBD,wBAAsB,6BAA6B,CAAC,YAAY,SAAS,MAAM,EAC7E,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,YAAY,EACzB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CA2CvC"}
|
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
import { IPA_CLAIM_SIZE, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, PAIRING_POINTS_SIZE, ULTRA_KECCAK_PROOF_LENGTH } from '@aztec/constants';
|
|
1
|
+
import { CIVC_PROOF_LENGTH, HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE, IPA_CLAIM_SIZE, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, PAIRING_POINTS_SIZE, ULTRA_KECCAK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { ClientIvcProof, Proof, RecursiveProof } from '@aztec/stdlib/proofs';
|
|
4
4
|
import assert from 'assert';
|
|
5
5
|
import { promises as fs } from 'fs';
|
|
6
6
|
import * as path from 'path';
|
|
7
|
-
import {
|
|
7
|
+
import { PROOF_FILENAME, PUBLIC_INPUTS_FILENAME } from '../bb/execute.js';
|
|
8
8
|
/**
|
|
9
9
|
* Create a ClientIvcProof proof file.
|
|
10
10
|
*
|
|
11
11
|
* @param directory the directory to read the proof from.
|
|
12
12
|
* @returns the encapsulated client ivc proof
|
|
13
13
|
*/ export async function readClientIVCProofFromOutputDirectory(directory) {
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const proofFilename = path.join(directory, PROOF_FILENAME);
|
|
15
|
+
const binaryProof = await fs.readFile(proofFilename);
|
|
16
|
+
const proofFields = splitBufferIntoFields(binaryProof);
|
|
17
|
+
return new ClientIvcProof(proofFields);
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Serialize a ClientIvcProof to a proof file.
|
|
19
21
|
*
|
|
20
22
|
* @param proof the ClientIvcProof from object
|
|
21
23
|
* @param directory the directory to write in
|
|
22
|
-
*/ export async function
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
*/ export async function writeClientIVCProofToPath(clientIvcProof, outputPath) {
|
|
25
|
+
// NB: Don't use clientIvcProof.toBuffer here because it will include the proof length.
|
|
26
|
+
const fieldsBuf = Buffer.concat(clientIvcProof.proof.map((field)=>field.toBuffer()));
|
|
27
|
+
await fs.writeFile(outputPath, fieldsBuf);
|
|
28
|
+
}
|
|
29
|
+
function getNumCustomPublicInputs(proofLength, vkData) {
|
|
30
|
+
let numPublicInputs = vkData.numPublicInputs;
|
|
31
|
+
if (proofLength == CIVC_PROOF_LENGTH) {
|
|
32
|
+
numPublicInputs -= HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE;
|
|
33
|
+
} else {
|
|
34
|
+
numPublicInputs -= PAIRING_POINTS_SIZE;
|
|
35
|
+
if (proofLength == NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH) {
|
|
36
|
+
numPublicInputs -= IPA_CLAIM_SIZE;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return numPublicInputs;
|
|
25
40
|
}
|
|
26
41
|
function splitBufferIntoFields(buffer) {
|
|
27
42
|
const fields = [];
|
|
@@ -30,26 +45,28 @@ function splitBufferIntoFields(buffer) {
|
|
|
30
45
|
}
|
|
31
46
|
return fields;
|
|
32
47
|
}
|
|
33
|
-
export async function
|
|
34
|
-
|
|
35
|
-
const
|
|
48
|
+
export async function readProofsFromOutputDirectory(directory, vkData, proofLength, logger) {
|
|
49
|
+
assert(proofLength == CIVC_PROOF_LENGTH || proofLength == NESTED_RECURSIVE_PROOF_LENGTH || proofLength == NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH || proofLength == ULTRA_KECCAK_PROOF_LENGTH, `Proof length must be one of the expected proof lengths, received ${proofLength}`);
|
|
50
|
+
const publicInputsFilename = path.join(directory, PUBLIC_INPUTS_FILENAME);
|
|
51
|
+
const proofFilename = path.join(directory, PROOF_FILENAME);
|
|
52
|
+
// Handle CIVC separately because bb outputs the proof fields with public inputs for CIVC.
|
|
53
|
+
const isCIVC = proofLength == CIVC_PROOF_LENGTH;
|
|
36
54
|
const [binaryPublicInputs, binaryProof] = await Promise.all([
|
|
37
|
-
fs.readFile(publicInputsFilename),
|
|
55
|
+
isCIVC ? Buffer.alloc(0) : fs.readFile(publicInputsFilename),
|
|
38
56
|
fs.readFile(proofFilename)
|
|
39
57
|
]);
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
numPublicInputs -= IPA_CLAIM_SIZE;
|
|
58
|
+
const numPublicInputs = getNumCustomPublicInputs(proofLength, vkData);
|
|
59
|
+
let fieldsWithoutPublicInputs = splitBufferIntoFields(binaryProof);
|
|
60
|
+
if (isCIVC) {
|
|
61
|
+
fieldsWithoutPublicInputs = fieldsWithoutPublicInputs.slice(numPublicInputs);
|
|
45
62
|
}
|
|
46
|
-
assert(fieldsWithoutPublicInputs.length == proofLength, `Proof length mismatch: ${fieldsWithoutPublicInputs.length} != ${proofLength}`);
|
|
63
|
+
assert(fieldsWithoutPublicInputs.length == proofLength, `Proof fields length mismatch: ${fieldsWithoutPublicInputs.length} != ${proofLength}`);
|
|
47
64
|
// Concat binary public inputs and binary proof
|
|
48
65
|
// This buffer will have the form: [binary public inputs, binary proof]
|
|
49
66
|
const binaryProofWithPublicInputs = Buffer.concat([
|
|
50
67
|
binaryPublicInputs,
|
|
51
68
|
binaryProof
|
|
52
69
|
]);
|
|
53
|
-
logger.debug(`Circuit path: ${
|
|
70
|
+
logger.debug(`Circuit path: ${directory}, proof fields length: ${fieldsWithoutPublicInputs.length}, num public inputs: ${numPublicInputs}, circuit size: ${vkData.circuitSize}`);
|
|
54
71
|
return new RecursiveProof(fieldsWithoutPublicInputs, new Proof(binaryProofWithPublicInputs, numPublicInputs), true, proofLength);
|
|
55
72
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH
|
|
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 { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
5
6
|
import type { BaseParityInputs, ParityPublicInputs, RootParityInputs } from '@aztec/stdlib/parity';
|
|
6
7
|
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
|
|
8
|
+
import { type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, type BlockRootOrBlockMergePublicInputs, type BlockRootRollupInputs, type EmptyBlockRootRollupInputs, type MergeRollupInputs, PaddingBlockRootRollupInputs, type PrivateBaseRollupInputs, PublicBaseRollupInputs, PublicTubePrivateInputs, type RootRollupInputs, type RootRollupPublicInputs, type SingleTxBlockRootRollupInputs } from '@aztec/stdlib/rollup';
|
|
8
9
|
import type { VerificationKeyData } from '@aztec/stdlib/vks';
|
|
9
10
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
10
11
|
import type { ACVMConfig, BBConfig } from '../../config.js';
|
|
@@ -39,6 +40,7 @@ export declare class BBNativeRollupProver implements ServerCircuitProver {
|
|
|
39
40
|
* @returns The proof.
|
|
40
41
|
*/
|
|
41
42
|
getAvmProof(inputs: AvmCircuitInputs, skipPublicInputsValidation?: boolean): Promise<ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>>;
|
|
43
|
+
getPublicTubeProof(inputs: PublicTubePrivateInputs): Promise<PublicInputsAndRecursiveProof<PrivateToPublicKernelCircuitPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
42
44
|
/**
|
|
43
45
|
* Simulates the base rollup circuit from its inputs.
|
|
44
46
|
* @param inputs - Inputs to the circuit.
|
|
@@ -86,9 +88,7 @@ export declare class BBNativeRollupProver implements ServerCircuitProver {
|
|
|
86
88
|
private generateProofWithBB;
|
|
87
89
|
private createProof;
|
|
88
90
|
private generateAvmProofWithBB;
|
|
89
|
-
private generateTubeProofWithBB;
|
|
90
91
|
private createAvmProof;
|
|
91
|
-
getTubeProof(input: TubeInputs): Promise<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>>;
|
|
92
92
|
/**
|
|
93
93
|
* Executes a circuit and returns its outputs and corresponding proof with embedded aggregation object
|
|
94
94
|
* @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,
|
|
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,EAEvB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,KAAK,sBAAsB,EA0B5B,MAAM,4CAA4C,CAAC;AAIpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,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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;YA2CX,sBAAsB;YAatB,cAAc;IAkC5B;;;;;;;;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;IAuBlC,OAAO,CAAC,cAAc;CAYvB"}
|
|
@@ -4,12 +4,12 @@ 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,
|
|
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 { convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap, convertBlockMergeRollupInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap, convertBlockRootRollupInputsToWitnessMap, convertBlockRootRollupOutputsFromWitnessMap, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap, convertPaddingBlockRootRollupInputsToWitnessMap, convertPaddingBlockRootRollupOutputsFromWitnessMap, convertPrivateBaseRollupInputsToWitnessMap, convertPrivateBaseRollupOutputsFromWitnessMap, convertPublicBaseRollupInputsToWitnessMap, convertPublicBaseRollupOutputsFromWitnessMap, convertPublicTubeOutputsFromWitnessMap, convertPublicTubePrivateInputsToWitnessMap, 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';
|
|
@@ -17,16 +17,14 @@ import { makeProofAndVerificationKey, makePublicInputsAndRecursiveProof } from '
|
|
|
17
17
|
import { Proof, RecursiveProof, makeRecursiveProofFromBinary } from '@aztec/stdlib/proofs';
|
|
18
18
|
import { enhanceProofWithPiValidationFlag } from '@aztec/stdlib/rollup';
|
|
19
19
|
import { Attributes, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
20
|
-
import crypto from 'crypto';
|
|
21
20
|
import { promises as fs } from 'fs';
|
|
22
21
|
import * as path from 'path';
|
|
23
|
-
import { BB_RESULT, PROOF_FILENAME, PUBLIC_INPUTS_FILENAME, VK_FILENAME, generateAvmProof, generateProof,
|
|
22
|
+
import { BB_RESULT, PROOF_FILENAME, PUBLIC_INPUTS_FILENAME, VK_FILENAME, generateAvmProof, generateProof, verifyAvmProof, verifyProof } from '../../bb/execute.js';
|
|
24
23
|
import { getUltraHonkFlavorForCircuit } from '../../honk.js';
|
|
25
24
|
import { ProverInstrumentation } from '../../instrumentation.js';
|
|
26
25
|
import { mapProtocolArtifactNameToCircuitName } from '../../stats.js';
|
|
27
|
-
import { extractAvmVkData
|
|
28
|
-
import {
|
|
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
|
|
@@ -84,6 +82,13 @@ const logger = createLogger('bb-prover');
|
|
|
84
82
|
proofAndVk.proof.proof = enhanceProofWithPiValidationFlag(proofAndVk.proof.proof, skipPublicInputsValidation);
|
|
85
83
|
return proofAndVk;
|
|
86
84
|
}
|
|
85
|
+
async getPublicTubeProof(inputs) {
|
|
86
|
+
const artifactName = 'PublicTube';
|
|
87
|
+
const { circuitOutput, proof } = await this.createRecursiveProof(inputs, artifactName, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertPublicTubePrivateInputsToWitnessMap, convertPublicTubeOutputsFromWitnessMap);
|
|
88
|
+
const verificationKey = this.getVerificationKeyDataForCircuit(artifactName);
|
|
89
|
+
await this.verifyProof(artifactName, proof.binaryProof);
|
|
90
|
+
return makePublicInputsAndRecursiveProof(circuitOutput, proof, verificationKey);
|
|
91
|
+
}
|
|
87
92
|
/**
|
|
88
93
|
* Simulates the base rollup circuit from its inputs.
|
|
89
94
|
* @param inputs - Inputs to the circuit.
|
|
@@ -196,7 +201,7 @@ const logger = createLogger('bb-prover');
|
|
|
196
201
|
});
|
|
197
202
|
// Now prove the circuit from the generated witness
|
|
198
203
|
logger.debug(`Proving ${circuitType}...`);
|
|
199
|
-
const provingResult = await generateProof(this.config.bbBinaryPath, workingDirectory, circuitType, Buffer.from(artifact.bytecode, 'base64'), outputWitnessFile, getUltraHonkFlavorForCircuit(circuitType), logger);
|
|
204
|
+
const provingResult = await generateProof(this.config.bbBinaryPath, workingDirectory, circuitType, Buffer.from(artifact.bytecode, 'base64'), this.getVerificationKeyDataForCircuit(circuitType).keyAsBytes, outputWitnessFile, getUltraHonkFlavorForCircuit(circuitType), logger);
|
|
200
205
|
if (provingResult.status === BB_RESULT.FAILURE) {
|
|
201
206
|
logger.error(`Failed to generate proof for ${circuitType}: ${provingResult.reason}`);
|
|
202
207
|
throw new ProvingError(provingResult.reason, provingResult, provingResult.retry);
|
|
@@ -211,7 +216,7 @@ const logger = createLogger('bb-prover');
|
|
|
211
216
|
const { provingResult, circuitOutput: output } = await this.generateProofWithBB(input, circuitType, convertInput, convertOutput, bbWorkingDirectory);
|
|
212
217
|
const vkData = this.getVerificationKeyDataForCircuit(circuitType);
|
|
213
218
|
const PROOF_LENGTH = circuitType == 'RootRollupArtifact' ? ULTRA_KECCAK_PROOF_LENGTH : RECURSIVE_PROOF_LENGTH;
|
|
214
|
-
const proof = await
|
|
219
|
+
const proof = await readProofsFromOutputDirectory(provingResult.proofPath, vkData, PROOF_LENGTH, logger);
|
|
215
220
|
const circuitName = mapProtocolArtifactNameToCircuitName(circuitType);
|
|
216
221
|
this.instrumentation.recordDuration('provingDuration', circuitName, provingResult.durationMs);
|
|
217
222
|
this.instrumentation.recordSize('proofSize', circuitName, proof.binaryProof.buffer.length);
|
|
@@ -244,18 +249,6 @@ const logger = createLogger('bb-prover');
|
|
|
244
249
|
}
|
|
245
250
|
return provingResult;
|
|
246
251
|
}
|
|
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
252
|
async createAvmProof(input) {
|
|
260
253
|
const operation = async (bbWorkingDirectory)=>{
|
|
261
254
|
const provingResult = await this.generateAvmProofWithBB(input, bbWorkingDirectory);
|
|
@@ -280,25 +273,6 @@ const logger = createLogger('bb-prover');
|
|
|
280
273
|
};
|
|
281
274
|
return await this.runInDirectory(operation);
|
|
282
275
|
}
|
|
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
276
|
/**
|
|
303
277
|
* Executes a circuit and returns its outputs and corresponding proof with embedded aggregation object
|
|
304
278
|
* @param witnessMap - The input witness
|
|
@@ -313,7 +287,7 @@ const logger = createLogger('bb-prover');
|
|
|
313
287
|
const { provingResult, circuitOutput: output } = await this.generateProofWithBB(input, circuitType, convertInput, convertOutput, bbWorkingDirectory);
|
|
314
288
|
const vkData = this.getVerificationKeyDataForCircuit(circuitType);
|
|
315
289
|
// Read the proof as fields
|
|
316
|
-
const proof = await
|
|
290
|
+
const proof = await readProofsFromOutputDirectory(provingResult.proofPath, vkData, proofLength, logger);
|
|
317
291
|
const circuitName = mapProtocolArtifactNameToCircuitName(circuitType);
|
|
318
292
|
this.instrumentation.recordDuration('provingDuration', circuitName, provingResult.durationMs);
|
|
319
293
|
this.instrumentation.recordSize('proofSize', circuitName, proof.binaryProof.buffer.length);
|
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,CA6C5F"}
|
package/dest/stats.js
CHANGED
|
@@ -4,6 +4,8 @@ export function mapProtocolArtifactNameToCircuitName(artifact) {
|
|
|
4
4
|
return 'base-parity';
|
|
5
5
|
case 'RootParityArtifact':
|
|
6
6
|
return 'root-parity';
|
|
7
|
+
case 'PublicTube':
|
|
8
|
+
return 'public-tube';
|
|
7
9
|
case 'PrivateBaseRollupArtifact':
|
|
8
10
|
return 'private-base-rollup';
|
|
9
11
|
case 'PublicBaseRollupArtifact':
|
|
@@ -11,7 +11,7 @@ export const WITGEN_DELAY_MS = {
|
|
|
11
11
|
[ProvingRequestType.PUBLIC_BASE_ROLLUP]: 470_000,
|
|
12
12
|
[ProvingRequestType.ROOT_PARITY]: 100,
|
|
13
13
|
[ProvingRequestType.ROOT_ROLLUP]: 650,
|
|
14
|
-
[ProvingRequestType.
|
|
14
|
+
[ProvingRequestType.PUBLIC_TUBE]: 0,
|
|
15
15
|
[ProvingRequestType.PUBLIC_VM]: 0
|
|
16
16
|
};
|
|
17
17
|
export const PROOF_DELAY_MS = {
|
|
@@ -26,6 +26,6 @@ export const PROOF_DELAY_MS = {
|
|
|
26
26
|
[ProvingRequestType.PUBLIC_BASE_ROLLUP]: 160_000,
|
|
27
27
|
[ProvingRequestType.ROOT_PARITY]: 30_000,
|
|
28
28
|
[ProvingRequestType.ROOT_ROLLUP]: 15_000,
|
|
29
|
-
[ProvingRequestType.
|
|
29
|
+
[ProvingRequestType.PUBLIC_TUBE]: 30_000,
|
|
30
30
|
[ProvingRequestType.PUBLIC_VM]: 0
|
|
31
31
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH
|
|
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 CircuitSimulator } from '@aztec/simulator/server';
|
|
4
4
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
5
5
|
import { type ProofAndVerificationKey, type PublicInputsAndRecursiveProof, type ServerCircuitProver } from '@aztec/stdlib/interfaces/server';
|
|
6
|
+
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
6
7
|
import type { BaseParityInputs, ParityPublicInputs, RootParityInputs } from '@aztec/stdlib/parity';
|
|
7
8
|
import { type Proof } from '@aztec/stdlib/proofs';
|
|
8
|
-
import type { BaseOrMergeRollupPublicInputs, BlockMergeRollupInputs, BlockRootOrBlockMergePublicInputs, BlockRootRollupInputs, EmptyBlockRootRollupInputs, MergeRollupInputs, PaddingBlockRootRollupInputs, PrivateBaseRollupInputs, PublicBaseRollupInputs, RootRollupInputs, RootRollupPublicInputs, SingleTxBlockRootRollupInputs
|
|
9
|
+
import type { BaseOrMergeRollupPublicInputs, BlockMergeRollupInputs, BlockRootOrBlockMergePublicInputs, BlockRootRollupInputs, EmptyBlockRootRollupInputs, MergeRollupInputs, PaddingBlockRootRollupInputs, PrivateBaseRollupInputs, PublicBaseRollupInputs, PublicTubePrivateInputs, RootRollupInputs, RootRollupPublicInputs, SingleTxBlockRootRollupInputs } from '@aztec/stdlib/rollup';
|
|
9
10
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
10
11
|
type TestDelay = {
|
|
11
12
|
proverTestDelayType: 'fixed';
|
|
@@ -38,7 +39,7 @@ export declare class TestCircuitProver implements ServerCircuitProver {
|
|
|
38
39
|
* @returns The public inputs of the parity circuit.
|
|
39
40
|
*/
|
|
40
41
|
getRootParityProof(inputs: RootParityInputs): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
|
|
41
|
-
|
|
42
|
+
getPublicTubeProof(inputs: PublicTubePrivateInputs): Promise<PublicInputsAndRecursiveProof<PrivateToPublicKernelCircuitPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
42
43
|
getPrivateBaseRollupProof(inputs: PrivateBaseRollupInputs): Promise<PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
43
44
|
getPublicBaseRollupProof(inputs: PublicBaseRollupInputs): Promise<PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
44
45
|
/**
|
|
@@ -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,
|
|
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,EACvB,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,wCAAwC,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,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,UAAU;IAejB,WAAW,CAAC,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;YAI1D,QAAQ;CA8CvB"}
|
|
@@ -4,7 +4,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
4
4
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
}
|
|
7
|
-
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH
|
|
7
|
+
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH } from '@aztec/constants';
|
|
8
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
9
|
import { sleep } from '@aztec/foundation/sleep';
|
|
10
10
|
import { Timer } from '@aztec/foundation/timer';
|
|
@@ -54,8 +54,8 @@ import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
|
|
|
54
54
|
*/ getRootParityProof(inputs) {
|
|
55
55
|
return this.applyDelay(ProvingRequestType.ROOT_PARITY, ()=>this.simulate(inputs, 'RootParityArtifact', NESTED_RECURSIVE_PROOF_LENGTH, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap));
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
return this.applyDelay(ProvingRequestType.
|
|
57
|
+
getPublicTubeProof(inputs) {
|
|
58
|
+
return this.applyDelay(ProvingRequestType.PUBLIC_TUBE, ()=>makePublicInputsAndRecursiveProof(inputs.hidingKernelProofData.publicInputs, makeEmptyRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH), ProtocolCircuitVks.PublicTube));
|
|
59
59
|
}
|
|
60
60
|
getPrivateBaseRollupProof(inputs) {
|
|
61
61
|
return this.applyDelay(ProvingRequestType.PRIVATE_BASE_ROLLUP, ()=>this.simulate(inputs, 'PrivateBaseRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertSimulatedPrivateBaseRollupInputsToWitnessMap, convertSimulatedPrivateBaseRollupOutputsFromWitnessMap));
|