@aztec/prover-client 3.0.0-nightly.20251114 → 3.0.0-nightly.20251115

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.
Files changed (32) hide show
  1. package/dest/block-factory/light.d.ts +6 -6
  2. package/dest/block-factory/light.d.ts.map +1 -1
  3. package/dest/block-factory/light.js +35 -22
  4. package/dest/light/lightweight_checkpoint_builder.d.ts +29 -0
  5. package/dest/light/lightweight_checkpoint_builder.d.ts.map +1 -0
  6. package/dest/light/lightweight_checkpoint_builder.js +107 -0
  7. package/dest/mocks/fixtures.d.ts +0 -3
  8. package/dest/mocks/fixtures.d.ts.map +1 -1
  9. package/dest/mocks/fixtures.js +1 -12
  10. package/dest/mocks/test_context.d.ts +26 -44
  11. package/dest/mocks/test_context.d.ts.map +1 -1
  12. package/dest/mocks/test_context.js +101 -112
  13. package/dest/orchestrator/block-building-helpers.d.ts +12 -14
  14. package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
  15. package/dest/orchestrator/block-building-helpers.js +81 -105
  16. package/dest/orchestrator/block-proving-state.d.ts +9 -4
  17. package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
  18. package/dest/orchestrator/block-proving-state.js +80 -19
  19. package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
  20. package/dest/orchestrator/checkpoint-proving-state.js +6 -4
  21. package/dest/orchestrator/orchestrator.d.ts +0 -1
  22. package/dest/orchestrator/orchestrator.d.ts.map +1 -1
  23. package/dest/orchestrator/orchestrator.js +15 -23
  24. package/package.json +15 -15
  25. package/src/block-factory/light.ts +43 -42
  26. package/src/light/lightweight_checkpoint_builder.ts +141 -0
  27. package/src/mocks/fixtures.ts +1 -25
  28. package/src/mocks/test_context.ts +141 -174
  29. package/src/orchestrator/block-building-helpers.ts +120 -198
  30. package/src/orchestrator/block-proving-state.ts +100 -22
  31. package/src/orchestrator/checkpoint-proving-state.ts +12 -5
  32. package/src/orchestrator/orchestrator.ts +18 -25
@@ -1,68 +1,61 @@
1
1
  import { TestCircuitProver } from '@aztec/bb-prover';
2
- import { SpongeBlob } from '@aztec/blob-lib';
2
+ import { getTotalNumBlobFieldsFromTxs } from '@aztec/blob-lib';
3
3
  import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
4
- import { padArrayEnd, times, timesParallel } from '@aztec/foundation/collection';
4
+ import { padArrayEnd, times, timesAsync } from '@aztec/foundation/collection';
5
5
  import { Fr } from '@aztec/foundation/fields';
6
- import { TestDateProvider } from '@aztec/foundation/timer';
7
6
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
8
7
  import { ProtocolContractsList } from '@aztec/protocol-contracts';
9
8
  import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
10
- import { SimpleContractDataSource } from '@aztec/simulator/public/fixtures';
11
- import { PublicProcessorFactory } from '@aztec/simulator/server';
12
9
  import { PublicDataWrite } from '@aztec/stdlib/avm';
13
10
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
14
11
  import { EthAddress } from '@aztec/stdlib/block';
15
- import { getCheckpointBlobFields } from '@aztec/stdlib/checkpoint';
16
- import { makeBloatedProcessedTx } from '@aztec/stdlib/testing';
12
+ import { mockProcessedTx } from '@aztec/stdlib/testing';
17
13
  import { MerkleTreeId, PublicDataTreeLeaf } from '@aztec/stdlib/trees';
18
14
  import { TreeSnapshots } from '@aztec/stdlib/tx';
19
15
  import { NativeWorldStateService } from '@aztec/world-state/native';
20
16
  import { promises as fs } from 'fs';
