From 21e34da9c4ebe5c5e5cd7f017a8d35eed48d7cab Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Fri, 24 Mar 2023 12:14:03 -0400 Subject: [PATCH] fix: disable EIP3607 for eth_call and eth_estimateGas (#1961) --- crates/rpc/rpc/Cargo.toml | 2 +- crates/rpc/rpc/src/eth/api/call.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/rpc/rpc/Cargo.toml b/crates/rpc/rpc/Cargo.toml index 30fe4953e7..5eb601861c 100644 --- a/crates/rpc/rpc/Cargo.toml +++ b/crates/rpc/rpc/Cargo.toml @@ -25,7 +25,7 @@ reth-revm = { path = "../../revm" } reth-tasks = { path = "../../tasks" } # eth -revm = { version = "3.0.0", features = ["optional_block_gas_limit"] } +revm = { version = "3.0.0", features = ["optional_block_gas_limit", "optional_eip3607"] } ethers-core = { git = "https://github.com/gakonst/ethers-rs", features = ["eip712"] } revm-primitives = { version = "1.0", features = ["serde"] } diff --git a/crates/rpc/rpc/src/eth/api/call.rs b/crates/rpc/rpc/src/eth/api/call.rs index 54c8217818..e489addfd2 100644 --- a/crates/rpc/rpc/src/eth/api/call.rs +++ b/crates/rpc/rpc/src/eth/api/call.rs @@ -71,6 +71,10 @@ where // impls and providers cfg.disable_block_gas_limit = true; + // Disabled because eth_call is sometimes used with eoa senders + // See + cfg.disable_eip3607 = true; + let request_gas = request.gas; let mut env = build_call_evm_env(cfg, block, request)?; @@ -106,7 +110,7 @@ where /// This will execute the [CallRequest] and find the best gas limit via binary search fn estimate_gas_with( &self, - cfg: CfgEnv, + mut cfg: CfgEnv, block: BlockEnv, request: CallRequest, state: S, @@ -114,6 +118,10 @@ where where S: StateProvider, { + // Disabled because eth_estimateGas is sometimes used with eoa senders + // See + cfg.disable_eip3607 = true; + // keep a copy of gas related request values let request_gas = request.gas; let request_gas_price = request.gas_price;