@@ -281,9 +281,11 @@ where
281281 first_flashblock_offset = first_flashblock_offset. as_millis( ) ,
282282 flashblocks_interval = self . config. specific. interval. as_millis( ) ,
283283 ) ;
284- ctx. metrics
285- . target_flashblock
286- . record ( flashblocks_per_block as f64 ) ;
284+ ctx. metrics . reduced_flashblocks_number . record (
285+ self . config
286+ . flashblocks_per_block ( )
287+ . saturating_sub ( flashblocks_per_block) as f64 ,
288+ ) ;
287289 ctx. metrics
288290 . first_flashblock_time_offset
289291 . record ( first_flashblock_offset. as_millis ( ) as f64 ) ;
@@ -490,9 +492,14 @@ where
490492 // Exit loop if channel closed or cancelled
491493 ctx. metrics . block_built_success . increment ( 1 ) ;
492494 ctx. metrics . flashblock_count . record ( flashblock_count as f64 ) ;
495+ ctx. metrics
496+ . missing_flashblocks_count
497+ . record ( flashblocks_per_block. saturating_sub ( flashblock_count) as f64 ) ;
493498 debug ! (
494499 target: "payload_builder" ,
495- message = "Payload building complete, channel closed or job cancelled"
500+ message = "Payload building complete, channel closed or job cancelled" ,
501+ missing_falshblocks = flashblocks_per_block. saturating_sub( flashblock_count) ,
502+ reduced_flashblocks = self . config. flashblocks_per_block( ) . saturating_sub( flashblocks_per_block) ,
496503 ) ;
497504 span. record ( "flashblock_count" , flashblock_count) ;
498505 return Ok ( ( ) ) ;
@@ -579,14 +586,17 @@ where
579586 self . config . specific . interval ,
580587 ) ;
581588 } ;
582- self . metrics
583- . flashblock_time_drift
584- . record ( time_drift. as_millis ( ) as f64 ) ;
589+ self . metrics . flashblocks_time_drift . record (
590+ self . config
591+ . block_time
592+ . as_millis ( )
593+ . saturating_sub ( time_drift. as_millis ( ) ) as f64 ,
594+ ) ;
585595 debug ! (
586596 target: "payload_builder" ,
587597 message = "Time drift for building round" ,
588598 ?target_time,
589- ? time_drift,
599+ time_drift = self . config . block_time . as_millis ( ) . saturating_sub ( time_drift . as_millis ( ) ) ,
590600 ?timestamp
591601 ) ;
592602 // This is extra check to ensure that we would account at least for block time in case we have any timer discrepancies.
0 commit comments