@aztec/bb-prover 3.0.0-rc.5 → 4.0.0-nightly.20260107

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.
@@ -1,9 +1,376 @@
1
- function _ts_decorate(decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1
+ function applyDecs2203RFactory() {
2
+ function createAddInitializerMethod(initializers, decoratorFinishedRef) {
3
+ return function addInitializer(initializer) {
4
+ assertNotFinished(decoratorFinishedRef, "addInitializer");
5
+ assertCallable(initializer, "An initializer");
6
+ initializers.push(initializer);
7
+ };
8
+ }
9
+ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
10
+ var kindStr;
11
+ switch(kind){
12
+ case 1:
13
+ kindStr = "accessor";
14
+ break;
15
+ case 2:
16
+ kindStr = "method";
17
+ break;
18
+ case 3:
19
+ kindStr = "getter";
20
+ break;
21
+ case 4:
22
+ kindStr = "setter";
23
+ break;
24
+ default:
25
+ kindStr = "field";
26
+ }
27
+ var ctx = {
28
+ kind: kindStr,
29
+ name: isPrivate ? "#" + name : name,
30
+ static: isStatic,
31
+ private: isPrivate,
32
+ metadata: metadata
33
+ };
34
+ var decoratorFinishedRef = {
35
+ v: false
36
+ };
37
+ ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
38
+ var get, set;
39
+ if (kind === 0) {
40
+ if (isPrivate) {
41
+ get = desc.get;
42
+ set = desc.set;
43
+ } else {
44
+ get = function() {
45
+ return this[name];
46
+ };
47
+ set = function(v) {
48
+ this[name] = v;
49
+ };
50
+ }
51
+ } else if (kind === 2) {
52
+ get = function() {
53
+ return desc.value;
54
+ };
55
+ } else {
56
+ if (kind === 1 || kind === 3) {
57
+ get = function() {
58
+ return desc.get.call(this);
59
+ };
60
+ }
61
+ if (kind === 1 || kind === 4) {
62
+ set = function(v) {
63
+ desc.set.call(this, v);
64
+ };
65
+ }
66
+ }
67
+ ctx.access = get && set ? {
68
+ get: get,
69
+ set: set
70
+ } : get ? {
71
+ get: get
72
+ } : {
73
+ set: set
74
+ };
75
+ try {
76
+ return dec(value, ctx);
77
+ } finally{
78
+ decoratorFinishedRef.v = true;
79
+ }
80
+ }
81
+ function assertNotFinished(decoratorFinishedRef, fnName) {
82
+ if (decoratorFinishedRef.v) {
83
+ throw new Error("attempted to call " + fnName + " after decoration was finished");
84
+ }
85
+ }
86
+ function assertCallable(fn, hint) {
87
+ if (typeof fn !== "function") {
88
+ throw new TypeError(hint + " must be a function");
89
+ }
90
+ }
91
+ function assertValidReturnValue(kind, value) {
92
+ var type = typeof value;
93
+ if (kind === 1) {
94
+ if (type !== "object" || value === null) {
95
+ throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
96
+ }
97
+ if (value.get !== undefined) {
98
+ assertCallable(value.get, "accessor.get");
99
+ }
100
+ if (value.set !== undefined) {
101
+ assertCallable(value.set, "accessor.set");
102
+ }
103
+ if (value.init !== undefined) {
104
+ assertCallable(value.init, "accessor.init");
105
+ }
106
+ } else if (type !== "function") {
107
+ var hint;
108
+ if (kind === 0) {
109
+ hint = "field";
110
+ } else if (kind === 10) {
111
+ hint = "class";
112
+ } else {
113
+ hint = "method";
114
+ }
115
+ throw new TypeError(hint + " decorators must return a function or void 0");
116
+ }
117
+ }
118
+ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
119
+ var decs = decInfo[0];
120
+ var desc, init, value;
121
+ if (isPrivate) {
122
+ if (kind === 0 || kind === 1) {
123
+ desc = {
124
+ get: decInfo[3],
125
+ set: decInfo[4]
126
+ };
127
+ } else if (kind === 3) {
128
+ desc = {
129
+ get: decInfo[3]
130
+ };
131
+ } else if (kind === 4) {
132
+ desc = {
133
+ set: decInfo[3]
134
+ };
135
+ } else {
136
+ desc = {
137
+ value: decInfo[3]
138
+ };
139
+ }
140
+ } else if (kind !== 0) {
141
+ desc = Object.getOwnPropertyDescriptor(base, name);
142
+ }
143
+ if (kind === 1) {
144
+ value = {
145
+ get: desc.get,
146
+ set: desc.set
147
+ };
148
+ } else if (kind === 2) {
149
+ value = desc.value;
150
+ } else if (kind === 3) {
151
+ value = desc.get;
152
+ } else if (kind === 4) {
153
+ value = desc.set;
154
+ }
155
+ var newValue, get, set;
156
+ if (typeof decs === "function") {
157
+ newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
158
+ if (newValue !== void 0) {
159
+ assertValidReturnValue(kind, newValue);
160
+ if (kind === 0) {
161
+ init = newValue;
162
+ } else if (kind === 1) {
163
+ init = newValue.init;
164
+ get = newValue.get || value.get;
165
+ set = newValue.set || value.set;
166
+ value = {
167
+ get: get,
168
+ set: set
169
+ };
170
+ } else {
171
+ value = newValue;
172
+ }
173
+ }
174
+ } else {
175
+ for(var i = decs.length - 1; i >= 0; i--){
176
+ var dec = decs[i];
177
+ newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
178
+ if (newValue !== void 0) {
179
+ assertValidReturnValue(kind, newValue);
180
+ var newInit;
181
+ if (kind === 0) {
182
+ newInit = newValue;
183
+ } else if (kind === 1) {
184
+ newInit = newValue.init;
185
+ get = newValue.get || value.get;
186
+ set = newValue.set || value.set;
187
+ value = {
188
+ get: get,
189
+ set: set
190
+ };
191
+ } else {
192
+ value = newValue;
193
+ }
194
+ if (newInit !== void 0) {
195
+ if (init === void 0) {
196
+ init = newInit;
197
+ } else if (typeof init === "function") {
198
+ init = [
199
+ init,
200
+ newInit
201
+ ];
202
+ } else {
203
+ init.push(newInit);
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }
209
+ if (kind === 0 || kind === 1) {
210
+ if (init === void 0) {
211
+ init = function(instance, init) {
212
+ return init;
213
+ };
214
+ } else if (typeof init !== "function") {
215
+ var ownInitializers = init;
216
+ init = function(instance, init) {
217
+ var value = init;
218
+ for(var i = 0; i < ownInitializers.length; i++){
219
+ value = ownInitializers[i].call(instance, value);
220
+ }
221
+ return value;
222
+ };
223
+ } else {
224
+ var originalInitializer = init;
225
+ init = function(instance, init) {
226
+ return originalInitializer.call(instance, init);
227
+ };
228
+ }
229
+ ret.push(init);
230
+ }
231
+ if (kind !== 0) {
232
+ if (kind === 1) {
233
+ desc.get = value.get;
234
+ desc.set = value.set;
235
+ } else if (kind === 2) {
236
+ desc.value = value;
237
+ } else if (kind === 3) {
238
+ desc.get = value;
239
+ } else if (kind === 4) {
240
+ desc.set = value;
241
+ }
242
+ if (isPrivate) {
243
+ if (kind === 1) {
244
+ ret.push(function(instance, args) {
245
+ return value.get.call(instance, args);
246
+ });
247
+ ret.push(function(instance, args) {
248
+ return value.set.call(instance, args);
249
+ });
250
+ } else if (kind === 2) {
251
+ ret.push(value);
252
+ } else {
253
+ ret.push(function(instance, args) {
254
+ return value.call(instance, args);
255
+ });
256
+ }
257
+ } else {
258
+ Object.defineProperty(base, name, desc);
259
+ }
260
+ }
261
+ }
262
+ function applyMemberDecs(Class, decInfos, metadata) {
263
+ var ret = [];
264
+ var protoInitializers;
265
+ var staticInitializers;
266
+ var existingProtoNonFields = new Map();
267
+ var existingStaticNonFields = new Map();
268
+ for(var i = 0; i < decInfos.length; i++){
269
+ var decInfo = decInfos[i];
270
+ if (!Array.isArray(decInfo)) continue;
271
+ var kind = decInfo[1];
272
+ var name = decInfo[2];
273
+ var isPrivate = decInfo.length > 3;
274
+ var isStatic = kind >= 5;
275
+ var base;
276
+ var initializers;
277
+ if (isStatic) {
278
+ base = Class;
279
+ kind = kind - 5;
280
+ staticInitializers = staticInitializers || [];
281
+ initializers = staticInitializers;
282
+ } else {
283
+ base = Class.prototype;
284
+ protoInitializers = protoInitializers || [];
285
+ initializers = protoInitializers;
286
+ }
287
+ if (kind !== 0 && !isPrivate) {
288
+ var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
289
+ var existingKind = existingNonFields.get(name) || 0;
290
+ if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
291
+ throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
292
+ } else if (!existingKind && kind > 2) {
293
+ existingNonFields.set(name, kind);
294
+ } else {
295
+ existingNonFields.set(name, true);
296
+ }
297
+ }
298
+ applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
299
+ }
300
+ pushInitializers(ret, protoInitializers);
301
+ pushInitializers(ret, staticInitializers);
302
+ return ret;
303
+ }
304
+ function pushInitializers(ret, initializers) {
305
+ if (initializers) {
306
+ ret.push(function(instance) {
307
+ for(var i = 0; i < initializers.length; i++){
308
+ initializers[i].call(instance);
309
+ }
310
+ return instance;
311
+ });
312
+ }
313
+ }
314
+ function applyClassDecs(targetClass, classDecs, metadata) {
315
+ if (classDecs.length > 0) {
316
+ var initializers = [];
317
+ var newClass = targetClass;
318
+ var name = targetClass.name;
319
+ for(var i = classDecs.length - 1; i >= 0; i--){
320
+ var decoratorFinishedRef = {
321
+ v: false
322
+ };
323
+ try {
324
+ var nextNewClass = classDecs[i](newClass, {
325
+ kind: "class",
326
+ name: name,
327
+ addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
328
+ metadata
329
+ });
330
+ } finally{
331
+ decoratorFinishedRef.v = true;
332
+ }
333
+ if (nextNewClass !== undefined) {
334
+ assertValidReturnValue(10, nextNewClass);
335
+ newClass = nextNewClass;
336
+ }
337
+ }
338
+ return [
339
+ defineMetadata(newClass, metadata),
340
+ function() {
341
+ for(var i = 0; i < initializers.length; i++){
342
+ initializers[i].call(newClass);
343
+ }
344
+ }
345
+ ];
346
+ }
347
+ }
348
+ function defineMetadata(Class, metadata) {
349
+ return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
350
+ configurable: true,
351
+ enumerable: true,
352
+ value: metadata
353
+ });
354
+ }
355
+ return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
356
+ if (parentClass !== void 0) {
357
+ var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
358
+ }
359
+ var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
360
+ var e = applyMemberDecs(targetClass, memberDecs, metadata);
361
+ if (!classDecs.length) defineMetadata(targetClass, metadata);
362
+ return {
363
+ e: e,
364
+ get c () {
365
+ return applyClassDecs(targetClass, classDecs, metadata);
366
+ }
367
+ };
368
+ };
369
+ }
370
+ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
371
+ return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
6
372
  }
