Skip to content

Commit 11bc2dc

Browse files
fix: remove iterations cap for EVM calls (#718)
1 parent 83a73c3 commit 11bc2dc

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

ethereum/src/evm.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,11 @@ impl<E: ExecutionProvider<Ethereum>> EthereumEvm<E> {
5757
let mut db = ProofDB::new(self.block_id, self.execution.clone());
5858
_ = db.state.prefetch_state(tx, validate_tx).await;
5959

60-
// Iterative execution with state fetching
61-
let mut iteration = 0;
62-
const MAX_ITERATIONS: u32 = 50; // Prevent infinite loops
60+
// Track iterations for debugging
61+
let mut iteration: u32 = 0;
6362

6463
let tx_res = loop {
6564
iteration += 1;
66-
if iteration > MAX_ITERATIONS {
67-
return Err(EvmError::Generic(
68-
"Maximum iterations reached while fetching state".to_string(),
69-
));
70-
}
7165

7266
// Update state first if needed
7367
if db.state.needs_update() {

opstack/src/evm.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,11 @@ impl<E: ExecutionProvider<OpStack>> OpStackEvm<E> {
6161
let mut db = ProofDB::new(self.block_id, self.execution.clone());
6262
_ = db.state.prefetch_state(tx, validate_tx).await;
6363

64-
// Iterative execution with state fetching
65-
let mut iteration = 0;
66-
const MAX_ITERATIONS: u32 = 50; // Prevent infinite loops
64+
// Track iterations for debugging
65+
let mut iteration: u32 = 0;
6766

6867
let tx_res = loop {
6968
iteration += 1;
70-
if iteration > MAX_ITERATIONS {
71-
return Err(EvmError::Generic(
72-
"Maximum iterations reached while fetching state".to_string(),
73-
));
74-
}
7569

7670
// Update state first if needed
7771
if db.state.needs_update() {

0 commit comments

Comments
 (0)