EVM: support PUSH0 opcode
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:
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.
Related to https://github.com/zeta-chain/ethermint/issues/145
Fixed in new upgrade