From a1df91dedc89cb56b7ad6253485e2050bfd03065 Mon Sep 17 00:00:00 2001 From: Francesco Dainese Date: Mon, 18 Nov 2024 10:29:05 +0100 Subject: [PATCH] Revert "feat(inspector:zk): delay startup migration" This reverts commit 71ca065bd944c4955c704ca1e4fd8dedeb88cd93. --- crates/cheatcodes/src/inspector.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/cheatcodes/src/inspector.rs b/crates/cheatcodes/src/inspector.rs index d481f6a20..aad1f7dfd 100644 --- a/crates/cheatcodes/src/inspector.rs +++ b/crates/cheatcodes/src/inspector.rs @@ -1473,14 +1473,8 @@ where { }; let prev = account.info.nonce; account.info.nonce = prev.saturating_sub(1); - let nonce = account.info.nonce; - if self.startup_zk { - self.startup_zk = false; // We only do this once. - self.select_zk_vm(ecx_inner, None); - } - - trace!(target: "cheatcodes", %sender, nonce, prev, "corrected nonce"); + trace!(target: "cheatcodes", %sender, nonce=account.info.nonce, prev, "corrected nonce"); } if call.target_address == CHEATCODE_ADDRESS { @@ -1980,6 +1974,11 @@ impl Inspector<&mut dyn DatabaseExt> for Cheatcodes { ecx.env.tx.gas_price = gas_price; } + if self.startup_zk && !self.use_zk_vm { + self.startup_zk = false; // We only do this once. + self.select_zk_vm(ecx, None); + } + // Record gas for current frame. if self.gas_metering.paused { self.gas_metering.paused_frames.push(interpreter.gas);