@aztec/prover-client 0.0.1-commit.e61ad554 → 0.0.1-commit.ec5f612
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/light/lightweight_checkpoint_builder.d.ts +12 -5
- package/dest/light/lightweight_checkpoint_builder.d.ts.map +1 -1
- package/dest/light/lightweight_checkpoint_builder.js +42 -20
- package/dest/mocks/fixtures.d.ts +1 -1
- package/dest/mocks/fixtures.d.ts.map +1 -1
- package/dest/mocks/fixtures.js +2 -1
- package/dest/mocks/test_context.js +5 -2
- package/dest/orchestrator/block-building-helpers.d.ts +4 -4
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +4 -4
- package/dest/orchestrator/block-proving-state.d.ts +4 -1
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +7 -0
- package/dest/orchestrator/checkpoint-proving-state.d.ts +3 -3
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/checkpoint-proving-state.js +3 -3
- package/dest/orchestrator/epoch-proving-state.d.ts +3 -3
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +5 -3
- package/dest/orchestrator/orchestrator.d.ts +5 -3
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +105 -113
- package/dest/prover-client/prover-client.d.ts +3 -3
- package/dest/prover-client/prover-client.d.ts.map +1 -1
- package/dest/prover-client/prover-client.js +15 -10
- package/dest/proving_broker/broker_prover_facade.d.ts +4 -3
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +3 -3
- package/dest/proving_broker/config.d.ts +9 -1
- package/dest/proving_broker/config.d.ts.map +1 -1
- package/dest/proving_broker/config.js +13 -2
- package/dest/proving_broker/proof_store/factory.d.ts +2 -5
- package/dest/proving_broker/proof_store/factory.d.ts.map +1 -1
- package/dest/proving_broker/proof_store/factory.js +7 -30
- package/dest/proving_broker/proof_store/file_store_proof_store.d.ts +18 -0
- package/dest/proving_broker/proof_store/file_store_proof_store.d.ts.map +1 -0
- package/dest/proving_broker/proof_store/file_store_proof_store.js +60 -0
- package/dest/proving_broker/proof_store/index.d.ts +2 -2
- package/dest/proving_broker/proof_store/index.d.ts.map +1 -1
- package/dest/proving_broker/proof_store/index.js +1 -1
- package/dest/proving_broker/proving_agent.d.ts +4 -3
- package/dest/proving_broker/proving_agent.d.ts.map +1 -1
- package/dest/proving_broker/proving_agent.js +4 -4
- package/dest/proving_broker/proving_broker.d.ts +7 -4
- package/dest/proving_broker/proving_broker.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.js +36 -4
- package/dest/proving_broker/proving_broker_instrumentation.d.ts +3 -1
- package/dest/proving_broker/proving_broker_instrumentation.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker_instrumentation.js +18 -7
- package/dest/proving_broker/proving_job_controller.d.ts +4 -3
- package/dest/proving_broker/proving_job_controller.d.ts.map +1 -1
- package/dest/proving_broker/proving_job_controller.js +6 -3
- package/dest/proving_broker/rpc.d.ts +4 -2
- package/dest/proving_broker/rpc.d.ts.map +1 -1
- package/dest/proving_broker/rpc.js +8 -0
- package/dest/test/mock_prover.d.ts +4 -4
- package/package.json +15 -16
- package/src/light/lightweight_checkpoint_builder.ts +48 -21
- package/src/mocks/fixtures.ts +2 -1
- package/src/mocks/test_context.ts +2 -2
- package/src/orchestrator/block-building-helpers.ts +4 -4
- package/src/orchestrator/block-proving-state.ts +9 -0
- package/src/orchestrator/checkpoint-proving-state.ts +4 -4
- package/src/orchestrator/epoch-proving-state.ts +6 -4
- package/src/orchestrator/orchestrator.ts +116 -121
- package/src/prover-client/prover-client.ts +22 -13
- package/src/proving_broker/broker_prover_facade.ts +6 -3
- package/src/proving_broker/config.ts +13 -0
- package/src/proving_broker/proof_store/factory.ts +10 -32
- package/src/proving_broker/proof_store/file_store_proof_store.ts +78 -0
- package/src/proving_broker/proof_store/index.ts +1 -1
- package/src/proving_broker/proving_agent.ts +5 -2
- package/src/proving_broker/proving_broker.ts +37 -3
- package/src/proving_broker/proving_broker_instrumentation.ts +19 -6
- package/src/proving_broker/proving_job_controller.ts +9 -3
- package/src/proving_broker/rpc.ts +14 -0
- package/dest/proving_broker/proof_store/gcs_proof_store.d.ts +0 -14
- package/dest/proving_broker/proof_store/gcs_proof_store.d.ts.map +0 -1
- package/dest/proving_broker/proof_store/gcs_proof_store.js +0 -52
- package/src/proving_broker/proof_store/gcs_proof_store.ts +0 -76
|
@@ -10,7 +10,7 @@ import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
|
10
10
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
11
11
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
12
12
|
import { AbortError } from '@aztec/foundation/error';
|
|
13
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
13
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
14
14
|
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
15
15
|
import { assertLength } from '@aztec/foundation/serialize';
|
|
16
16
|
import { pushTestData } from '@aztec/foundation/testing';
|
|
@@ -71,13 +71,6 @@ import { EpochProvingState, type ProvingResult, type TreeSnapshots } from './epo
|
|
|
71
71
|
import { ProvingOrchestratorMetrics } from './orchestrator_metrics.js';
|
|
72
72
|
import { TxProvingState } from './tx-proving-state.js';
|
|
73
73
|
|
|
74
|
-
const logger = createLogger('prover-client:orchestrator');
|
|
75
|
-
|
|
76
|
-
type WorldStateFork = {
|
|
77
|
-
fork: MerkleTreeWriteOperations;
|
|
78
|
-
cleanupPromise: Promise<void> | undefined;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
74
|
/**
|
|
82
75
|
* Implements an event driven proving scheduler to build the recursive proof tree. The idea being:
|
|
83
76
|
* 1. Transactions are provided to the scheduler post simulation.
|
|
@@ -99,7 +92,8 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
99
92
|
private provingPromise: Promise<ProvingResult> | undefined = undefined;
|
|
100
93
|
private metrics: ProvingOrchestratorMetrics;
|
|
101
94
|
// eslint-disable-next-line aztec-custom/no-non-primitive-in-collections
|
|
102
|
-
private dbs: Map<BlockNumber,
|
|
95
|
+
private dbs: Map<BlockNumber, MerkleTreeWriteOperations> = new Map();
|
|
96
|
+
private logger: Logger;
|
|
103
97
|
|
|
104
98
|
constructor(
|
|
105
99
|
private dbProvider: ReadonlyWorldStateAccess & ForkMerkleTreeOperations,
|
|
@@ -107,7 +101,9 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
107
101
|
private readonly proverId: EthAddress,
|
|
108
102
|
private readonly cancelJobsOnStop: boolean = false,
|
|
109
103
|
telemetryClient: TelemetryClient = getTelemetryClient(),
|
|
104
|
+
bindings?: LoggerBindings,
|
|
110
105
|
) {
|
|
106
|
+
this.logger = createLogger('prover-client:orchestrator', bindings);
|
|
111
107
|
this.metrics = new ProvingOrchestratorMetrics(telemetryClient, 'ProvingOrchestrator');
|
|
112
108
|
}
|
|
113
109
|
|
|
@@ -141,7 +137,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
141
137
|
|
|
142
138
|
const { promise: _promise, resolve, reject } = promiseWithResolvers<ProvingResult>();
|
|
143
139
|
const promise = _promise.catch((reason): ProvingResult => ({ status: 'failure', reason }));
|
|
144
|
-
logger.info(`Starting epoch ${epochNumber} with ${totalNumCheckpoints} checkpoints.`);
|
|
140
|
+
this.logger.info(`Starting epoch ${epochNumber} with ${totalNumCheckpoints} checkpoints.`);
|
|
145
141
|
this.provingState = new EpochProvingState(
|
|
146
142
|
epochNumber,
|
|
147
143
|
totalNumCheckpoints,
|
|
@@ -181,7 +177,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
181
177
|
const db = await this.dbProvider.fork(lastBlockNumber);
|
|
182
178
|
|
|
183
179
|
const firstBlockNumber = BlockNumber(lastBlockNumber + 1);
|
|
184
|
-
this.dbs.set(firstBlockNumber,
|
|
180
|
+
this.dbs.set(firstBlockNumber, db);
|
|
185
181
|
|
|
186
182
|
// Get archive sibling path before any block in this checkpoint lands.
|
|
187
183
|
const lastArchiveSiblingPath = await getLastSiblingPath(MerkleTreeId.ARCHIVE, db);
|
|
@@ -233,15 +229,15 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
233
229
|
}
|
|
234
230
|
|
|
235
231
|
const constants = checkpointProvingState.constants;
|
|
236
|
-
logger.info(`Starting block ${blockNumber} for slot ${constants.slotNumber}.`);
|
|
232
|
+
this.logger.info(`Starting block ${blockNumber} for slot ${constants.slotNumber}.`);
|
|
237
233
|
|
|
238
234
|
// Fork the db only when it's not already set. The db for the first block is set in `startNewCheckpoint`.
|
|
239
235
|
if (!this.dbs.has(blockNumber)) {
|
|
240
236
|
// Fork world state at the end of the immediately previous block
|
|
241
237
|
const db = await this.dbProvider.fork(BlockNumber(blockNumber - 1));
|
|
242
|
-
this.dbs.set(blockNumber,
|
|
238
|
+
this.dbs.set(blockNumber, db);
|
|
243
239
|
}
|
|
244
|
-
const db = this.
|
|
240
|
+
const db = this.getDbForBlock(blockNumber);
|
|
245
241
|
|
|
246
242
|
// Get archive snapshot and sibling path before any txs in this block lands.
|
|
247
243
|
const lastArchiveTreeSnapshot = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
|
|
@@ -294,7 +290,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
294
290
|
if (!txs.length) {
|
|
295
291
|
// To avoid an ugly throw below. If we require an empty block, we can just call setBlockCompleted
|
|
296
292
|
// on a block with no txs. We cannot do that here because we cannot find the blockNumber without any txs.
|
|
297
|
-
logger.warn(`Provided no txs to orchestrator addTxs.`);
|
|
293
|
+
this.logger.warn(`Provided no txs to orchestrator addTxs.`);
|
|
298
294
|
return;
|
|
299
295
|
}
|
|
300
296
|
|
|
@@ -314,9 +310,9 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
314
310
|
throw new Error(`Block ${blockNumber} has been initialized with transactions.`);
|
|
315
311
|
}
|
|
316
312
|
|
|
317
|
-
logger.info(`Adding ${txs.length} transactions to block ${blockNumber}`);
|
|
313
|
+
this.logger.info(`Adding ${txs.length} transactions to block ${blockNumber}`);
|
|
318
314
|
|
|
319
|
-
const db = this.
|
|
315
|
+
const db = this.getDbForBlock(blockNumber);
|
|
320
316
|
const lastArchive = provingState.lastArchiveTreeSnapshot;
|
|
321
317
|
const newL1ToL2MessageTreeSnapshot = provingState.newL1ToL2MessageTreeSnapshot;
|
|
322
318
|
const spongeBlobState = provingState.getStartSpongeBlob().clone();
|
|
@@ -329,7 +325,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
329
325
|
|
|
330
326
|
validateTx(tx);
|
|
331
327
|
|
|
332
|
-
logger.debug(`Received transaction: ${tx.hash}`);
|
|
328
|
+
this.logger.debug(`Received transaction: ${tx.hash}`);
|
|
333
329
|
|
|
334
330
|
const startSpongeBlob = spongeBlobState.clone();
|
|
335
331
|
const [hints, treeSnapshots] = await this.prepareBaseRollupInputs(
|
|
@@ -350,10 +346,10 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
350
346
|
const txIndex = provingState.addNewTx(txProvingState);
|
|
351
347
|
if (txProvingState.requireAvmProof) {
|
|
352
348
|
this.getOrEnqueueChonkVerifier(provingState, txIndex);
|
|
353
|
-
logger.debug(`Enqueueing public VM for tx ${txIndex}`);
|
|
349
|
+
this.logger.debug(`Enqueueing public VM for tx ${txIndex}`);
|
|
354
350
|
this.enqueueVM(provingState, txIndex);
|
|
355
351
|
} else {
|
|
356
|
-
logger.debug(`Enqueueing base rollup for private-only tx ${txIndex}`);
|
|
352
|
+
this.logger.debug(`Enqueueing base rollup for private-only tx ${txIndex}`);
|
|
357
353
|
this.enqueueBaseRollup(provingState, txIndex);
|
|
358
354
|
}
|
|
359
355
|
} catch (err: any) {
|
|
@@ -396,7 +392,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
396
392
|
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
397
393
|
>
|
|
398
394
|
>();
|
|
399
|
-
logger.debug(`Starting chonk verifier circuit for tx ${txHash}`);
|
|
395
|
+
this.logger.debug(`Starting chonk verifier circuit for tx ${txHash}`);
|
|
400
396
|
this.doEnqueueChonkVerifier(txHash, privateInputs, proof => {
|
|
401
397
|
tubeProof.resolve(proof);
|
|
402
398
|
});
|
|
@@ -436,22 +432,28 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
436
432
|
}
|
|
437
433
|
|
|
438
434
|
// Given we've applied every change from this block, now assemble the block header:
|
|
439
|
-
logger.verbose(`Block ${blockNumber} completed. Assembling header.`);
|
|
435
|
+
this.logger.verbose(`Block ${blockNumber} completed. Assembling header.`);
|
|
440
436
|
const header = await provingState.buildBlockHeader();
|
|
441
437
|
|
|
442
438
|
if (expectedHeader && !header.equals(expectedHeader)) {
|
|
443
|
-
logger.error(`Block header mismatch: header=${header} expectedHeader=${expectedHeader}`);
|
|
439
|
+
this.logger.error(`Block header mismatch: header=${header} expectedHeader=${expectedHeader}`);
|
|
444
440
|
throw new Error('Block header mismatch');
|
|
445
441
|
}
|
|
446
442
|
|
|
447
|
-
// Get db for this block
|
|
448
|
-
const db = this.
|
|
443
|
+
// Get db for this block and remove from map — no other code should use it after this point.
|
|
444
|
+
const db = this.getDbForBlock(provingState.blockNumber);
|
|
445
|
+
this.dbs.delete(provingState.blockNumber);
|
|
449
446
|
|
|
450
|
-
// Update the archive tree,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
447
|
+
// Update the archive tree, capture the snapshot, and close the fork deterministically.
|
|
448
|
+
try {
|
|
449
|
+
this.logger.verbose(
|
|
450
|
+
`Updating archive tree with block ${provingState.blockNumber} header ${(await header.hash()).toString()}`,
|
|
451
|
+
);
|
|
452
|
+
await db.updateArchive(header);
|
|
453
|
+
provingState.setBuiltArchive(await getTreeSnapshot(MerkleTreeId.ARCHIVE, db));
|
|
454
|
+
} finally {
|
|
455
|
+
await db.close();
|
|
456
|
+
}
|
|
455
457
|
|
|
456
458
|
await this.verifyBuiltBlockAgainstSyncedState(provingState);
|
|
457
459
|
|
|
@@ -462,31 +464,34 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
462
464
|
protected async verifyBuiltBlockAgainstSyncedState(provingState: BlockProvingState) {
|
|
463
465
|
const builtBlockHeader = provingState.getBuiltBlockHeader();
|
|
464
466
|
if (!builtBlockHeader) {
|
|
465
|
-
logger.debug('Block header not built yet, skipping header check.');
|
|
467
|
+
this.logger.debug('Block header not built yet, skipping header check.');
|
|
466
468
|
return;
|
|
467
469
|
}
|
|
468
470
|
|
|
469
471
|
const output = provingState.getBlockRootRollupOutput();
|
|
470
472
|
if (!output) {
|
|
471
|
-
logger.debug('Block root rollup proof not built yet, skipping header check.');
|
|
473
|
+
this.logger.debug('Block root rollup proof not built yet, skipping header check.');
|
|
472
474
|
return;
|
|
473
475
|
}
|
|
476
|
+
|
|
477
|
+
const newArchive = provingState.getBuiltArchive();
|
|
478
|
+
if (!newArchive) {
|
|
479
|
+
this.logger.debug('Archive snapshot not yet captured, skipping header check.');
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
|
|
474
483
|
const header = await buildHeaderFromCircuitOutputs(output);
|
|
475
484
|
|
|
476
485
|
if (!(await header.hash()).equals(await builtBlockHeader.hash())) {
|
|
477
|
-
logger.error(`Block header mismatch.\nCircuit: ${inspect(header)}\nComputed: ${inspect(builtBlockHeader)}`);
|
|
486
|
+
this.logger.error(`Block header mismatch.\nCircuit: ${inspect(header)}\nComputed: ${inspect(builtBlockHeader)}`);
|
|
478
487
|
provingState.reject(`Block header hash mismatch.`);
|
|
479
488
|
return;
|
|
480
489
|
}
|
|
481
490
|
|
|
482
|
-
// Get db for this block
|
|
483
491
|
const blockNumber = provingState.blockNumber;
|
|
484
|
-
const db = this.dbs.get(blockNumber)!.fork;
|
|
485
|
-
|
|
486
|
-
const newArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
|
|
487
492
|
const syncedArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, this.dbProvider.getSnapshot(blockNumber));
|
|
488
493
|
if (!syncedArchive.equals(newArchive)) {
|
|
489
|
-
logger.error(
|
|
494
|
+
this.logger.error(
|
|
490
495
|
`Archive tree mismatch for block ${blockNumber}: world state synced to ${inspect(
|
|
491
496
|
syncedArchive,
|
|
492
497
|
)} but built ${inspect(newArchive)}`,
|
|
@@ -497,16 +502,10 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
497
502
|
|
|
498
503
|
const circuitArchive = output.newArchive;
|
|
499
504
|
if (!newArchive.equals(circuitArchive)) {
|
|
500
|
-
logger.error(`New archive mismatch.\nCircuit: ${output.newArchive}\nComputed: ${newArchive}`);
|
|
505
|
+
this.logger.error(`New archive mismatch.\nCircuit: ${output.newArchive}\nComputed: ${newArchive}`);
|
|
501
506
|
provingState.reject(`New archive mismatch.`);
|
|
502
507
|
return;
|
|
503
508
|
}
|
|
504
|
-
|
|
505
|
-
// TODO(palla/prover): This closes the fork only on the happy path. If this epoch orchestrator
|
|
506
|
-
// is aborted and never reaches this point, it will leak the fork. We need to add a global cleanup,
|
|
507
|
-
// but have to make sure it only runs once all operations are completed, otherwise some function here
|
|
508
|
-
// will attempt to access the fork after it was closed.
|
|
509
|
-
void this.cleanupDBFork(blockNumber);
|
|
510
509
|
}
|
|
511
510
|
|
|
512
511
|
/**
|
|
@@ -522,6 +521,19 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
522
521
|
}
|
|
523
522
|
|
|
524
523
|
this.provingState?.cancel();
|
|
524
|
+
|
|
525
|
+
for (const [blockNumber, db] of this.dbs.entries()) {
|
|
526
|
+
void db.close().catch(err => this.logger.error(`Error closing db for block ${blockNumber}`, err));
|
|
527
|
+
}
|
|
528
|
+
this.dbs.clear();
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
private getDbForBlock(blockNumber: BlockNumber): MerkleTreeWriteOperations {
|
|
532
|
+
const db = this.dbs.get(blockNumber);
|
|
533
|
+
if (!db) {
|
|
534
|
+
throw new Error(`World state fork for block ${blockNumber} not found.`);
|
|
535
|
+
}
|
|
536
|
+
return db;
|
|
525
537
|
}
|
|
526
538
|
|
|
527
539
|
/**
|
|
@@ -553,24 +565,6 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
553
565
|
return epochProofResult;
|
|
554
566
|
}
|
|
555
567
|
|
|
556
|
-
private async cleanupDBFork(blockNumber: BlockNumber): Promise<void> {
|
|
557
|
-
logger.debug(`Cleaning up world state fork for ${blockNumber}`);
|
|
558
|
-
const fork = this.dbs.get(blockNumber);
|
|
559
|
-
if (!fork) {
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
try {
|
|
564
|
-
if (!fork.cleanupPromise) {
|
|
565
|
-
fork.cleanupPromise = fork.fork.close();
|
|
566
|
-
}
|
|
567
|
-
await fork.cleanupPromise;
|
|
568
|
-
this.dbs.delete(blockNumber);
|
|
569
|
-
} catch (err) {
|
|
570
|
-
logger.error(`Error closing db for block ${blockNumber}`, err);
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
|
|
574
568
|
/**
|
|
575
569
|
* Enqueue a job to be scheduled
|
|
576
570
|
* @param provingState - The proving state object being operated on
|
|
@@ -583,7 +577,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
583
577
|
callback: (result: T) => void | Promise<void>,
|
|
584
578
|
) {
|
|
585
579
|
if (!provingState.verifyState()) {
|
|
586
|
-
logger.debug(`Not enqueuing job, state no longer valid`);
|
|
580
|
+
this.logger.debug(`Not enqueuing job, state no longer valid`);
|
|
587
581
|
return;
|
|
588
582
|
}
|
|
589
583
|
|
|
@@ -601,7 +595,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
601
595
|
|
|
602
596
|
const result = await request(controller.signal);
|
|
603
597
|
if (!provingState.verifyState()) {
|
|
604
|
-
logger.debug(`State no longer valid, discarding result`);
|
|
598
|
+
this.logger.debug(`State no longer valid, discarding result`);
|
|
605
599
|
return;
|
|
606
600
|
}
|
|
607
601
|
|
|
@@ -619,7 +613,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
619
613
|
return;
|
|
620
614
|
}
|
|
621
615
|
|
|
622
|
-
logger.error(`Error thrown when proving job`, err);
|
|
616
|
+
this.logger.error(`Error thrown when proving job`, err);
|
|
623
617
|
provingState!.reject(`${err}`);
|
|
624
618
|
} finally {
|
|
625
619
|
const index = this.pendingProvingJobs.indexOf(controller);
|
|
@@ -704,12 +698,12 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
704
698
|
// Executes the next level of merge if all inputs are available
|
|
705
699
|
private enqueueBaseRollup(provingState: BlockProvingState, txIndex: number) {
|
|
706
700
|
if (!provingState.verifyState()) {
|
|
707
|
-
logger.debug('Not running base rollup, state invalid');
|
|
701
|
+
this.logger.debug('Not running base rollup, state invalid');
|
|
708
702
|
return;
|
|
709
703
|
}
|
|
710
704
|
|
|
711
705
|
if (!provingState.tryStartProvingBase(txIndex)) {
|
|
712
|
-
logger.debug(`Base rollup for tx ${txIndex} already started.`);
|
|
706
|
+
this.logger.debug(`Base rollup for tx ${txIndex} already started.`);
|
|
713
707
|
return;
|
|
714
708
|
}
|
|
715
709
|
|
|
@@ -717,7 +711,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
717
711
|
const { processedTx } = txProvingState;
|
|
718
712
|
const { rollupType, inputs } = txProvingState.getBaseRollupTypeAndInputs();
|
|
719
713
|
|
|
720
|
-
logger.debug(`Enqueuing deferred proving base rollup for ${processedTx.hash.toString()}`);
|
|
714
|
+
this.logger.debug(`Enqueuing deferred proving base rollup for ${processedTx.hash.toString()}`);
|
|
721
715
|
|
|
722
716
|
this.deferredProving(
|
|
723
717
|
provingState,
|
|
@@ -741,7 +735,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
741
735
|
},
|
|
742
736
|
),
|
|
743
737
|
result => {
|
|
744
|
-
logger.debug(`Completed proof for ${rollupType} for tx ${processedTx.hash.toString()}`);
|
|
738
|
+
this.logger.debug(`Completed proof for ${rollupType} for tx ${processedTx.hash.toString()}`);
|
|
745
739
|
validatePartialState(result.inputs.endTreeSnapshots, txProvingState.treeSnapshots);
|
|
746
740
|
const leafLocation = provingState.setBaseRollupProof(txIndex, result);
|
|
747
741
|
if (provingState.totalNumTxs === 1) {
|
|
@@ -757,7 +751,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
757
751
|
// Once completed, will enqueue the the public tx base rollup.
|
|
758
752
|
private getOrEnqueueChonkVerifier(provingState: BlockProvingState, txIndex: number) {
|
|
759
753
|
if (!provingState.verifyState()) {
|
|
760
|
-
logger.debug('Not running chonk verifier circuit, state invalid');
|
|
754
|
+
this.logger.debug('Not running chonk verifier circuit, state invalid');
|
|
761
755
|
return;
|
|
762
756
|
}
|
|
763
757
|
|
|
@@ -770,19 +764,19 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
770
764
|
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
771
765
|
>,
|
|
772
766
|
) => {
|
|
773
|
-
logger.debug(`Got chonk verifier proof for tx index: ${txIndex}`, { txHash });
|
|
767
|
+
this.logger.debug(`Got chonk verifier proof for tx index: ${txIndex}`, { txHash });
|
|
774
768
|
txProvingState.setPublicChonkVerifierProof(result);
|
|
775
769
|
this.provingState?.cachedChonkVerifierProofs.delete(txHash);
|
|
776
770
|
this.checkAndEnqueueBaseRollup(provingState, txIndex);
|
|
777
771
|
};
|
|
778
772
|
|
|
779
773
|
if (this.provingState?.cachedChonkVerifierProofs.has(txHash)) {
|
|
780
|
-
logger.debug(`Chonk verifier proof already enqueued for tx index: ${txIndex}`, { txHash });
|
|
774
|
+
this.logger.debug(`Chonk verifier proof already enqueued for tx index: ${txIndex}`, { txHash });
|
|
781
775
|
void this.provingState!.cachedChonkVerifierProofs.get(txHash)!.then(handleResult);
|
|
782
776
|
return;
|
|
783
777
|
}
|
|
784
778
|
|
|
785
|
-
logger.debug(`Enqueuing chonk verifier circuit for tx index: ${txIndex}`);
|
|
779
|
+
this.logger.debug(`Enqueuing chonk verifier circuit for tx index: ${txIndex}`);
|
|
786
780
|
this.doEnqueueChonkVerifier(txHash, txProvingState.getPublicChonkVerifierPrivateInputs(), handleResult);
|
|
787
781
|
}
|
|
788
782
|
|
|
@@ -798,7 +792,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
798
792
|
provingState: EpochProvingState | BlockProvingState = this.provingState!,
|
|
799
793
|
) {
|
|
800
794
|
if (!provingState.verifyState()) {
|
|
801
|
-
logger.debug('Not running chonk verifier circuit, state invalid');
|
|
795
|
+
this.logger.debug('Not running chonk verifier circuit, state invalid');
|
|
802
796
|
return;
|
|
803
797
|
}
|
|
804
798
|
|
|
@@ -821,12 +815,12 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
821
815
|
// Enqueues the next level of merge if all inputs are available
|
|
822
816
|
private enqueueMergeRollup(provingState: BlockProvingState, location: TreeNodeLocation) {
|
|
823
817
|
if (!provingState.verifyState()) {
|
|
824
|
-
logger.debug('Not running merge rollup. State no longer valid.');
|
|
818
|
+
this.logger.debug('Not running merge rollup. State no longer valid.');
|
|
825
819
|
return;
|
|
826
820
|
}
|
|
827
821
|
|
|
828
822
|
if (!provingState.tryStartProvingMerge(location)) {
|
|
829
|
-
logger.debug('Merge rollup already started.');
|
|
823
|
+
this.logger.debug('Merge rollup already started.');
|
|
830
824
|
return;
|
|
831
825
|
}
|
|
832
826
|
|
|
@@ -852,18 +846,18 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
852
846
|
// Executes the block root rollup circuit
|
|
853
847
|
private enqueueBlockRootRollup(provingState: BlockProvingState) {
|
|
854
848
|
if (!provingState.verifyState()) {
|
|
855
|
-
logger.debug('Not running block root rollup, state no longer valid');
|
|
849
|
+
this.logger.debug('Not running block root rollup, state no longer valid');
|
|
856
850
|
return;
|
|
857
851
|
}
|
|
858
852
|
|
|
859
853
|
if (!provingState.tryStartProvingBlockRoot()) {
|
|
860
|
-
logger.debug('Block root rollup already started.');
|
|
854
|
+
this.logger.debug('Block root rollup already started.');
|
|
861
855
|
return;
|
|
862
856
|
}
|
|
863
857
|
|
|
864
858
|
const { rollupType, inputs } = provingState.getBlockRootRollupTypeAndInputs();
|
|
865
859
|
|
|
866
|
-
logger.debug(`Enqueuing ${rollupType} for block ${provingState.blockNumber}.`);
|
|
860
|
+
this.logger.debug(`Enqueuing ${rollupType} for block ${provingState.blockNumber}.`);
|
|
867
861
|
|
|
868
862
|
this.deferredProving(
|
|
869
863
|
provingState,
|
|
@@ -888,22 +882,20 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
888
882
|
},
|
|
889
883
|
),
|
|
890
884
|
async result => {
|
|
891
|
-
logger.debug(`Completed ${rollupType} proof for block ${provingState.blockNumber}`);
|
|
885
|
+
this.logger.debug(`Completed ${rollupType} proof for block ${provingState.blockNumber}`);
|
|
892
886
|
|
|
893
887
|
const leafLocation = provingState.setBlockRootRollupProof(result);
|
|
894
888
|
const checkpointProvingState = provingState.parentCheckpoint;
|
|
895
889
|
|
|
896
|
-
//
|
|
890
|
+
// Verification is called from both here and setBlockCompleted. Whichever runs last
|
|
891
|
+
// will be the first to see all three pieces (header, proof output, archive) and run the checks.
|
|
897
892
|
await this.verifyBuiltBlockAgainstSyncedState(provingState);
|
|
898
893
|
|
|
899
894
|
if (checkpointProvingState.totalNumBlocks === 1) {
|
|
900
|
-
this.checkAndEnqueueCheckpointRootRollup(checkpointProvingState);
|
|
895
|
+
await this.checkAndEnqueueCheckpointRootRollup(checkpointProvingState);
|
|
901
896
|
} else {
|
|
902
|
-
this.checkAndEnqueueNextBlockMergeRollup(checkpointProvingState, leafLocation);
|
|
897
|
+
await this.checkAndEnqueueNextBlockMergeRollup(checkpointProvingState, leafLocation);
|
|
903
898
|
}
|
|
904
|
-
|
|
905
|
-
// We are finished with the block at this point, ensure the fork is cleaned up
|
|
906
|
-
void this.cleanupDBFork(provingState.blockNumber);
|
|
907
899
|
},
|
|
908
900
|
);
|
|
909
901
|
}
|
|
@@ -916,12 +908,12 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
916
908
|
baseParityIndex: number,
|
|
917
909
|
) {
|
|
918
910
|
if (!provingState.verifyState()) {
|
|
919
|
-
logger.debug('Not running base parity. State no longer valid.');
|
|
911
|
+
this.logger.debug('Not running base parity. State no longer valid.');
|
|
920
912
|
return;
|
|
921
913
|
}
|
|
922
914
|
|
|
923
915
|
if (!provingState.tryStartProvingBaseParity(baseParityIndex)) {
|
|
924
|
-
logger.warn(`Base parity ${baseParityIndex} already started.`);
|
|
916
|
+
this.logger.warn(`Base parity ${baseParityIndex} already started.`);
|
|
925
917
|
return;
|
|
926
918
|
}
|
|
927
919
|
|
|
@@ -956,12 +948,12 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
956
948
|
// Enqueues the root rollup proof if all inputs are available
|
|
957
949
|
private enqueueRootParityCircuit(provingState: BlockProvingState) {
|
|
958
950
|
if (!provingState.verifyState()) {
|
|
959
|
-
logger.debug('Not running root parity. State no longer valid.');
|
|
951
|
+
this.logger.debug('Not running root parity. State no longer valid.');
|
|
960
952
|
return;
|
|
961
953
|
}
|
|
962
954
|
|
|
963
955
|
if (!provingState.tryStartProvingRootParity()) {
|
|
964
|
-
logger.debug('Root parity already started.');
|
|
956
|
+
this.logger.debug('Root parity already started.');
|
|
965
957
|
return;
|
|
966
958
|
}
|
|
967
959
|
|
|
@@ -988,12 +980,12 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
988
980
|
// Enqueues the next level of merge if all inputs are available
|
|
989
981
|
private enqueueBlockMergeRollup(provingState: CheckpointProvingState, location: TreeNodeLocation) {
|
|
990
982
|
if (!provingState.verifyState()) {
|
|
991
|
-
logger.debug('Not running block merge rollup. State no longer valid.');
|
|
983
|
+
this.logger.debug('Not running block merge rollup. State no longer valid.');
|
|
992
984
|
return;
|
|
993
985
|
}
|
|
994
986
|
|
|
995
987
|
if (!provingState.tryStartProvingBlockMerge(location)) {
|
|
996
|
-
logger.debug('Block merge rollup already started.');
|
|
988
|
+
this.logger.debug('Block merge rollup already started.');
|
|
997
989
|
return;
|
|
998
990
|
}
|
|
999
991
|
|
|
@@ -1008,29 +1000,29 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1008
1000
|
},
|
|
1009
1001
|
signal => this.prover.getBlockMergeRollupProof(inputs, signal, provingState.epochNumber),
|
|
1010
1002
|
),
|
|
1011
|
-
result => {
|
|
1003
|
+
async result => {
|
|
1012
1004
|
provingState.setBlockMergeRollupProof(location, result);
|
|
1013
|
-
this.checkAndEnqueueNextBlockMergeRollup(provingState, location);
|
|
1005
|
+
await this.checkAndEnqueueNextBlockMergeRollup(provingState, location);
|
|
1014
1006
|
},
|
|
1015
1007
|
);
|
|
1016
1008
|
}
|
|
1017
1009
|
|
|
1018
|
-
private enqueueCheckpointRootRollup(provingState: CheckpointProvingState) {
|
|
1010
|
+
private async enqueueCheckpointRootRollup(provingState: CheckpointProvingState) {
|
|
1019
1011
|
if (!provingState.verifyState()) {
|
|
1020
|
-
logger.debug('Not running checkpoint root rollup. State no longer valid.');
|
|
1012
|
+
this.logger.debug('Not running checkpoint root rollup. State no longer valid.');
|
|
1021
1013
|
return;
|
|
1022
1014
|
}
|
|
1023
1015
|
|
|
1024
1016
|
if (!provingState.tryStartProvingCheckpointRoot()) {
|
|
1025
|
-
logger.debug('Checkpoint root rollup already started.');
|
|
1017
|
+
this.logger.debug('Checkpoint root rollup already started.');
|
|
1026
1018
|
return;
|
|
1027
1019
|
}
|
|
1028
1020
|
|
|
1029
1021
|
const rollupType = provingState.getCheckpointRootRollupType();
|
|
1030
1022
|
|
|
1031
|
-
logger.debug(`Enqueuing ${rollupType} for checkpoint ${provingState.index}.`);
|
|
1023
|
+
this.logger.debug(`Enqueuing ${rollupType} for checkpoint ${provingState.index}.`);
|
|
1032
1024
|
|
|
1033
|
-
const inputs = provingState.getCheckpointRootRollupInputs();
|
|
1025
|
+
const inputs = await provingState.getCheckpointRootRollupInputs();
|
|
1034
1026
|
|
|
1035
1027
|
this.deferredProving(
|
|
1036
1028
|
provingState,
|
|
@@ -1052,7 +1044,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1052
1044
|
const computedEndBlobAccumulatorState = provingState.getEndBlobAccumulator()!.toBlobAccumulator();
|
|
1053
1045
|
const circuitEndBlobAccumulatorState = result.inputs.endBlobAccumulator;
|
|
1054
1046
|
if (!circuitEndBlobAccumulatorState.equals(computedEndBlobAccumulatorState)) {
|
|
1055
|
-
logger.error(
|
|
1047
|
+
this.logger.error(
|
|
1056
1048
|
`Blob accumulator state mismatch.\nCircuit: ${inspect(circuitEndBlobAccumulatorState)}\nComputed: ${inspect(
|
|
1057
1049
|
computedEndBlobAccumulatorState,
|
|
1058
1050
|
)}`,
|
|
@@ -1061,7 +1053,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1061
1053
|
return;
|
|
1062
1054
|
}
|
|
1063
1055
|
|
|
1064
|
-
logger.debug(`Completed ${rollupType} proof for checkpoint ${provingState.index}.`);
|
|
1056
|
+
this.logger.debug(`Completed ${rollupType} proof for checkpoint ${provingState.index}.`);
|
|
1065
1057
|
|
|
1066
1058
|
const leafLocation = provingState.setCheckpointRootRollupProof(result);
|
|
1067
1059
|
const epochProvingState = provingState.parentEpoch;
|
|
@@ -1077,12 +1069,12 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1077
1069
|
|
|
1078
1070
|
private enqueueCheckpointMergeRollup(provingState: EpochProvingState, location: TreeNodeLocation) {
|
|
1079
1071
|
if (!provingState.verifyState()) {
|
|
1080
|
-
logger.debug('Not running checkpoint merge rollup. State no longer valid.');
|
|
1072
|
+
this.logger.debug('Not running checkpoint merge rollup. State no longer valid.');
|
|
1081
1073
|
return;
|
|
1082
1074
|
}
|
|
1083
1075
|
|
|
1084
1076
|
if (!provingState.tryStartProvingCheckpointMerge(location)) {
|
|
1085
|
-
logger.debug('Checkpoint merge rollup already started.');
|
|
1077
|
+
this.logger.debug('Checkpoint merge rollup already started.');
|
|
1086
1078
|
return;
|
|
1087
1079
|
}
|
|
1088
1080
|
|
|
@@ -1099,7 +1091,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1099
1091
|
signal => this.prover.getCheckpointMergeRollupProof(inputs, signal, provingState.epochNumber),
|
|
1100
1092
|
),
|
|
1101
1093
|
result => {
|
|
1102
|
-
logger.debug('Completed proof for checkpoint merge rollup.');
|
|
1094
|
+
this.logger.debug('Completed proof for checkpoint merge rollup.');
|
|
1103
1095
|
provingState.setCheckpointMergeRollupProof(location, result);
|
|
1104
1096
|
this.checkAndEnqueueNextCheckpointMergeRollup(provingState, location);
|
|
1105
1097
|
},
|
|
@@ -1108,16 +1100,16 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1108
1100
|
|
|
1109
1101
|
private enqueueEpochPadding(provingState: EpochProvingState) {
|
|
1110
1102
|
if (!provingState.verifyState()) {
|
|
1111
|
-
logger.debug('Not running epoch padding. State no longer valid.');
|
|
1103
|
+
this.logger.debug('Not running epoch padding. State no longer valid.');
|
|
1112
1104
|
return;
|
|
1113
1105
|
}
|
|
1114
1106
|
|
|
1115
1107
|
if (!provingState.tryStartProvingPaddingCheckpoint()) {
|
|
1116
|
-
logger.debug('Padding checkpoint already started.');
|
|
1108
|
+
this.logger.debug('Padding checkpoint already started.');
|
|
1117
1109
|
return;
|
|
1118
1110
|
}
|
|
1119
1111
|
|
|
1120
|
-
logger.debug('Padding epoch proof with a padding block root proof.');
|
|
1112
|
+
this.logger.debug('Padding epoch proof with a padding block root proof.');
|
|
1121
1113
|
|
|
1122
1114
|
const inputs = provingState.getPaddingCheckpointInputs();
|
|
1123
1115
|
|
|
@@ -1132,7 +1124,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1132
1124
|
signal => this.prover.getCheckpointPaddingRollupProof(inputs, signal, provingState.epochNumber),
|
|
1133
1125
|
),
|
|
1134
1126
|
result => {
|
|
1135
|
-
logger.debug('Completed proof for padding checkpoint.');
|
|
1127
|
+
this.logger.debug('Completed proof for padding checkpoint.');
|
|
1136
1128
|
provingState.setCheckpointPaddingProof(result);
|
|
1137
1129
|
this.checkAndEnqueueRootRollup(provingState);
|
|
1138
1130
|
},
|
|
@@ -1142,11 +1134,11 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1142
1134
|
// Executes the root rollup circuit
|
|
1143
1135
|
private enqueueRootRollup(provingState: EpochProvingState) {
|
|
1144
1136
|
if (!provingState.verifyState()) {
|
|
1145
|
-
logger.debug('Not running root rollup, state no longer valid');
|
|
1137
|
+
this.logger.debug('Not running root rollup, state no longer valid');
|
|
1146
1138
|
return;
|
|
1147
1139
|
}
|
|
1148
1140
|
|
|
1149
|
-
logger.debug(`Preparing root rollup`);
|
|
1141
|
+
this.logger.debug(`Preparing root rollup`);
|
|
1150
1142
|
|
|
1151
1143
|
const inputs = provingState.getRootRollupInputs();
|
|
1152
1144
|
|
|
@@ -1161,7 +1153,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1161
1153
|
signal => this.prover.getRootRollupProof(inputs, signal, provingState.epochNumber),
|
|
1162
1154
|
),
|
|
1163
1155
|
result => {
|
|
1164
|
-
logger.verbose(`Orchestrator completed root rollup for epoch ${provingState.epochNumber}`);
|
|
1156
|
+
this.logger.verbose(`Orchestrator completed root rollup for epoch ${provingState.epochNumber}`);
|
|
1165
1157
|
provingState.setRootRollupProof(result);
|
|
1166
1158
|
provingState.resolve({ status: 'success' });
|
|
1167
1159
|
},
|
|
@@ -1183,32 +1175,35 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1183
1175
|
|
|
1184
1176
|
private checkAndEnqueueBlockRootRollup(provingState: BlockProvingState) {
|
|
1185
1177
|
if (!provingState.isReadyForBlockRootRollup()) {
|
|
1186
|
-
logger.debug('Not ready for block root rollup');
|
|
1178
|
+
this.logger.debug('Not ready for block root rollup');
|
|
1187
1179
|
return;
|
|
1188
1180
|
}
|
|
1189
1181
|
|
|
1190
1182
|
this.enqueueBlockRootRollup(provingState);
|
|
1191
1183
|
}
|
|
1192
1184
|
|
|
1193
|
-
private checkAndEnqueueNextBlockMergeRollup(
|
|
1185
|
+
private async checkAndEnqueueNextBlockMergeRollup(
|
|
1186
|
+
provingState: CheckpointProvingState,
|
|
1187
|
+
currentLocation: TreeNodeLocation,
|
|
1188
|
+
) {
|
|
1194
1189
|
if (!provingState.isReadyForBlockMerge(currentLocation)) {
|
|
1195
1190
|
return;
|
|
1196
1191
|
}
|
|
1197
1192
|
|
|
1198
1193
|
const parentLocation = provingState.getParentLocation(currentLocation);
|
|
1199
1194
|
if (parentLocation.level === 0) {
|
|
1200
|
-
this.checkAndEnqueueCheckpointRootRollup(provingState);
|
|
1195
|
+
await this.checkAndEnqueueCheckpointRootRollup(provingState);
|
|
1201
1196
|
} else {
|
|
1202
1197
|
this.enqueueBlockMergeRollup(provingState, parentLocation);
|
|
1203
1198
|
}
|
|
1204
1199
|
}
|
|
1205
1200
|
|
|
1206
|
-
private checkAndEnqueueCheckpointRootRollup(provingState: CheckpointProvingState) {
|
|
1201
|
+
private async checkAndEnqueueCheckpointRootRollup(provingState: CheckpointProvingState) {
|
|
1207
1202
|
if (!provingState.isReadyForCheckpointRoot()) {
|
|
1208
1203
|
return;
|
|
1209
1204
|
}
|
|
1210
1205
|
|
|
1211
|
-
this.enqueueCheckpointRootRollup(provingState);
|
|
1206
|
+
await this.enqueueCheckpointRootRollup(provingState);
|
|
1212
1207
|
}
|
|
1213
1208
|
|
|
1214
1209
|
private checkAndEnqueueNextCheckpointMergeRollup(provingState: EpochProvingState, currentLocation: TreeNodeLocation) {
|
|
@@ -1226,7 +1221,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1226
1221
|
|
|
1227
1222
|
private checkAndEnqueueRootRollup(provingState: EpochProvingState) {
|
|
1228
1223
|
if (!provingState.isReadyForRootRollup()) {
|
|
1229
|
-
logger.debug('Not ready for root rollup');
|
|
1224
|
+
this.logger.debug('Not ready for root rollup');
|
|
1230
1225
|
return;
|
|
1231
1226
|
}
|
|
1232
1227
|
|
|
@@ -1241,7 +1236,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1241
1236
|
*/
|
|
1242
1237
|
private enqueueVM(provingState: BlockProvingState, txIndex: number) {
|
|
1243
1238
|
if (!provingState.verifyState()) {
|
|
1244
|
-
logger.debug(`Not running VM circuit as state is no longer valid`);
|
|
1239
|
+
this.logger.debug(`Not running VM circuit as state is no longer valid`);
|
|
1245
1240
|
return;
|
|
1246
1241
|
}
|
|
1247
1242
|
|
|
@@ -1260,7 +1255,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1260
1255
|
);
|
|
1261
1256
|
|
|
1262
1257
|
this.deferredProving(provingState, doAvmProving, proof => {
|
|
1263
|
-
logger.debug(`Proven VM for tx index: ${txIndex}`);
|
|
1258
|
+
this.logger.debug(`Proven VM for tx index: ${txIndex}`);
|
|
1264
1259
|
txProvingState.setAvmProof(proof);
|
|
1265
1260
|
this.checkAndEnqueueBaseRollup(provingState, txIndex);
|
|
1266
1261
|
});
|
|
@@ -1273,7 +1268,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1273
1268
|
}
|
|
1274
1269
|
|
|
1275
1270
|
// We must have completed all proving (chonk verifier proof and (if required) vm proof are generated), we now move to the base rollup.
|
|
1276
|
-
logger.debug(`Public functions completed for tx ${txIndex} enqueueing base rollup`);
|
|
1271
|
+
this.logger.debug(`Public functions completed for tx ${txIndex} enqueueing base rollup`);
|
|
1277
1272
|
|
|
1278
1273
|
this.enqueueBaseRollup(provingState, txIndex);
|
|
1279
1274
|
}
|