Skip to content

Commit

Permalink
Reapply "feat: enable basefee opcode"
Browse files Browse the repository at this point in the history
This reverts commit 4ba4f60.
  • Loading branch information
lispc committed Apr 23, 2024
1 parent e831d31 commit 9b9ab8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
11 changes: 5 additions & 6 deletions eth-types/src/evm_types/opcode_ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,6 @@ impl From<u8> for OpcodeId {
0x45u8 => OpcodeId::GASLIMIT,
0x46u8 => OpcodeId::CHAINID,
0x47u8 => OpcodeId::SELFBALANCE,
#[cfg(not(feature = "scroll"))]
0x48u8 => OpcodeId::BASEFEE,
0x54u8 => OpcodeId::SLOAD,
0x55u8 => OpcodeId::SSTORE,
Expand Down Expand Up @@ -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<Regex> = LazyLock::new(|| {
Expand Down
8 changes: 0 additions & 8 deletions zkevm-circuits/src/evm_circuit/execution/block_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ impl<F: Field> ExecutionGadget<F> for BlockCtxU160Gadget<F> {
}
}

// TODO:
// This gadget is used for `BASEFEE` opcode. With current `scroll` feature, it's
// disabled by l2geth and converted to an invalid opcode.
// <https://github.com/scroll-tech/zkevm-circuits/blob/develop/eth-types/src/evm_types/opcode_ids.rs#L1062>
// So need to test it after `BASEFEE` opcode is enabled in scroll l2geth.
#[derive(Clone, Debug)]
pub(crate) struct BlockCtxU256Gadget<F> {
value_u256: BlockCtxGadget<F, N_BYTES_WORD>,
Expand All @@ -177,9 +172,6 @@ impl<F: Field> ExecutionGadget<F> for BlockCtxU256Gadget<F> {
_: &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
Expand Down

0 comments on commit 9b9ab8d

Please sign in to comment.