@@ -32,7 +32,12 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address';
3232import { type BlockData , BlockHash , L2Block , type L2BlockSink , type L2BlockSource } from '@aztec/stdlib/block' ;
3333import { type Checkpoint , CheckpointReexecutionTracker , type ProposedCheckpointData } from '@aztec/stdlib/checkpoint' ;
3434import type { SlasherConfig , WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server' ;
35- import { type L1ToL2MessageSource , computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging' ;
35+ import {
36+ type InboxBucket ,
37+ InboxBucketRef ,
38+ type L1ToL2MessageSource ,
39+ computeInHashFromL1ToL2Messages ,
40+ } from '@aztec/stdlib/messaging' ;
3641import type { BlockProposal } from '@aztec/stdlib/p2p' ;
3742import { CheckpointHeader } from '@aztec/stdlib/rollup' ;
3843import {
@@ -448,11 +453,24 @@ describe('ValidatorClient', () => {
448453 Array . isArray ( args ) &&
449454 args [ 0 ] ?. offenseType === OffenseType . ATTESTED_TO_INVALID_CHECKPOINT_PROPOSAL ,
450455 ) ;
456+ // AZIP-22 Fast Inbox: an empty-consumption streaming setup. Proposals reference the genesis Inbox bucket, the
457+ // parent block's L1-to-L2 leaf count equals its cumulative total (0), so the derived per-block bundle is empty.
458+ const genesisInboxBucket : InboxBucket = {
459+ seq : 0n ,
460+ inboxRollingHash : Fr . ZERO ,
461+ totalMsgCount : 0n ,
462+ timestamp : 0n ,
463+ msgCount : 0 ,
464+ lastMessageIndex : 0n ,
465+ isOpen : false ,
466+ } ;
467+ const genesisBucketRef = InboxBucketRef . fromBucket ( genesisInboxBucket ) ;
468+
451469 beforeEach ( async ( ) => {
452470 const emptyInHash = computeInHashFromL1ToL2Messages ( [ ] ) ;
453471 const blockHeader = makeBlockHeader ( 1 , { blockNumber : BlockNumber ( 100 ) , slotNumber : SlotNumber ( 100 ) } ) ;
454472 blockNumber = BlockNumber ( blockHeader . globalVariables . blockNumber ) ;
455- proposal = await makeBlockProposal ( { blockHeader, inHash : emptyInHash } ) ;
473+ proposal = await makeBlockProposal ( { blockHeader, inHash : emptyInHash , bucketRef : genesisBucketRef } ) ;
456474 // The proposal targets slot 100, which under pipelining is built during the previous slot. Set the
457475 // wall clock to the start of that build slot (target_slot_start - S), matching how a pipelined
458476 // proposer is positioned when validating an inbound block proposal. With S - 2E = 0 in this config
@@ -512,6 +530,7 @@ describe('ValidatorClient', () => {
512530 getBlockNumber : ( ) => blockNumber - 1 ,
513531 getSlot : ( ) => parentSlot ,
514532 globalVariables : blockHeader . globalVariables ,
533+ state : { l1ToL2MessageTree : { nextAvailableLeafIndex : 0 } } ,
515534 } ,
516535 archive : new AppendOnlyTreeSnapshot ( Fr . random ( ) , blockNumber - 1 ) ,
517536 blockHash : BlockHash . random ( ) ,
@@ -525,6 +544,11 @@ describe('ValidatorClient', () => {
525544 blockSource . getGenesisValues . mockResolvedValue ( { genesisArchiveRoot : new Fr ( GENESIS_ARCHIVE_ROOT ) } ) ;
526545 blockSource . syncImmediate . mockImplementation ( ( ) => Promise . resolve ( ) ) ;
527546
547+ // Resolve every Inbox bucket query to the genesis bucket, so streaming checks accept with an empty bundle.
548+ l1ToL2MessageSource . getInboxBucket . mockResolvedValue ( genesisInboxBucket ) ;
549+ l1ToL2MessageSource . getInboxBucketByTotalMsgCount . mockResolvedValue ( genesisInboxBucket ) ;
550+ l1ToL2MessageSource . getL1ToL2MessagesBetweenBuckets . mockResolvedValue ( [ ] ) ;
551+
528552 const clonedBlockHeader = blockHeader . clone ( ) ;
529553 blockBuildResult = {
530554 publicProcessorDuration : 0 ,
@@ -727,6 +751,7 @@ describe('ValidatorClient', () => {
727751 archiveRoot : proposal . archive ,
728752 txHashes : proposal . txHashes ,
729753 signer : selfSigner ,
754+ bucketRef : genesisBucketRef ,
730755 } ) ;
731756
732757 epochCache . getProposerAttesterAddressInSlot . mockResolvedValue ( selfSigner . address ) ;
0 commit comments