373
+ var _dec, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _initProto;
7
374
  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
375
  import { createLogger } from '@aztec/foundation/log';
9
376
  import { sleep } from '@aztec/foundation/sleep';
@@ -19,12 +386,97 @@ import { VerificationKeyData } from '@aztec/stdlib/vks';
19
386
  import { getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
20
387
  import { ProverInstrumentation } from '../instrumentation.js';
21
388
  import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
389
+ _dec = trackSpan('TestCircuitProver.getBaseParityProof'), _dec1 = trackSpan('TestCircuitProver.getRootParityProof'), _dec2 = trackSpan('TestCircuitProver.getPrivateTxBaseRollupProof'), _dec3 = trackSpan('TestCircuitProver.getPublicTxBaseRollupProof'), _dec4 = trackSpan('TestCircuitProver.getTxMergeRollupProof'), _dec5 = trackSpan('TestCircuitProver.getBlockRootFirstRollupProof'), _dec6 = trackSpan('TestCircuitProver.getBlockRootSingleTxFirstRollupProof'), _dec7 = trackSpan('TestCircuitProver.getBlockRootEmptyTxFirstRollupProof'), _dec8 = trackSpan('TestCircuitProver.getBlockRootRollupProof'), _dec9 = trackSpan('TestCircuitProver.getBlockRootSingleTxRollupProof'), _dec10 = trackSpan('TestCircuitProver.getBlockMergeRollupProof'), _dec11 = trackSpan('TestCircuitProver.getCheckpointRootRollupProof'), _dec12 = trackSpan('TestCircuitProver.getCheckpointRootSingleBlockRollupProof'), _dec13 = trackSpan('TestCircuitProver.getCheckpointPaddingRollupProof'), _dec14 = trackSpan('TestCircuitProver.getCheckpointMergeRollupProof'), _dec15 = trackSpan('TestCircuitProver.getRootRollupProof');
22
390
  /**
23
391
  * A class for use in testing situations (e2e, unit test, etc) and temporarily for assembling a block in the sequencer.
24
392
  * Simulates circuits using the most efficient method and performs no proving.
25
393
  */ export class TestCircuitProver {
26
394
  simulator;
27
395
  opts;
396
+ static{
397
+ ({ e: [_initProto] } = _apply_decs_2203_r(this, [
398
+ [
399
+ _dec,
400
+ 2,
401
+ "getBaseParityProof"
402
+ ],
403
+ [
404
+ _dec1,
405
+ 2,
406
+ "getRootParityProof"
407
+ ],
408
+ [
409
+ _dec2,
410
+ 2,
411
+ "getPrivateTxBaseRollupProof"
412
+ ],
413
+ [
414
+ _dec3,
415
+ 2,
416
+ "getPublicTxBaseRollupProof"
417
+ ],
418
+ [
419
+ _dec4,
420
+ 2,
421
+ "getTxMergeRollupProof"
422
+ ],
423
+ [
424
+ _dec5,
425
+ 2,
426
+ "getBlockRootFirstRollupProof"
427
+ ],
428
+ [
429
+ _dec6,
430
+ 2,
431
+ "getBlockRootSingleTxFirstRollupProof"
432
+ ],
433
+ [
434
+ _dec7,
435
+ 2,
436
+ "getBlockRootEmptyTxFirstRollupProof"
437
+ ],
438
+ [
439
+ _dec8,
440
+ 2,
441
+ "getBlockRootRollupProof"
442
+ ],
443
+ [
444
+ _dec9,
445
+ 2,
446
+ "getBlockRootSingleTxRollupProof"
447
+ ],
448
+ [
449
+ _dec10,
450
+ 2,
451
+ "getBlockMergeRollupProof"
452
+ ],
453
+ [
454
+ _dec11,
455
+ 2,
456
+ "getCheckpointRootRollupProof"
457
+ ],
458
+ [
459
+ _dec12,
460
+ 2,
461
+ "getCheckpointRootSingleBlockRollupProof"
462
+ ],
463
+ [
464
+ _dec13,
465
+ 2,
466
+ "getCheckpointPaddingRollupProof"
467
+ ],
468
+ [
469
+ _dec14,
470
+ 2,
471
+ "getCheckpointMergeRollupProof"
472
+ ],
473
+ [
474
+ _dec15,
475
+ 2,
476
+ "getRootRollupProof"
477
+ ]
478
+ ], []));
479
+ }
28
480
  wasmSimulator;
29
481
  instrumentation;
30
482
  logger;
@@ -34,7 +486,7 @@ import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
34
486
  }, telemetry = getTelemetryClient()){
35
487
  this.simulator = simulator;
36
488
  this.opts = opts;
37
- this.wasmSimulator = new WASMSimulatorWithBlobs();
489
+ this.wasmSimulator = (_initProto(this), new WASMSimulatorWithBlobs());
38
490
  this.logger = createLogger('bb-prover:test-prover');
39
491
  this.instrumentation = new ProverInstrumentation(telemetry, 'TestCircuitProver');
40
492
  }
