@@ -398,17 +398,17 @@ where
398
398
. build ( ) ;
399
399
400
400
let mut info = execute_pre_steps ( & mut db, & ctx) ?;
401
- ctx . metrics
401
+ self . metrics
402
402
. sequencer_tx_duration
403
403
. record ( sequencer_tx_start_time. elapsed ( ) ) ;
404
404
405
- let ( payload, fb_payload, mut bundle_state) = build_block ( db, & ctx, & mut info) ?;
405
+ let ( payload, fb_payload, mut bundle_state) = build_block ( db, & ctx, & mut info, & self . metrics ) ?;
406
406
407
407
best_payload. set ( payload. clone ( ) ) ;
408
408
let _ = self . send_message ( serde_json:: to_string ( & fb_payload) . unwrap_or_default ( ) ) ;
409
409
410
410
tracing:: info!( target: "payload_builder" , "Fallback block built" ) ;
411
- ctx . metrics
411
+ self . metrics
412
412
. payload_num_tx
413
413
. record ( info. executed_transactions . len ( ) as f64 ) ;
414
414
@@ -517,7 +517,7 @@ where
517
517
self . pool
518
518
. best_transactions_with_attributes ( ctx. best_transaction_attributes ( ) ) ,
519
519
) ;
520
- ctx . metrics
520
+ self . metrics
521
521
. transaction_pool_fetch_duration
522
522
. record ( best_txs_start_time. elapsed ( ) ) ;
523
523
@@ -528,7 +528,7 @@ where
528
528
best_txs,
529
529
total_gas_per_batch. min ( ctx. block_gas_limit ( ) ) ,
530
530
) ?;
531
- ctx . metrics
531
+ self . metrics
532
532
. payload_tx_simulation_duration
533
533
. record ( tx_execution_start_time. elapsed ( ) ) ;
534
534
@@ -542,8 +542,8 @@ where
542
542
}
543
543
544
544
let total_block_built_duration = Instant :: now ( ) ;
545
- let build_result = build_block ( db, & ctx, & mut info) ;
546
- ctx . metrics
545
+ let build_result = build_block ( db, & ctx, & mut info, & self . metrics ) ;
546
+ self . metrics
547
547
. total_block_built_duration
548
548
. record ( total_block_built_duration. elapsed ( ) ) ;
549
549
@@ -570,10 +570,10 @@ where
570
570
self . metrics
571
571
. flashblock_build_duration
572
572
. record ( flashblock_build_start_time. elapsed ( ) ) ;
573
- ctx . metrics
573
+ self . metrics
574
574
. payload_byte_size
575
575
. record ( new_payload. block ( ) . size ( ) as f64 ) ;
576
- ctx . metrics
576
+ self . metrics
577
577
. payload_num_tx
578
578
. record ( info. executed_transactions . len ( ) as f64 ) ;
579
579
@@ -620,6 +620,7 @@ pub fn build_block<ChainSpec, DB, P>(
620
620
mut state : State < DB > ,
621
621
ctx : & OpPayloadBuilderCtx < ChainSpec > ,
622
622
info : & mut ExecutionInfo < OpPrimitives > ,
623
+ metrics : & OpRBuilderMetrics ,
623
624
) -> Result < ( OpBuiltPayload , FlashblocksPayloadV1 , BundleState ) , PayloadBuilderError >
624
625
where
625
626
ChainSpec : EthChainSpec + OpHardforks ,
@@ -631,7 +632,7 @@ where
631
632
// and 4788 contract call
632
633
let state_merge_start_time = Instant :: now ( ) ;
633
634
state. merge_transitions ( BundleRetention :: Reverts ) ;
634
- ctx . metrics
635
+ metrics
635
636
. state_transition_merge_duration
636
637
. record ( state_merge_start_time. elapsed ( ) ) ;
637
638
@@ -677,7 +678,7 @@ where
677
678
) ;
678
679
} ) ?
679
680
} ;
680
- ctx . metrics
681
+ metrics
681
682
. state_root_calculation_duration
682
683
. record ( state_root_start_time. elapsed ( ) ) ;
683
684
0 commit comments