node icon indicating copy to clipboard operation
node copied to clipboard

EVM: support PUSH0 opcode

Open brewmaster012 opened this issue 8 months ago • 1 comments

Is your feature request related to a problem? Please describe. Current EVM on ZetaChain testnet/mainnet does not appear to support PUSH0 opcode, introduced in EIP3855 as part of Ethereum Shanghai upgrade.

As a result, some contracts compiled with Solidity 0.8.20 or Vyper 0.3.10 may fail to work on Zeta EVM due to the presence of PUSH0 opcode in the generated code.

To test it on zetachain testnet or mainnet, go to https://remix.ethereum.org/ and copy this contract there

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Push0Opcode {
    constructor() {
        assembly {
            // explicitly emit PUSH0 (opcode 0x5f)
            mstore8(0, 0x5f)
            return(0, 1)
        }
    }
}

compile and deploy it. On ZetaChain it will error:

Image

Whereas on Ethereum mainnet or the Remix Cancun the deployment will succeed.

Describe the solution you'd like Support EIP3855 in Zeta EVM by enabling it in the imported go-ethereum EVM implementation.

This issue can be resolved when the above test passes.

Describe alternatives you've considered N/A

Motivation and Context This would enhance compatibility of smart contracts at the EVM level with Ethereum.

brewmaster012 avatar Apr 08 '25 16:04 brewmaster012

Related to https://github.com/zeta-chain/ethermint/issues/145

gartnera avatar Apr 08 '25 18:04 gartnera

Fixed in new upgrade

lumtis avatar Aug 20 '25 14:08 lumtis