chore: rm chainspec max gas limit (#13308)

This commit is contained in:
Matthias Seitz
2024-12-11 20:29:06 +01:00
committed by GitHub
parent 8fd305adc2
commit 941ffb51fa
18 changed files with 39 additions and 67 deletions

View File

@ -5,8 +5,8 @@ use crate::{AsEthApiError, FromEthApiError, IntoEthApiError};
use alloy_primitives::U256;
use alloy_rpc_types_eth::{state::StateOverride, transaction::TransactionRequest, BlockId};
use futures::Future;
use reth_chainspec::{EthChainSpec, MIN_TRANSACTION_GAS};
use reth_provider::{ChainSpecProvider, StateProvider};
use reth_chainspec::MIN_TRANSACTION_GAS;
use reth_provider::StateProvider;
use reth_revm::{
database::StateProviderDatabase,
db::CacheDB,
@ -116,9 +116,7 @@ pub trait EstimateCall: Call {
}
// We can now normalize the highest gas limit to a u64
let mut highest_gas_limit: u64 = highest_gas_limit
.try_into()
.unwrap_or_else(|_| self.provider().chain_spec().max_gas_limit());
let mut highest_gas_limit = highest_gas_limit.saturating_to::<u64>();
// If the provided gas limit is less than computed cap, use that
env.tx.gas_limit = env.tx.gas_limit.min(highest_gas_limit);