@@ -151,51 +603,3 @@ import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
151
603
  return makePublicInputsAndRecursiveProof(result, makeRecursiveProof(proofLength), ProtocolCircuitVks[artifactName]);
152
604
  }
153
605
  }
154
- _ts_decorate([
155
- trackSpan('TestCircuitProver.getBaseParityProof')
156
- ], TestCircuitProver.prototype, "getBaseParityProof", null);
157
- _ts_decorate([
158
- trackSpan('TestCircuitProver.getRootParityProof')
159
- ], TestCircuitProver.prototype, "getRootParityProof", null);
160
- _ts_decorate([
161
- trackSpan('TestCircuitProver.getPrivateTxBaseRollupProof')
162
- ], TestCircuitProver.prototype, "getPrivateTxBaseRollupProof", null);
163
- _ts_decorate([
164
- trackSpan('TestCircuitProver.getPublicTxBaseRollupProof')
165
- ], TestCircuitProver.prototype, "getPublicTxBaseRollupProof", null);
166
- _ts_decorate([
167
- trackSpan('TestCircuitProver.getTxMergeRollupProof')
168
- ], TestCircuitProver.prototype, "getTxMergeRollupProof", null);
169
- _ts_decorate([
170
- trackSpan('TestCircuitProver.getBlockRootFirstRollupProof')
171
- ], TestCircuitProver.prototype, "getBlockRootFirstRollupProof", null);
172
- _ts_decorate([
173
- trackSpan('TestCircuitProver.getBlockRootSingleTxFirstRollupProof')
174
- ], TestCircuitProver.prototype, "getBlockRootSingleTxFirstRollupProof", null);
175
- _ts_decorate([
176
- trackSpan('TestCircuitProver.getBlockRootEmptyTxFirstRollupProof')
177
- ], TestCircuitProver.prototype, "getBlockRootEmptyTxFirstRollupProof", null);
178
- _ts_decorate([
179
- trackSpan('TestCircuitProver.getBlockRootRollupProof')
180
- ], TestCircuitProver.prototype, "getBlockRootRollupProof", null);
181
- _ts_decorate([
182
- trackSpan('TestCircuitProver.getBlockRootSingleTxRollupProof')
183
- ], TestCircuitProver.prototype, "getBlockRootSingleTxRollupProof", null);
184
- _ts_decorate([
185
- trackSpan('TestCircuitProver.getBlockMergeRollupProof')
186
- ], TestCircuitProver.prototype, "getBlockMergeRollupProof", null);
187
- _ts_decorate([
188
- trackSpan('TestCircuitProver.getCheckpointRootRollupProof')
189
- ], TestCircuitProver.prototype, "getCheckpointRootRollupProof", null);
190
- _ts_decorate([
191
- trackSpan('TestCircuitProver.getCheckpointRootSingleBlockRollupProof')
192
- ], TestCircuitProver.prototype, "getCheckpointRootSingleBlockRollupProof", null);
193
- _ts_decorate([
194
- trackSpan('TestCircuitProver.getCheckpointPaddingRollupProof')
195
- ], TestCircuitProver.prototype, "getCheckpointPaddingRollupProof", null);
196
- _ts_decorate([
197
- trackSpan('TestCircuitProver.getCheckpointMergeRollupProof')
198
- ], TestCircuitProver.prototype, "getCheckpointMergeRollupProof", null);
199
- _ts_decorate([
200
- trackSpan('TestCircuitProver.getRootRollupProof')
201
- ], TestCircuitProver.prototype, "getRootRollupProof", null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/bb-prover",
3
- "version": "3.0.0-rc.5",
3
+ "version": "4.0.0-nightly.20260107",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -69,27 +69,27 @@
69
69
  ]
