Skip to content

Commit e72a9fd

Browse files
authored
chore(l1): reduce log spam when building blocks (#4747)
**Motivation** When we changed block building to be done asynchronously and multiple times per slot, we kept metrics logs, which ended up being too spammy. **Description** This PR reduces the logs to `debug` level. Closes #4719
1 parent 05e0de5 commit e72a9fd

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

crates/blockchain/payload.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,10 @@ impl Blockchain {
401401
self.finalize_payload(&mut context).await?;
402402

403403
let interval = Instant::now().duration_since(since).as_millis();
404-
tracing::info!(
404+
// TODO: expose as a proper metric
405+
// Commented out because we build multiple blocks per request
406+
// each one printing this metric can be spammy
407+
tracing::debug!(
405408
"[METRIC] BUILDING PAYLOAD TOOK: {interval} ms, base fee {}",
406409
base_fee
407410
);
@@ -410,7 +413,10 @@ impl Blockchain {
410413

411414
if interval != 0 {
412415
let throughput = (as_gigas) / (interval as f64) * 1000_f64;
413-
tracing::info!(
416+
// TODO: expose as a proper metric
417+
// Commented out because we build multiple blocks per request
418+
// each one printing this metric can be spammy
419+
tracing::debug!(
414420
"[METRIC] BLOCK BUILDING THROUGHPUT: {throughput} Gigagas/s TIME SPENT: {interval} msecs"
415421
);
416422
}
@@ -543,7 +549,7 @@ impl Blockchain {
543549
}
544550
// Ignore following txs from sender
545551
Err(e) => {
546-
error!("Failed to execute transaction: {tx_hash:x}, {e}");
552+
debug!("Failed to execute transaction: {tx_hash:x}, {e}");
547553
metrics!(METRICS_TX.inc_tx_errors(e.to_metric()));
548554
txs.pop();
549555
continue;

crates/l2/sequencer/block_producer/payload_builder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ pub async fn build_payload(
5858
blockchain.finalize_payload(&mut context).await?;
5959

6060
let interval = Instant::now().duration_since(since).as_millis();
61+
// TODO: expose as a proper metric
6162
tracing::info!("[METRIC] BUILDING PAYLOAD TOOK: {interval} ms");
6263
#[allow(clippy::as_conversions)]
6364
if let Some(gas_used) = gas_limit.checked_sub(context.remaining_gas) {
6465
let as_gigas = (gas_used as f64).div(10_f64.powf(9_f64));
6566

6667
if interval != 0 {
6768
let throughput = (as_gigas) / (interval as f64) * 1000_f64;
69+
// TODO: expose as a proper metric
6870
tracing::info!(
6971
"[METRIC] BLOCK BUILDING THROUGHPUT: {throughput} Gigagas/s TIME SPENT: {interval} msecs"
7072
);

0 commit comments

Comments
 (0)