@aztec/prover-node 6.0.0-nightly.20260810 → 6.0.0-nightly.20260821
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/actions/rerun-epoch-proving-job.d.ts +3 -2
- package/dest/actions/rerun-epoch-proving-job.d.ts.map +1 -1
- package/dest/actions/rerun-epoch-proving-job.js +5 -3
- package/dest/job/checkpoint-prover.d.ts +15 -11
- package/dest/job/checkpoint-prover.d.ts.map +1 -1
- package/dest/job/checkpoint-prover.js +46 -38
- package/dest/job/epoch-proving-job-data.d.ts +3 -1
- package/dest/job/epoch-proving-job-data.d.ts.map +1 -1
- package/dest/job/epoch-proving-job-data.js +3 -1
- package/dest/job/top-tree-job.d.ts +1 -1
- package/dest/job/top-tree-job.js +2 -2
- package/dest/prover-node-publisher.d.ts +1 -1
- package/dest/prover-node-publisher.d.ts.map +1 -1
- package/dest/prover-node-publisher.js +21 -12
- package/dest/prover-node.d.ts +2 -1
- package/dest/prover-node.d.ts.map +1 -1
- package/dest/prover-node.js +23 -1
- package/dest/session-manager.d.ts +1 -1
- package/dest/session-manager.d.ts.map +1 -1
- package/dest/session-manager.js +1 -0
- package/package.json +24 -24
- package/src/actions/rerun-epoch-proving-job.ts +8 -5
- package/src/job/checkpoint-prover.ts +62 -49
- package/src/job/epoch-proving-job-data.ts +13 -1
- package/src/job/top-tree-job.ts +2 -2
- package/src/prover-node-publisher.ts +21 -12
- package/src/prover-node.ts +26 -1
- package/src/session-manager.ts +1 -0
package/src/prover-node.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
|
3
3
|
import type { Delayer } from '@aztec/ethereum/l1-tx-utils';
|
|
4
4
|
import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
5
5
|
import { assertRequired, compact, pick } from '@aztec/foundation/collection';
|
|
6
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
7
|
import { memoize } from '@aztec/foundation/decorators';
|
|
7
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
8
9
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
@@ -349,8 +350,15 @@ export class ProverNode implements L2BlockStreamEventHandler, ProverNodeApi, Tra
|
|
|
349
350
|
): Promise<RegisterCheckpointData> {
|
|
350
351
|
const previousBlockNumber = BlockNumber(checkpoint.blocks[0].number - 1);
|
|
351
352
|
const previousBlockHeader = await this.gatherPreviousBlockHeader(previousBlockNumber);
|
|
352
|
-
const l1ToL2Messages = await this.l1ToL2MessageSource.getL1ToL2Messages(checkpoint.number);
|
|
353
353
|
const lastBlock = checkpoint.blocks.at(-1)!;
|
|
354
|
+
// Streaming Inbox: the checkpoint's consumed messages are those between the parent
|
|
355
|
+
// checkpoint's consumed position and this checkpoint's last block, as a compact leaf-count range. The prover
|
|
356
|
+
// slices them per block.
|
|
357
|
+
const l1ToL2Messages = await this.l1ToL2MessageSource.getL1ToL2MessagesBetweenLeafCounts(
|
|
358
|
+
BigInt(previousBlockHeader.state.l1ToL2MessageTree.nextAvailableLeafIndex),
|
|
359
|
+
BigInt(lastBlock.header.state.l1ToL2MessageTree.nextAvailableLeafIndex),
|
|
360
|
+
);
|
|
361
|
+
const previousInboxRollingHash = await this.gatherPreviousInboxRollingHash(checkpoint.number);
|
|
354
362
|
const lastBlockHash = await lastBlock.header.hash();
|
|
355
363
|
await this.worldState.syncImmediate(lastBlock.number, lastBlockHash);
|
|
356
364
|
const previousArchiveSiblingPath = await getLastSiblingPath(
|
|
@@ -361,10 +369,27 @@ export class ProverNode implements L2BlockStreamEventHandler, ProverNodeApi, Tra
|
|
|
361
369
|
attestations,
|
|
362
370
|
previousBlockHeader,
|
|
363
371
|
l1ToL2Messages,
|
|
372
|
+
previousInboxRollingHash,
|
|
364
373
|
previousArchiveSiblingPath,
|
|
365
374
|
};
|
|
366
375
|
}
|
|
367
376
|
|
|
377
|
+
/**
|
|
378
|
+
* Sources the inbox rolling hash chain-start for a checkpoint: the previous checkpoint's `inboxRollingHash`, or zero
|
|
379
|
+
* for the genesis checkpoint. The prover threads this into the base parity circuits so the rebuilt checkpoint header
|
|
380
|
+
* matches the proposer's.
|
|
381
|
+
*/
|
|
382
|
+
private async gatherPreviousInboxRollingHash(checkpointNumber: CheckpointNumber): Promise<Fr> {
|
|
383
|
+
if (checkpointNumber <= 1) {
|
|
384
|
+
return Fr.ZERO;
|
|
385
|
+
}
|
|
386
|
+
const previous = await this.l2BlockSource.getCheckpoint({ number: CheckpointNumber(checkpointNumber - 1) });
|
|
387
|
+
if (!previous) {
|
|
388
|
+
throw new Error(`Previous checkpoint ${checkpointNumber - 1} not found when sourcing inbox rolling hash`);
|
|
389
|
+
}
|
|
390
|
+
return previous.checkpoint.header.inboxRollingHash;
|
|
391
|
+
}
|
|
392
|
+
|
|
368
393
|
/**
|
|
369
394
|
* Marks every prover orphaned by the prune as pruned, clamps the catch-up cursor below the prune target's
|
|
370
395
|
* checkpoint, and notifies the session manager. Keyed off the prune target block (the highest surviving block)
|
package/src/session-manager.ts
CHANGED