diff --git a/crates/sim/src/gas/gas.rs b/crates/sim/src/gas/gas.rs index a1a35d31b..c88cb3fe1 100644 --- a/crates/sim/src/gas/gas.rs +++ b/crates/sim/src/gas/gas.rs @@ -13,7 +13,7 @@ use std::{cmp, fmt::Debug, sync::Arc}; -use anyhow::Context; +use anyhow::{bail, Context}; use ethers::types::U256; use rundler_provider::{EntryPoint, L1GasProvider, Provider}; use rundler_types::{ @@ -84,6 +84,10 @@ pub async fn calc_required_pre_verification_gas< op.max_fee_per_gas(), ); + if gas_price.is_zero() { + bail!("Gas price cannot be zero") + } + let dynamic_gas = entry_point .calc_l1_gas(entry_point.address(), op.clone(), gas_price) .await?; diff --git a/crates/sim/src/precheck.rs b/crates/sim/src/precheck.rs index 0d73d724b..8b53afa47 100644 --- a/crates/sim/src/precheck.rs +++ b/crates/sim/src/precheck.rs @@ -408,7 +408,6 @@ where ) -> anyhow::Result { gas::calc_required_pre_verification_gas(&self.chain_spec, &self.entry_point, &op, base_fee) .await - .context("should calculate pre-verification gas") } }