@@ -29,8 +29,7 @@ jest.setTimeout(1000 * 60 * 10);
2929
3030const NODE_COUNT = 8 ;
3131const COMMITTEE_SIZE = 3 ;
32- const TX_COUNT = 2 ;
33- const EPOCH = EpochNumber ( 4 ) ;
32+ const TX_COUNT = 8 ;
3433
3534// Spawns NODE_COUNT validator nodes, connected via a mocked gossip sub network, but sets
3635// committee size to 3. Warps to immediately before the beginning of an epoch, and checks
@@ -54,6 +53,7 @@ describe('e2e_epochs/epochs_first_slot', () => {
5453 } ) ;
5554
5655 // Setup context with the given set of validators, no reorgs, mocked gossip sub network, and no anvil test watcher.
56+ // We expect 4 blocks per checkpoint with this config
5757 test = await EpochsTestContext . setup ( {
5858 numberOfAccounts : 0 ,
5959 initialValidators : validators ,
@@ -62,6 +62,8 @@ describe('e2e_epochs/epochs_first_slot', () => {
6262 aztecProofSubmissionEpochs : 1024 ,
6363 aztecEpochDuration : 32 ,
6464 aztecSlotDurationInL1Slots : 3 ,
65+ ethereumSlotDuration : 12 ,
66+ blockDurationMs : 6000 ,
6567 startProverNode : false ,
6668 aztecTargetCommitteeSize : COMMITTEE_SIZE ,
6769 enforceTimeTable : true ,
@@ -70,6 +72,8 @@ describe('e2e_epochs/epochs_first_slot', () => {
7072 attestationPropagationTime : 0.5 ,
7173 archiverPollingIntervalMS : 200 ,
7274 skipInitialSequencer : true ,
75+ enableProposerPipelining : true ,
76+ inboxLag : 2 ,
7377 } ) ;
7478
7579 ( { context, logger } = test ) ;
@@ -110,9 +114,18 @@ describe('e2e_epochs/epochs_first_slot', () => {
110114 const sequencers = nodes . map ( node => node . getSequencer ( ) ! ) ;
111115 const { failEvents } = test . watchSequencerEvents ( sequencers , i => ( { validator : validators [ i ] . attester } ) ) ;
112116
113- // Warp to before the first slot of an epoch, so that the sequencers are ready to build blocks.
114- const [ epochStart ] = getTimestampRangeForEpoch ( EPOCH , test . constants ) ;
115- await test . context . cheatCodes . eth . warp ( Number ( epochStart ) - test . L1_BLOCK_TIME_IN_S , {
117+ // Jump to the beginning of two epochs from now
118+ const currentEpoch = ( await test . monitor . run ( ) ) . l2EpochNumber ;
119+ const epoch = EpochNumber ( currentEpoch + 2 ) ;
120+
121+ // Warp so that the next pipelined build cycle targets the first slot of the epoch. Under
122+ // proposer pipelining the build window starts one L2 slot earlier than the target slot
123+ // so we want wall-clock to enter `firstSlot - 1` (the last slot of the previous epoch) before
124+ // the next L1 block. Subtracting `L2_SLOT_DURATION + L1_BLOCK_TIME` puts us one L1 block before that
125+ // build slot starts, so the proposer for `firstSlot` gets the full build window available
126+ // before the epoch boundary is crossed on L1.
127+ const [ epochStart ] = getTimestampRangeForEpoch ( epoch , test . constants ) ;
128+ await test . context . cheatCodes . eth . warp ( Number ( epochStart ) - test . L2_SLOT_DURATION_IN_S - test . L1_BLOCK_TIME_IN_S , {
116129 resetBlockInterval : true ,
117130 } ) ;
118131
@@ -126,7 +139,7 @@ describe('e2e_epochs/epochs_first_slot', () => {
126139 logger . warn ( `All txs have been mined` ) ;
127140
128141 // Check that the first two slots of the epoch have a block
129- const [ firstSlot ] = getSlotRangeForEpoch ( EPOCH , test . constants ) ;
142+ const [ firstSlot ] = getSlotRangeForEpoch ( epoch , test . constants ) ;
130143 const secondSlot = SlotNumber ( firstSlot + 1 ) ;
131144 logger . warn ( `Waiting until blocks are synced for slots ${ firstSlot } and ${ secondSlot } ` ) ;
132145 await retryUntil (
@@ -141,12 +154,6 @@ describe('e2e_epochs/epochs_first_slot', () => {
141154 1 ,
142155 ) ;
143156
144- // Expect no failures from sequencers during block building.
145- // The following error is marked as a flake on the test ignore patterns,
146- // so we can have this test run for a while before it breaks CI on a recoverable error.
147- if ( failEvents . length > 0 ) {
148- logger . error ( `Failed events from sequencers` , failEvents ) ;
149- }
150- expect ( failEvents ) . toEqual ( [ ] ) ;
157+ test . assertNoFailuresFromSequencers ( failEvents ) ;
151158 } ) ;
152159} ) ;
0 commit comments