Skip to content

Commit a55c748

Browse files
committed
Allow higher provider gas limit than block gas limit
Operators can set a higher provider gas limit for eth_call and eth_estimateGas and meter usage themselves.
1 parent 7797e97 commit a55c748

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

monad-ethcall/src/lib.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::{
2020
sync::Arc,
2121
};
2222

23-
use alloy_consensus::{Header, Transaction as _, TxEnvelope};
23+
use alloy_consensus::{Header, TxEnvelope};
2424
use alloy_eips::eip2718::Encodable2718;
2525
use alloy_primitives::{Address, Bytes, B256, U256, U64};
2626
use alloy_rlp::Encodable;
@@ -198,15 +198,6 @@ pub async fn eth_call(
198198
tracer: MonadTracer,
199199
gas_specified: bool,
200200
) -> CallResult {
201-
// upper bound gas limit of transaction to block gas limit to prevent abuse of eth_call
202-
if transaction.gas_limit() > block_header.gas_limit {
203-
return CallResult::Failure(FailureCallResult {
204-
error_code: EthCallResult::OtherError,
205-
message: "gas limit too high".into(),
206-
data: None,
207-
});
208-
}
209-
210201
let mut rlp_encoded_tx = vec![];
211202
transaction.encode_2718(&mut rlp_encoded_tx);
212203

monad-rpc/src/handlers/eth/call.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,6 @@ async fn prepare_eth_call<T: Triedb + TriedbPath>(
673673
.tx()
674674
.gas
675675
.unwrap_or(U256::from(header.header.gas_limit));
676-
let eth_call_provider_gas_limit = eth_call_provider_gas_limit.min(header.header.gas_limit);
677676
fill_gas_params(
678677
triedb_env,
679678
block_key,

monad-rpc/src/handlers/eth/gas.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ pub async fn monad_eth_estimateGas<T: Triedb>(
280280
};
281281

282282
let gas_specified = params.tx.gas.is_some();
283-
let provider_gas_limit = provider_gas_limit.min(header.header.gas_limit);
284283
let original_tx_gas = params.tx.gas.unwrap_or(U256::from(header.header.gas_limit));
285284
fill_gas_params(
286285
triedb_env,

0 commit comments

Comments
 (0)