Etherlink architecture
The main running components of Etherlink are its nodes and the sequencer. The sequencer and nodes handle blocks, but they create and handle blocks in a way different from Tezos layer 1. Some major differences are that only the sequencer can create blocks and that the timing for blocks changes based on the demand.
These components are instances of binaries in the Octez software suite.
High-level diagram
Sequencer
Etherlink relies on a sequencer to publish transactions. The sequencer receives transactions from EVM nodes, puts them in order, and packages them into an Etherlink block.
If the Tezos Data Availability Layer (DAL) is active, the sequencer has the option to publish the block via the DAL if capacity requires it; otherwise, it publishes the block directly to Tezos layer 1.
The sequencer generates blocks at a variable rate, depending on demand. Currently, it generates a block at least every 6 seconds, even if the block is empty. As demand increases, it generates blocks more quickly, up to a block every 500ms. These values can change with Etherlink kernel upgrades.
Each Etherlink block contains:
- A list of transactions
- A list of transactions that are currently in the delayed inbox, as described in Transaction lifecycle
- The hash of the previous block
- The timestamp of the block
The sequencer publishes each block in two ways:
- It publishes them to EVM nodes
- It publishes them via the DAL or directly to Tezos layer 1
The sequencer is the primary way that Etherlink transactions are processed. However, to protect the system from censorship and any other problems with the sequencer, Etherlink provides a backup way of handling transactions; see Transaction lifecycle.
The sequencer is an instance of the octez-evm-node binary running in sequencer mode.
Only one account can run the sequencer; see Sequencer governance.
Nodes
Etherlink relies on three types of nodes, with instances of each type running in different modes:
-
EVM nodes (
octez-evm-node): The EVM nodes running in sequencer observer mode maintain a local copy of the Etherlink context and expose a JSON RPC API-compliant endpoint for clients to submit transactions to. Since Etherlink 7.0, they also expose the Tezos RPC endpoint of the Michelson interface. They forward these transactions to the sequencer and receive transactions from the sequencer, which they use to update their state. They also check Smart Rollup nodes to verify that these transactions make it to Tezos layer 1. -
Smart Rollup nodes (
octez-smart-rollup-node): Smart Rollup nodes are Octez daemons that run the kernel of a Tezos Smart Rollup. For more information about Smart Rollup nodes in general, see Smart Rollup node in the Octez documentation.Etherlink Smart Rollup nodes run the kernel for the Etherlink Smart Rollup and store the state of the Etherlink blockchain from the perspective of Tezos layer 1. They monitor the Tezos layer 1 Smart Rollup inbox, filter the inbox to Etherlink-related messages, process them, and update their states.
Importantly, the Smart Rollup nodes store the state of Etherlink based on the information that they get from layer 1, not on information from EVM nodes or the sequencer.
These Smart Rollup nodes run in different modes depending on the needs of the people who run them. The
octez-smart-rollup-nodebinary has many different modes, but these are the primary modes for Etherlink:- Nodes running in observer mode follow the state of the rollup by monitoring layer 1 and updating their states.
- Nodes running in operator mode update their states like nodes running in observer mode. They also have the critical role of securing the Etherlink Smart Rollup by publishing commitments to layer 1 and playing refutation games.
- The sequencer can use a node running in batcher mode to publish transactions to layer 1. It can also use a node running in operator mode to publish transactions.
For more information about Smart Rollup nodes in general, see Smart Rollups on docs.tezos.com and Smart Rollup Node in the Octez documentation.
-
Tezos layer 1 nodes (
octez-node): Layer 1 nodes are responsible for the state of layer 1. In addition to ordinary layer 1 transactions, they receive Etherlink transactions from the sequencer. Then the baking nodes publish the Etherlink transactions in the Smart Rollup inbox in layer 1 blocks. For more information about Tezos layer 1 and its nodes, see Architecture on docs.tezos.com.
Transaction lifecycle
Etherlink has a standard method of processing transactions and a backup method that protects it from censorship and network problems.
Standard transaction processing
The lifecycle of a typical operation under normal circumstances is as follows:
- A user submits a transaction to an EVM node.
- The EVM node forwards the transaction to the sequencer when it is valid. If users submit multiple transactions that depend on each other (that is, they have nonces that are not yet valid), the EVM node stores them until they are valid.
- The sequencer puts the transaction in its pool.
- The sequencer enqueues the transaction and sends an instant confirmation to the nodes that the transaction will be in the next block.
- The sequencer puts the enqueued transactions into a block as soon as possible (less than 500ms after receiving it in a nominal scenario).
- The sequencer publishes the block to the EVM nodes, which update their states based on the transactions in the block.
- The sequencer publishes the block to the Smart Rollup inbox on layer 1 via a Smart Rollup node running in operator or batcher mode.
- The Smart Rollup nodes tracking the state of Etherlink fetch the block from the Smart Rollup inbox, read its transactions, and update their states.
- The EVM nodes check the state of the Smart Rollup nodes to verify that blocks have successfully and faithfully been finalized on layer 1.
- The Smart Rollup nodes running in operator mode post hashes of Etherlink's state to layer 1 as commitments.
This diagram summarizes the transaction process: