From 2d87c5d62772d7e019aad727fc90e2a9ba445ba4 Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Wed, 29 Mar 2023 11:27:55 -0700 Subject: [PATCH] Remove `CONSUME_GAS` Now that gas info is in `kexit_info`. --- evm/src/cpu/kernel/asm/util/basic_macros.asm | 5 ----- evm/src/cpu/kernel/interpreter.rs | 2 -- evm/src/cpu/kernel/opcodes.rs | 1 - 3 files changed, 8 deletions(-) diff --git a/evm/src/cpu/kernel/asm/util/basic_macros.asm b/evm/src/cpu/kernel/asm/util/basic_macros.asm index 2ba6ad0b..f85b7792 100644 --- a/evm/src/cpu/kernel/asm/util/basic_macros.asm +++ b/evm/src/cpu/kernel/asm/util/basic_macros.asm @@ -160,11 +160,6 @@ // stack: input >= c, ... %endmacro -%macro consume_gas_const(c) - PUSH $c - CONSUME_GAS -%endmacro - // If pred is zero, yields z; otherwise, yields nz %macro select // stack: pred, nz, z diff --git a/evm/src/cpu/kernel/interpreter.rs b/evm/src/cpu/kernel/interpreter.rs index 8347d896..fbd43247 100644 --- a/evm/src/cpu/kernel/interpreter.rs +++ b/evm/src/cpu/kernel/interpreter.rs @@ -385,7 +385,6 @@ impl<'a> Interpreter<'a> { 0xf5 => todo!(), // "CREATE2", 0xf6 => self.run_get_context(), // "GET_CONTEXT", 0xf7 => self.run_set_context(), // "SET_CONTEXT", - 0xf8 => todo!(), // "CONSUME_GAS", 0xf9 => todo!(), // "EXIT_KERNEL", 0xfa => todo!(), // "STATICCALL", 0xfb => self.run_mload_general(), // "MLOAD_GENERAL", @@ -966,7 +965,6 @@ fn get_mnemonic(opcode: u8) -> &'static str { 0xf5 => "CREATE2", 0xf6 => "GET_CONTEXT", 0xf7 => "SET_CONTEXT", - 0xf8 => "CONSUME_GAS", 0xf9 => "EXIT_KERNEL", 0xfa => "STATICCALL", 0xfb => "MLOAD_GENERAL", diff --git a/evm/src/cpu/kernel/opcodes.rs b/evm/src/cpu/kernel/opcodes.rs index 112de792..be17f6f4 100644 --- a/evm/src/cpu/kernel/opcodes.rs +++ b/evm/src/cpu/kernel/opcodes.rs @@ -122,7 +122,6 @@ pub fn get_opcode(mnemonic: &str) -> u8 { "CREATE2" => 0xf5, "GET_CONTEXT" => 0xf6, "SET_CONTEXT" => 0xf7, - "CONSUME_GAS" => 0xf8, "EXIT_KERNEL" => 0xf9, "STATICCALL" => 0xfa, "MLOAD_GENERAL" => 0xfb,