@@ -26,6 +26,7 @@ use reth_optimism_evm::{OpEvmConfig, OpNextBlockEnvAttributes};
2626use reth_optimism_forks:: OpHardforks ;
2727use reth_optimism_node:: { OpBuiltPayload , OpEngineTypes , OpPayloadBuilderAttributes } ;
2828use reth_optimism_primitives:: { OpPrimitives , OpReceipt , OpTransactionSigned } ;
29+ use reth_payload_builder_primitives:: Events ;
2930use reth_payload_util:: BestPayloadTransactions ;
3031use reth_primitives_traits:: RecoveredBlock ;
3132use reth_provider:: {
@@ -44,12 +45,10 @@ use std::{
4445 ops:: { Div , Rem } ,
4546 sync:: {
4647 atomic:: { AtomicU64 , Ordering } ,
47- Arc ,
48+ Arc , Mutex ,
4849 } ,
4950 time:: Instant ,
5051} ;
51- use std:: sync:: Mutex ;
52- use reth_payload_builder_primitives:: Events ;
5352use tokio:: sync:: {
5453 mpsc,
5554 mpsc:: { error:: SendError , Sender } ,
@@ -122,7 +121,8 @@ pub struct OpPayloadBuilder<Pool, Client, BT> {
122121 #[ allow( dead_code) ]
123122 pub builder_tx : BT ,
124123 /// Builder events handle to send BuiltPayload events
125- payload_builder_handle : Arc < Mutex < Option < tokio:: sync:: broadcast:: Sender < Events < OpEngineTypes > > > > >
124+ payload_builder_handle :
125+ Arc < Mutex < Option < tokio:: sync:: broadcast:: Sender < Events < OpEngineTypes > > > > > ,
126126}
127127
128128impl < Pool , Client , BT > OpPayloadBuilder < Pool , Client , BT > {
@@ -133,7 +133,9 @@ impl<Pool, Client, BT> OpPayloadBuilder<Pool, Client, BT> {
133133 client : Client ,
134134 config : BuilderConfig < FlashblocksConfig > ,
135135 builder_tx : BT ,
136- payload_builder_handle : Arc < Mutex < Option < tokio:: sync:: broadcast:: Sender < Events < OpEngineTypes > > > > >
136+ payload_builder_handle : Arc <
137+ Mutex < Option < tokio:: sync:: broadcast:: Sender < Events < OpEngineTypes > > > > ,
138+ > ,
137139 ) -> eyre:: Result < Self > {
138140 let metrics = Arc :: new ( OpRBuilderMetrics :: default ( ) ) ;
139141 let ws_pub = WebSocketPublisher :: new ( config. specific . ws_addr , Arc :: clone ( & metrics) ) ?. into ( ) ;
@@ -619,15 +621,17 @@ where
619621 // Send built payload as create one
620622 match self . payload_builder_handle . lock ( ) . as_deref ( ) {
621623 Ok ( Some ( handle) ) => {
622- let res = handle. send ( Events :: BuiltPayload ( payload. clone ( ) . into ( ) ) ) ;
624+ let res = handle. send ( Events :: BuiltPayload ( payload. clone ( ) ) ) ;
623625 if let Err ( e) = res {
624626 error ! (
625627 message = "Failed to send payload via payload builder handle" ,
626628 error = ?e,
627629 ) ;
628630 }
629- } ,
630- Ok ( None ) => error ! ( message = "Payload builder handle is not setup, skipping sending payload" ) ,
631+ }
632+ Ok ( None ) => {
633+ error ! ( message = "Payload builder handle is not setup, skipping sending payload" )
634+ }
631635 Err ( e) => error ! (
632636 message = "Failed to get access to payload builder handle" ,
633637 error = ?e,
0 commit comments