11import { createLogger } from '@aztec/aztec.js/log' ;
2+ import { getCheckpointFinalizationTimeSeconds } from '@aztec/stdlib/timetable' ;
3+ import {
4+ DEFAULT_CHECKPOINT_ASSEMBLE_TIME_SECONDS ,
5+ TEST_CHECKPOINT_ASSEMBLE_TIME_SECONDS ,
6+ TEST_FAST_TIMING_ETHEREUM_SLOT_THRESHOLD_SECONDS ,
7+ } from '@aztec/stdlib/timetable/constants' ;
28
39import { DEFAULT_ATTESTATION_PROPAGATION_TIME as DEFAULT_P2P_PROPAGATION_TIME } from '../config.js' ;
410import { SequencerTooSlowError } from './errors.js' ;
@@ -7,7 +13,7 @@ import { SequencerState } from './utils.js';
713
814export const MIN_EXECUTION_TIME = 2 ;
915export const CHECKPOINT_INITIALIZATION_TIME = 1 ;
10- export const CHECKPOINT_ASSEMBLE_TIME = 1 ;
16+ export const CHECKPOINT_ASSEMBLE_TIME = DEFAULT_CHECKPOINT_ASSEMBLE_TIME_SECONDS ;
1117
1218export class SequencerTimetable {
1319 /**
@@ -89,9 +95,9 @@ export class SequencerTimetable {
8995 this . enforce = opts . enforce ;
9096
9197 // Assume zero-cost propagation time and faster runs in test environments where L1 slot duration is shortened
92- if ( this . ethereumSlotDuration < 8 ) {
98+ if ( this . ethereumSlotDuration < TEST_FAST_TIMING_ETHEREUM_SLOT_THRESHOLD_SECONDS ) {
9399 this . p2pPropagationTime = 0 ;
94- this . checkpointAssembleTime = 0.5 ;
100+ this . checkpointAssembleTime = TEST_CHECKPOINT_ASSEMBLE_TIME_SECONDS ;
95101 this . checkpointInitializationTime = 0.5 ;
96102 this . minExecutionTime = 1 ;
97103 }
@@ -106,10 +112,11 @@ export class SequencerTimetable {
106112 this . initializationOffset = this . checkpointInitializationTime ;
107113
108114 // Calculate total checkpoint finalization time (assembly + attestations + L1 publishing)
109- this . checkpointFinalizationTime =
110- this . checkpointAssembleTime +
111- this . p2pPropagationTime * 2 + // Round-trip propagation
112- this . l1PublishingTime ; // L1 publishing
115+ this . checkpointFinalizationTime = getCheckpointFinalizationTimeSeconds ( {
116+ ethereumSlotDuration : this . ethereumSlotDuration ,
117+ l1PublishingTime : this . l1PublishingTime ,
118+ p2pPropagationTime : this . p2pPropagationTime ,
119+ } ) ;
113120
114121 // Calculate maximum number of blocks that fit in this slot
115122 if ( ! this . blockDuration ) {
0 commit comments