diff --git a/crates/rpc/rpc-eth-api/src/helpers/call.rs b/crates/rpc/rpc-eth-api/src/helpers/call.rs index 8d34020d67..6189b69492 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/call.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/call.rs @@ -1107,6 +1107,14 @@ pub trait Call: LoadState + SpawnBlocking { DB: DatabaseRef, EthApiError: From<::Error>, { + // TODO(mattsse): cleanup, by not disabling gaslimit and instead use self.call_gas_limit + if request.gas > Some(gas_limit) { + // configured gas exceeds limit + return Err( + EthApiError::InvalidTransaction(RpcInvalidTransactionError::GasTooHigh).into() + ) + } + // we want to disable this in eth_call, since this is common practice used by other node // impls and providers cfg.disable_block_gas_limit = true;