@@ -12,7 +12,7 @@ use std::sync::Arc;
12
12
use thiserror:: Error ;
13
13
use tokio:: sync:: RwLock ;
14
14
use tokio:: sync:: mpsc;
15
- use tracing:: error;
15
+ use tracing:: { error, debug } ;
16
16
#[ derive( Debug , Error ) ]
17
17
pub enum FlashblocksError {
18
18
#[ error( "Missing base payload for initial flashblock" ) ]
@@ -162,16 +162,19 @@ impl FlashblocksService {
162
162
) -> Result < Option < OpExecutionPayloadEnvelopeV3 > , FlashblocksError > {
163
163
// consume the best payload and reset the builder
164
164
let payload = {
165
+ debug ! ( message = "Acquiring best payload write lock: get_best_payload() to use best_payload" ) ;
165
166
let mut builder = self . best_payload . write ( ) . await ;
166
167
std:: mem:: take ( & mut * builder) . into_envelope ( ) ?
167
168
} ;
169
+ debug ! ( message = "Acquiring best payload write lock: get_best_payload() to reset best_payload" ) ;
168
170
* self . best_payload . write ( ) . await = FlashblockBuilder :: new ( ) ;
169
171
170
172
Ok ( Some ( payload) )
171
173
}
172
174
173
175
pub async fn set_current_payload_id ( & self , payload_id : PayloadId ) {
174
176
tracing:: debug!( message = "Setting current payload ID" , payload_id = %payload_id) ;
177
+ debug ! ( message = "Acquiring current payload id write lock: set_current_payload_id() to use current_payload_id" ) ;
175
178
* self . current_payload_id . write ( ) . await = payload_id;
176
179
}
177
180
@@ -185,11 +188,13 @@ impl FlashblocksService {
185
188
) ;
186
189
187
190
// make sure the payload id matches the current payload id
191
+ debug ! ( message = "Acquiring current payload id read lock: on_event() to use current_payload_id" ) ;
188
192
if * self . current_payload_id . read ( ) . await != payload. payload_id {
189
193
error ! ( message = "Payload ID mismatch" , ) ;
190
194
return ;
191
195
}
192
196
197
+ debug ! ( message = "Acquiring best payload write lock: on_event() to extend best_payload" ) ;
193
198
if let Err ( e) = self . best_payload . write ( ) . await . extend ( payload. clone ( ) ) {
194
199
error ! ( message = "Failed to extend payload" , error = %e) ;
195
200
} else {
0 commit comments