From 9b9ab8d9b2c1d26945445c617dad6eeb499100b8 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Tue, 23 Apr 2024 15:56:22 +0800 Subject: [PATCH] Reapply "feat: enable basefee opcode" This reverts commit 4ba4f60235e413f615aae51a85ca5173d588ba6e. --- eth-types/src/evm_types/opcode_ids.rs | 11 +++++------ zkevm-circuits/src/evm_circuit/execution/block_ctx.rs | 8 -------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/eth-types/src/evm_types/opcode_ids.rs b/eth-types/src/evm_types/opcode_ids.rs index 3287b40072..72ec88a0fa 100644 --- a/eth-types/src/evm_types/opcode_ids.rs +++ b/eth-types/src/evm_types/opcode_ids.rs @@ -1059,7 +1059,6 @@ impl From for OpcodeId { 0x45u8 => OpcodeId::GASLIMIT, 0x46u8 => OpcodeId::CHAINID, 0x47u8 => OpcodeId::SELFBALANCE, - #[cfg(not(feature = "scroll"))] 0x48u8 => OpcodeId::BASEFEE, 0x54u8 => OpcodeId::SLOAD, 0x55u8 => OpcodeId::SSTORE, @@ -1236,12 +1235,12 @@ impl FromStr for OpcodeId { #[cfg(not(feature = "scroll"))] "SELFDESTRUCT" => OpcodeId::SELFDESTRUCT, "CHAINID" => OpcodeId::CHAINID, - #[cfg(not(feature = "scroll"))] "BASEFEE" => OpcodeId::BASEFEE, - #[cfg(feature = "scroll")] - "BASEFEE" => OpcodeId::INVALID(0x48), - "TLOAD" => OpcodeId::INVALID(0xb3), - "TSTORE" => OpcodeId::INVALID(0xb4), + "BLOBHASH" => OpcodeId::INVALID(0x49), + "BLOBBASEFEE" => OpcodeId::INVALID(0x4a), + "TLOAD" => OpcodeId::INVALID(0x5c), + "TSTORE" => OpcodeId::INVALID(0x5d), + "MCOPY" => OpcodeId::INVALID(0x5e), _ => { // Parse an invalid opcode value as reported by geth static RE: LazyLock = LazyLock::new(|| { diff --git a/zkevm-circuits/src/evm_circuit/execution/block_ctx.rs b/zkevm-circuits/src/evm_circuit/execution/block_ctx.rs index a388529a3f..a349d5e256 100644 --- a/zkevm-circuits/src/evm_circuit/execution/block_ctx.rs +++ b/zkevm-circuits/src/evm_circuit/execution/block_ctx.rs @@ -147,11 +147,6 @@ impl ExecutionGadget for BlockCtxU160Gadget { } } -// TODO: -// This gadget is used for `BASEFEE` opcode. With current `scroll` feature, it's -// disabled by l2geth and converted to an invalid opcode. -// -// So need to test it after `BASEFEE` opcode is enabled in scroll l2geth. #[derive(Clone, Debug)] pub(crate) struct BlockCtxU256Gadget { value_u256: BlockCtxGadget, @@ -177,9 +172,6 @@ impl ExecutionGadget for BlockCtxU256Gadget { _: &Call, step: &ExecStep, ) -> Result<(), Error> { - if cfg!(feature = "scroll") { - panic!("BASEFEE is disabled by scroll for now"); - } log::debug!("BlockCtxU256Gadget assign for {:?}", step.opcode); self.value_u256