diff --git a/core/lib/zksync_core/src/l1_gas_price/gas_adjuster/mod.rs b/core/lib/zksync_core/src/l1_gas_price/gas_adjuster/mod.rs index db3a8e059cf..94d511061d0 100644 --- a/core/lib/zksync_core/src/l1_gas_price/gas_adjuster/mod.rs +++ b/core/lib/zksync_core/src/l1_gas_price/gas_adjuster/mod.rs @@ -97,9 +97,12 @@ impl GasAdjuster { ) .await?; - METRICS - .current_base_fee_per_gas - .set(*base_fee_history.last().unwrap()); + // We shouldn't rely on L1 provider to return consistent results, so we check that we have at least one new sample. + if let Some(current_base_fee_per_gas) = base_fee_history.last() { + METRICS + .current_base_fee_per_gas + .set(*current_base_fee_per_gas); + } self.base_fee_statistics.add_samples(&base_fee_history); if let Some(current_blob_base_fee) = blob_base_fee_history.last() {