@aztec/prover-client 3.0.0-nightly.20251121 → 3.0.0-nightly.20251122
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/block-factory/light.d.ts.map +1 -1
- package/dest/block-factory/light.js +11 -10
- package/dest/light/lightweight_checkpoint_builder.d.ts +4 -6
- package/dest/light/lightweight_checkpoint_builder.d.ts.map +1 -1
- package/dest/light/lightweight_checkpoint_builder.js +24 -26
- package/dest/mocks/test_context.d.ts +0 -1
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +1 -5
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +2 -4
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +1 -1
- package/dest/orchestrator/checkpoint-proving-state.d.ts +2 -3
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/checkpoint-proving-state.js +5 -10
- package/dest/orchestrator/epoch-proving-state.d.ts +1 -1
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +2 -2
- package/dest/orchestrator/orchestrator.d.ts +1 -1
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +3 -3
- package/dest/prover-client/server-epoch-prover.d.ts +1 -1
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.js +2 -2
- package/package.json +15 -15
- package/src/block-factory/light.ts +7 -11
- package/src/light/lightweight_checkpoint_builder.ts +27 -27
- package/src/mocks/test_context.ts +1 -8
- package/src/orchestrator/block-building-helpers.ts +2 -4
- package/src/orchestrator/block-proving-state.ts +0 -1
- package/src/orchestrator/checkpoint-proving-state.ts +5 -10
- package/src/orchestrator/epoch-proving-state.ts +0 -2
- package/src/orchestrator/orchestrator.ts +1 -3
- package/src/prover-client/server-epoch-prover.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../src/block-factory/light.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../src/block-factory/light.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAiB,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAGhG,OAAO,EAAqB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAQnF;;;;;;;;;;;;;GAaG;AACH,qBAAa,uBAAwB,YAAW,aAAa;IAQzD,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,SAAS;IARnB,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAO;IAC9B,OAAO,CAAC,GAAG,CAA4B;IAEvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6C;gBAG1D,EAAE,EAAE,yBAAyB,EAC7B,SAAS,GAAE,eAAsC;IAGrD,aAAa,CAAC,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAS1F,MAAM,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzC,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;YAIvB,UAAU;CA8CzB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,WAAW,EAAE,EAClB,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,EAAE,EAAE,EACpB,EAAE,EAAE,yBAAyB,EAC7B,SAAS,GAAE,eAAsC,oBAWlD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpongeBlob, computeBlobsHashFromBlobs,
|
|
1
|
+
import { SpongeBlob, computeBlobsHashFromBlobs, encodeCheckpointEndMarker, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
2
2
|
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
3
3
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -62,24 +62,25 @@ import { buildHeaderAndBodyFromTxs, getTreeSnapshot, insertSideEffects } from '.
|
|
|
62
62
|
const lastArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db);
|
|
63
63
|
const state = await this.db.getStateReference();
|
|
64
64
|
const txs = this.txs ?? [];
|
|
65
|
-
const
|
|
66
|
-
const totalNumBlobFields = getTotalNumBlobFieldsFromTxs([
|
|
67
|
-
txEffects.map((tx)=>tx.getTxStartMarker())
|
|
68
|
-
]);
|
|
69
|
-
const startSpongeBlob = await SpongeBlob.init(totalNumBlobFields);
|
|
65
|
+
const startSpongeBlob = SpongeBlob.init();
|
|
70
66
|
const { header, body, blockBlobFields } = await buildHeaderAndBodyFromTxs(txs, lastArchive, state, this.globalVariables, startSpongeBlob, true);
|
|
71
67
|
header.state.validate();
|
|
72
68
|
await this.db.updateArchive(header);
|
|
73
69
|
const newArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db);
|
|
74
70
|
const outHash = computeBlockOutHash(txs.map((tx)=>tx.txEffect.l2ToL1Msgs));
|
|
75
|
-
const inHash =
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
const inHash = computeInHashFromL1ToL2Messages(this.l1ToL2Messages);
|
|
72
|
+
const numBlobFields = blockBlobFields.length + 1;
|
|
73
|
+
const blobFields = blockBlobFields.concat([
|
|
74
|
+
encodeCheckpointEndMarker({
|
|
75
|
+
numBlobFields
|
|
76
|
+
})
|
|
77
|
+
]);
|
|
79
78
|
const blobsHash = computeBlobsHashFromBlobs(getBlobsPerL1Block(blobFields));
|
|
79
|
+
const blockHeaderHash = await header.hash();
|
|
80
80
|
const contentCommitment = new ContentCommitment(blobsHash, inHash, outHash);
|
|
81
81
|
const l2BlockHeader = L2BlockHeader.from({
|
|
82
82
|
...header,
|
|
83
|
+
blockHeadersHash: blockHeaderHash,
|
|
83
84
|
contentCommitment
|
|
84
85
|
});
|
|
85
86
|
const block = new L2Block(newArchive, l2BlockHeader, body);
|
|
@@ -4,7 +4,6 @@ import { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
|
4
4
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
5
5
|
import { CheckpointConstantData } from '@aztec/stdlib/rollup';
|
|
6
6
|
import { type GlobalVariables, type ProcessedTx, StateReference } from '@aztec/stdlib/tx';
|
|
7
|
-
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
8
7
|
/**
|
|
9
8
|
* Builds a checkpoint and its header and the blocks in it from a set of processed tx without running any circuits.
|
|
10
9
|
*
|
|
@@ -12,17 +11,16 @@ import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
|
12
11
|
* nullifier, and public data trees, then updates the archive tree when a block is added.
|
|
13
12
|
*/
|
|
14
13
|
export declare class LightweightCheckpointBuilder {
|
|
15
|
-
private db;
|
|
16
|
-
private telemetry;
|
|
17
|
-
private readonly logger;
|
|
18
14
|
private constants;
|
|
19
15
|
private l1ToL2Messages;
|
|
16
|
+
private db;
|
|
17
|
+
private readonly logger;
|
|
20
18
|
private lastArchives;
|
|
21
19
|
private spongeBlob;
|
|
22
20
|
private blocks;
|
|
23
21
|
private blobFields;
|
|
24
|
-
constructor(
|
|
25
|
-
startNewCheckpoint(constants: CheckpointConstantData, l1ToL2Messages: Fr[],
|
|
22
|
+
constructor(constants: CheckpointConstantData, l1ToL2Messages: Fr[], db: MerkleTreeWriteOperations);
|
|
23
|
+
static startNewCheckpoint(constants: CheckpointConstantData, l1ToL2Messages: Fr[], db: MerkleTreeWriteOperations): Promise<LightweightCheckpointBuilder>;
|
|
26
24
|
addBlock(globalVariables: GlobalVariables, endState: StateReference, txs: ProcessedTx[]): Promise<L2BlockNew>;
|
|
27
25
|
completeCheckpoint(): Promise<Checkpoint>;
|
|
28
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightweight_checkpoint_builder.d.ts","sourceRoot":"","sources":["../../src/light/lightweight_checkpoint_builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"lightweight_checkpoint_builder.d.ts","sourceRoot":"","sources":["../../src/light/lightweight_checkpoint_builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,sBAAsB,EAA6C,MAAM,sBAAsB,CAAC;AAEzG,OAAO,EAAqB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQ7G;;;;;GAKG;AACH,qBAAa,4BAA4B;IASrC,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,EAAE;IAVZ,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkD;IAEzE,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,UAAU,CAAY;gBAGpB,SAAS,EAAE,sBAAsB,EACjC,cAAc,EAAE,EAAE,EAAE,EACpB,EAAE,EAAE,yBAAyB;WAM1B,kBAAkB,CAC7B,SAAS,EAAE,sBAAsB,EACjC,cAAc,EAAE,EAAE,EAAE,EACpB,EAAE,EAAE,yBAAyB,GAC5B,OAAO,CAAC,4BAA4B,CAAC;IAUlC,QAAQ,CAAC,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IA0C7G,kBAAkB,IAAI,OAAO,CAAC,UAAU,CAAC;CA0ChD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpongeBlob, computeBlobsHashFromBlobs, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
1
|
+
import { SpongeBlob, computeBlobsHashFromBlobs, encodeCheckpointEndMarker, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
2
2
|
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
3
3
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -6,10 +6,9 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
6
6
|
import { L2BlockNew } from '@aztec/stdlib/block';
|
|
7
7
|
import { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
8
8
|
import { computeCheckpointOutHash, computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
|
|
9
|
-
import { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
9
|
+
import { CheckpointHeader, computeBlockHeadersHash } from '@aztec/stdlib/rollup';
|
|
10
10
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
11
11
|
import { ContentCommitment } from '@aztec/stdlib/tx';
|
|
12
|
-
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
13
12
|
import { buildHeaderAndBodyFromTxs, getTreeSnapshot, insertSideEffects } from '../orchestrator/block-building-helpers.js';
|
|
14
13
|
/**
|
|
15
14
|
* Builds a checkpoint and its header and the blocks in it from a set of processed tx without running any circuits.
|
|
@@ -17,44 +16,39 @@ import { buildHeaderAndBodyFromTxs, getTreeSnapshot, insertSideEffects } from '.
|
|
|
17
16
|
* It updates the l1-to-l2 message tree when starting a new checkpoint, inserts the side effects to note hash,
|
|
18
17
|
* nullifier, and public data trees, then updates the archive tree when a block is added.
|
|
19
18
|
*/ export class LightweightCheckpointBuilder {
|
|
20
|
-
db;
|
|
21
|
-
telemetry;
|
|
22
|
-
logger;
|
|
23
19
|
constants;
|
|
24
20
|
l1ToL2Messages;
|
|
21
|
+
db;
|
|
22
|
+
logger;
|
|
25
23
|
lastArchives;
|
|
26
24
|
spongeBlob;
|
|
27
25
|
blocks;
|
|
28
26
|
blobFields;
|
|
29
|
-
constructor(
|
|
27
|
+
constructor(constants, l1ToL2Messages, db){
|
|
28
|
+
this.constants = constants;
|
|
29
|
+
this.l1ToL2Messages = l1ToL2Messages;
|
|
30
30
|
this.db = db;
|
|
31
|
-
this.telemetry = telemetry;
|
|
32
31
|
this.logger = createLogger('lightweight-checkpoint-builder');
|
|
33
|
-
this.l1ToL2Messages = [];
|
|
34
32
|
this.lastArchives = [];
|
|
35
|
-
this.spongeBlob = SpongeBlob.empty();
|
|
36
33
|
this.blocks = [];
|
|
37
34
|
this.blobFields = [];
|
|
38
|
-
|
|
39
|
-
async startNewCheckpoint(constants, l1ToL2Messages, totalNumBlobFields) {
|
|
35
|
+
this.spongeBlob = SpongeBlob.init();
|
|
40
36
|
this.logger.debug('Starting new checkpoint', {
|
|
41
37
|
constants: constants.toInspect(),
|
|
42
38
|
l1ToL2Messages
|
|
43
39
|
});
|
|
44
|
-
|
|
40
|
+
}
|
|
41
|
+
static async startNewCheckpoint(constants, l1ToL2Messages, db) {
|
|
45
42
|
// Insert l1-to-l2 messages into the tree.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.lastArchives.push(await getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db));
|
|
49
|
-
this.spongeBlob = await SpongeBlob.init(totalNumBlobFields);
|
|
50
|
-
this.blocks = [];
|
|
51
|
-
this.blobFields = [
|
|
52
|
-
new Fr(totalNumBlobFields)
|
|
53
|
-
];
|
|
43
|
+
await db.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
|
|
44
|
+
return new LightweightCheckpointBuilder(constants, l1ToL2Messages, db);
|
|
54
45
|
}
|
|
55
46
|
async addBlock(globalVariables, endState, txs) {
|
|
56
47
|
const isFirstBlock = this.blocks.length === 0;
|
|
57
|
-
|
|
48
|
+
if (isFirstBlock) {
|
|
49
|
+
this.lastArchives.push(await getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db));
|
|
50
|
+
}
|
|
51
|
+
const lastArchive = this.lastArchives.at(-1);
|
|
58
52
|
for (const tx of txs){
|
|
59
53
|
await insertSideEffects(tx, this.db);
|
|
60
54
|
}
|
|
@@ -79,14 +73,17 @@ import { buildHeaderAndBodyFromTxs, getTreeSnapshot, insertSideEffects } from '.
|
|
|
79
73
|
if (!this.blocks.length) {
|
|
80
74
|
throw new Error('No blocks added to checkpoint.');
|
|
81
75
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
const numBlobFields = this.blobFields.length + 1; // +1 for the checkpoint end marker.
|
|
77
|
+
const checkpointEndMarker = encodeCheckpointEndMarker({
|
|
78
|
+
numBlobFields
|
|
79
|
+
});
|
|
80
|
+
this.blobFields.push(checkpointEndMarker);
|
|
85
81
|
const blocks = this.blocks;
|
|
82
|
+
const blockHeadersHash = await computeBlockHeadersHash(blocks.map((block)=>block.header));
|
|
86
83
|
const newArchive = this.lastArchives[this.lastArchives.length - 1];
|
|
87
84
|
const blobs = getBlobsPerL1Block(this.blobFields);
|
|
88
85
|
const blobsHash = computeBlobsHashFromBlobs(blobs);
|
|
89
|
-
const inHash =
|
|
86
|
+
const inHash = computeInHashFromL1ToL2Messages(this.l1ToL2Messages);
|
|
90
87
|
const outHash = computeCheckpointOutHash(blocks.map((block)=>block.body.txEffects.map((tx)=>tx.l2ToL1Msgs)));
|
|
91
88
|
const constants = this.constants;
|
|
92
89
|
// timestamp of a checkpoint is the timestamp of the last block in the checkpoint.
|
|
@@ -94,6 +91,7 @@ import { buildHeaderAndBodyFromTxs, getTreeSnapshot, insertSideEffects } from '.
|
|
|
94
91
|
const totalManaUsed = blocks.reduce((acc, block)=>acc.add(block.header.totalManaUsed), Fr.ZERO);
|
|
95
92
|
const header = CheckpointHeader.from({
|
|
96
93
|
lastArchiveRoot: this.lastArchives[0].root,
|
|
94
|
+
blockHeadersHash,
|
|
97
95
|
contentCommitment: new ContentCommitment(blobsHash, inHash, outHash),
|
|
98
96
|
slotNumber: constants.slotNumber,
|
|
99
97
|
timestamp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_context.d.ts","sourceRoot":"","sources":["../../src/mocks/test_context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"test_context.d.ts","sourceRoot":"","sources":["../../src/mocks/test_context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,KAAK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;WAEY,GAAG,CACd,MAAM,EAAE,MAAM,EACd,EACE,WAAe,EACf,YAA8G,GAC/G,GAAE;QACD,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;KACtE;IAyDD,OAAO;IAIR,OAAO;IAYN,aAAa;IAOb,aAAa;IAIP,sBAAsB;IAKtB,cAAc,CACzB,SAAS,EAAE,MAAM,EACjB,EACE,cAAkB,EAClB,iBAAqB,EACrB,mBAAgC,EAChC,GAAG,YAAY,EAChB,GAAE;QACD,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,mBAAmB,CAAC,EAAE,CACpB,oBAAoB,EAAE,eAAe,EACrC,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACrD,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAM;;;;;;;;;;YA6FtC,eAAe;IAoB7B,OAAO,CAAC,cAAc;YAOR,WAAW;CA8B1B;AAED,cAAM,uBAAwB,SAAQ,mBAAmB;IAChD,2CAA2C,UAAS;cAIxC,kCAAkC,CAAC,YAAY,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAMtG"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TestCircuitProver } from '@aztec/bb-prover';
|
|
2
|
-
import { getTotalNumBlobFieldsFromTxs } from '@aztec/blob-lib';
|
|
3
2
|
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
4
3
|
import { padArrayEnd, times, timesAsync } from '@aztec/foundation/collection';
|
|
5
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -162,9 +161,7 @@ export class TestContext {
|
|
|
162
161
|
return txs;
|
|
163
162
|
});
|
|
164
163
|
const cleanFork = await this.worldState.fork();
|
|
165
|
-
const builder =
|
|
166
|
-
const totalNumBlobFields = getTotalNumBlobFieldsFromTxs(blockTxs.map((txs)=>txs.map((tx)=>tx.txEffect.getTxStartMarker())));
|
|
167
|
-
await builder.startNewCheckpoint(constants, l1ToL2Messages, totalNumBlobFields);
|
|
164
|
+
const builder = await LightweightCheckpointBuilder.startNewCheckpoint(constants, l1ToL2Messages, cleanFork);
|
|
168
165
|
// Add tx effects to db and build block headers.
|
|
169
166
|
const blocks = [];
|
|
170
167
|
for(let i = 0; i < numBlocks; i++){
|
|
@@ -188,7 +185,6 @@ export class TestContext {
|
|
|
188
185
|
header: checkpoint.header,
|
|
189
186
|
blocks,
|
|
190
187
|
l1ToL2Messages,
|
|
191
|
-
totalNumBlobFields,
|
|
192
188
|
previousBlockHeader
|
|
193
189
|
};
|
|
194
190
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-building-helpers.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-building-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EACtB,UAAU,EAKX,MAAM,iBAAiB,CAAC;AAgBzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,UAAU,EAAgC,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhH,OAAO,EAAS,SAAS,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAEL,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,gCAAgC,EAEjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,sBAAsB,EACtB,Y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EAAE,EAAE,wBAAwB;;;;;;SAI/G;AAED,wBAAsB,eAAe,CAAC,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,wBAAwB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAGrH;AAED,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,wBAMrE;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,wBAAwB,GAC3B,OAAO,CAAC,EAAE,EAAE,CAAC,CAMf;AAGD,wBAAsB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EAC5D,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,wBAAwB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAY/B;AAED,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,qBAAqB,EACnC,aAAa,EAAE,GAAG,CAAC,YAAY,EAAE,sBAAsB,CAAC,QASzD;AAqBD,wBAAgB,UAAU,CAAC,EAAE,EAAE,WAAW,QAczC;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,UAAU,EAAE,YAAY,SAAS,MAAM,EAC3E,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,6BAA6B,CAAC,CAAC,EAAE,YAAY,CAAC,EAClF,OAAO,CAAC,EAAE,MAAM,8BAKjB"}
|
|
@@ -126,12 +126,10 @@ export const buildBlobHints = (blobFields)=>{
|
|
|
126
126
|
};
|
|
127
127
|
};
|
|
128
128
|
export const buildFinalBlobChallenges = async (blobFieldsPerCheckpoint)=>{
|
|
129
|
-
|
|
130
|
-
return await BatchedBlob.precomputeBatchedBlobChallenges(blobs);
|
|
129
|
+
return await BatchedBlob.precomputeBatchedBlobChallenges(blobFieldsPerCheckpoint);
|
|
131
130
|
};
|
|
132
131
|
export const accumulateBlobs = runInSpan('BlockBuilderHelpers', 'accumulateBlobs', async (_span, blobFields, startBlobAccumulator)=>{
|
|
133
|
-
const
|
|
134
|
-
const endBlobAccumulator = await startBlobAccumulator.accumulateBlobs(blobs);
|
|
132
|
+
const endBlobAccumulator = await startBlobAccumulator.accumulateFields(blobFields);
|
|
135
133
|
return endBlobAccumulator;
|
|
136
134
|
});
|
|
137
135
|
export const buildHeaderFromCircuitOutputs = runInSpan('BlockBuilderHelpers', 'buildHeaderFromCircuitOutputs', async (_span, blockRootRollupOutput)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,6CAA6C,EAElD,KAAK,yCAAyC,EAE/C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,yBAAyB,CAAC;AACrF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,KAAK,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAExF,OAAO,EACL,uBAAuB,EACvB,wCAAwC,EAExC,4BAA4B,EAE5B,oCAAoC,EACpC,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,MA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BAAgB;IASpD,+BAA+B;;;;;;;;;;IAsE/B,mBAAmB;IAWnB,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAI3B,6BAA6B;IAQnC,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB;IAKhD,yBAAyB;IAMzB,oBAAoB;IAIpB,UAAU;IAIV,WAAW;IAIX,QAAQ;IAIR,MAAM,CAAC,MAAM,EAAE,MAAM;CA2C7B"}
|
|
@@ -276,7 +276,7 @@ import { buildHeaderFromCircuitOutputs, toProofData } from './block-building-hel
|
|
|
276
276
|
if (!leftRollup) {
|
|
277
277
|
return {
|
|
278
278
|
rollupType: 'rollup-block-root-first-empty-tx',
|
|
279
|
-
inputs: new BlockRootEmptyTxFirstRollupPrivateInputs(l1ToL2Roots, this.lastArchiveTreeSnapshot, this.headerOfLastBlockInPreviousCheckpoint.state, this.constants, this.
|
|
279
|
+
inputs: new BlockRootEmptyTxFirstRollupPrivateInputs(l1ToL2Roots, this.lastArchiveTreeSnapshot, this.headerOfLastBlockInPreviousCheckpoint.state, this.constants, this.timestamp, this.lastL1ToL2MessageSubtreeRootSiblingPath, this.lastArchiveSiblingPath)
|
|
280
280
|
};
|
|
281
281
|
} else if (!rightRollup) {
|
|
282
282
|
return {
|
|
@@ -17,7 +17,6 @@ export declare class CheckpointProvingState {
|
|
|
17
17
|
readonly index: number;
|
|
18
18
|
readonly constants: CheckpointConstantData;
|
|
19
19
|
readonly totalNumBlocks: number;
|
|
20
|
-
private readonly totalNumBlobFields;
|
|
21
20
|
private readonly finalBlobBatchingChallenges;
|
|
22
21
|
private readonly headerOfLastBlockInPreviousCheckpoint;
|
|
23
22
|
private readonly lastArchiveSiblingPath;
|
|
@@ -36,9 +35,9 @@ export declare class CheckpointProvingState {
|
|
|
36
35
|
private blobFields;
|
|
37
36
|
private error;
|
|
38
37
|
readonly firstBlockNumber: number;
|
|
39
|
-
constructor(index: number, constants: CheckpointConstantData, totalNumBlocks: number,
|
|
38
|
+
constructor(index: number, constants: CheckpointConstantData, totalNumBlocks: number, finalBlobBatchingChallenges: FinalBlobBatchingChallenges, headerOfLastBlockInPreviousCheckpoint: BlockHeader, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, l1ToL2Messages: Fr[], lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>, newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>, parentEpoch: EpochProvingState, onBlobAccumulatorSet: (checkpoint: CheckpointProvingState) => void);
|
|
40
39
|
get epochNumber(): number;
|
|
41
|
-
startNewBlock(blockNumber: number, timestamp: UInt64, totalNumTxs: number, lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>):
|
|
40
|
+
startNewBlock(blockNumber: number, timestamp: UInt64, totalNumTxs: number, lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>): BlockProvingState;
|
|
42
41
|
isAcceptingBlocks(): boolean;
|
|
43
42
|
setBlockRootRollupProof(blockIndex: number, provingOutput: PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): TreeNodeLocation;
|
|
44
43
|
tryStartProvingBlockMerge(location: TreeNodeLocation): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/checkpoint-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EAGjC,MAAM,iBAAiB,CAAC;AACzB,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,EAC1B,aAAa,EAAE,6BAA6B,CAC1C,uBAAuB,EACvB,OAAO,yCAAyC,CACjD;IAKI,6BAA6B;IAS7B,4BAA4B,CACjC,aAAa,EAAE,6BAA6B,CAC1C,4BAA4B,EAC5B,OAAO,yCAAyC,CACjD,GACA,gBAAgB;IAKZ,mBAAmB,CAAC,eAAe,EAAE,MAAM;IAYrC,eAAe,CAAC,oBAAoB,EAAE,sBAAsB;IAclE,qBAAqB;IAIrB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB;IAI5C,yBAAyB,CAAC,aAAa,EAAE,gBAAgB;IASzD,2BAA2B,IAAI,WAAW;IAI1C,6BAA6B;IAgC7B,iCAAiC,CAAC,WAAW,EAAE,MAAM;IAKrD,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB;IAI/C,wBAAwB;IAKxB,WAAW;IAIX,QAAQ;IAKR,MAAM;IAIN,MAAM,CAAC,MAAM,EAAE,MAAM;CAW7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpongeBlob,
|
|
1
|
+
import { SpongeBlob, encodeCheckpointBlobDataFromBlocks } from '@aztec/blob-lib';
|
|
2
2
|
import { BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB, NUM_MSGS_PER_BASE_PARITY } from '@aztec/constants';
|
|
3
3
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
4
4
|
import { BLS12Point, Fr } from '@aztec/foundation/fields';
|
|
@@ -11,7 +11,6 @@ export class CheckpointProvingState {
|
|
|
11
11
|
index;
|
|
12
12
|
constants;
|
|
13
13
|
totalNumBlocks;
|
|
14
|
-
totalNumBlobFields;
|
|
15
14
|
finalBlobBatchingChallenges;
|
|
16
15
|
headerOfLastBlockInPreviousCheckpoint;
|
|
17
16
|
lastArchiveSiblingPath;
|
|
@@ -30,13 +29,12 @@ export class CheckpointProvingState {
|
|
|
30
29
|
blobFields;
|
|
31
30
|
error;
|
|
32
31
|
firstBlockNumber;
|
|
33
|
-
constructor(index, constants, totalNumBlocks,
|
|
32
|
+
constructor(index, constants, totalNumBlocks, finalBlobBatchingChallenges, headerOfLastBlockInPreviousCheckpoint, lastArchiveSiblingPath, l1ToL2Messages, // The snapshot and sibling path before the new l1 to l2 message subtree is inserted.
|
|
34
33
|
lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, // The snapshot and sibling path after the new l1 to l2 message subtree is inserted.
|
|
35
34
|
newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath, parentEpoch, onBlobAccumulatorSet){
|
|
36
35
|
this.index = index;
|
|
37
36
|
this.constants = constants;
|
|
38
37
|
this.totalNumBlocks = totalNumBlocks;
|
|
39
|
-
this.totalNumBlobFields = totalNumBlobFields;
|
|
40
38
|
this.finalBlobBatchingChallenges = finalBlobBatchingChallenges;
|
|
41
39
|
this.headerOfLastBlockInPreviousCheckpoint = headerOfLastBlockInPreviousCheckpoint;
|
|
42
40
|
this.lastArchiveSiblingPath = lastArchiveSiblingPath;
|
|
@@ -54,7 +52,7 @@ export class CheckpointProvingState {
|
|
|
54
52
|
get epochNumber() {
|
|
55
53
|
return this.parentEpoch.epochNumber;
|
|
56
54
|
}
|
|
57
|
-
|
|
55
|
+
startNewBlock(blockNumber, timestamp, totalNumTxs, lastArchiveTreeSnapshot, lastArchiveSiblingPath) {
|
|
58
56
|
const index = blockNumber - this.firstBlockNumber;
|
|
59
57
|
if (index >= this.totalNumBlocks) {
|
|
60
58
|
throw new Error(`Unable to start a new block at index ${index}. Expected at most ${this.totalNumBlocks} blocks.`);
|
|
@@ -64,7 +62,7 @@ export class CheckpointProvingState {
|
|
|
64
62
|
// happen in the first block.
|
|
65
63
|
const lastL1ToL2MessageTreeSnapshot = index === 0 ? this.lastL1ToL2MessageTreeSnapshot : this.newL1ToL2MessageTreeSnapshot;
|
|
66
64
|
const lastL1ToL2MessageSubtreeRootSiblingPath = index === 0 ? this.lastL1ToL2MessageSubtreeRootSiblingPath : this.newL1ToL2MessageSubtreeRootSiblingPath;
|
|
67
|
-
const startSpongeBlob = index === 0 ?
|
|
65
|
+
const startSpongeBlob = index === 0 ? SpongeBlob.init() : this.blocks[index - 1]?.getEndSpongeBlob();
|
|
68
66
|
if (!startSpongeBlob) {
|
|
69
67
|
throw new Error('Cannot start a new block before the trees have progressed from the tx effects in the previous block.');
|
|
70
68
|
}
|
|
@@ -120,10 +118,7 @@ export class CheckpointProvingState {
|
|
|
120
118
|
if (this.isAcceptingBlocks() || this.blocks.some((b)=>!b?.hasEndState())) {
|
|
121
119
|
return;
|
|
122
120
|
}
|
|
123
|
-
this.blobFields =
|
|
124
|
-
totalNumBlobFields: this.totalNumBlobFields,
|
|
125
|
-
blocks: this.blocks.map((b)=>b.getBlockBlobData())
|
|
126
|
-
});
|
|
121
|
+
this.blobFields = encodeCheckpointBlobDataFromBlocks(this.blocks.map((b)=>b.getBlockBlobData()));
|
|
127
122
|
this.endBlobAccumulator = await accumulateBlobs(this.blobFields, startBlobAccumulator);
|
|
128
123
|
this.startBlobAccumulator = startBlobAccumulator;
|
|
129
124
|
this.onBlobAccumulatorSet(this);
|
|
@@ -40,7 +40,7 @@ export declare class EpochProvingState {
|
|
|
40
40
|
private provingStateLifecycle;
|
|
41
41
|
readonly cachedChonkVerifierProofs: Map<string, Promise<PublicInputsAndRecursiveProof<PublicChonkVerifierPublicInputs, 531>>>;
|
|
42
42
|
constructor(epochNumber: number, totalNumCheckpoints: number, finalBlobBatchingChallenges: FinalBlobBatchingChallenges, onCheckpointBlobAccumulatorSet: (checkpoint: CheckpointProvingState) => void, completionCallback: (result: ProvingResult) => void, rejectionCallback: (reason: string) => void);
|
|
43
|
-
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, totalNumBlocks: number,
|
|
43
|
+
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, totalNumBlocks: number, previousBlockHeader: BlockHeader, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, l1ToL2Messages: Fr[], lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>, newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>): CheckpointProvingState;
|
|
44
44
|
getCheckpointProvingState(index: number): CheckpointProvingState | undefined;
|
|
45
45
|
getCheckpointProvingStateByBlockNumber(blockNumber: number): CheckpointProvingState | undefined;
|
|
46
46
|
getBlockProvingStateByBlockNumber(blockNumber: number): import("./block-proving-state.js").BlockProvingState | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epoch-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/epoch-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA0B,KAAK,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACxG,OAAO,KAAK,EACV,cAAc,EACd,6CAA6C,EAE7C,yCAAyC,EAC1C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,yBAAyB,CAAC;AACrF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,kCAAkC,EAClC,oCAAoC,EACpC,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,YA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aAAa,EAAE,6BAA6B,CAC1C,4BAA4B,EAC5B,OAAO,yCAAyC,CACjD,GACA,gBAAgB;IAIZ,8BAA8B,CAAC,QAAQ,EAAE,gBAAgB;IASzD,6BAA6B,CAClC,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,6BAA6B,CAC1C,4BAA4B,EAC5B,OAAO,yCAAyC,CACjD;IAKI,yBAAyB;IASzB,kBAAkB,CAAC,aAAa,EAAE,6BAA6B,CAAC,sBAAsB,CAAC;IAIvF,gCAAgC;IAShC,yBAAyB,CAC9B,aAAa,EAAE,6BAA6B,CAC1C,4BAA4B,EAC5B,OAAO,yCAAyC,CACjD;IAKU,mBAAmB;IAwBnB,mBAAmB;IAOzB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB;IAI5C,8BAA8B,CAAC,aAAa,EAAE,gBAAgB;IAS9D,mBAAmB;IAWnB,0BAA0B;IAI1B,mBAAmB,IAAI;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,YAAY,EAAE,sBAAsB,CAAC;QAAC,iBAAiB,EAAE,WAAW,CAAA;KAAE;IAc7G,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB;IAKpD,oBAAoB;IAMpB,MAAM;IAMN,MAAM,CAAC,MAAM,EAAE,MAAM;IAUrB,OAAO,CAAC,MAAM,EAAE,aAAa;CAerC"}
|
|
@@ -47,11 +47,11 @@ var PROVING_STATE_LIFECYCLE = /*#__PURE__*/ function(PROVING_STATE_LIFECYCLE) {
|
|
|
47
47
|
}
|
|
48
48
|
// Adds a block to the proving state, returns its index
|
|
49
49
|
// Will update the proving life cycle if this is the last block
|
|
50
|
-
startNewCheckpoint(checkpointIndex, constants, totalNumBlocks,
|
|
50
|
+
startNewCheckpoint(checkpointIndex, constants, totalNumBlocks, previousBlockHeader, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath) {
|
|
51
51
|
if (checkpointIndex >= this.totalNumCheckpoints) {
|
|
52
52
|
throw new Error(`Unable to start a new checkpoint at index ${checkpointIndex}. Expected at most ${this.totalNumCheckpoints} checkpoints.`);
|
|
53
53
|
}
|
|
54
|
-
const checkpoint = new CheckpointProvingState(checkpointIndex, constants, totalNumBlocks,
|
|
54
|
+
const checkpoint = new CheckpointProvingState(checkpointIndex, constants, totalNumBlocks, this.finalBlobBatchingChallenges, previousBlockHeader, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath, this, this.onCheckpointBlobAccumulatorSet);
|
|
55
55
|
this.checkpoints[checkpointIndex] = checkpoint;
|
|
56
56
|
if (this.checkpoints.filter((c)=>!!c).length === this.totalNumCheckpoints) {
|
|
57
57
|
this.provingStateLifecycle = 1;
|
|
@@ -35,7 +35,7 @@ export declare class ProvingOrchestrator implements EpochProver {
|
|
|
35
35
|
getProverId(): EthAddress;
|
|
36
36
|
stop(): Promise<void>;
|
|
37
37
|
startNewEpoch(epochNumber: number, totalNumCheckpoints: number, finalBlobBatchingChallenges: FinalBlobBatchingChallenges): void;
|
|
38
|
-
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, l1ToL2Messages: Fr[], totalNumBlocks: number,
|
|
38
|
+
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, l1ToL2Messages: Fr[], totalNumBlocks: number, headerOfLastBlockInPreviousCheckpoint: BlockHeader): Promise<void>;
|
|
39
39
|
/**
|
|
40
40
|
* Starts off a new block
|
|
41
41
|
* @param blockNumber - The block number
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAc,MAAM,i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IAkChC,OAAO,CAAC,gCAAgC;IAUxC,OAAO,CAAC,wBAAwB;IAgChC,OAAO,CAAC,uBAAuB;IA6B/B,OAAO,CAAC,2BAA2B;IA4DnC,OAAO,CAAC,4BAA4B;IA+BpC,OAAO,CAAC,mBAAmB;IAkC3B,OAAO,CAAC,iBAAiB;IA4BzB,OAAO,CAAC,8BAA8B;IAatC,OAAO,CAAC,8BAA8B;IAStC,OAAO,CAAC,mCAAmC;IAa3C,OAAO,CAAC,mCAAmC;IAQ3C,OAAO,CAAC,wCAAwC;IAahD,OAAO,CAAC,yBAAyB;IASjC;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAoDjB,OAAO,CAAC,yBAAyB;CAWlC"}
|
|
@@ -76,7 +76,7 @@ const logger = createLogger('prover-client:orchestrator');
|
|
|
76
76
|
this.provingState = new EpochProvingState(epochNumber, totalNumCheckpoints, finalBlobBatchingChallenges, (provingState)=>this.checkAndEnqueueCheckpointRootRollup(provingState), resolve, reject);
|
|
77
77
|
this.provingPromise = promise;
|
|
78
78
|
}
|
|
79
|
-
async startNewCheckpoint(checkpointIndex, constants, l1ToL2Messages, totalNumBlocks,
|
|
79
|
+
async startNewCheckpoint(checkpointIndex, constants, l1ToL2Messages, totalNumBlocks, headerOfLastBlockInPreviousCheckpoint) {
|
|
80
80
|
if (!this.provingState) {
|
|
81
81
|
throw new Error('Empty epoch proving state. Call startNewEpoch before starting a checkpoint.');
|
|
82
82
|
}
|
|
@@ -92,7 +92,7 @@ const logger = createLogger('prover-client:orchestrator');
|
|
|
92
92
|
const lastArchiveSiblingPath = await getLastSiblingPath(MerkleTreeId.ARCHIVE, db);
|
|
93
93
|
// Insert all the l1 to l2 messages into the db. And get the states before and after the insertion.
|
|
94
94
|
const { lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath } = await this.updateL1ToL2MessageTree(l1ToL2Messages, db);
|
|
95
|
-
this.provingState.startNewCheckpoint(checkpointIndex, constants, totalNumBlocks,
|
|
95
|
+
this.provingState.startNewCheckpoint(checkpointIndex, constants, totalNumBlocks, headerOfLastBlockInPreviousCheckpoint, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath);
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* Starts off a new block
|
|
@@ -123,7 +123,7 @@ const logger = createLogger('prover-client:orchestrator');
|
|
|
123
123
|
// Get archive snapshot and sibling path before any txs in this block lands.
|
|
124
124
|
const lastArchiveTreeSnapshot = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
|
|
125
125
|
const lastArchiveSiblingPath = await getRootTreeSiblingPath(MerkleTreeId.ARCHIVE, db);
|
|
126
|
-
const blockProvingState =
|
|
126
|
+
const blockProvingState = checkpointProvingState.startNewBlock(blockNumber, timestamp, totalNumTxs, lastArchiveTreeSnapshot, lastArchiveSiblingPath);
|
|
127
127
|
// Enqueue base parity circuits for the first block in the checkpoint.
|
|
128
128
|
if (blockProvingState.index === 0) {
|
|
129
129
|
for(let i = 0; i < NUM_BASE_PARITY_PER_ROOT_PARITY; i++){
|
|
@@ -14,7 +14,7 @@ export declare class ServerEpochProver implements EpochProver {
|
|
|
14
14
|
private orchestrator;
|
|
15
15
|
constructor(facade: BrokerCircuitProverFacade, orchestrator: ProvingOrchestrator);
|
|
16
16
|
startNewEpoch(epochNumber: number, totalNumCheckpoints: number, finalBlobBatchingChallenges: FinalBlobBatchingChallenges): void;
|
|
17
|
-
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, l1ToL2Messages: Fr[], totalNumBlocks: number,
|
|
17
|
+
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, l1ToL2Messages: Fr[], totalNumBlocks: number, headerOfLastBlockInPreviousCheckpoint: BlockHeader): Promise<void>;
|
|
18
18
|
startChonkVerifierCircuits(txs: Tx[]): Promise<void>;
|
|
19
19
|
setBlockCompleted(blockNumber: number, expectedBlockHeader?: BlockHeader): Promise<BlockHeader>;
|
|
20
20
|
finalizeEpoch(): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-epoch-prover.d.ts","sourceRoot":"","sources":["../../src/prover-client/server-epoch-prover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAE3F,kEAAkE;AAClE,qBAAa,iBAAkB,YAAW,WAAW;IAEjD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;gBADZ,MAAM,EAAE,yBAAyB,EACjC,YAAY,EAAE,mBAAmB;IAG3C,aAAa,CACX,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,MAAM,EAC3B,2BAA2B,EAAE,2BAA2B,GACvD,IAAI;IAIP,kBAAkB,CAChB,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,sBAAsB,EACjC,cAAc,EA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AE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAGpD,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAG/F,aAAa,IAAI,OAAO,CAAC;QAAE,YAAY,EAAE,sBAAsB,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;QAAC,iBAAiB,EAAE,WAAW,CAAA;KAAE,CAAC;IAGhH,MAAM,IAAI,IAAI;IAGd,WAAW,IAAI,UAAU;IAGnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAGzF,MAAM,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1C"}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
this.orchestrator.startNewEpoch(epochNumber, totalNumCheckpoints, finalBlobBatchingChallenges);
|
|
10
10
|
this.facade.start();
|
|
11
11
|
}
|
|
12
|
-
startNewCheckpoint(checkpointIndex, constants, l1ToL2Messages, totalNumBlocks,
|
|
13
|
-
return this.orchestrator.startNewCheckpoint(checkpointIndex, constants, l1ToL2Messages, totalNumBlocks,
|
|
12
|
+
startNewCheckpoint(checkpointIndex, constants, l1ToL2Messages, totalNumBlocks, headerOfLastBlockInPreviousCheckpoint) {
|
|
13
|
+
return this.orchestrator.startNewCheckpoint(checkpointIndex, constants, l1ToL2Messages, totalNumBlocks, headerOfLastBlockInPreviousCheckpoint);
|
|
14
14
|
}
|
|
15
15
|
startChonkVerifierCircuits(txs) {
|
|
16
16
|
return this.orchestrator.startChonkVerifierCircuits(txs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/prover-client",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251122",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -67,19 +67,19 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
71
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
72
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
73
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
74
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
75
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
76
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
77
|
-
"@aztec/noir-types": "3.0.0-nightly.
|
|
78
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
79
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
80
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
81
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
82
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
70
|
+
"@aztec/bb-prover": "3.0.0-nightly.20251122",
|
|
71
|
+
"@aztec/blob-lib": "3.0.0-nightly.20251122",
|
|
72
|
+
"@aztec/constants": "3.0.0-nightly.20251122",
|
|
73
|
+
"@aztec/ethereum": "3.0.0-nightly.20251122",
|
|
74
|
+
"@aztec/foundation": "3.0.0-nightly.20251122",
|
|
75
|
+
"@aztec/kv-store": "3.0.0-nightly.20251122",
|
|
76
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251122",
|
|
77
|
+
"@aztec/noir-types": "3.0.0-nightly.20251122",
|
|
78
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251122",
|
|
79
|
+
"@aztec/simulator": "3.0.0-nightly.20251122",
|
|
80
|
+
"@aztec/stdlib": "3.0.0-nightly.20251122",
|
|
81
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251122",
|
|
82
|
+
"@aztec/world-state": "3.0.0-nightly.20251122",
|
|
83
83
|
"@google-cloud/storage": "^7.15.0",
|
|
84
84
|
"@iarna/toml": "^2.2.5",
|
|
85
85
|
"commander": "^12.1.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"zod": "^3.23.8"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
92
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251122",
|
|
93
93
|
"@jest/globals": "^30.0.0",
|
|
94
94
|
"@types/jest": "^30.0.0",
|
|
95
95
|
"@types/node": "^22.15.17",
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SpongeBlob,
|
|
3
|
-
computeBlobsHashFromBlobs,
|
|
4
|
-
getBlobsPerL1Block,
|
|
5
|
-
getTotalNumBlobFieldsFromTxs,
|
|
6
|
-
} from '@aztec/blob-lib';
|
|
1
|
+
import { SpongeBlob, computeBlobsHashFromBlobs, encodeCheckpointEndMarker, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
7
2
|
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
8
3
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
9
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -76,9 +71,7 @@ export class LightweightBlockFactory implements IBlockFactory {
|
|
|
76
71
|
const state = await this.db.getStateReference();
|
|
77
72
|
|
|
78
73
|
const txs = this.txs ?? [];
|
|
79
|
-
const
|
|
80
|
-
const totalNumBlobFields = getTotalNumBlobFieldsFromTxs([txEffects.map(tx => tx.getTxStartMarker())]);
|
|
81
|
-
const startSpongeBlob = await SpongeBlob.init(totalNumBlobFields);
|
|
74
|
+
const startSpongeBlob = SpongeBlob.init();
|
|
82
75
|
|
|
83
76
|
const { header, body, blockBlobFields } = await buildHeaderAndBodyFromTxs(
|
|
84
77
|
txs,
|
|
@@ -95,12 +88,15 @@ export class LightweightBlockFactory implements IBlockFactory {
|
|
|
95
88
|
const newArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db);
|
|
96
89
|
|
|
97
90
|
const outHash = computeBlockOutHash(txs.map(tx => tx.txEffect.l2ToL1Msgs));
|
|
98
|
-
const inHash =
|
|
99
|
-
const
|
|
91
|
+
const inHash = computeInHashFromL1ToL2Messages(this.l1ToL2Messages!);
|
|
92
|
+
const numBlobFields = blockBlobFields.length + 1;
|
|
93
|
+
const blobFields = blockBlobFields.concat([encodeCheckpointEndMarker({ numBlobFields })]);
|
|
100
94
|
const blobsHash = computeBlobsHashFromBlobs(getBlobsPerL1Block(blobFields));
|
|
95
|
+
const blockHeaderHash = await header.hash();
|
|
101
96
|
const contentCommitment = new ContentCommitment(blobsHash, inHash, outHash);
|
|
102
97
|
const l2BlockHeader = L2BlockHeader.from({
|
|
103
98
|
...header,
|
|
99
|
+
blockHeadersHash: blockHeaderHash,
|
|
104
100
|
contentCommitment,
|
|
105
101
|
});
|
|
106
102
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpongeBlob, computeBlobsHashFromBlobs, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
1
|
+
import { SpongeBlob, computeBlobsHashFromBlobs, encodeCheckpointEndMarker, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
2
2
|
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
3
3
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -7,10 +7,9 @@ import { L2BlockNew } from '@aztec/stdlib/block';
|
|
|
7
7
|
import { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
8
8
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
9
9
|
import { computeCheckpointOutHash, computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
|
|
10
|
-
import { CheckpointConstantData, CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
10
|
+
import { CheckpointConstantData, CheckpointHeader, computeBlockHeadersHash } from '@aztec/stdlib/rollup';
|
|
11
11
|
import { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
12
12
|
import { ContentCommitment, type GlobalVariables, type ProcessedTx, StateReference } from '@aztec/stdlib/tx';
|
|
13
|
-
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
14
13
|
|
|
15
14
|
import {
|
|
16
15
|
buildHeaderAndBodyFromTxs,
|
|
@@ -26,42 +25,42 @@ import {
|
|
|
26
25
|
*/
|
|
27
26
|
export class LightweightCheckpointBuilder {
|
|
28
27
|
private readonly logger = createLogger('lightweight-checkpoint-builder');
|
|
29
|
-
|
|
30
|
-
private l1ToL2Messages: Fr[] = [];
|
|
28
|
+
|
|
31
29
|
private lastArchives: AppendOnlyTreeSnapshot[] = [];
|
|
32
|
-
private spongeBlob
|
|
30
|
+
private spongeBlob: SpongeBlob;
|
|
33
31
|
private blocks: L2BlockNew[] = [];
|
|
34
32
|
private blobFields: Fr[] = [];
|
|
35
33
|
|
|
36
34
|
constructor(
|
|
35
|
+
private constants: CheckpointConstantData,
|
|
36
|
+
private l1ToL2Messages: Fr[],
|
|
37
37
|
private db: MerkleTreeWriteOperations,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
) {
|
|
39
|
+
this.spongeBlob = SpongeBlob.init();
|
|
40
|
+
this.logger.debug('Starting new checkpoint', { constants: constants.toInspect(), l1ToL2Messages });
|
|
41
|
+
}
|
|
40
42
|
|
|
41
|
-
async startNewCheckpoint(
|
|
43
|
+
static async startNewCheckpoint(
|
|
42
44
|
constants: CheckpointConstantData,
|
|
43
45
|
l1ToL2Messages: Fr[],
|
|
44
|
-
|
|
45
|
-
): Promise<
|
|
46
|
-
this.logger.debug('Starting new checkpoint', { constants: constants.toInspect(), l1ToL2Messages });
|
|
47
|
-
this.constants = constants;
|
|
48
|
-
|
|
46
|
+
db: MerkleTreeWriteOperations,
|
|
47
|
+
): Promise<LightweightCheckpointBuilder> {
|
|
49
48
|
// Insert l1-to-l2 messages into the tree.
|
|
50
|
-
|
|
51
|
-
await this.db.appendLeaves(
|
|
49
|
+
await db.appendLeaves(
|
|
52
50
|
MerkleTreeId.L1_TO_L2_MESSAGE_TREE,
|
|
53
51
|
padArrayEnd<Fr, number>(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP),
|
|
54
52
|
);
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
this.spongeBlob = await SpongeBlob.init(totalNumBlobFields);
|
|
58
|
-
this.blocks = [];
|
|
59
|
-
this.blobFields = [new Fr(totalNumBlobFields)];
|
|
54
|
+
return new LightweightCheckpointBuilder(constants, l1ToL2Messages, db);
|
|
60
55
|
}
|
|
61
56
|
|
|
62
57
|
async addBlock(globalVariables: GlobalVariables, endState: StateReference, txs: ProcessedTx[]): Promise<L2BlockNew> {
|
|
63
58
|
const isFirstBlock = this.blocks.length === 0;
|
|
64
|
-
|
|
59
|
+
if (isFirstBlock) {
|
|
60
|
+
this.lastArchives.push(await getTreeSnapshot(MerkleTreeId.ARCHIVE, this.db));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const lastArchive = this.lastArchives.at(-1)!;
|
|
65
64
|
|
|
66
65
|
for (const tx of txs) {
|
|
67
66
|
await insertSideEffects(tx, this.db);
|
|
@@ -101,20 +100,20 @@ export class LightweightCheckpointBuilder {
|
|
|
101
100
|
if (!this.blocks.length) {
|
|
102
101
|
throw new Error('No blocks added to checkpoint.');
|
|
103
102
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
103
|
+
|
|
104
|
+
const numBlobFields = this.blobFields.length + 1; // +1 for the checkpoint end marker.
|
|
105
|
+
const checkpointEndMarker = encodeCheckpointEndMarker({ numBlobFields });
|
|
106
|
+
this.blobFields.push(checkpointEndMarker);
|
|
109
107
|
|
|
110
108
|
const blocks = this.blocks;
|
|
109
|
+
const blockHeadersHash = await computeBlockHeadersHash(blocks.map(block => block.header));
|
|
111
110
|
|
|
112
111
|
const newArchive = this.lastArchives[this.lastArchives.length - 1];
|
|
113
112
|
|
|
114
113
|
const blobs = getBlobsPerL1Block(this.blobFields);
|
|
115
114
|
const blobsHash = computeBlobsHashFromBlobs(blobs);
|
|
116
115
|
|
|
117
|
-
const inHash =
|
|
116
|
+
const inHash = computeInHashFromL1ToL2Messages(this.l1ToL2Messages);
|
|
118
117
|
|
|
119
118
|
const outHash = computeCheckpointOutHash(blocks.map(block => block.body.txEffects.map(tx => tx.l2ToL1Msgs)));
|
|
120
119
|
|
|
@@ -127,6 +126,7 @@ export class LightweightCheckpointBuilder {
|
|
|
127
126
|
|
|
128
127
|
const header = CheckpointHeader.from({
|
|
129
128
|
lastArchiveRoot: this.lastArchives[0].root,
|
|
129
|
+
blockHeadersHash,
|
|
130
130
|
contentCommitment: new ContentCommitment(blobsHash, inHash, outHash),
|
|
131
131
|
slotNumber: constants.slotNumber,
|
|
132
132
|
timestamp,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { BBProverConfig } from '@aztec/bb-prover';
|
|
2
2
|
import { TestCircuitProver } from '@aztec/bb-prover';
|
|
3
|
-
import { getTotalNumBlobFieldsFromTxs } from '@aztec/blob-lib';
|
|
4
3
|
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
5
4
|
import { padArrayEnd, times, timesAsync } from '@aztec/foundation/collection';
|
|
6
5
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -239,12 +238,7 @@ export class TestContext {
|
|
|
239
238
|
});
|
|
240
239
|
|
|
241
240
|
const cleanFork = await this.worldState.fork();
|
|
242
|
-
const builder =
|
|
243
|
-
|
|
244
|
-
const totalNumBlobFields = getTotalNumBlobFieldsFromTxs(
|
|
245
|
-
blockTxs.map(txs => txs.map(tx => tx.txEffect.getTxStartMarker())),
|
|
246
|
-
);
|
|
247
|
-
await builder.startNewCheckpoint(constants, l1ToL2Messages, totalNumBlobFields);
|
|
241
|
+
const builder = await LightweightCheckpointBuilder.startNewCheckpoint(constants, l1ToL2Messages, cleanFork);
|
|
248
242
|
|
|
249
243
|
// Add tx effects to db and build block headers.
|
|
250
244
|
const blocks = [];
|
|
@@ -272,7 +266,6 @@ export class TestContext {
|
|
|
272
266
|
header: checkpoint.header,
|
|
273
267
|
blocks,
|
|
274
268
|
l1ToL2Messages,
|
|
275
|
-
totalNumBlobFields,
|
|
276
269
|
previousBlockHeader,
|
|
277
270
|
};
|
|
278
271
|
}
|
|
@@ -261,16 +261,14 @@ export const buildBlobHints = (blobFields: Fr[]) => {
|
|
|
261
261
|
};
|
|
262
262
|
|
|
263
263
|
export const buildFinalBlobChallenges = async (blobFieldsPerCheckpoint: Fr[][]) => {
|
|
264
|
-
|
|
265
|
-
return await BatchedBlob.precomputeBatchedBlobChallenges(blobs);
|
|
264
|
+
return await BatchedBlob.precomputeBatchedBlobChallenges(blobFieldsPerCheckpoint);
|
|
266
265
|
};
|
|
267
266
|
|
|
268
267
|
export const accumulateBlobs = runInSpan(
|
|
269
268
|
'BlockBuilderHelpers',
|
|
270
269
|
'accumulateBlobs',
|
|
271
270
|
async (_span: Span, blobFields: Fr[], startBlobAccumulator: BatchedBlobAccumulator) => {
|
|
272
|
-
const
|
|
273
|
-
const endBlobAccumulator = await startBlobAccumulator.accumulateBlobs(blobs);
|
|
271
|
+
const endBlobAccumulator = await startBlobAccumulator.accumulateFields(blobFields);
|
|
274
272
|
return endBlobAccumulator;
|
|
275
273
|
},
|
|
276
274
|
);
|
|
@@ -346,7 +346,6 @@ export class BlockProvingState {
|
|
|
346
346
|
this.lastArchiveTreeSnapshot,
|
|
347
347
|
this.headerOfLastBlockInPreviousCheckpoint.state,
|
|
348
348
|
this.constants,
|
|
349
|
-
this.startSpongeBlob,
|
|
350
349
|
this.timestamp,
|
|
351
350
|
this.lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
352
351
|
this.lastArchiveSiblingPath,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
BatchedBlobAccumulator,
|
|
3
3
|
type FinalBlobBatchingChallenges,
|
|
4
4
|
SpongeBlob,
|
|
5
|
-
|
|
5
|
+
encodeCheckpointBlobDataFromBlocks,
|
|
6
6
|
} from '@aztec/blob-lib';
|
|
7
7
|
import {
|
|
8
8
|
type ARCHIVE_HEIGHT,
|
|
@@ -54,7 +54,6 @@ export class CheckpointProvingState {
|
|
|
54
54
|
public readonly index: number,
|
|
55
55
|
public readonly constants: CheckpointConstantData,
|
|
56
56
|
public readonly totalNumBlocks: number,
|
|
57
|
-
private readonly totalNumBlobFields: number,
|
|
58
57
|
private readonly finalBlobBatchingChallenges: FinalBlobBatchingChallenges,
|
|
59
58
|
private readonly headerOfLastBlockInPreviousCheckpoint: BlockHeader,
|
|
60
59
|
private readonly lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
@@ -82,13 +81,13 @@ export class CheckpointProvingState {
|
|
|
82
81
|
return this.parentEpoch.epochNumber;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
public
|
|
84
|
+
public startNewBlock(
|
|
86
85
|
blockNumber: number,
|
|
87
86
|
timestamp: UInt64,
|
|
88
87
|
totalNumTxs: number,
|
|
89
88
|
lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
90
89
|
lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
91
|
-
):
|
|
90
|
+
): BlockProvingState {
|
|
92
91
|
const index = blockNumber - this.firstBlockNumber;
|
|
93
92
|
if (index >= this.totalNumBlocks) {
|
|
94
93
|
throw new Error(`Unable to start a new block at index ${index}. Expected at most ${this.totalNumBlocks} blocks.`);
|
|
@@ -102,8 +101,7 @@ export class CheckpointProvingState {
|
|
|
102
101
|
const lastL1ToL2MessageSubtreeRootSiblingPath =
|
|
103
102
|
index === 0 ? this.lastL1ToL2MessageSubtreeRootSiblingPath : this.newL1ToL2MessageSubtreeRootSiblingPath;
|
|
104
103
|
|
|
105
|
-
const startSpongeBlob =
|
|
106
|
-
index === 0 ? await SpongeBlob.init(this.totalNumBlobFields) : this.blocks[index - 1]?.getEndSpongeBlob();
|
|
104
|
+
const startSpongeBlob = index === 0 ? SpongeBlob.init() : this.blocks[index - 1]?.getEndSpongeBlob();
|
|
107
105
|
if (!startSpongeBlob) {
|
|
108
106
|
throw new Error(
|
|
109
107
|
'Cannot start a new block before the trees have progressed from the tx effects in the previous block.',
|
|
@@ -200,10 +198,7 @@ export class CheckpointProvingState {
|
|
|
200
198
|
return;
|
|
201
199
|
}
|
|
202
200
|
|
|
203
|
-
this.blobFields =
|
|
204
|
-
totalNumBlobFields: this.totalNumBlobFields,
|
|
205
|
-
blocks: this.blocks.map(b => b!.getBlockBlobData()),
|
|
206
|
-
});
|
|
201
|
+
this.blobFields = encodeCheckpointBlobDataFromBlocks(this.blocks.map(b => b!.getBlockBlobData()));
|
|
207
202
|
this.endBlobAccumulator = await accumulateBlobs(this.blobFields!, startBlobAccumulator);
|
|
208
203
|
this.startBlobAccumulator = startBlobAccumulator;
|
|
209
204
|
|
|
@@ -83,7 +83,6 @@ export class EpochProvingState {
|
|
|
83
83
|
checkpointIndex: number,
|
|
84
84
|
constants: CheckpointConstantData,
|
|
85
85
|
totalNumBlocks: number,
|
|
86
|
-
totalNumBlobFields: number,
|
|
87
86
|
previousBlockHeader: BlockHeader,
|
|
88
87
|
lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
89
88
|
l1ToL2Messages: Fr[],
|
|
@@ -102,7 +101,6 @@ export class EpochProvingState {
|
|
|
102
101
|
checkpointIndex,
|
|
103
102
|
constants,
|
|
104
103
|
totalNumBlocks,
|
|
105
|
-
totalNumBlobFields,
|
|
106
104
|
this.finalBlobBatchingChallenges,
|
|
107
105
|
previousBlockHeader,
|
|
108
106
|
lastArchiveSiblingPath,
|
|
@@ -146,7 +146,6 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
146
146
|
constants: CheckpointConstantData,
|
|
147
147
|
l1ToL2Messages: Fr[],
|
|
148
148
|
totalNumBlocks: number,
|
|
149
|
-
totalNumBlobFields: number,
|
|
150
149
|
headerOfLastBlockInPreviousCheckpoint: BlockHeader,
|
|
151
150
|
) {
|
|
152
151
|
if (!this.provingState) {
|
|
@@ -179,7 +178,6 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
179
178
|
checkpointIndex,
|
|
180
179
|
constants,
|
|
181
180
|
totalNumBlocks,
|
|
182
|
-
totalNumBlobFields,
|
|
183
181
|
headerOfLastBlockInPreviousCheckpoint,
|
|
184
182
|
lastArchiveSiblingPath,
|
|
185
183
|
l1ToL2Messages,
|
|
@@ -229,7 +227,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
229
227
|
const lastArchiveTreeSnapshot = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
|
|
230
228
|
const lastArchiveSiblingPath = await getRootTreeSiblingPath(MerkleTreeId.ARCHIVE, db);
|
|
231
229
|
|
|
232
|
-
const blockProvingState =
|
|
230
|
+
const blockProvingState = checkpointProvingState.startNewBlock(
|
|
233
231
|
blockNumber,
|
|
234
232
|
timestamp,
|
|
235
233
|
totalNumTxs,
|
|
@@ -30,7 +30,6 @@ export class ServerEpochProver implements EpochProver {
|
|
|
30
30
|
constants: CheckpointConstantData,
|
|
31
31
|
l1ToL2Messages: Fr[],
|
|
32
32
|
totalNumBlocks: number,
|
|
33
|
-
totalNumBlobFields: number,
|
|
34
33
|
headerOfLastBlockInPreviousCheckpoint: BlockHeader,
|
|
35
34
|
): Promise<void> {
|
|
36
35
|
return this.orchestrator.startNewCheckpoint(
|
|
@@ -38,7 +37,6 @@ export class ServerEpochProver implements EpochProver {
|
|
|
38
37
|
constants,
|
|
39
38
|
l1ToL2Messages,
|
|
40
39
|
totalNumBlocks,
|
|
41
|
-
totalNumBlobFields,
|
|
42
40
|
headerOfLastBlockInPreviousCheckpoint,
|
|
43
41
|
);
|
|
44
42
|
}
|