diff --git a/evm_arithmetization/src/witness/transition.rs b/evm_arithmetization/src/witness/transition.rs index fdcf9af65..8a6f1d39a 100644 --- a/evm_arithmetization/src/witness/transition.rs +++ b/evm_arithmetization/src/witness/transition.rs @@ -345,14 +345,6 @@ where where Self: Sized, { - self.perform_op(op, row)?; - self.incr_pc(match op { - Operation::Syscall(_, _, _) | Operation::ExitKernel => 0, - Operation::Push(n) => n as usize + 1, - Operation::Jump | Operation::Jumpi => 0, - _ => 1, - }); - self.incr_gas(gas_to_charge(op)); let registers = self.get_registers(); let gas_limit_address = MemoryAddress::new( @@ -373,6 +365,14 @@ where } } + self.perform_op(op, row)?; + self.incr_pc(match op { + Operation::Syscall(_, _, _) | Operation::ExitKernel => 0, + Operation::Push(n) => n as usize + 1, + Operation::Jump | Operation::Jumpi => 0, + _ => 1, + }); + Ok(op) }