Skip to content

Commit 3e67b28

Browse files
spalladinoclaude
andcommitted
feat(fast-inbox): split checkpoint messages per block in the prover (A-1384)
Prove streaming per-block message insertion (AZIP-22 Fast Inbox): each block root now appends its own real message slice at compact indices instead of the whole checkpoint being padded into the first block. - checkpoint-prover: slices the checkpoint's messages per block from the blocks' L1-to-L2 leaf-count ranges and feeds each block its slice. - CheckpointSubTreeOrchestrator.startNewBlock: inserts the block's slice, capturing the per-block start/end snapshots and a full-height frontier at the compact start index (new getFrontierSiblingPath helper); startCheckpoint no longer inserts messages up front. - BlockProvingState/CheckpointProvingState carry per-block snapshots + the block's own slice; getPaddedL1ToL2Messages/getNumRealL1ToL2Messages retired. Prover orchestrator unit suites verify on CI (bb proving is not local); test mocks updated for compact per-block insertion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 69e967d commit 3e67b28

10 files changed

Lines changed: 99 additions & 134 deletions

yarn-project/prover-client/src/mocks/test_context.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { BBProverConfig } from '@aztec/bb-prover';
22
import { TestCircuitProver } from '@aztec/bb-prover';
3-
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
43
import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
5-
import { padArrayEnd, times, timesAsync } from '@aztec/foundation/collection';
4+
import { times, timesAsync } from '@aztec/foundation/collection';
65
import { Fr } from '@aztec/foundation/curves/bn254';
76
import type { Logger } from '@aztec/foundation/log';
87
import { SerialQueue } from '@aztec/foundation/queue';
@@ -194,12 +193,10 @@ export class TestContext {
194193

195194
const fork = await this.worldState.fork();
196195

197-
// Build l1 to l2 messages.
196+
// Build l1 to l2 messages. Appended unpadded at compact indices (AZIP-22 Fast Inbox); the mock assigns them all to
197+
// the checkpoint's first block, matching how the per-block driver slices them.
198198
const l1ToL2Messages = times(numL1ToL2Messages, i => new Fr(slotNumber * 100 + i));
199-
await fork.appendLeaves(
200-
MerkleTreeId.L1_TO_L2_MESSAGE_TREE,
201-
padArrayEnd<Fr, number>(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP),
202-
);
199+
await fork.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, l1ToL2Messages);
203200
const newL1ToL2Snapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, fork);
204201

205202
const startBlockNumber = this.nextBlockNumber;

yarn-project/prover-client/src/orchestrator/block-building-helpers.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,15 @@ export async function getSubtreeSiblingPath(
400400
return fullSiblingPath.getSubtreeSiblingPath(subtreeHeight).toFields();
401401
}
402402

