@aztec/bb-prover 0.76.4 → 0.77.0-testnet-ignition.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/avm_proving_tests/avm_proving_tester.d.ts +8 -8
- package/dest/avm_proving_tests/avm_proving_tester.d.ts.map +1 -1
- package/dest/avm_proving_tests/avm_proving_tester.js +24 -25
- package/dest/bb/cli.d.ts +3 -3
- package/dest/bb/cli.d.ts.map +1 -1
- package/dest/bb/cli.js +4 -9
- package/dest/bb/execute.d.ts +7 -37
- package/dest/bb/execute.d.ts.map +1 -1
- package/dest/bb/execute.js +359 -357
- package/dest/bb/index.js +4 -6
- package/dest/config.js +1 -2
- package/dest/honk.d.ts +1 -1
- package/dest/honk.d.ts.map +1 -1
- package/dest/honk.js +8 -5
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/instrumentation.d.ts +2 -2
- package/dest/instrumentation.d.ts.map +1 -1
- package/dest/instrumentation.js +50 -47
- package/dest/prover/bb_native_private_kernel_prover.d.ts +4 -4
- package/dest/prover/bb_native_private_kernel_prover.d.ts.map +1 -1
- package/dest/prover/bb_native_private_kernel_prover.js +19 -19
- package/dest/prover/bb_private_kernel_prover.d.ts +7 -6
- package/dest/prover/bb_private_kernel_prover.d.ts.map +1 -1
- package/dest/prover/bb_private_kernel_prover.js +14 -15
- package/dest/prover/bb_prover.d.ts +7 -10
- package/dest/prover/bb_prover.d.ts.map +1 -1
- package/dest/prover/bb_prover.js +402 -447
- package/dest/prover/client_ivc_proof_utils.d.ts +3 -3
- package/dest/prover/client_ivc_proof_utils.d.ts.map +1 -1
- package/dest/prover/client_ivc_proof_utils.js +18 -12
- package/dest/prover/index.js +0 -1
- package/dest/stats.d.ts +2 -2
- package/dest/stats.d.ts.map +1 -1
- package/dest/stats.js +15 -14
- package/dest/test/delay_values.d.ts +4 -0
- package/dest/test/delay_values.d.ts.map +1 -0
- package/dest/test/delay_values.js +29 -0
- package/dest/test/index.js +0 -1
- package/dest/test/test_circuit_prover.d.ts +16 -7
- package/dest/test/test_circuit_prover.d.ts.map +1 -1
- package/dest/test/test_circuit_prover.js +165 -161
- package/dest/test/test_verifier.d.ts +2 -1
- package/dest/test/test_verifier.d.ts.map +1 -1
- package/dest/test/test_verifier.js +0 -1
- package/dest/verification_key/verification_key_data.d.ts +1 -1
- package/dest/verification_key/verification_key_data.d.ts.map +1 -1
- package/dest/verification_key/verification_key_data.js +13 -9
- package/dest/verifier/bb_verifier.d.ts +6 -4
- package/dest/verifier/bb_verifier.d.ts.map +1 -1
- package/dest/verifier/bb_verifier.js +18 -18
- package/dest/verifier/index.js +0 -1
- package/dest/wasm/bb_wasm_private_kernel_prover.d.ts +5 -4
- package/dest/wasm/bb_wasm_private_kernel_prover.d.ts.map +1 -1
- package/dest/wasm/bb_wasm_private_kernel_prover.js +26 -11
- package/dest/wasm/bundle.d.ts +1 -1
- package/dest/wasm/bundle.d.ts.map +1 -1
- package/dest/wasm/bundle.js +1 -2
- package/dest/wasm/lazy.d.ts +1 -1
- package/dest/wasm/lazy.d.ts.map +1 -1
- package/dest/wasm/lazy.js +1 -2
- package/package.json +18 -19
- package/src/avm_proving_tests/avm_proving_tester.ts +17 -33
- package/src/bb/cli.ts +3 -3
- package/src/bb/execute.ts +80 -211
- package/src/honk.ts +1 -1
- package/src/index.ts +1 -1
- package/src/instrumentation.ts +10 -10
- package/src/prover/bb_native_private_kernel_prover.ts +5 -4
- package/src/prover/bb_private_kernel_prover.ts +20 -20
- package/src/prover/bb_prover.ts +33 -100
- package/src/prover/client_ivc_proof_utils.ts +3 -3
- package/src/stats.ts +2 -2
- package/src/test/delay_values.ts +31 -0
- package/src/test/test_circuit_prover.ts +149 -120
- package/src/test/test_verifier.ts +2 -1
- package/src/verification_key/verification_key_data.ts +4 -7
- package/src/verifier/bb_verifier.ts +16 -9
- package/src/wasm/bb_wasm_private_kernel_prover.ts +18 -5
- package/src/wasm/bundle.ts +1 -1
- package/src/wasm/lazy.ts +1 -1
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { type ClientProtocolCircuitVerifier, Tx } from '@aztec/circuit-types';
|
|
2
|
-
import { type CircuitVerificationStats } from '@aztec/circuit-types/stats';
|
|
3
|
-
import { type Proof, type VerificationKeyData } from '@aztec/circuits.js';
|
|
4
1
|
import { runInDirectory } from '@aztec/foundation/fs';
|
|
5
2
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { ServerCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
4
|
+
import type { ClientProtocolArtifact, ServerProtocolArtifact } from '@aztec/noir-protocol-circuits-types/types';
|
|
5
|
+
import type { ClientProtocolCircuitVerifier } from '@aztec/stdlib/interfaces/server';
|
|
6
|
+
import type { Proof } from '@aztec/stdlib/proofs';
|
|
7
|
+
import type { CircuitVerificationStats } from '@aztec/stdlib/stats';
|
|
8
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
9
|
+
import type { VerificationKeyData } from '@aztec/stdlib/vks';
|
|
8
10
|
|
|
9
11
|
import { promises as fs } from 'fs';
|
|
10
12
|
import * as path from 'path';
|
|
11
13
|
|
|
12
14
|
import { BB_RESULT, PROOF_FILENAME, VK_FILENAME, verifyClientIvcProof, verifyProof } from '../bb/execute.js';
|
|
13
|
-
import {
|
|
15
|
+
import type { BBConfig } from '../config.js';
|
|
14
16
|
import { getUltraHonkFlavorForCircuit } from '../honk.js';
|
|
15
17
|
import { writeToOutputDirectory } from '../prover/client_ivc_proof_utils.js';
|
|
16
18
|
import { mapProtocolArtifactNameToCircuitName } from '../stats.js';
|
|
@@ -62,7 +64,7 @@ export class BBCircuitVerifier implements ClientProtocolCircuitVerifier {
|
|
|
62
64
|
proofType: 'ultra-honk',
|
|
63
65
|
} satisfies CircuitVerificationStats);
|
|
64
66
|
};
|
|
65
|
-
await runInDirectory(this.config.bbWorkingDirectory, operation, this.config.bbSkipCleanup);
|
|
67
|
+
await runInDirectory(this.config.bbWorkingDirectory, operation, this.config.bbSkipCleanup, this.logger);
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
public async verifyProof(tx: Tx): Promise<boolean> {
|
|
@@ -83,7 +85,12 @@ export class BBCircuitVerifier implements ClientProtocolCircuitVerifier {
|
|
|
83
85
|
};
|
|
84
86
|
|
|
85
87
|
await writeToOutputDirectory(tx.clientIvcProof, bbWorkingDirectory);
|
|
86
|
-
const result = await verifyClientIvcProof(
|
|
88
|
+
const result = await verifyClientIvcProof(
|
|
89
|
+
this.config.bbBinaryPath,
|
|
90
|
+
bbWorkingDirectory.concat('/proof'),
|
|
91
|
+
bbWorkingDirectory.concat('/vk'),
|
|
92
|
+
logFunction,
|
|
93
|
+
);
|
|
87
94
|
|
|
88
95
|
if (result.status === BB_RESULT.FAILURE) {
|
|
89
96
|
const errorMessage = `Failed to verify ${circuit} proof!`;
|
|
@@ -97,7 +104,7 @@ export class BBCircuitVerifier implements ClientProtocolCircuitVerifier {
|
|
|
97
104
|
proofType: 'client-ivc',
|
|
98
105
|
} satisfies CircuitVerificationStats);
|
|
99
106
|
};
|
|
100
|
-
await runInDirectory(this.config.bbWorkingDirectory, operation, this.config.bbSkipCleanup);
|
|
107
|
+
await runInDirectory(this.config.bbWorkingDirectory, operation, this.config.bbSkipCleanup, this.logger);
|
|
101
108
|
return true;
|
|
102
109
|
} catch (err) {
|
|
103
110
|
this.logger.warn(`Failed to verify ClientIVC proof for tx ${Tx.getHash(tx)}: ${String(err)}`);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AztecClientBackend } from '@aztec/bb.js';
|
|
2
|
-
import { ClientIvcProof } from '@aztec/circuits.js';
|
|
3
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
3
|
import { Timer } from '@aztec/foundation/timer';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import type { ArtifactProvider } from '@aztec/noir-protocol-circuits-types/types';
|
|
5
|
+
import type { SimulationProvider } from '@aztec/simulator/client';
|
|
6
|
+
import { ClientIvcProof } from '@aztec/stdlib/proofs';
|
|
7
7
|
|
|
8
8
|
import { serializeWitness } from '@noir-lang/noirc_abi';
|
|
9
|
-
import {
|
|
9
|
+
import type { WitnessMap } from '@noir-lang/types';
|
|
10
10
|
import { ungzip } from 'pako';
|
|
11
11
|
|
|
12
12
|
import { BBPrivateKernelProver } from '../prover/bb_private_kernel_prover.js';
|
|
@@ -26,7 +26,7 @@ export abstract class BBWASMPrivateKernelProver extends BBPrivateKernelProver {
|
|
|
26
26
|
this.log.info(`Generating ClientIVC proof...`);
|
|
27
27
|
const backend = new AztecClientBackend(
|
|
28
28
|
acirs.map(acir => ungzip(acir)),
|
|
29
|
-
{ threads: this.threads },
|
|
29
|
+
{ threads: this.threads, logger: this.log.verbose, wasmPath: process.env.BB_WASM_PATH },
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
const [proof, vk] = await backend.prove(witnessStack.map(witnessMap => ungzip(serializeWitness(witnessMap))));
|
|
@@ -39,4 +39,17 @@ export abstract class BBWASMPrivateKernelProver extends BBPrivateKernelProver {
|
|
|
39
39
|
});
|
|
40
40
|
return new ClientIvcProof(Buffer.from(proof), Buffer.from(vk));
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
public override async computeGateCountForCircuit(_bytecode: Buffer, _circuitName: string): Promise<number> {
|
|
44
|
+
const backend = new AztecClientBackend([ungzip(_bytecode)], {
|
|
45
|
+
threads: this.threads,
|
|
46
|
+
logger: this.log.verbose,
|
|
47
|
+
wasmPath: process.env.BB_WASM_PATH,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const gateCount = await backend.gates();
|
|
51
|
+
await backend.destroy();
|
|
52
|
+
|
|
53
|
+
return gateCount[0];
|
|
54
|
+
}
|
|
42
55
|
}
|
package/src/wasm/bundle.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { BundleArtifactProvider } from '@aztec/noir-protocol-circuits-types/client/bundle';
|
|
3
|
-
import {
|
|
3
|
+
import type { SimulationProvider } from '@aztec/simulator/client';
|
|
4
4
|
|
|
5
5
|
import { BBWASMPrivateKernelProver } from './bb_wasm_private_kernel_prover.js';
|
|
6
6
|
|
package/src/wasm/lazy.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { LazyArtifactProvider } from '@aztec/noir-protocol-circuits-types/client/lazy';
|
|
3
|
-
import {
|
|
3
|
+
import type { SimulationProvider } from '@aztec/simulator/client';
|
|
4
4
|
|
|
5
5
|
import { BBWASMPrivateKernelProver } from './bb_wasm_private_kernel_prover.js';
|
|
6
6
|
|