@@ -7,7 +7,7 @@ use crate::{
77use alloy_eips:: eip2718:: WithEncoded ;
88use alloy_primitives:: B256 ;
99use futures_util:: { FutureExt , Stream , StreamExt } ;
10- use metrics:: Histogram ;
10+ use metrics:: { Gauge , Histogram } ;
1111use op_alloy_rpc_types_engine:: OpFlashblockPayloadBase ;
1212use reth_chain_state:: { CanonStateNotification , CanonStateNotifications , CanonStateSubscriptions } ;
1313use reth_evm:: ConfigureEvm ;
@@ -279,6 +279,7 @@ where
279279
280280 let elapsed = now. elapsed ( ) ;
281281 this. metrics . execution_duration . record ( elapsed. as_secs_f64 ( ) ) ;
282+
282283 trace ! (
283284 target: "flashblocks" ,
284285 parent_hash = %new_pending. block( ) . parent_hash( ) ,
@@ -349,6 +350,9 @@ where
349350 index : args. last_flashblock_index ,
350351 block_number : args. base . block_number ,
351352 } ;
353+ // Record current block and index metrics
354+ this. metrics . current_block_height . set ( fb_info. block_number as f64 ) ;
355+ this. metrics . current_index . set ( fb_info. index as f64 ) ;
352356 // Signal that a flashblock build has started with build metadata
353357 let _ = this. in_progress_tx . send ( Some ( fb_info) ) ;
354358 let ( tx, rx) = oneshot:: channel ( ) ;
@@ -389,4 +393,8 @@ struct FlashBlockServiceMetrics {
389393 last_flashblock_length : Histogram ,
390394 /// The duration applying flashblock state changes in seconds.
391395 execution_duration : Histogram ,
396+ /// Current block height.
397+ current_block_height : Gauge ,
398+ /// Current flashblock index.
399+ current_index : Gauge ,
392400}
0 commit comments