Skip to content

Commit 4aff943

Browse files
authored
Merge pull request #203 from decipherhub/fix/eth-call-balance-check
fix: disable balance check for eth_call RPCs
2 parents 2072e7f + be51cc6 commit 4aff943

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ jobs:
365365
- name: Upload coverage to Codecov
366366
uses: codecov/codecov-action@v4
367367
with:
368+
token: ${{ secrets.CODECOV_TOKEN }}
368369
files: ./lcov.info
369370
fail_ci_if_error: false
370371
verbose: true

crates/rpc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ reth-primitives-traits = { workspace = true }
3636
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" }
3737

3838
# EVM execution (revm 33.x uses modular crates)
39-
revm = { version = "33.1.0", default-features = false, features = ["std", "secp256k1"] }
39+
revm = { version = "33.1.0", default-features = false, features = ["std", "secp256k1", "optional_balance_check"] }
4040
revm-primitives = "21"
4141

4242
# Middleware and utilities

crates/rpc/src/adapters.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,9 +2239,10 @@ impl<P: Provider> EvmExecutionApi<P> {
22392239

22402240
// Configure chain settings
22412241
ctx.cfg.chain_id = self.chain_id;
2242-
// Disable nonce check for eth_call and eth_estimateGas
2243-
// These are simulation calls that shouldn't require valid nonce
2242+
// Disable nonce and balance checks for eth_call and eth_estimateGas
2243+
// These are simulation calls that shouldn't require valid nonce or sufficient balance
22442244
ctx.cfg.disable_nonce_check = true;
2245+
ctx.cfg.disable_balance_check = true;
22452246

22462247
// Set up transaction environment
22472248
ctx.tx.caller = from.unwrap_or(Address::ZERO);
@@ -2700,8 +2701,9 @@ where
27002701

27012702
// Configure chain settings
27022703
ctx.cfg.chain_id = self.chain_id;
2703-
// Disable nonce check for trace calls (simulation)
2704+
// Disable nonce and balance checks for trace calls (simulation)
27042705
ctx.cfg.disable_nonce_check = true;
2706+
ctx.cfg.disable_balance_check = true;
27052707

27062708
// Set up transaction environment
27072709
ctx.tx.caller = from.unwrap_or(Address::ZERO);
@@ -2812,8 +2814,9 @@ where
28122814

28132815
// Configure chain settings
28142816
ctx.cfg.chain_id = self.chain_id;
2815-
// Disable nonce check for trace calls (simulation)
2817+
// Disable nonce and balance checks for trace calls (simulation)
28162818
ctx.cfg.disable_nonce_check = true;
2819+
ctx.cfg.disable_balance_check = true;
28172820

28182821
// Set up transaction environment
28192822
ctx.tx.caller = from.unwrap_or(Address::ZERO);

0 commit comments

Comments
 (0)