EVM Equivalence now live on Optimism

By November 15, 2021Ethereum
Click here to view original web page at blog.infura.io

On Nov. 11, 2021 ,the Optimism team announced a major milestone - EVM equivalence is now live on Optimistic Ethereum mainnet. This makes it a lot easier for Infura users on the Layer 2 network to deploy their smart contracts.

Now, let's dive a little deeper into what this network upgrade means.

The basic idea of all optimistic rollups is that going through expensive Layer 1 transactions is like going to court: An expensive but a necessary backup mechanism to prevent cheating. Normally, it is enough to record information, just as it is normally enough to deposit checks. You don't need the court unless the check bounces. Any transaction on an optimistic rollup needs to be executed in two contexts:

  • Normal execution using the rollup's own mechanisms
  • Dispute resolution has to be done on L1 to make sure it is honest

The initial Optimism architecture used a mechanism similar to Docker containers. In the case of a dispute, the entire contract was executed on L1, and all the opcodes that would be different than on L2 (SSTORE, BALANCE, etc.) were replaced by contract calls to virtualize them. This was simple and functional, but there were several drawbacks:

  • A contract call takes more bytes than most opcodes do, so contracts close to the contract size limit couldn't be run in dispute resolution and therefore couldn't be executed on Optimistic Ethereum.
  • The compiler had to be modified to emit those calls instead of the normal opcodes, which limited the selection of languages and compiler versions.

To solve these problems, we decided to pivot to a different system where dispute resolution occurs interactively, with disputants establishing the exact point during transaction processing where the disagreement started. Then, we can execute the next instruction on L1 and see which one is correct.

This lets us run any Ethereum Virtual Machine (EVM) code, using the same clients as the rest of the world.

We call this EVM equivalence because from the smart contract's perspective, there is no difference between how it is executed on L1 and how it is executed inside Optimistic Ethereum.

What does this mean for you?

It depends.

If you are an end user of a protocol, you won't see any changes.

If you are a smart contract developer, it should now be a lot easier to deploy your decentralized applications on Optimistic Ethereum. You don't need to worry about special compilers, just use the same tools you're used to.

If you are a frontend developer, it changes nothing. Your Infura endpoints continue to give you the same reliable service, and the same results, they always have.

Get started building for free on the Optimism network with Infura.

All Today's Crypto News In One Place