Skip to content

Commit 3071908

Browse files
committed
log
1 parent e7f3020 commit 3071908

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

crates/pbs/src/mev_boost/get_header.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use futures::future::join_all;
2727
use parking_lot::RwLock;
2828
use reqwest::{StatusCode, header::USER_AGENT};
2929
use tokio::time::sleep;
30-
use tracing::{Instrument, debug, error, warn};
30+
use tracing::{Instrument, debug, error, info, warn};
3131
use tree_hash::TreeHash;
3232
use url::Url;
3333

@@ -131,17 +131,26 @@ pub async fn get_header<S: BuilderApiState>(
131131
.unwrap_or_default();
132132
RELAY_HEADER_VALUE.with_label_values(&[relay_id]).set(value_gwei);
133133

134-
relay_bids.push(res)
134+
relay_bids.push((relay_id, res))
135135
}
136136
Ok(_) => {}
137137
Err(err) if err.is_timeout() => error!(err = "Timed Out", relay_id),
138138
Err(err) => error!(%err, relay_id),
139139
}
140140
}
141141

142-
let max_bid = relay_bids.into_iter().max_by_key(|bid| *bid.value());
142+
let max_bid = relay_bids.into_iter().max_by_key(|(_, bid)| *bid.value());
143143

144-
Ok(max_bid)
144+
if let Some((winning_relay_id, ref bid)) = max_bid {
145+
info!(
146+
relay_id = winning_relay_id,
147+
value_eth = format_ether(*bid.value()),
148+
block_hash = %bid.block_hash(),
149+
"auction winner"
150+
);
151+
}
152+
153+
Ok(max_bid.map(|(_, bid)| bid))
145154
}
146155

147156
/// Fetch the parent block from the RPC URL for extra validation of the header.
@@ -373,7 +382,7 @@ async fn send_one_get_header(
373382
}
374383
};
375384

376-
debug!(
385+
info!(
377386
relay_id = relay.id.as_ref(),
378387
header_size_bytes,
379388
latency = ?request_latency,

0 commit comments

Comments
 (0)