File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,14 @@ pub struct BuilderConfig {
155155 ) ]
156156 pub max_host_gas_coefficient : Option < u8 > ,
157157
158+ /// Number of seconds before the end of the slot to stop querying for new blocks
159+ #[ from_env(
160+ var ="BLOCK_QUERY_CUTOFF_SECS" ,
161+ desc = "Number of seconds before the end of the slot to stop querying for new blocks" ,
162+ default = 2
163+ ) ]
164+ pub block_query_cutoff_secs : u64 ,
165+
158166 /// The slot calculator for the builder.
159167 pub slot_calculator : SlotCalculator ,
160168
Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ impl Simulator {
253253 // We have the timepoint in seconds into the slot. To find out what's
254254 // remaining, we need to subtract it from the slot duration
255255 // we also subtract 3 seconds to account for the sequencer stopping signing.
256- let remaining = ( self . slot_calculator ( ) . slot_duration ( ) - timepoint) . saturating_sub ( 3 ) ;
256+ let remaining = ( self . slot_calculator ( ) . slot_duration ( ) - timepoint) . saturating_sub ( self . config . block_query_cutoff_secs ) ;
257257
258258 let deadline = Instant :: now ( ) + Duration :: from_secs ( remaining) ;
259259 deadline. max ( Instant :: now ( ) )
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ pub fn setup_test_config() -> Result<BuilderConfig> {
5353 1740681556 , // pecorino start timestamp as sane default
5454 0 , 1 ,
5555 ) ,
56+ block_query_cutoff_secs : 2 ,
5657 max_host_gas_coefficient : Some ( 80 ) ,
5758 constants : SignetSystemConstants :: pecorino ( ) ,
5859 } ;
You can’t perform that action at this time.
0 commit comments