Skip to content

Commit 1c63316

Browse files
committed
add lock logs
1 parent b8c3e49 commit 1c63316

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/flashblocks/service.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::sync::Arc;
1212
use thiserror::Error;
1313
use tokio::sync::RwLock;
1414
use tokio::sync::mpsc;
15-
use tracing::error;
15+
use tracing::{error, debug};
1616
#[derive(Debug, Error)]
1717
pub enum FlashblocksError {
1818
#[error("Missing base payload for initial flashblock")]
@@ -162,16 +162,19 @@ impl FlashblocksService {
162162
) -> Result<Option<OpExecutionPayloadEnvelopeV3>, FlashblocksError> {
163163
// consume the best payload and reset the builder
164164
let payload = {
165+
debug!(message = "Acquiring best payload write lock: get_best_payload() to use best_payload");
165166
let mut builder = self.best_payload.write().await;
166167
std::mem::take(&mut *builder).into_envelope()?
167168
};
169+
debug!(message = "Acquiring best payload write lock: get_best_payload() to reset best_payload");
168170
*self.best_payload.write().await = FlashblockBuilder::new();
169171

170172
Ok(Some(payload))
171173
}
172174

173175
pub async fn set_current_payload_id(&self, payload_id: PayloadId) {
174176
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");
175178
*self.current_payload_id.write().await = payload_id;
176179
}
177180

@@ -185,11 +188,13 @@ impl FlashblocksService {
185188
);
186189

187190
// 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");
188192
if *self.current_payload_id.read().await != payload.payload_id {
189193
error!(message = "Payload ID mismatch",);
190194
return;
191195
}
192196

197+
debug!(message = "Acquiring best payload write lock: on_event() to extend best_payload");
193198
if let Err(e) = self.best_payload.write().await.extend(payload.clone()) {
194199
error!(message = "Failed to extend payload", error = %e);
195200
} else {

src/proxy.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ async fn process_response(
308308
};
309309

310310
// log the decoded body
311-
debug!(
312-
target: "proxy::forward_request",
313-
message = "raw response body",
314-
body = %String::from_utf8_lossy(&decoded_body),
315-
);
311+
// debug!(
312+
// target: "proxy::forward_request",
313+
// message = "raw response body",
314+
// body = %String::from_utf8_lossy(&decoded_body),
315+
// );
316316

317317
let rpc_status_code = parse_response_code(&decoded_body);
318318
record_metrics(

src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ impl RollupBoostServer {
494494

495495
let builder = self.builder_client.clone();
496496

497-
if let Some(payload) = payload {
497+
if let Some(_payload) = payload {
498498
info!(message = "flashblocks payload exists, but not using it");
499499
} else {
500500
info!(message = "no flashblocks payload");

0 commit comments

Comments
 (0)