70
70
  },
71
71
  "dependencies": {
72
- "@aztec/bb.js": "3.0.0-rc.5",
73
- "@aztec/constants": "3.0.0-rc.5",
74
- "@aztec/foundation": "3.0.0-rc.5",
75
- "@aztec/noir-noirc_abi": "3.0.0-rc.5",
76
- "@aztec/noir-protocol-circuits-types": "3.0.0-rc.5",
77
- "@aztec/noir-types": "3.0.0-rc.5",
78
- "@aztec/simulator": "3.0.0-rc.5",
79
- "@aztec/stdlib": "3.0.0-rc.5",
80
- "@aztec/telemetry-client": "3.0.0-rc.5",
81
- "@aztec/world-state": "3.0.0-rc.5",
72
+ "@aztec/bb.js": "4.0.0-nightly.20260107",
73
+ "@aztec/constants": "4.0.0-nightly.20260107",
74
+ "@aztec/foundation": "4.0.0-nightly.20260107",
75
+ "@aztec/noir-noirc_abi": "4.0.0-nightly.20260107",
76
+ "@aztec/noir-protocol-circuits-types": "4.0.0-nightly.20260107",
77
+ "@aztec/noir-types": "4.0.0-nightly.20260107",
78
+ "@aztec/simulator": "4.0.0-nightly.20260107",
79
+ "@aztec/stdlib": "4.0.0-nightly.20260107",
80
+ "@aztec/telemetry-client": "4.0.0-nightly.20260107",
81
+ "@aztec/world-state": "4.0.0-nightly.20260107",
82
82
  "commander": "^12.1.0",
83
83
  "pako": "^2.1.0",
84
84
  "source-map-support": "^0.5.21",
85
85
  "tslib": "^2.4.0"
86
86
  },