403+
/**
404+
* Returns the full-height frontier (left-sibling path) at a tree's next-available leaf index — the hint the append
405+
* circuits re-hash against the snapshot root when appending leaves at a compact (unaligned) index (AZIP-22 Fast Inbox).
406+
*/
407+
export async function getFrontierSiblingPath(treeId: MerkleTreeId, db: MerkleTreeReadOperations): Promise<Fr[]> {
408+
const nextAvailableLeafIndex = await db.getTreeInfo(treeId).then(t => t.size);
409+
return (await db.getSiblingPath(treeId, nextAvailableLeafIndex)).toFields();
410+
}
411+
403412
// Scan a tree searching for a specific value and return a membership witness proof for it
404413
export async function getMembershipWitnessFor<N extends number>(
405414
value: Fr,

yarn-project/prover-client/src/orchestrator/block-proving-state.ts

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { type BlockBlobData, type BlockEndBlobData, type SpongeBlob, encodeBlockEndBlobData } from '@aztec/blob-lib';
22
import {
33
type ARCHIVE_HEIGHT,
4-
L1_TO_L2_MSG_SUBTREE_HEIGHT,
5-
type L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
64
type L1_TO_L2_MSG_TREE_HEIGHT,
7-
MAX_L1_TO_L2_MSGS_PER_BLOCK,
85
type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
96
} from '@aztec/constants';
107
import { BlockNumber } from '@aztec/foundation/branded-types';
@@ -66,12 +63,14 @@ export class BlockProvingState {
6663
private readonly timestamp: UInt64,
6764
public readonly lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot,
6865
private readonly lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
69-
private readonly lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
70-
private readonly lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<
71-
Fr,
72-
typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH
73-
>,
66+
// This block's L1-to-L2 message tree snapshot before and after its own bundle (AZIP-22 Fast Inbox). The start is
67+
// the previous block's end (block-merge continuity); the end is this block's own post-bundle snapshot.
68+
private readonly startL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
7469
public readonly newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
70+
// Full-height frontier (left-sibling path) at the block's start index, pinning the append at a compact index.
71+
private readonly l1ToL2MessageFrontierHint: Tuple<Fr, typeof L1_TO_L2_MSG_TREE_HEIGHT>,
72+
// This block's own real L1-to-L2 message leaves (unpadded slice).
73+
private readonly l1ToL2Messages: Fr[],
7574
private readonly headerOfLastBlockInPreviousCheckpoint: BlockHeader,
7675
private readonly startSpongeBlob: SpongeBlob,
7776
public parentCheckpoint: CheckpointProvingState,
@@ -304,7 +303,7 @@ export class BlockProvingState {
304303
inputs: new BlockRootSingleTxRollupPrivateInputs(
305304
leftRollup,
306305
messageBundle,
307-
this.lastL1ToL2MessageTreeSnapshot,
306+
this.startL1ToL2MessageTreeSnapshot,
308307
startMsgSponge,
309308
frontierHint,
310309
this.lastArchiveSiblingPath,
@@ -316,7 +315,7 @@ export class BlockProvingState {
316315
inputs: new BlockRootRollupPrivateInputs(
317316
[leftRollup, rightRollup],
318317
messageBundle,
319-
this.lastL1ToL2MessageTreeSnapshot,
318+
this.startL1ToL2MessageTreeSnapshot,
320319
startMsgSponge,
321320
frontierHint,
322321
this.lastArchiveSiblingPath,
@@ -348,7 +347,7 @@ export class BlockProvingState {
348347
inputs: new BlockRootSingleTxFirstRollupPrivateInputs(
349348
leftRollup,
350349
messageBundle,
351-
this.lastL1ToL2MessageTreeSnapshot,
350+
this.startL1ToL2MessageTreeSnapshot,
352351
frontierHint,
353352
this.lastArchiveSiblingPath,
354353
),
@@ -359,7 +358,7 @@ export class BlockProvingState {
359358
inputs: new BlockRootFirstRollupPrivateInputs(
360359
[leftRollup, rightRollup],
361360
messageBundle,
362-
this.lastL1ToL2MessageTreeSnapshot,
361+
this.startL1ToL2MessageTreeSnapshot,
363362
frontierHint,
364363
this.lastArchiveSiblingPath,
365364
),
@@ -368,31 +367,21 @@ export class BlockProvingState {
368367
}
369368

370369
/**
371-
* The real-count message bundle this block appends (AZIP-22 Fast Inbox): the real leaves inserted at compact indices
372-
* and absorbed into the message sponge.
373-
*
374-
* TODO(fast-inbox): the prover still assigns the whole checkpoint's messages to the first block. Post-flip a block
375-
* carries at most `MAX_L1_TO_L2_MSGS_PER_BLOCK` and a checkpoint drains its consumption across up to four blocks, so
376-
* this must split the checkpoint's messages per block (with per-block start/end snapshots and full-height frontier
377-
* hints at compact indices). Requires the proving-path rework; verified by epoch-proving e2e on CI.
370+
* The real-count message bundle this block appends (AZIP-22 Fast Inbox): the block's own message slice, inserted at
371+
* compact indices and absorbed into its block-root message sponge.
378372
*/
379373
#getMessageBundle(): L1ToL2MessageBundle {
380-
if (this.isFirstBlock) {
381-
return makeL1ToL2MessageBundle(this.parentCheckpoint.getL1ToL2Messages());
382-
}
383-
return L1ToL2MessageBundle.empty();
374+
return this.l1ToL2Messages.length === 0
375+
? L1ToL2MessageBundle.empty()
376+
: makeL1ToL2MessageBundle(this.l1ToL2Messages);
384377
}
385378

386379
/**
387-
* Full-height frontier hint for the bundle append. The l1-to-l2 tree index is always subtree-aligned in the
388-
* transitional wiring, so the bottom `L1_TO_L2_MSG_SUBTREE_HEIGHT` levels are left-child (unread, zero) and the top
389-
* levels are exactly the subtree-root sibling path already captured for this block.
380+
* Full-height frontier hint for the bundle append: the left-sibling path at the block's compact start index, which
381+
* the block-root circuit re-hashes against its start snapshot root (AZIP-22 Fast Inbox).
390382
*/
391383
#getFrontierHint(): Tuple<Fr, typeof L1_TO_L2_MSG_TREE_HEIGHT> {
392-
return [
393-
...Array.from({ length: L1_TO_L2_MSG_SUBTREE_HEIGHT }, () => Fr.ZERO),
394-
...this.lastL1ToL2MessageSubtreeRootSiblingPath,
395-
] as Tuple<Fr, typeof L1_TO_L2_MSG_TREE_HEIGHT>;
384+
return this.l1ToL2MessageFrontierHint;
396385
}
397386

398387
// Returns a specific transaction proving state

yarn-project/prover-client/src/orchestrator/checkpoint-proving-state.ts

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SpongeBlob } from '@aztec/blob-lib';
22
import type {
33
ARCHIVE_HEIGHT,
4-
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
4+
L1_TO_L2_MSG_TREE_HEIGHT,
55
NESTED_RECURSIVE_PROOF_LENGTH,
66
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
77
} from '@aztec/constants';
@@ -42,18 +42,6 @@ export class CheckpointProvingState {
4242
// Inbox rolling hash before this checkpoint's messages (the previous checkpoint's end value; genesis is zero).
4343
// Threaded into the InboxParity circuit so the resulting checkpoint header rolling hash matches the proposer's.
4444
private readonly startInboxRollingHash: Fr,
45-
// The snapshot and sibling path before the new l1 to l2 message subtree is inserted.
46-
private readonly lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
47-
private readonly lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<
48-
Fr,
49-
typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH
50-
>,
51-
// The snapshot and sibling path after the new l1 to l2 message subtree is inserted.
52-
private readonly newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
53-
private readonly newL1ToL2MessageSubtreeRootSiblingPath: Tuple<
54-
Fr,
55-
typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH
56-
>,
5745
// Message-bundle sponge over the checkpoint's real messages (real-count absorb). Equals the InboxParity proof's
5846
// end sponge and the sponge the block roots accumulate, so it is threaded into non-first block roots as their
5947
// inherited `startMsgSponge`.
@@ -84,20 +72,18 @@ export class CheckpointProvingState {
8472
totalNumTxs: number,
8573
lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot,
8674
lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
75+
// Per-block L1-to-L2 message state (AZIP-22 Fast Inbox): the block's start snapshot (its parent's end), its own
76+
// post-bundle end snapshot, the full-height frontier at the start index, and its own real message slice.
77+
startL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
78+
endL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
79+
l1ToL2MessageFrontierHint: Tuple<Fr, typeof L1_TO_L2_MSG_TREE_HEIGHT>,
80+
l1ToL2Messages: Fr[],
8781
): BlockProvingState {
8882
const index = Number(blockNumber) - Number(this.firstBlockNumber);
8983
if (index >= this.totalNumBlocks) {
9084
throw new Error(`Unable to start a new block at index ${index}. Expected at most ${this.totalNumBlocks} blocks.`);
9185
}
9286

93-
// If this is the first block, we use the snapshot and sibling path before the new l1 to l2 messages are inserted.
94-
// Otherwise, we use the snapshot and sibling path after the new l1 to l2 messages are inserted, which will always
95-
// happen in the first block.
96-
const lastL1ToL2MessageTreeSnapshot =
97-
index === 0 ? this.lastL1ToL2MessageTreeSnapshot : this.newL1ToL2MessageTreeSnapshot;
98-
const lastL1ToL2MessageSubtreeRootSiblingPath =
99-
index === 0 ? this.lastL1ToL2MessageSubtreeRootSiblingPath : this.newL1ToL2MessageSubtreeRootSiblingPath;
100-
10187
const startSpongeBlob = index === 0 ? SpongeBlob.init() : this.blocks[index - 1]?.getEndSpongeBlob();
10288
if (!startSpongeBlob) {
10389
throw new Error(
@@ -113,9 +99,10 @@ export class CheckpointProvingState {
11399
timestamp,
114100
lastArchiveTreeSnapshot,
115101
lastArchiveSiblingPath,
116-
lastL1ToL2MessageTreeSnapshot,
117-
lastL1ToL2MessageSubtreeRootSiblingPath,
118-
this.newL1ToL2MessageTreeSnapshot,
102+
startL1ToL2MessageTreeSnapshot,
103+
endL1ToL2MessageTreeSnapshot,
104+
l1ToL2MessageFrontierHint,
105+
l1ToL2Messages,
119106
this.headerOfLastBlockInPreviousCheckpoint,
120107
startSpongeBlob,
121108
this,

yarn-project/prover-client/src/orchestrator/checkpoint-sub-tree-orchestrator.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ describe('prover/orchestrator/checkpoint-sub-tree', () => {
5858
try {
5959
const resultPromise = subTree.getSubTreeResult();
6060

61-
for (const block of blocks) {
61+
for (const [blockIndex, block] of blocks.entries()) {
6262
const { blockNumber, timestamp } = block.header.globalVariables;
63-
await subTree.startNewBlock(blockNumber, timestamp, block.txs.length);
63+
await subTree.startNewBlock(blockNumber, timestamp, block.txs.length, blockIndex === 0 ? l1ToL2Messages : []);
6464
if (block.txs.length > 0) {
6565
await subTree.addTxs(block.txs);
6666
}
@@ -104,9 +104,9 @@ describe('prover/orchestrator/checkpoint-sub-tree', () => {
104104
try {
105105
const resultPromise = subTree.getSubTreeResult();
106106

107-
for (const block of blocks) {
107+
for (const [blockIndex, block] of blocks.entries()) {
108108
const { blockNumber, timestamp } = block.header.globalVariables;
109-
await subTree.startNewBlock(blockNumber, timestamp, block.txs.length);
109+
await subTree.startNewBlock(blockNumber, timestamp, block.txs.length, blockIndex === 0 ? l1ToL2Messages : []);
110110
if (block.txs.length > 0) {
111111
await subTree.addTxs(block.txs);
112112
}
@@ -149,9 +149,9 @@ describe('prover/orchestrator/checkpoint-sub-tree', () => {
149149
try {
150150
const resultPromise = subTree.getSubTreeResult();
151151

152-
for (const block of blocks) {
152+
for (const [blockIndex, block] of blocks.entries()) {
153153
const { blockNumber, timestamp } = block.header.globalVariables;
154-
await subTree.startNewBlock(blockNumber, timestamp, block.txs.length);
154+
await subTree.startNewBlock(blockNumber, timestamp, block.txs.length, blockIndex === 0 ? l1ToL2Messages : []);
155155
if (block.txs.length > 0) {
156156
await subTree.addTxs(block.txs);
157157
}
@@ -197,9 +197,9 @@ describe('prover/orchestrator/checkpoint-sub-tree', () => {
197197
try {
198198
const resultPromise = subTree.getSubTreeResult();
199199

200-
for (const block of blocks) {
200+
for (const [blockIndex, block] of blocks.entries()) {
201201
const { blockNumber, timestamp } = block.header.globalVariables;
202-
await subTree.startNewBlock(blockNumber, timestamp, block.txs.length);
202+
await subTree.startNewBlock(blockNumber, timestamp, block.txs.length, blockIndex === 0 ? l1ToL2Messages : []);
203203
if (block.txs.length > 0) {
204204
await subTree.addTxs(block.txs);
205205
}

yarn-project/prover-client/src/orchestrator/checkpoint-sub-tree-orchestrator.ts

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { SpongeBlob } from '@aztec/blob-lib/types';
22
import {
33
type ARCHIVE_HEIGHT,
4-
L1_TO_L2_MSG_SUBTREE_HEIGHT,
5-
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
4+
L1_TO_L2_MSG_TREE_HEIGHT,
65
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
76
} from '@aztec/constants';
87
import { BlockNumber, type EpochNumber } from '@aztec/foundation/branded-types';
@@ -51,10 +50,10 @@ import { inspect } from 'util';
5150

5251
import {
5352
buildHeaderFromCircuitOutputs,
53+
getFrontierSiblingPath,
5454
getLastSiblingPath,
5555
getPublicChonkVerifierPrivateInputsFromTx,
5656
getRootTreeSiblingPath,
57-
getSubtreeSiblingPath,
5857
getTreeSnapshot,
5958
insertSideEffectsAndBuildBaseRollupHints,
6059
validatePartialState,
@@ -264,7 +263,7 @@ export class CheckpointSubTreeOrchestrator extends ProvingScheduler {
264263
@trackSpan('CheckpointSubTreeOrchestrator.startNewBlock', blockNumber => ({
265264
[Attributes.BLOCK_NUMBER]: blockNumber,
266265
}))
267-
public async startNewBlock(blockNumber: BlockNumber, timestamp: UInt64, totalNumTxs: number) {
266+
public async startNewBlock(blockNumber: BlockNumber, timestamp: UInt64, totalNumTxs: number, l1ToL2Messages: Fr[]) {
268267
if (!this.provingState) {
269268
throw new Error('Empty proving state. The checkpoint sub-tree has not been started.');
270269
}
@@ -288,12 +287,26 @@ export class CheckpointSubTreeOrchestrator extends ProvingScheduler {
288287
const lastArchiveTreeSnapshot = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
289288
const lastArchiveSiblingPath = await getRootTreeSiblingPath(MerkleTreeId.ARCHIVE, db);
290289

290+
// Streaming Inbox (AZIP-22 Fast Inbox): insert this block's own real message slice at compact indices, capturing
291+
// the start snapshot + full-height frontier before the append and the block's own post-bundle end snapshot after.
292+
const startL1ToL2Snapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db);
293+
const l1ToL2FrontierHint = assertLength(
294+
await getFrontierSiblingPath(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db),
295+
L1_TO_L2_MSG_TREE_HEIGHT,
296+
);
297+
await appendL1ToL2MessagesToTree(db, l1ToL2Messages);
298+
const endL1ToL2Snapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db);
299+
291300
const blockProvingState = this.provingState.startNewBlock(
292301
blockNumber,
293302
timestamp,
294303
totalNumTxs,
295304
lastArchiveTreeSnapshot,
296305
lastArchiveSiblingPath,
306+
startL1ToL2Snapshot,
307+
endL1ToL2Snapshot,
308+
l1ToL2FrontierHint,
309+
l1ToL2Messages,
297310
);
298311

299312
// Because `addTxs` won't be called for a block without txs, and that's where the sponge blob state is computed,
@@ -518,16 +531,9 @@ export class CheckpointSubTreeOrchestrator extends ProvingScheduler {
518531
// Get archive sibling path before any block in this checkpoint lands.
519532
const lastArchiveSiblingPath = await getLastSiblingPath(MerkleTreeId.ARCHIVE, db);
520533

521-
// Insert all the l1 to l2 messages into the db. Get the states before and after the insertion.
522-
const {
523-
lastL1ToL2MessageTreeSnapshot,
524-
lastL1ToL2MessageSubtreeRootSiblingPath,
525-
newL1ToL2MessageTreeSnapshot,
526-
newL1ToL2MessageSubtreeRootSiblingPath,
527-
} = await this.updateL1ToL2MessageTree(l1ToL2Messages, db);
528-
529-
// The message sponge absorbs the checkpoint's real messages (real-count), matching the checkpoint's single
530-
// InboxParity proof; non-first block roots inherit this sponge (AZIP-22 Fast Inbox).
534+
// Streaming Inbox (AZIP-22 Fast Inbox): messages are inserted per block in `startNewBlock`, not the whole
535+
// checkpoint up front. The message sponge still absorbs the checkpoint's real messages (real-count), matching the
536+
// checkpoint's single InboxParity proof; non-first block roots inherit this sponge.
531537
const checkpointMsgSponge = L1ToL2MessageSponge.empty();
532538
await checkpointMsgSponge.absorb(l1ToL2Messages);
533539

@@ -539,10 +545,6 @@ export class CheckpointSubTreeOrchestrator extends ProvingScheduler {
539545
lastArchiveSiblingPath,
540546
l1ToL2Messages,
541547
startInboxRollingHash,
542-
lastL1ToL2MessageTreeSnapshot,
543-
lastL1ToL2MessageSubtreeRootSiblingPath,
544-
newL1ToL2MessageTreeSnapshot,
545-
newL1ToL2MessageSubtreeRootSiblingPath,
546548
checkpointMsgSponge,
547549
Number(this.epochNumber),
548550
/* isAlive */ () => !this.cancelled,
@@ -556,30 +558,6 @@ export class CheckpointSubTreeOrchestrator extends ProvingScheduler {
556558

557559
// ---------------- private: per-block proof orchestration ----------------
558560

559-
private async updateL1ToL2MessageTree(l1ToL2Messages: Fr[], db: MerkleTreeWriteOperations) {
560-
const lastL1ToL2MessageTreeSnapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db);
561-
const lastL1ToL2MessageSubtreeRootSiblingPath = assertLength(
562-
await getSubtreeSiblingPath(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, L1_TO_L2_MSG_SUBTREE_HEIGHT, db),
563-
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
564-
);
565-
566-
// Update the local trees to include the new l1 to l2 messages.
567-
await appendL1ToL2MessagesToTree(db, l1ToL2Messages);
568-
569-
const newL1ToL2MessageTreeSnapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db);
570-
const newL1ToL2MessageSubtreeRootSiblingPath = assertLength(
571-
await getSubtreeSiblingPath(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, L1_TO_L2_MSG_SUBTREE_HEIGHT, db),
572-
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
573-
);
574-
575-
return {
576-
lastL1ToL2MessageTreeSnapshot,
577-
lastL1ToL2MessageSubtreeRootSiblingPath,
578-
newL1ToL2MessageTreeSnapshot,
579-
newL1ToL2MessageSubtreeRootSiblingPath,
580-
};
581-
}
582-
583561
// Updates the merkle trees for a transaction. The first enqueued job for a transaction.
584562
@trackSpan('CheckpointSubTreeOrchestrator.prepareBaseRollupInputs', tx => ({
585563
[Attributes.TX_HASH]: tx.hash.toString(),

0 commit comments

Comments
 (0)