@aztec/prover-client 3.0.0-nightly.20251026 → 3.0.0-nightly.20251031
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.js +1 -1
- package/dest/config.js +1 -1
- package/dest/mocks/fixtures.js +1 -1
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +8 -9
- package/dest/orchestrator/block-building-helpers.d.ts +9 -11
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +35 -45
- package/dest/orchestrator/block-proving-state.d.ts +1 -1
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +2 -3
- package/dest/orchestrator/checkpoint-proving-state.d.ts +3 -2
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/checkpoint-proving-state.js +12 -9
- package/dest/orchestrator/epoch-proving-state.d.ts +2 -2
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +4 -4
- package/dest/orchestrator/orchestrator.d.ts +5 -5
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +34 -35
- package/dest/orchestrator/tx-proving-state.d.ts +4 -4
- package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/tx-proving-state.js +12 -12
- 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/dest/proving_broker/broker_prover_facade.d.ts +2 -2
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +2 -2
- package/dest/proving_broker/proving_broker.js +2 -2
- package/dest/proving_broker/proving_job_controller.js +2 -2
- package/dest/test/mock_prover.d.ts +2 -2
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +3 -3
- package/package.json +15 -15
- package/src/block-factory/light.ts +1 -1
- package/src/config.ts +1 -1
- package/src/mocks/fixtures.ts +1 -1
- package/src/mocks/test_context.ts +8 -9
- package/src/orchestrator/block-building-helpers.ts +43 -52
- package/src/orchestrator/block-proving-state.ts +2 -3
- package/src/orchestrator/checkpoint-proving-state.ts +14 -10
- package/src/orchestrator/epoch-proving-state.ts +7 -5
- package/src/orchestrator/orchestrator.ts +50 -42
- package/src/orchestrator/tx-proving-state.ts +20 -16
- package/src/prover-client/server-epoch-prover.ts +2 -2
- package/src/proving_broker/broker_prover_facade.ts +9 -7
- package/src/proving_broker/proving_broker.ts +2 -2
- package/src/proving_broker/proving_job_controller.ts +2 -2
- package/src/test/mock_prover.ts +9 -7
|
@@ -87,7 +87,7 @@ import { buildHeaderAndBodyFromTxs, getTreeSnapshot, insertSideEffectsAndBuildBa
|
|
|
87
87
|
// startSpongeBlob and proverId are only used for constructing private inputs of the base rollup.
|
|
88
88
|
// Their values don't matter here because we are not using the return private inputs to build the block.
|
|
89
89
|
const proverId = Fr.ZERO;
|
|
90
|
-
await insertSideEffectsAndBuildBaseRollupHints(tx, lastArchive, l1ToL2MessageTree, startSpongeBlob?.clone() ?? SpongeBlob.
|
|
90
|
+
await insertSideEffectsAndBuildBaseRollupHints(tx, lastArchive, l1ToL2MessageTree, startSpongeBlob?.clone() ?? SpongeBlob.empty(), proverId, db);
|
|
91
91
|
}
|
|
92
92
|
await builder.addTxs(txs);
|
|
93
93
|
return await builder.setBlockCompleted();
|
package/dest/config.js
CHANGED
|
@@ -25,7 +25,7 @@ export const bbConfigMappings = {
|
|
|
25
25
|
},
|
|
26
26
|
numConcurrentIVCVerifiers: {
|
|
27
27
|
env: 'BB_NUM_IVC_VERIFIERS',
|
|
28
|
-
description: 'Max number of
|
|
28
|
+
description: 'Max number of chonk verifiers to run concurrently',
|
|
29
29
|
...numberConfigHelper(8)
|
|
30
30
|
},
|
|
31
31
|
bbIVCConcurrency: {
|
package/dest/mocks/fixtures.js
CHANGED
|
@@ -18,7 +18,7 @@ const { BB_RELEASE_DIR = 'cpp/build/bin', TEMP_DIR = '/tmp', BB_BINARY_PATH = ''
|
|
|
18
18
|
// Determines if we have access to the bb binary and a tmp folder for temp files
|
|
19
19
|
export const getEnvironmentConfig = async (logger)=>{
|
|
20
20
|
try {
|
|
21
|
-
const expectedBBPath = BB_BINARY_PATH ? BB_BINARY_PATH : `${path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../barretenberg/', BB_RELEASE_DIR)}/bb`;
|
|
21
|
+
const expectedBBPath = BB_BINARY_PATH ? BB_BINARY_PATH : `${path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../barretenberg/', BB_RELEASE_DIR)}/bb-avm`;
|
|
22
22
|
await fs.access(expectedBBPath, fs.constants.R_OK);
|
|
23
23
|
const tempWorkingDirectory = `${TEMP_DIR}/${randomBytes(4).toString('hex')}`;
|
|
24
24
|
const bbWorkingDirectory = BB_WORKING_DIRECTORY ? BB_WORKING_DIRECTORY : `${tempWorkingDirectory}/bb`;
|
|
@@ -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;AAKvD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,OAAO,EA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BAAoC,EACpC,mBAAgC,GACjC,GAAE;QACD,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,uBAAuB,CAAC,EAAE,CACxB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,KACpB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAC3E,mBAAmB,CAAC,EAAE,CACpB,oBAAoB,EAAE,eAAe,EACrC,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACvD;;oBAiCkB,WAAW;iBAAO,WAAW,EAAE;;;;;IA2B5C,sBAAsB,CACjC,GAAG,EAAE,EAAE,EAAE,EACT,EACE,eAA4B,EAC5B,iBAAqB,EACrB,kBAAkB,GACnB,GAAE;QACD,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;KAC1C;YAqBM,YAAY;CAuB3B;AAED,cAAM,uBAAwB,SAAQ,mBAAmB;IAChD,2CAA2C,UAAS;cAIxC,kCAAkC,CAAC,YAAY,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAMtG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TestCircuitProver } from '@aztec/bb-prover';
|
|
1
2
|
import { SpongeBlob } from '@aztec/blob-lib';
|
|
2
3
|
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
3
4
|
import { padArrayEnd, times, timesParallel } from '@aztec/foundation/collection';
|
|
@@ -10,15 +11,13 @@ import { SimpleContractDataSource } from '@aztec/simulator/public/fixtures';
|
|
|
10
11
|
import { PublicProcessorFactory } from '@aztec/simulator/server';
|
|
11
12
|
import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
12
13
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
13
|
-
import { EthAddress
|
|
14
|
+
import { EthAddress } from '@aztec/stdlib/block';
|
|
15
|
+
import { getCheckpointBlobFields } from '@aztec/stdlib/checkpoint';
|
|
14
16
|
import { makeBloatedProcessedTx } from '@aztec/stdlib/testing';
|
|
15
17
|
import { MerkleTreeId, PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
16
18
|
import { TreeSnapshots } from '@aztec/stdlib/tx';
|
|
17
19
|
import { NativeWorldStateService } from '@aztec/world-state/native';
|
|
18
20
|
import { promises as fs } from 'fs';
|
|
19
|
-
// TODO(#12613) This means of sharing test code is not ideal.
|
|
20
|
-
// eslint-disable-next-line import/no-relative-packages
|
|
21
|
-
import { TestCircuitProver } from '../../../bb-prover/src/test/test_circuit_prover.js';
|
|
22
21
|
import { buildBlockWithCleanDB } from '../block-factory/light.js';
|
|
23
22
|
import { getTreeSnapshot } from '../orchestrator/block-building-helpers.js';
|
|
24
23
|
import { ProvingOrchestrator } from '../orchestrator/index.js';
|
|
@@ -186,9 +185,8 @@ export class TestContext {
|
|
|
186
185
|
...makeProcessedTxOpts(blockGlobalVariables[blockIndex], txIndexOffset + txIndex)
|
|
187
186
|
}));
|
|
188
187
|
});
|
|
189
|
-
const
|
|
190
|
-
const
|
|
191
|
-
const spongeBlobState = SpongeBlob.init(totalNumBlobFields);
|
|
188
|
+
const blobFields = getCheckpointBlobFields(blockTxs.map((txs)=>txs.map((tx)=>tx.txEffect)));
|
|
189
|
+
const spongeBlobState = await SpongeBlob.init(blobFields.length);
|
|
192
190
|
const blocks = [];
|
|
193
191
|
for(let i = 0; i < numBlocks; i++){
|
|
194
192
|
const isFirstBlock = i === 0;
|
|
@@ -202,7 +200,8 @@ export class TestContext {
|
|
|
202
200
|
const header = block.getBlockHeader();
|
|
203
201
|
this.headers.set(blockNumber, header);
|
|
204
202
|
await this.worldState.handleL2BlockAndMessages(block, blockMsgs, isFirstBlock);
|
|
205
|
-
|
|
203
|
+
const blockBlobFields = block.body.toBlobFields();
|
|
204
|
+
await spongeBlobState.absorb(blockBlobFields);
|
|
206
205
|
blocks.push({
|
|
207
206
|
header,
|
|
208
207
|
txs
|
|
@@ -211,7 +210,7 @@ export class TestContext {
|
|
|
211
210
|
return {
|
|
212
211
|
blocks,
|
|
213
212
|
l1ToL2Messages,
|
|
214
|
-
blobFields
|
|
213
|
+
blobFields
|
|
215
214
|
};
|
|
216
215
|
}
|
|
217
216
|
async processPublicFunctions(txs, { maxTransactions = txs.length, numL1ToL2Messages = 0, contractDataSource } = {}) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BatchedBlobAccumulator,
|
|
2
|
-
import {
|
|
1
|
+
import { BatchedBlobAccumulator, SpongeBlob } from '@aztec/blob-lib';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { type Bufferable, type Tuple } from '@aztec/foundation/serialize';
|
|
4
4
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
5
5
|
import { Body, L2BlockHeader } from '@aztec/stdlib/block';
|
|
6
6
|
import type { MerkleTreeWriteOperations, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
7
7
|
import { ProofData, RecursiveProof } from '@aztec/stdlib/proofs';
|
|
8
|
-
import { BlockRollupPublicInputs, PrivateBaseRollupHints, PublicBaseRollupHints,
|
|
8
|
+
import { BlockRollupPublicInputs, PrivateBaseRollupHints, PublicBaseRollupHints, PublicChonkVerifierPrivateInputs } from '@aztec/stdlib/rollup';
|
|
9
9
|
import { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
10
10
|
import { BlockHeader, GlobalVariables, PartialStateReference, type ProcessedTx, Tx } from '@aztec/stdlib/tx';
|
|
11
11
|
import type { MerkleTreeReadOperations } from '@aztec/world-state';
|
|
@@ -18,13 +18,13 @@ type BaseTreeNames = 'NoteHashTree' | 'ContractTree' | 'NullifierTree' | 'Public
|
|
|
18
18
|
*/
|
|
19
19
|
export type TreeNames = BaseTreeNames | 'L1ToL2MessageTree' | 'Archive';
|
|
20
20
|
export declare const insertSideEffectsAndBuildBaseRollupHints: (tx: ProcessedTx, lastArchive: AppendOnlyTreeSnapshot, newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, startSpongeBlob: SpongeBlob, proverId: Fr, db: MerkleTreeWriteOperations) => Promise<PublicBaseRollupHints | PrivateBaseRollupHints>;
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
23
|
-
export declare const buildBlobHints: (blobFields: Fr[]) =>
|
|
24
|
-
blobCommitments: BLS12Point[];
|
|
25
|
-
blobs: Blob[];
|
|
21
|
+
export declare function getChonkProofFromTx(tx: Tx | ProcessedTx): RecursiveProof<2084>;
|
|
22
|
+
export declare function getPublicChonkVerifierPrivateInputsFromTx(tx: Tx | ProcessedTx, proverId: Fr): PublicChonkVerifierPrivateInputs;
|
|
23
|
+
export declare const buildBlobHints: (blobFields: Fr[]) => {
|
|
24
|
+
blobCommitments: import("@aztec/foundation/fields").BLS12Point[];
|
|
25
|
+
blobs: import("@aztec/blob-lib").Blob[];
|
|
26
26
|
blobsHash: Fr;
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
export declare const buildBlobDataFromTxs: (txsPerCheckpoint: ProcessedTx[][]) => Promise<{
|
|
29
29
|
blobFieldsLengths: number[];
|
|
30
30
|
finalBlobChallenges: import("@aztec/blob-lib").FinalBlobBatchingChallenges;
|
|
@@ -39,8 +39,6 @@ export declare const buildHeaderAndBodyFromTxs: (txs: ProcessedTx[], globalVaria
|
|
|
39
39
|
export declare const buildBlockHeaderFromTxs: (txs: ProcessedTx[], globalVariables: GlobalVariables, startSpongeBlob: SpongeBlob, db: MerkleTreeReadOperations) => Promise<BlockHeader>;
|
|
40
40
|
/** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */
|
|
41
41
|
export declare function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages: Fr[]): Promise<Fr>;
|
|
42
|
-
export declare function getBlobsHashFromBlobs(inputs: Blob[]): Fr;
|
|
43
|
-
export declare function getEmptyBlockBlobsHash(): Promise<Fr>;
|
|
44
42
|
export declare function getLastSiblingPath<TID extends MerkleTreeId>(treeId: TID, db: MerkleTreeReadOperations): Promise<Tuple<Fr, {
|
|
45
43
|
readonly 1: 42;
|
|
46
44
|
readonly 4: 30;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-building-helpers.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-building-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,EAIX,MAAM,iBAAiB,CAAC;AAkBzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,KAAK,EAAgC,MAAM,6BAA6B,CAAC;AACxG,OAAO,EACL,iBAAiB,EAGlB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,IAAI,EAAE,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAE9E,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,YAAY,EAKb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW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B,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;AA4CD,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"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { BatchedBlob,
|
|
2
|
-
import { ARCHIVE_HEIGHT,
|
|
1
|
+
import { BatchedBlob, SpongeBlob, computeBlobsHashFromBlobs, getBlobCommitmentsFromBlobs, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
2
|
+
import { ARCHIVE_HEIGHT, CHONK_PROOF_LENGTH, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NOTE_HASH_SUBTREE_HEIGHT, NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_HEIGHT, NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants';
|
|
3
3
|
import { makeTuple } from '@aztec/foundation/array';
|
|
4
4
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { sha256Trunc } from '@aztec/foundation/crypto';
|
|
6
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
7
7
|
import { assertLength, toFriendlyJSON } from '@aztec/foundation/serialize';
|
|
8
8
|
import { MembershipWitness, MerkleTreeCalculator, computeCompressedUnbalancedMerkleTreeRoot } from '@aztec/foundation/trees';
|
|
9
9
|
import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
10
10
|
import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
11
11
|
import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
12
12
|
import { Body, L2BlockHeader, getBlockBlobFields } from '@aztec/stdlib/block';
|
|
13
|
+
import { getCheckpointBlobFields } from '@aztec/stdlib/checkpoint';
|
|
13
14
|
import { ContractClassLogFields } from '@aztec/stdlib/logs';
|
|
14
15
|
import { Proof, ProofData, RecursiveProof } from '@aztec/stdlib/proofs';
|
|
15
|
-
import { BlockConstantData, PrivateBaseRollupHints, PublicBaseRollupHints,
|
|
16
|
+
import { BlockConstantData, PrivateBaseRollupHints, PublicBaseRollupHints, PublicChonkVerifierPrivateInputs, TreeSnapshotDiffHints } from '@aztec/stdlib/rollup';
|
|
16
17
|
import { AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafPreimage, PublicDataTreeLeaf, getTreeHeight } from '@aztec/stdlib/trees';
|
|
17
18
|
import { BlockHeader, ContentCommitment, GlobalVariables, PartialStateReference, StateReference } from '@aztec/stdlib/tx';
|
|
18
19
|
import { VkData } from '@aztec/stdlib/vks';
|
|
@@ -87,38 +88,33 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan('BlockBuilderH
|
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
});
|
|
90
|
-
export function
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
const proofFieldsWithoutPublicInputs = proofFields.slice(numPublicInputs);
|
|
95
|
-
return new RecursiveProof(proofFieldsWithoutPublicInputs, binaryProof, true, CIVC_PROOF_LENGTH);
|
|
91
|
+
export function getChonkProofFromTx(tx) {
|
|
92
|
+
const publicInputs = tx.data.publicInputs().toFields();
|
|
93
|
+
const binaryProof = new Proof(Buffer.concat(tx.chonkProof.attachPublicInputs(publicInputs).fieldsWithPublicInputs.map((field)=>field.toBuffer())), publicInputs.length);
|
|
94
|
+
return new RecursiveProof(tx.chonkProof.fields, binaryProof, true, CHONK_PROOF_LENGTH);
|
|
96
95
|
}
|
|
97
|
-
export function
|
|
98
|
-
const proofData = new ProofData(tx.data.toPrivateToPublicKernelCircuitPublicInputs(),
|
|
99
|
-
return new
|
|
96
|
+
export function getPublicChonkVerifierPrivateInputsFromTx(tx, proverId) {
|
|
97
|
+
const proofData = new ProofData(tx.data.toPrivateToPublicKernelCircuitPublicInputs(), getChonkProofFromTx(tx), getVkData('HidingKernelToPublic'));
|
|
98
|
+
return new PublicChonkVerifierPrivateInputs(proofData, proverId);
|
|
100
99
|
}
|
|
101
100
|
// Build "hints" as the private inputs for the checkpoint root rollup circuit.
|
|
102
101
|
// The `blobCommitments` will be accumulated and checked in the root rollup against the `finalBlobChallenges`.
|
|
103
|
-
// The `blobsHash` will be validated on L1 against the blob
|
|
104
|
-
export const buildBlobHints =
|
|
105
|
-
const blobs =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
// - blobCommitmentsHash := sha256( ...sha256(sha256(C_0), C_1) ... C_n) = iteratively calculated hash of all blob commitments in an epoch with n+1 blobs (see calculateBlobCommitmentsHash()),
|
|
109
|
-
// exists so we can validate injected commitments to the rollup circuits correspond to the correct real blobs.
|
|
110
|
-
// We may be able to combine these values e.g. blobCommitmentsHash := sha256( ...sha256(sha256(blobshash_0), blobshash_1) ... blobshash_l) for an epoch with l+1 blocks.
|
|
111
|
-
const blobCommitments = blobs.map((b)=>BLS12Point.decompress(b.commitment));
|
|
112
|
-
const blobsHash = new Fr(getBlobsHashFromBlobs(blobs));
|
|
102
|
+
// The `blobsHash` will be validated on L1 against the submitted blob data.
|
|
103
|
+
export const buildBlobHints = (blobFields)=>{
|
|
104
|
+
const blobs = getBlobsPerL1Block(blobFields);
|
|
105
|
+
const blobCommitments = getBlobCommitmentsFromBlobs(blobs);
|
|
106
|
+
const blobsHash = computeBlobsHashFromBlobs(blobs);
|
|
113
107
|
return {
|
|
114
108
|
blobCommitments,
|
|
115
109
|
blobs,
|
|
116
110
|
blobsHash
|
|
117
111
|
};
|
|
118
|
-
}
|
|
119
|
-
// Build the data required to prove the txs in an epoch. Currently only used in tests.
|
|
112
|
+
};
|
|
113
|
+
// Build the data required to prove the txs in an epoch. Currently only used in tests. It assumes 1 block per checkpoint.
|
|
120
114
|
export const buildBlobDataFromTxs = async (txsPerCheckpoint)=>{
|
|
121
|
-
const blobFields = txsPerCheckpoint.map((txs)=>
|
|
115
|
+
const blobFields = txsPerCheckpoint.map((txs)=>getCheckpointBlobFields([
|
|
116
|
+
txs.map((tx)=>tx.txEffect)
|
|
117
|
+
]));
|
|
122
118
|
const finalBlobChallenges = await buildFinalBlobChallenges(blobFields);
|
|
123
119
|
return {
|
|
124
120
|
blobFieldsLengths: blobFields.map((fields)=>fields.length),
|
|
@@ -126,12 +122,12 @@ export const buildBlobDataFromTxs = async (txsPerCheckpoint)=>{
|
|
|
126
122
|
};
|
|
127
123
|
};
|
|
128
124
|
export const buildFinalBlobChallenges = async (blobFieldsPerCheckpoint)=>{
|
|
129
|
-
const blobs =
|
|
130
|
-
return await BatchedBlob.precomputeBatchedBlobChallenges(blobs
|
|
125
|
+
const blobs = blobFieldsPerCheckpoint.map((blobFields)=>getBlobsPerL1Block(blobFields));
|
|
126
|
+
return await BatchedBlob.precomputeBatchedBlobChallenges(blobs);
|
|
131
127
|
};
|
|
132
128
|
export const accumulateBlobs = runInSpan('BlockBuilderHelpers', 'accumulateBlobs', async (_span, blobFields, startBlobAccumulator)=>{
|
|
133
|
-
const blobs =
|
|
134
|
-
const endBlobAccumulator = startBlobAccumulator.accumulateBlobs(blobs);
|
|
129
|
+
const blobs = getBlobsPerL1Block(blobFields);
|
|
130
|
+
const endBlobAccumulator = await startBlobAccumulator.accumulateBlobs(blobs);
|
|
135
131
|
return endBlobAccumulator;
|
|
136
132
|
});
|
|
137
133
|
export const buildHeaderFromCircuitOutputs = runInSpan('BlockBuilderHelpers', 'buildHeaderFromCircuitOutputs', async (_span, blockRootRollupOutput)=>{
|
|
@@ -158,13 +154,17 @@ export const buildHeaderAndBodyFromTxs = runInSpan('BlockBuilderHelpers', 'build
|
|
|
158
154
|
const txOutHashes = txEffects.map((tx)=>tx.txOutHash());
|
|
159
155
|
const outHash = txOutHashes.length === 0 ? Fr.ZERO : new Fr(computeCompressedUnbalancedMerkleTreeRoot(txOutHashes));
|
|
160
156
|
const parityShaRoot = await computeInHashFromL1ToL2Messages(l1ToL2Messages);
|
|
161
|
-
const
|
|
162
|
-
|
|
157
|
+
const blockBlobFields = body.toBlobFields();
|
|
158
|
+
// TODO(#17027): This only works when there's one block per checkpoint.
|
|
159
|
+
const blobFields = [
|
|
160
|
+
new Fr(blockBlobFields.length + 1)
|
|
161
|
+
].concat(blockBlobFields);
|
|
162
|
+
const blobsHash = computeBlobsHashFromBlobs(getBlobsPerL1Block(blobFields));
|
|
163
163
|
const contentCommitment = new ContentCommitment(blobsHash, parityShaRoot, outHash);
|
|
164
164
|
const fees = txEffects.reduce((acc, tx)=>acc.add(tx.transactionFee), Fr.ZERO);
|
|
165
165
|
const manaUsed = txs.reduce((acc, tx)=>acc.add(new Fr(tx.gasUsed.billedGas.l2Gas)), Fr.ZERO);
|
|
166
|
-
const endSpongeBlob = startSpongeBlob?.clone() ?? SpongeBlob.init(blobFields.length);
|
|
167
|
-
await endSpongeBlob.absorb(
|
|
166
|
+
const endSpongeBlob = startSpongeBlob?.clone() ?? await SpongeBlob.init(blobFields.length);
|
|
167
|
+
await endSpongeBlob.absorb(blockBlobFields);
|
|
168
168
|
const spongeBlobHash = await endSpongeBlob.squeeze();
|
|
169
169
|
const header = new L2BlockHeader(previousArchive, contentCommitment, stateReference, globalVariables, fees, manaUsed, spongeBlobHash);
|
|
170
170
|
return {
|
|
@@ -195,16 +195,6 @@ export const buildBlockHeaderFromTxs = runInSpan('BlockBuilderHelpers', 'buildBl
|
|
|
195
195
|
const parityCalculator = await MerkleTreeCalculator.create(parityHeight, Fr.ZERO.toBuffer(), hasher);
|
|
196
196
|
return new Fr(await parityCalculator.computeTreeRoot(l1ToL2Messages.map((msg)=>msg.toBuffer())));
|
|
197
197
|
}
|
|
198
|
-
export function getBlobsHashFromBlobs(inputs) {
|
|
199
|
-
return sha256ToField(inputs.map((b)=>b.getEthVersionedBlobHash()));
|
|
200
|
-
}
|
|
201
|
-
// Note: tested against the constant values in block_root/empty_block_root_rollup_inputs.nr, set by block_building_helpers.test.ts.
|
|
202
|
-
// Having this separate fn hopefully makes it clear how we treat empty blocks and their blobs, and won't break if we decide to change how
|
|
203
|
-
// getBlobsPerBlock() works on empty input.
|
|
204
|
-
export async function getEmptyBlockBlobsHash() {
|
|
205
|
-
const blobHash = (await Blob.getBlobsPerBlock([])).map((b)=>b.getEthVersionedBlobHash());
|
|
206
|
-
return sha256ToField(blobHash);
|
|
207
|
-
}
|
|
208
198
|
export async function getLastSiblingPath(treeId, db) {
|
|
209
199
|
const { size } = await db.getTreeInfo(treeId);
|
|
210
200
|
const path = await db.getSiblingPath(treeId, size - 1n);
|
|
@@ -65,7 +65,7 @@ export declare class BlockProvingState {
|
|
|
65
65
|
getStartSpongeBlob(): SpongeBlob;
|
|
66
66
|
setEndSpongeBlob(endSpongeBlob: SpongeBlob): void;
|
|
67
67
|
getEndSpongeBlob(): SpongeBlob | undefined;
|
|
68
|
-
|
|
68
|
+
getTxEffects(): import("@aztec/stdlib/tx").TxEffect[];
|
|
69
69
|
getParentLocation(location: TreeNodeLocation): TreeNodeLocation;
|
|
70
70
|
getMergeRollupInputs(mergeLocation: TreeNodeLocation): TxMergeRollupPrivateInputs;
|
|
71
71
|
getBlockRootRollupTypeAndInputs(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,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;
|
|
1
|
+
{"version":3,"file":"block-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,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;AACr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AkB,CAAC;IASlG,yBAAyB;IASzB,kBAAkB,CAAC,aAAa,EAAE,6BAA6B,CAAC,kBAAkB,CAAC;IAInF,wBAAwB;IASxB,uBAAuB,CAC5B,aAAa,EAAE,6BAA6B,CAC1C,uBAAuB,EACvB,OAAO,yCAAyC,CACjD,GACA,gBAAgB;IAKZ,wBAAwB;IAIxB,mBAAmB,CAAC,WAAW,EAAE,WAAW;IAI5C,mBAAmB;IAInB,kBAAkB;IAkBlB,kBAAkB;IAIlB,gBAAgB,CAAC,aAAa,EAAE,UAAU;IAI1C,gBAAgB;IAIhB,YAAY;IAIZ,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB;IAI5C,oBAAoB,CAAC,aAAa,EAAE,gBAAgB;IASpD,+BAA+B;;;;;;;;;;IAuE/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;CAgB7B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NUM_BASE_PARITY_PER_ROOT_PARITY } from '@aztec/constants';
|
|
2
2
|
import { assertLength } from '@aztec/foundation/serialize';
|
|
3
3
|
import { UnbalancedTreeStore } from '@aztec/foundation/trees';
|
|
4
|
-
import { getBlockBlobFields } from '@aztec/stdlib/block';
|
|
5
4
|
import { ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
6
5
|
import { BlockRootEmptyTxFirstRollupPrivateInputs, BlockRootFirstRollupPrivateInputs, BlockRootRollupPrivateInputs, BlockRootSingleTxFirstRollupPrivateInputs, BlockRootSingleTxRollupPrivateInputs, TxMergeRollupPrivateInputs } from '@aztec/stdlib/rollup';
|
|
7
6
|
import { GlobalVariables } from '@aztec/stdlib/tx';
|
|
@@ -189,8 +188,8 @@ import { buildHeaderFromCircuitOutputs, toProofData } from './block-building-hel
|
|
|
189
188
|
getEndSpongeBlob() {
|
|
190
189
|
return this.endSpongeBlob;
|
|
191
190
|
}
|
|
192
|
-
|
|
193
|
-
return
|
|
191
|
+
getTxEffects() {
|
|
192
|
+
return this.txs.map((t)=>t.processedTx.txEffect);
|
|
194
193
|
}
|
|
195
194
|
getParentLocation(location) {
|
|
196
195
|
return this.baseOrMergeProofs.getParentLocation(location);
|
|
@@ -33,11 +33,12 @@ export declare class CheckpointProvingState {
|
|
|
33
33
|
private blocks;
|
|
34
34
|
private startBlobAccumulator;
|
|
35
35
|
private endBlobAccumulator;
|
|
36
|
+
private blobFields;
|
|
36
37
|
private error;
|
|
37
38
|
readonly firstBlockNumber: number;
|
|
38
39
|
constructor(index: number, constants: CheckpointConstantData, totalNumBlocks: number, totalNumBlobFields: 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);
|
|
39
40
|
get epochNumber(): number;
|
|
40
|
-
startNewBlock(blockNumber: number, timestamp: UInt64, totalNumTxs: number, lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>): BlockProvingState
|
|
41
|
+
startNewBlock(blockNumber: number, timestamp: UInt64, totalNumTxs: number, lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>): Promise<BlockProvingState>;
|
|
41
42
|
isAcceptingBlocks(): boolean;
|
|
42
43
|
setBlockRootRollupProof(blockIndex: number, provingOutput: PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): TreeNodeLocation;
|
|
43
44
|
tryStartProvingBlockMerge(location: TreeNodeLocation): boolean;
|
|
@@ -50,7 +51,7 @@ export declare class CheckpointProvingState {
|
|
|
50
51
|
getParentLocation(location: TreeNodeLocation): TreeNodeLocation;
|
|
51
52
|
getBlockMergeRollupInputs(mergeLocation: TreeNodeLocation): BlockMergeRollupPrivateInputs;
|
|
52
53
|
getCheckpointRootRollupType(): CircuitName;
|
|
53
|
-
getCheckpointRootRollupInputs():
|
|
54
|
+
getCheckpointRootRollupInputs(): CheckpointRootSingleBlockRollupPrivateInputs | CheckpointRootRollupPrivateInputs;
|
|
54
55
|
getBlockProvingStateByBlockNumber(blockNumber: number): BlockProvingState | undefined;
|
|
55
56
|
isReadyForBlockMerge(location: TreeNodeLocation): boolean;
|
|
56
57
|
isReadyForCheckpointRoot(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/checkpoint-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"checkpoint-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/checkpoint-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,KAAK,2BAA2B,EAAc,MAAM,iBAAiB,CAAC;AACvG,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,6CAA6C,EAClD,KAAK,yCAAyC,EAE/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAc,EAAE,EAAE,M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BAAwB,CAC7B,QAAQ,EAAE,gBAAgB,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,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SpongeBlob } from '@aztec/blob-lib';
|
|
2
2
|
import { BLOBS_PER_BLOCK, 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';
|
|
5
5
|
import { UnbalancedTreeStore } from '@aztec/foundation/trees';
|
|
6
|
+
import { getCheckpointBlobFields } from '@aztec/stdlib/checkpoint';
|
|
6
7
|
import { ParityBasePrivateInputs } from '@aztec/stdlib/parity';
|
|
7
8
|
import { BlockMergeRollupPrivateInputs, CheckpointRootRollupHints, CheckpointRootRollupPrivateInputs, CheckpointRootSingleBlockRollupPrivateInputs } from '@aztec/stdlib/rollup';
|
|
8
9
|
import { accumulateBlobs, buildBlobHints, toProofData } from './block-building-helpers.js';
|
|
@@ -27,6 +28,7 @@ export class CheckpointProvingState {
|
|
|
27
28
|
blocks;
|
|
28
29
|
startBlobAccumulator;
|
|
29
30
|
endBlobAccumulator;
|
|
31
|
+
blobFields;
|
|
30
32
|
error;
|
|
31
33
|
firstBlockNumber;
|
|
32
34
|
constructor(index, constants, totalNumBlocks, totalNumBlobFields, finalBlobBatchingChallenges, headerOfLastBlockInPreviousCheckpoint, lastArchiveSiblingPath, l1ToL2Messages, // The snapshot and sibling path before the new l1 to l2 message subtree is inserted.
|
|
@@ -53,7 +55,7 @@ export class CheckpointProvingState {
|
|
|
53
55
|
get epochNumber() {
|
|
54
56
|
return this.parentEpoch.epochNumber;
|
|
55
57
|
}
|
|
56
|
-
startNewBlock(blockNumber, timestamp, totalNumTxs, lastArchiveTreeSnapshot, lastArchiveSiblingPath) {
|
|
58
|
+
async startNewBlock(blockNumber, timestamp, totalNumTxs, lastArchiveTreeSnapshot, lastArchiveSiblingPath) {
|
|
57
59
|
const index = blockNumber - this.firstBlockNumber;
|
|
58
60
|
if (index >= this.totalNumBlocks) {
|
|
59
61
|
throw new Error(`Unable to start a new block at index ${index}. Expected at most ${this.totalNumBlocks} blocks.`);
|
|
@@ -63,7 +65,7 @@ export class CheckpointProvingState {
|
|
|
63
65
|
// happen in the first block.
|
|
64
66
|
const lastL1ToL2MessageTreeSnapshot = index === 0 ? this.lastL1ToL2MessageTreeSnapshot : this.newL1ToL2MessageTreeSnapshot;
|
|
65
67
|
const lastL1ToL2MessageSubtreeRootSiblingPath = index === 0 ? this.lastL1ToL2MessageSubtreeRootSiblingPath : this.newL1ToL2MessageSubtreeRootSiblingPath;
|
|
66
|
-
const startSpongeBlob = index === 0 ? SpongeBlob.init(this.totalNumBlobFields) : this.blocks[index - 1]?.getEndSpongeBlob();
|
|
68
|
+
const startSpongeBlob = index === 0 ? await SpongeBlob.init(this.totalNumBlobFields) : this.blocks[index - 1]?.getEndSpongeBlob();
|
|
67
69
|
if (!startSpongeBlob) {
|
|
68
70
|
throw new Error('Cannot start a new block before the trees have progressed from the tx effects in the previous block.');
|
|
69
71
|
}
|
|
@@ -119,8 +121,8 @@ export class CheckpointProvingState {
|
|
|
119
121
|
if (this.isAcceptingBlocks() || this.blocks.some((b)=>b.isAcceptingTxs())) {
|
|
120
122
|
return;
|
|
121
123
|
}
|
|
122
|
-
|
|
123
|
-
this.endBlobAccumulator = await accumulateBlobs(blobFields, startBlobAccumulator);
|
|
124
|
+
this.blobFields = getCheckpointBlobFields(this.blocks.map((b)=>b.getTxEffects()));
|
|
125
|
+
this.endBlobAccumulator = await accumulateBlobs(this.blobFields, startBlobAccumulator);
|
|
124
126
|
this.startBlobAccumulator = startBlobAccumulator;
|
|
125
127
|
this.onBlobAccumulatorSet(this);
|
|
126
128
|
return this.endBlobAccumulator;
|
|
@@ -144,7 +146,7 @@ export class CheckpointProvingState {
|
|
|
144
146
|
getCheckpointRootRollupType() {
|
|
145
147
|
return this.totalNumBlocks === 1 ? 'rollup-checkpoint-root-single-block' : 'rollup-checkpoint-root';
|
|
146
148
|
}
|
|
147
|
-
|
|
149
|
+
getCheckpointRootRollupInputs() {
|
|
148
150
|
const proofs = this.#getChildProofsForRoot();
|
|
149
151
|
const nonEmptyProofs = proofs.filter((p)=>!!p);
|
|
150
152
|
if (proofs.length !== nonEmptyProofs.length) {
|
|
@@ -153,12 +155,13 @@ export class CheckpointProvingState {
|
|
|
153
155
|
if (!this.startBlobAccumulator) {
|
|
154
156
|
throw new Error('Start blob accumulator is not set.');
|
|
155
157
|
}
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
+
// `blobFields` must've been set if `startBlobAccumulator` is set (in `accumulateBlobs`).
|
|
159
|
+
const blobFields = this.blobFields;
|
|
160
|
+
const { blobCommitments, blobsHash } = buildBlobHints(blobFields);
|
|
158
161
|
const hints = CheckpointRootRollupHints.from({
|
|
159
162
|
previousBlockHeader: this.headerOfLastBlockInPreviousCheckpoint,
|
|
160
163
|
previousArchiveSiblingPath: this.lastArchiveSiblingPath,
|
|
161
|
-
startBlobAccumulator:
|
|
164
|
+
startBlobAccumulator: this.startBlobAccumulator.toBlobAccumulator(),
|
|
162
165
|
finalBlobChallenges: this.finalBlobBatchingChallenges,
|
|
163
166
|
blobFields: padArrayEnd(blobFields, Fr.ZERO, FIELDS_PER_BLOB * BLOBS_PER_BLOCK),
|
|
164
167
|
blobCommitments: padArrayEnd(blobCommitments, BLS12Point.ZERO, BLOBS_PER_BLOCK),
|
|
@@ -5,7 +5,7 @@ import type { Tuple } from '@aztec/foundation/serialize';
|
|
|
5
5
|
import { type TreeNodeLocation } from '@aztec/foundation/trees';
|
|
6
6
|
import type { PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
7
7
|
import type { Proof } from '@aztec/stdlib/proofs';
|
|
8
|
-
import { CheckpointConstantData, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs,
|
|
8
|
+
import { CheckpointConstantData, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, PublicChonkVerifierPublicInputs, RootRollupPrivateInputs, type RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
9
9
|
import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
10
10
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
11
11
|
import { CheckpointProvingState } from './checkpoint-proving-state.js';
|
|
@@ -38,7 +38,7 @@ export declare class EpochProvingState {
|
|
|
38
38
|
private endBlobAccumulator;
|
|
39
39
|
private finalBatchedBlob;
|
|
40
40
|
private provingStateLifecycle;
|
|
41
|
-
readonly
|
|
41
|
+
readonly cachedChonkVerifierProofs: Map<string, Promise<PublicInputsAndRecursiveProof<PublicChonkVerifierPublicInputs, 535>>>;
|
|
42
42
|
constructor(epochNumber: number, totalNumCheckpoints: number, finalBlobBatchingChallenges: FinalBlobBatchingChallenges, onCheckpointBlobAccumulatorSet: (checkpoint: CheckpointProvingState) => void, completionCallback: (result: ProvingResult) => void, rejectionCallback: (reason: string) => void);
|
|
43
43
|
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, totalNumBlocks: number, totalNumBlobFields: 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;
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"epoch-proving-state.d.ts","sourceRo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A6B,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"}
|
|
@@ -30,8 +30,8 @@ var PROVING_STATE_LIFECYCLE = /*#__PURE__*/ function(PROVING_STATE_LIFECYCLE) {
|
|
|
30
30
|
endBlobAccumulator;
|
|
31
31
|
finalBatchedBlob;
|
|
32
32
|
provingStateLifecycle;
|
|
33
|
-
// Map from tx hash to
|
|
34
|
-
|
|
33
|
+
// Map from tx hash to chonk verifier proof promise. Used when kickstarting chonk verifier proofs before tx processing.
|
|
34
|
+
cachedChonkVerifierProofs;
|
|
35
35
|
constructor(epochNumber, totalNumCheckpoints, finalBlobBatchingChallenges, onCheckpointBlobAccumulatorSet, completionCallback, rejectionCallback){
|
|
36
36
|
this.epochNumber = epochNumber;
|
|
37
37
|
this.totalNumCheckpoints = totalNumCheckpoints;
|
|
@@ -41,7 +41,7 @@ var PROVING_STATE_LIFECYCLE = /*#__PURE__*/ function(PROVING_STATE_LIFECYCLE) {
|
|
|
41
41
|
this.rejectionCallback = rejectionCallback;
|
|
42
42
|
this.checkpoints = [];
|
|
43
43
|
this.provingStateLifecycle = 0;
|
|
44
|
-
this.
|
|
44
|
+
this.cachedChonkVerifierProofs = new Map();
|
|
45
45
|
this.checkpointProofs = new UnbalancedTreeStore(totalNumCheckpoints);
|
|
46
46
|
this.startBlobAccumulator = BatchedBlobAccumulator.newWithChallenges(finalBlobBatchingChallenges);
|
|
47
47
|
}
|
|
@@ -148,7 +148,7 @@ var PROVING_STATE_LIFECYCLE = /*#__PURE__*/ function(PROVING_STATE_LIFECYCLE) {
|
|
|
148
148
|
if (!this.endBlobAccumulator) {
|
|
149
149
|
throw new Error('End blob accumulator not ready.');
|
|
150
150
|
}
|
|
151
|
-
this.finalBatchedBlob = await this.endBlobAccumulator.finalize();
|
|
151
|
+
this.finalBatchedBlob = await this.endBlobAccumulator.finalize(true);
|
|
152
152
|
}
|
|
153
153
|
getParentLocation(location) {
|
|
154
154
|
return this.checkpointProofs.getParentLocation(location);
|
|
@@ -50,10 +50,10 @@ export declare class ProvingOrchestrator implements EpochProver {
|
|
|
50
50
|
*/
|
|
51
51
|
addTxs(txs: ProcessedTx[]): Promise<void>;
|
|
52
52
|
/**
|
|
53
|
-
* Kickstarts
|
|
54
|
-
* Note that if the
|
|
53
|
+
* Kickstarts chonk verifier circuits for the specified txs. These will be used during epoch proving.
|
|
54
|
+
* Note that if the chonk verifier circuits are not started this way, they will be started nontheless after processing.
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
startChonkVerifierCircuits(txs: Tx[]): Promise<void>;
|
|
57
57
|
/**
|
|
58
58
|
* Marks the block as completed.
|
|
59
59
|
* Computes the block header and updates the archive tree.
|
|
@@ -83,8 +83,8 @@ export declare class ProvingOrchestrator implements EpochProver {
|
|
|
83
83
|
private updateL1ToL2MessageTree;
|
|
84
84
|
private prepareBaseRollupInputs;
|
|
85
85
|
private enqueueBaseRollup;
|
|
86
|
-
private
|
|
87
|
-
private
|
|
86
|
+
private getOrEnqueueChonkVerifier;
|
|
87
|
+
private doEnqueueChonkVerifier;
|
|
88
88
|
private enqueueMergeRollup;
|
|
89
89
|
private enqueueBlockRootRollup;
|
|
90
90
|
private enqueueBaseParityCircuit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAc,MAAM,iBAAiB,CAAC;AAUvF,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAQ9C,OAAO,EAAE,UAAU,EAAwB,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EAGxB,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAML,sBAAsB,EAKtB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,MAAM,EAIZ,MAAM,yBAAyB,CAAC;AAgBjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAQlE;;;;;;;;;GASG;AAEH;;GAEG;AACH,qBAAa,mBAAoB,YAAW,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