87
87
  "devDependencies": {
88
- "@aztec/ethereum": "3.0.0-rc.5",
89
- "@aztec/kv-store": "3.0.0-rc.5",
90
- "@aztec/noir-contracts.js": "3.0.0-rc.5",
91
- "@aztec/noir-test-contracts.js": "3.0.0-rc.5",
92
- "@aztec/protocol-contracts": "3.0.0-rc.5",
88
+ "@aztec/ethereum": "4.0.0-nightly.20260107",
89
+ "@aztec/kv-store": "4.0.0-nightly.20260107",
90
+ "@aztec/noir-contracts.js": "4.0.0-nightly.20260107",
91
+ "@aztec/noir-test-contracts.js": "4.0.0-nightly.20260107",
92
+ "@aztec/protocol-contracts": "4.0.0-nightly.20260107",
93
93
  "@jest/globals": "^30.0.0",
94
94
  "@types/jest": "^30.0.0",
95
95
  "@types/node": "^22.15.17",
@@ -1,5 +1,5 @@
1
- import { AztecClientBackend, Barretenberg } from '@aztec/bb.js';
2
- import { createLogger } from '@aztec/foundation/log';
1
+ import { AztecClientBackend, type BackendOptions, Barretenberg } from '@aztec/bb.js';
2
+ import { type LogLevel, type Logger, createLogger } from '@aztec/foundation/log';
3
3
  import { Timer } from '@aztec/foundation/timer';
4
4
  import { serializeWitness } from '@aztec/noir-noirc_abi';
5
5
  import {
@@ -45,12 +45,17 @@ import type { CircuitSimulationStats, CircuitWitnessGenerationStats } from '@azt
45
45
 
46
46
  import { ungzip } from 'pako';
47
47
 
48
+ export type BBPrivateKernelProverOptions = Omit<BackendOptions, 'logger'> & { logger?: Logger };
48
49
  export abstract class BBPrivateKernelProver implements PrivateKernelProver {
50
+ private log: Logger;
51
+
49
52
  constructor(
50
53
  protected artifactProvider: ArtifactProvider,
51
54
  protected simulator: CircuitSimulator,
52
- protected log = createLogger('bb-prover'),
53
- ) {}
55
+ protected options: BBPrivateKernelProverOptions = {},
56
+ ) {
57
+ this.log = options.logger || createLogger('bb-prover:private-kernel');
58
+ }
54
59
 
55
60
  public async generateInitOutput(
56
61
  inputs: PrivateKernelInitCircuitPrivateInputs,
@@ -271,9 +276,13 @@ export abstract class BBPrivateKernelProver implements PrivateKernelProver {
271
276
  public async createChonkProof(executionSteps: PrivateExecutionStep[]): Promise<ChonkProofWithPublicInputs> {
272
277
  const timer = new Timer();
273
278
  this.log.info(`Generating ClientIVC proof...`);
279
+ const barretenberg = await Barretenberg.initSingleton({
280
+ ...this.options,
281
+ logger: this.options.logger?.[(process.env.LOG_LEVEL as LogLevel) || 'verbose'],
282
+ });
274
283
  const backend = new AztecClientBackend(
275
284
  executionSteps.map(step => ungzip(step.bytecode)),
276
- await Barretenberg.initSingleton(),
285
+ barretenberg,
277
286
  );
278
287
 
279
288
  const [proof] = await backend.prove(
@@ -290,7 +299,11 @@ export abstract class BBPrivateKernelProver implements PrivateKernelProver {
290
299
 
291
300
  public async computeGateCountForCircuit(_bytecode: Buffer, _circuitName: string): Promise<number> {
292
301
  // Note we do not pass the vk to the backend. This is unneeded for gate counts.
293
- const backend = new AztecClientBackend([ungzip(_bytecode)], await Barretenberg.initSingleton());
302
+ const barretenberg = await Barretenberg.initSingleton({
303
+ ...this.options,
304
+ logger: this.options.logger?.[(process.env.LOG_LEVEL as LogLevel) || 'verbose'],
305
+ });
306
+ const backend = new AztecClientBackend([ungzip(_bytecode)], barretenberg);
294
307
  const gateCount = await backend.gates();
295
308
  return gateCount[0];
296
309
  }
@@ -1,11 +1,10 @@
1
- import { createLogger } from '@aztec/foundation/log';
2
1
  import { BundleArtifactProvider } from '@aztec/noir-protocol-circuits-types/client/bundle';
3
2
  import type { CircuitSimulator } from '@aztec/simulator/client';
4
3
 
5
- import { BBPrivateKernelProver } from './bb_private_kernel_prover.js';
4
+ import { BBPrivateKernelProver, type BBPrivateKernelProverOptions } from './bb_private_kernel_prover.js';
6
5
 
7
6
  export class BBBundlePrivateKernelProver extends BBPrivateKernelProver {
8
- constructor(simulator: CircuitSimulator, log = createLogger('bb-prover:bundle')) {
9
- super(new BundleArtifactProvider(), simulator, log);
7
+ constructor(simulator: CircuitSimulator, options: BBPrivateKernelProverOptions = {}) {
8
+ super(new BundleArtifactProvider(), simulator, options);
10
9
  }
11
10
  }
@@ -1,11 +1,10 @@
1
- import { createLogger } from '@aztec/foundation/log';
2
1
  import { LazyArtifactProvider } from '@aztec/noir-protocol-circuits-types/client/lazy';
3
2
  import type { CircuitSimulator } from '@aztec/simulator/client';
4
3
 
5
- import { BBPrivateKernelProver } from './bb_private_kernel_prover.js';
4
+ import { BBPrivateKernelProver, type BBPrivateKernelProverOptions } from './bb_private_kernel_prover.js';
6
5
 
7
6
  export class BBLazyPrivateKernelProver extends BBPrivateKernelProver {
8
- constructor(simulator: CircuitSimulator, log = createLogger('bb-prover:lazy')) {
9
- super(new LazyArtifactProvider(), simulator, log);
7
+ constructor(simulator: CircuitSimulator, options: BBPrivateKernelProverOptions = {}) {
8
+ super(new LazyArtifactProvider(), simulator, options);
10
9
  }
11
10
  }