21
- import { buildBlockWithCleanDB } from '../block-factory/light.js';
22
- import { getTreeSnapshot } from '../orchestrator/block-building-helpers.js';
17
+ import { LightweightCheckpointBuilder } from '../light/lightweight_checkpoint_builder.js';
18
+ import { buildFinalBlobChallenges, getTreeSnapshot, insertSideEffects } from '../orchestrator/block-building-helpers.js';
23
19
  import { ProvingOrchestrator } from '../orchestrator/index.js';
24
20
  import { BrokerCircuitProverFacade } from '../proving_broker/broker_prover_facade.js';
25
21
  import { TestBroker } from '../test/mock_prover.js';
26
- import { getEnvironmentConfig, getSimulator, makeCheckpointConstants, makeGlobals, updateExpectedTreesFromTxs } from './fixtures.js';
22
+ import { getEnvironmentConfig, getSimulator, makeCheckpointConstants, makeGlobals } from './fixtures.js';
27
23
  export class TestContext {
28
24
  worldState;
29
- firstCheckpointNumber;
30
- globalVariables;
31
25
  prover;
32
26
  broker;
33
27
  brokerProverFacade;
34
28
  orchestrator;
35
- blockNumber;
36
29
  feePayer;
37
30
  directoriesToCleanup;
38
31
  logger;
39
32
  headers;
33
+ checkpoints;
34
+ nextCheckpointIndex;
35
+ nextBlockNumber;
36
+ epochNumber;
40
37
  feePayerBalance;
41
- constructor(worldState, firstCheckpointNumber, globalVariables, prover, broker, brokerProverFacade, orchestrator, blockNumber, feePayer, initialFeePayerBalance, directoriesToCleanup, logger){
38
+ constructor(worldState, prover, broker, brokerProverFacade, orchestrator, feePayer, initialFeePayerBalance, directoriesToCleanup, logger){
42
39
  this.worldState = worldState;
43
- this.firstCheckpointNumber = firstCheckpointNumber;
44
- this.globalVariables = globalVariables;
45
40
  this.prover = prover;
46
41
  this.broker = broker;
47
42
  this.brokerProverFacade = brokerProverFacade;
48
43
  this.orchestrator = orchestrator;
49
- this.blockNumber = blockNumber;
50
44
  this.feePayer = feePayer;
51
45
  this.directoriesToCleanup = directoriesToCleanup;
52
46
  this.logger = logger;
53
47
  this.headers = new Map();
48
+ this.checkpoints = [];
49
+ this.nextCheckpointIndex = 0;
50
+ this.nextBlockNumber = 1;
51
+ this.epochNumber = 1;
54
52
  this.feePayerBalance = initialFeePayerBalance;
55
53
  }
56
54
  get epochProver() {
57
55
  return this.orchestrator;
58
56
  }
59
- getCheckpointConstants(checkpointIndex = 0) {
60
- return makeCheckpointConstants(this.firstCheckpointNumber.toNumber() + checkpointIndex);
61
- }
62
- static async new(logger, { proverCount = 4, createProver = async (bbConfig)=>new TestCircuitProver(await getSimulator(bbConfig, logger)), slotNumber = 1, blockNumber = 1 } = {}) {
57
+ static async new(logger, { proverCount = 4, createProver = async (bbConfig)=>new TestCircuitProver(await getSimulator(bbConfig, logger)) } = {}) {
63
58
  const directoriesToCleanup = [];
64
- const firstCheckpointNumber = new Fr(slotNumber);
65
- const globalVariables = makeGlobals(blockNumber, slotNumber);
66
59
  const feePayer = AztecAddress.fromNumber(42222);
67
60
  const initialFeePayerBalance = new Fr(10n ** 20n);
68
61
  const feePayerSlot = await computeFeePayerBalanceLeafSlot(feePayer);
@@ -95,17 +88,11 @@ export class TestContext {
95
88
  const orchestrator = new TestProvingOrchestrator(ws, facade, EthAddress.ZERO);
96
89
  await broker.start();
97
90
  facade.start();
98
- return new this(ws, firstCheckpointNumber, globalVariables, localProver, broker, facade, orchestrator, blockNumber, feePayer, initialFeePayerBalance, directoriesToCleanup, logger);
91
+ return new this(ws, localProver, broker, facade, orchestrator, feePayer, initialFeePayerBalance, directoriesToCleanup, logger);
99
92
  }
100
93
  getFork() {
101
94
  return this.worldState.fork();
102
95
  }
103
- getBlockHeader(blockNumber = 0) {
104
- return blockNumber === 0 ? this.worldState.getCommitted().getInitialHeader() : this.headers.get(blockNumber);
105
- }
106
- getPreviousBlockHeader(currentBlockNumber = this.blockNumber) {
107
- return this.getBlockHeader(currentBlockNumber - 1);
108
- }
109
96
  async cleanup() {
110
97
  await this.brokerProverFacade.stop();
111
98
  await this.broker.stop();
@@ -121,125 +108,127 @@ export class TestContext {
121
108
  }
122
109
  }
123
110
  }
124
- async makeProcessedTx(opts) {
125
- const globalVariables = opts?.globalVariables ?? this.globalVariables;
126
- const blockNumber = globalVariables.blockNumber;
127
- const header = opts?.header ?? this.getBlockHeader(blockNumber - 1);
128
- const tx = await makeBloatedProcessedTx({
129
- header,
130
- vkTreeRoot: getVKTreeRoot(),
131
- protocolContracts: ProtocolContractsList,
132
- globalVariables,
133
- feePayer: this.feePayer,
134
- ...opts
135
- });
136
- this.feePayerBalance = new Fr(this.feePayerBalance.toBigInt() - tx.txEffect.transactionFee.toBigInt());
137
- if (opts?.privateOnly) {
138
- const feePayerSlot = await computeFeePayerBalanceLeafSlot(this.feePayer);
139
- tx.txEffect.publicDataWrites[0] = new PublicDataWrite(feePayerSlot, this.feePayerBalance);
140
- }
141
- return tx;
111
+ startNewEpoch() {
112
+ this.checkpoints = [];
113
+ this.nextCheckpointIndex = 0;
114
+ this.epochNumber++;
142
115
  }
143
- /** Creates a block with the given number of txs and adds it to world-state */ async makePendingBlock(numTxs, { checkpointIndex = 0, numL1ToL2Messages = 0, blockNumber = this.blockNumber, makeProcessedTxOpts = ()=>({}) } = {}) {
144
- const slotNumber = this.firstCheckpointNumber.toNumber() + checkpointIndex;
145
- const globalVariables = makeGlobals(blockNumber, slotNumber);
146
- const blockNum = globalVariables.blockNumber;
147
- const db = await this.worldState.fork();
148
- const l1ToL2Messages = times(numL1ToL2Messages, (i)=>new Fr(blockNum * 100 + i));
149
- const merkleTrees = await this.worldState.fork();
150
- await merkleTrees.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
151
- const newL1ToL2Snapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, merkleTrees);
152
- const txs = await timesParallel(numTxs, (i)=>this.makeProcessedTx({
153
- seed: i + blockNum * 1000,
154
- globalVariables,
155
- newL1ToL2Snapshot,
156
- ...makeProcessedTxOpts(i)
157
- }));
158
- await this.setTreeRoots(txs);
159
- const block = await buildBlockWithCleanDB(txs, globalVariables, l1ToL2Messages, db);
160
- this.headers.set(blockNum, block.getBlockHeader());
161
- await this.worldState.handleL2BlockAndMessages(block, l1ToL2Messages);
162
- return {
163
- block,
164
- txs,
165
- l1ToL2Messages
166
- };
116
+ // Return blob fields of all checkpoints in the epoch.
117
+ getBlobFields() {
118
+ return this.checkpoints.map((checkpoint)=>checkpoint.toBlobFields());
167
119
  }
168
- async makePendingBlocksInCheckpoint(numBlocks, { checkpointIndex = 0, numTxsPerBlock = 1, numL1ToL2Messages = 0, firstBlockNumber = this.blockNumber + checkpointIndex * numBlocks, makeGlobalVariablesOpts = ()=>({}), makeProcessedTxOpts = ()=>({}) } = {}) {
169
- const slotNumber = this.firstCheckpointNumber.toNumber() + checkpointIndex;
120
+ async getFinalBlobChallenges() {
121
+ const blobFields = this.getBlobFields();
122
+ return await buildFinalBlobChallenges(blobFields);
123
+ }
124
+ async makeCheckpoint(numBlocks, { numTxsPerBlock = 0, numL1ToL2Messages = 0, makeProcessedTxOpts = ()=>({}), ...constantOpts } = {}) {
125
+ if (numBlocks === 0) {
126
+ throw new Error('Cannot make a checkpoint with 0 blocks. Crate an empty block (numTxsPerBlock = 0) if there are no txs.');
127
+ }
128
+ const checkpointIndex = this.nextCheckpointIndex++;
129
+ const slotNumber = checkpointIndex + 1;
130
+ const constants = makeCheckpointConstants(slotNumber, constantOpts);
131
+ const fork = await this.worldState.fork();
132
+ // Build l1 to l2 messages.
170
133
  const l1ToL2Messages = times(numL1ToL2Messages, (i)=>new Fr(slotNumber * 100 + i));
171
- const merkleTrees = await this.worldState.fork();
172
- await merkleTrees.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
173
- const newL1ToL2Snapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, merkleTrees);
174
- const blockGlobalVariables = times(numBlocks, (i)=>makeGlobals(firstBlockNumber + i, slotNumber, makeGlobalVariablesOpts(firstBlockNumber + i, checkpointIndex)));
134
+ await fork.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
135
+ const newL1ToL2Snapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, fork);
136
+ const startBlockNumber = this.nextBlockNumber;
137
+ const previousBlockHeader = this.getBlockHeader(startBlockNumber - 1);
138
+ // Build global variables.
139
+ const blockGlobalVariables = times(numBlocks, (i)=>makeGlobals(startBlockNumber + i, slotNumber, {
140
+ coinbase: constants.coinbase,
141
+ feeRecipient: constants.feeRecipient,
142
+ gasFees: constants.gasFees
143
+ }));
144
+ this.nextBlockNumber += numBlocks;
145
+ // Build txs.
175
146
  let totalTxs = 0;
176
- const blockTxs = await timesParallel(numBlocks, (blockIndex)=>{
147
+ const blockEndStates = [];
148
+ const blockTxs = await timesAsync(numBlocks, async (blockIndex)=>{
177
149
  const txIndexOffset = totalTxs;
178
150
  const numTxs = typeof numTxsPerBlock === 'number' ? numTxsPerBlock : numTxsPerBlock[blockIndex];
179
151
  totalTxs += numTxs;
180
- return timesParallel(numTxs, (txIndex)=>this.makeProcessedTx({
181
- seed: (txIndexOffset + txIndex + 1) * 321 + (checkpointIndex + 1) * 123456,
152
+ const txs = await timesAsync(numTxs, (txIndex)=>this.makeProcessedTx({
153
+ seed: (txIndexOffset + txIndex + 1) * 321 + (checkpointIndex + 1) * 123456 + this.epochNumber * 0x99999,
182
154
  globalVariables: blockGlobalVariables[blockIndex],
183
- header: this.getBlockHeader(firstBlockNumber - 1),
155
+ anchorBlockHeader: previousBlockHeader,
184
156
  newL1ToL2Snapshot,
185
157
  ...makeProcessedTxOpts(blockGlobalVariables[blockIndex], txIndexOffset + txIndex)
186
158
  }));
159
+ // Insert side effects into the trees.
160
+ const endState = await this.updateTrees(txs, fork);
161
+ blockEndStates.push(endState);
162
+ return txs;
187
163
  });
188
- const blobFields = getCheckpointBlobFields(blockTxs.map((txs)=>txs.map((tx)=>tx.txEffect)));
189
- const spongeBlobState = await SpongeBlob.init(blobFields.length);
164
+ const cleanFork = await this.worldState.fork();
165
+ const builder = new LightweightCheckpointBuilder(cleanFork);
166
+ const totalNumBlobFields = getTotalNumBlobFieldsFromTxs(blockTxs.map((txs)=>txs.map((tx)=>tx.txEffect.getTxStartMarker())));
167
+ await builder.startNewCheckpoint(constants, l1ToL2Messages, totalNumBlobFields);
168
+ // Add tx effects to db and build block headers.
190
169
  const blocks = [];
191
170
  for(let i = 0; i < numBlocks; i++){
192
171
  const isFirstBlock = i === 0;
193
- const blockNumber = firstBlockNumber + i;
194
- const globalVariables = blockGlobalVariables[i];
195
172
  const txs = blockTxs[i];
196
- await this.setTreeRoots(txs);
197
- const fork = await this.worldState.fork();
173
+ const state = blockEndStates[i];
174
+ const block = await builder.addBlock(blockGlobalVariables[i], state, txs);
175
+ const header = block.header;
176
+ this.headers.set(block.number, header);
198
177
  const blockMsgs = isFirstBlock ? l1ToL2Messages : [];
199
- const block = await buildBlockWithCleanDB(txs, globalVariables, blockMsgs, fork, spongeBlobState, isFirstBlock);
200
- const header = block.getBlockHeader();
201
- this.headers.set(blockNumber, header);
202
178
  await this.worldState.handleL2BlockAndMessages(block, blockMsgs, isFirstBlock);
203
- const blockBlobFields = block.body.toBlobFields();
204
- await spongeBlobState.absorb(blockBlobFields);
205
179
  blocks.push({
206
180
  header,
207
181
  txs
208
182
  });
209
183
  }
184
+ const checkpoint = await builder.completeCheckpoint();
185
+ this.checkpoints.push(checkpoint);
210
186
  return {
187
+ constants,
188
+ header: checkpoint.header,
211
189
  blocks,
212
190
  l1ToL2Messages,
213
- blobFields
191
+ totalNumBlobFields,
192
+ previousBlockHeader
214
193
  };
215
194
  }
216
- async processPublicFunctions(txs, { maxTransactions = txs.length, numL1ToL2Messages = 0, contractDataSource } = {}) {
217
- const l1ToL2Messages = times(numL1ToL2Messages, (i)=>new Fr(this.blockNumber * 100 + i));
218
- const merkleTrees = await this.worldState.fork();
219
- await merkleTrees.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
220
- const processorFactory = new PublicProcessorFactory(contractDataSource ?? new SimpleContractDataSource(), new TestDateProvider());
221
- const publicProcessor = processorFactory.create(merkleTrees, this.globalVariables, {
222
- skipFeeEnforcement: false,
223
- clientInitiatedSimulation: false
224
- });
225
- return await publicProcessor.process(txs, {
226
- maxTransactions
195
+ async makeProcessedTx(opts = {}) {
196
+ const tx = await mockProcessedTx({
197
+ vkTreeRoot: getVKTreeRoot(),
198
+ protocolContracts: ProtocolContractsList,
199
+ feePayer: this.feePayer,
200
+ ...opts
227
201
  });
202
+ this.feePayerBalance = new Fr(this.feePayerBalance.toBigInt() - tx.txEffect.transactionFee.toBigInt());
203
+ const feePayerSlot = await computeFeePayerBalanceLeafSlot(this.feePayer);
204
+ const feePaymentPublicDataWrite = new PublicDataWrite(feePayerSlot, this.feePayerBalance);
205
+ tx.txEffect.publicDataWrites[0] = feePaymentPublicDataWrite;
206
+ if (tx.avmProvingRequest) {
207
+ tx.avmProvingRequest.inputs.publicInputs.accumulatedData.publicDataWrites[0] = feePaymentPublicDataWrite;
208
+ }
209
+ return tx;
210
+ }
211
+ getBlockHeader(blockNumber) {
212
+ if (blockNumber > 0 && blockNumber >= this.nextBlockNumber) {
213
+ throw new Error(`Block header not built for block number ${blockNumber}.`);
214
+ }
215
+ return blockNumber === 0 ? this.worldState.getCommitted().getInitialHeader() : this.headers.get(blockNumber);
228
216
  }
229
- async setTreeRoots(txs) {
230
- const db = await this.worldState.fork();
217
+ async updateTrees(txs, fork) {
218
+ let startStateReference = await fork.getStateReference();
219
+ let endStateReference = startStateReference;
231
220
  for (const tx of txs){
232
- const startStateReference = await db.getStateReference();
233
- await updateExpectedTreesFromTxs(db, [
234
- tx
235
- ]);
236
- const endStateReference = await db.getStateReference();
221
+ await insertSideEffects(tx, fork);
222
+ endStateReference = await fork.getStateReference();
237
223
  if (tx.avmProvingRequest) {
224
+ // Update the trees in the avm public inputs so that the proof won't fail.
238
225
  const l1ToL2MessageTree = tx.avmProvingRequest.inputs.publicInputs.startTreeSnapshots.l1ToL2MessageTree;
239
226
  tx.avmProvingRequest.inputs.publicInputs.startTreeSnapshots = new TreeSnapshots(l1ToL2MessageTree, startStateReference.partial.noteHashTree, startStateReference.partial.nullifierTree, startStateReference.partial.publicDataTree);
240
227
  tx.avmProvingRequest.inputs.publicInputs.endTreeSnapshots = new TreeSnapshots(l1ToL2MessageTree, endStateReference.partial.noteHashTree, endStateReference.partial.nullifierTree, endStateReference.partial.publicDataTree);
241
228
  }
229
+ startStateReference = endStateReference;
242
230
  }
231
+ return endStateReference;
243
232
  }
244
233
  }
245
234
  class TestProvingOrchestrator extends ProvingOrchestrator {
@@ -1,13 +1,13 @@
1
1
  import { BatchedBlobAccumulator, SpongeBlob } from '@aztec/blob-lib';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
- import { type Bufferable, type Tuple } from '@aztec/foundation/serialize';
3
+ import { type Bufferable } from '@aztec/foundation/serialize';
4
4
  import { MembershipWitness } from '@aztec/foundation/trees';
5
- import { Body, L2BlockHeader } from '@aztec/stdlib/block';
5
+ import { Body } 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
8
  import { BlockRollupPublicInputs, PrivateBaseRollupHints, PublicBaseRollupHints, PublicChonkVerifierPrivateInputs } from '@aztec/stdlib/rollup';
9
9
  import { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
10
- import { BlockHeader, GlobalVariables, PartialStateReference, type ProcessedTx, Tx } from '@aztec/stdlib/tx';
10
+ import { BlockHeader, GlobalVariables, PartialStateReference, type ProcessedTx, StateReference, Tx } from '@aztec/stdlib/tx';
11
11
  import type { MerkleTreeReadOperations } from '@aztec/world-state';
12
12
  /**
13
13
  * Type representing the names of the trees for the base rollup.
@@ -18,6 +18,10 @@ 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 const insertSideEffects: (tx: ProcessedTx, db: MerkleTreeWriteOperations) => Promise<{
22
+ nullifierInsertionResult: import("@aztec/stdlib/trees").BatchInsertionResult<number, number>;
23
+ publicDataInsertionResult: import("@aztec/stdlib/trees").SequentialInsertionResult<number>;
24
+ }>;
21
25
  export declare function getChonkProofFromTx(tx: Tx | ProcessedTx): RecursiveProof<2049>;
22
26
  export declare function getPublicChonkVerifierPrivateInputsFromTx(tx: Tx | ProcessedTx, proverId: Fr): PublicChonkVerifierPrivateInputs;
23
27
  export declare const buildBlobHints: (blobFields: Fr[]) => {
@@ -25,28 +29,22 @@ export declare const buildBlobHints: (blobFields: Fr[]) => {
25
29
  blobs: import("@aztec/blob-lib").Blob[];
26
30
  blobsHash: Fr;
27
31
  };
28
- export declare const buildBlobDataFromTxs: (txsPerCheckpoint: ProcessedTx[][]) => Promise<{
29
- blobFieldsLengths: number[];
30
- finalBlobChallenges: import("@aztec/blob-lib").FinalBlobBatchingChallenges;
31
- }>;
32
32
  export declare const buildFinalBlobChallenges: (blobFieldsPerCheckpoint: Fr[][]) => Promise<import("@aztec/blob-lib").FinalBlobBatchingChallenges>;
33
33
  export declare const accumulateBlobs: (blobFields: Fr[], startBlobAccumulator: BatchedBlobAccumulator) => Promise<BatchedBlobAccumulator>;
34
34
  export declare const buildHeaderFromCircuitOutputs: (blockRootRollupOutput: BlockRollupPublicInputs) => Promise<BlockHeader>;
35
- export declare const buildHeaderAndBodyFromTxs: (txs: ProcessedTx[], globalVariables: GlobalVariables, l1ToL2Messages: Fr[], db: MerkleTreeReadOperations, startSpongeBlob?: SpongeBlob | undefined) => Promise<{
36
- header: L2BlockHeader;
35
+ export declare const buildHeaderAndBodyFromTxs: (txs: ProcessedTx[], lastArchive: AppendOnlyTreeSnapshot, endState: StateReference, globalVariables: GlobalVariables, startSpongeBlob: SpongeBlob, isFirstBlock: boolean) => Promise<{
36
+ header: BlockHeader;
37
37
  body: Body;
38
+ blockBlobFields: Fr[];
38
39
  }>;
39
- export declare const buildBlockHeaderFromTxs: (txs: ProcessedTx[], globalVariables: GlobalVariables, startSpongeBlob: SpongeBlob, db: MerkleTreeReadOperations) => Promise<BlockHeader>;
40
- /** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */
41
- export declare function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages: Fr[]): Promise<Fr>;
42
- export declare function getLastSiblingPath<TID extends MerkleTreeId>(treeId: TID, db: MerkleTreeReadOperations): Promise<Tuple<Fr, {
40
+ export declare function getLastSiblingPath<TID extends MerkleTreeId>(treeId: TID, db: MerkleTreeReadOperations): Promise<import("@aztec/foundation/serialize").Tuple<Fr, {
43
41
  readonly 1: 42;
44
42
  readonly 4: 30;
45
43
  readonly 3: 36;
46
44
  readonly 0: 42;
47
45
  readonly 2: 40;
48
46
  }[TID]>>;
49
- export declare function getRootTreeSiblingPath<TID extends MerkleTreeId>(treeId: TID, db: MerkleTreeReadOperations): Promise<Tuple<Fr, {
47
+ export declare function getRootTreeSiblingPath<TID extends MerkleTreeId>(treeId: TID, db: MerkleTreeReadOperations): Promise<import("@aztec/foundation/serialize").Tuple<Fr, {
50
48
  readonly 1: 42;
51
49
  readonly 4: 30;
52
50
  readonly 3: 36;
@@ -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,EAIX,MAAM,iBAAiB,CAAC;AAkBzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,UAAU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