@@ -193,7 +193,7 @@ describe('e2e_block_building', () => {
193
193
logger . info ( `Updating aztec node config` ) ;
194
194
await aztecNode . setConfig ( { minTxsPerBlock : 1 , maxTxsPerBlock : TX_COUNT , enforceTimeTable : true } ) ;
195
195
196
- // We tweak the sequencer so it uses a fake simulator that adds a 200ms delay to every public tx.
196
+ // We tweak the sequencer so it uses a fake simulator that adds a delay to every public tx.
197
197
const archiver = ( aztecNode as AztecNodeService ) . getContractDataSource ( ) ;
198
198
sequencer . sequencer . publicProcessorFactory = new TestPublicProcessorFactory (
199
199
archiver ,
@@ -202,11 +202,13 @@ describe('e2e_block_building', () => {
202
202
) ;
203
203
204
204
// We also cheat the sequencer's timetable so it allocates little time to processing.
205
- // This will leave the sequencer with just 2s to build the block, so it shouldn't be
206
- // able to squeeze in more than 10 txs in each. This is sensitive to the time it takes
207
- // to pick up and validate the txs, so we may need to bump it to work on CI.
208
- sequencer . sequencer . timeTable [ SequencerState . WAITING_FOR_TXS ] = 2 ;
209
- sequencer . sequencer . timeTable [ SequencerState . CREATING_BLOCK ] = 2 ;
205
+ // This will leave the sequencer with just a few seconds to build the block, so it shouldn't
206
+ // be able to squeeze in more than ~12 txs in each. This is sensitive to the time it takes
207
+ // to pick up and validate the txs, so we may need to bump it to work on CI. Note that we need
208
+ // at least 3s here so the archiver has time to loop once and sync, and the sequencer has at
209
+ // least 1s to loop.
210
+ sequencer . sequencer . timeTable [ SequencerState . WAITING_FOR_TXS ] = 4 ;
211
+ sequencer . sequencer . timeTable [ SequencerState . CREATING_BLOCK ] = 4 ;
210
212
sequencer . sequencer . processTxTime = 1 ;
211
213
212
214
// Flood the mempool with TX_COUNT simultaneous txs
@@ -615,9 +617,11 @@ type TestSequencer = Omit<Sequencer, 'publicProcessorFactory' | 'timeTable'> & {
615
617
} ;
616
618
type TestSequencerClient = Omit < SequencerClient , 'sequencer' > & { sequencer : TestSequencer } ;
617
619
620
+ const TEST_PUBLIC_TX_SIMULATION_DELAY_MS = 300 ;
621
+
618
622
class TestPublicTxSimulator extends PublicTxSimulator {
619
623
public override async simulate ( tx : Tx ) : Promise < PublicTxResult > {
620
- await sleep ( 200 ) ;
624
+ await sleep ( TEST_PUBLIC_TX_SIMULATION_DELAY_MS ) ;
621
625
return super . simulate ( tx ) ;
622
626
}
623
627
}
0 commit comments