Differences between Ethereum and Linea
This page outlines Ethereum Mainnet functionality that differs on Linea, or is not yet available on Linea. Absence from this page indicates that the functionality is available on Linea and identical to behavior on Ethereum Mainnet; if you're experiencing otherwise, please get in touch via Discord.
EVM opcodes
Linea uses the London version of the Ethereum Virtual Machine (EVM). All EVM opcodes are managed identically to Ethereum London unless presented in the following table.
Solidity 8.23 and later compiles newer versions of the EVM by default. Use the solc --evm-version london
command to ensure compatibility with Linea.
Check out Ethereum's history to learn about major milestones, forks, and updates to the blockchain.
Opcode | Ethereum | Linea: current state | Linea: Pectra upgrade (Beta v4) |
---|---|---|---|
BLOBBASEFEE | Returns the value of the blob base-fee of the current block. | Not supported. | Will always return the minimum value. |
BLOBHASH | Given an an input in the form of an | Not supported. | Will always return 0 . |
BLOCKHASH | Returns the hash of a requested block from the 256 most recent blocks. | Not supported. | Returns the correct value, but the value is not guaranteed by the proof (Linea is a type 2 zkEVM, and uses/proves an L2-specific state representation). |
MCOPY | Copies memory areas, allowing the destination and source to overlap. | Not supported. | Available on Linea Beta v4. |
PREVRANDAO | Returns the RANDAO value from the previous block. | Not supported. | Use a formula similar to Ethereum, e.g. |
PUSH0 | Pushes the constant value 0 onto the stack. | Not supported. | PUSH0 was introduced in the Ethereum Mainnet Shanghai upgrade and became available in Solidity compiler version 0.8.20, which came after the London release. Available on Linea Beta v4. |
TLOAD | Load word from transient storage. | Not supported. | Available on Linea Beta v4. |
TSTORE | Save word to transient storage. | Not supported | Available on Linea Beta v4. |
Consult the Ethereum Foundation's Opcode Reference for more.
Evmdiff is also a useful resource for comparing Linea with Ethereum, and evm.codes is useful for information about specific opcodes on Ethereum.
Precompiles
Precompile | Ethereum | Linea: current state | Linea: Pectra upgrade (Beta v4) |
---|---|---|---|
BLAKE2f | Compression function F used in the BLAKE2 cryptographic hashing algorithm. | Not supported. | Not supported. |
MODEXP | Arbitrary-precision exponentiation under modulo. | Only supports arguments (base, exponent, modulus) that do not exceed 512-byte integers. | Only supports arguments (base, exponent, modulus) that do not exceed 512-byte integers. |
Point evaluation | Verify that specific points in a polynomial (blobs) match the expected values. | Not supported. | Available with Linea Beta v4. |
Precompiles as transaction recipients | Applicable to various use cases. | Not supported. A transaction | Not supported. A transaction to address cannot be a precompile, i.e. an
address in the range 0x01 -0x09 . |
RIPEMD-160 | A hash function. | Not supported. | TBD. |
Beacon root
EIP-4788, included in Ethereum's Dencun upgrade,
introduced a smart contract that enables the caller to get
or set
the hash tree root of a
beacon chain block.
This functionality is available with Linea Beta v4. However, due to the difference in block time when compared to Ethereum Mainnet, only the root of the previous block is available.
Call data
Linea's sequencer limits the size of call data, so that transactions can fit into the corresponding blob. The current limit is 60000 bytes.
JSON-RPC API
Linea uses the standard Ethereum JSON RPC API methods. However, in a few cases, methods differ from those on Ethereum. These methods are documented in the reference section, and include:
linea_estimateGas
linea_getProof
linea_getTransactionExclusionStatusV1
eth_sendRawTransaction
Additionally, the following methods are not supported:
eth_newFilter
eth_newBlockFilter
.