Linea: Sequencer, Conflation, Traces Generator

The sequencer is the heart of Linea's execution client, responsible for ordering, building, and executing blocks in a way that allows subsequent zero-knowledge proof to be made.

What does it do ?

  • Determines the order - the sequence - in which transactions will be executed.
  • Builds blocks from them
  • Executes those blocks
  • Prepares certain data relating to the traces of that execution for the zero-knowledge prover

How does it do it ?

  • Currently, Linea's execution client zkGeth, a version of geth that has been modified to work with zk-proving technology.
  • However, Linea is building linea-besu: leveraging the full power of Consensys stack by using the same Besu client software that is used to execute blocks on Ethereum coupled with a plugin system.
  • Linea's sequencer takes transactions from the Linea memory pool, and builds them into blocks, just like Besu does on mainnet Ethereum.
  • However, on Linea, it also does a bit of extra work, and communication, with the coordinator, to ensure that blocks are made in such a way that they can be proven by zero-knowledge prover, and that they are compact as possible-doubly important situation where all data has to be written in tiny, costly pieces on Ethereum mainnet.
  • This is done specifically by subsystems within the Sequencer: the traces generator and conflator.

Conflation

What is it ?

  • Conflation is the process of combining two or more blocks' worth of transactions into one data set.
  • It can be used to produce a 'before and after' map of the network state (a Merkle tree, in technical terms) as well as zero-knowledge proof, which is published to Ethereum.

What does it do ?

  • Conflation is not normally seen in mainnet Ethereum environments, where transaction data must be published in discrete blocks, one by one in order, before the next block can be published.
  • In a zkEVM environment, the 'source of truth' from Ethereum's perspective is the data submitted to it: ZK proof, the list of transactions proved by it, and the Merkle tree.
  • That means that it's not a question of how many transactions fit in a block, but how many transactions fit in proof.
  • By conflating multiple blocks into one, Linea's proving system becomes more efficient.

How does it do it ?

  • Conflation occurs within the execution client, but through a process of communication with the Coordinator:
    • The conflator waits for a traces file to appear
    • Marks the blocks' worth of traces as "merged"
    • Waits a certain amount of time in case more block data comes in
      • If it does, it checks to see if the number of lines in the block and the length of the data would exceed the limit
        • If it is within limit, the conflator marks it as merged as well.
  • The conflator continues this cycle until the time limit is reached, at which point it passes the conflated trace data back to the coordinator, for subsequent Merkle tree and proof generation.

Traces Generator

What is it ?

  • The part of Linea's sequencer responsible for generating the data used by the prover to create ZK proofs, and for making them as compact as possible.

What does it do ?

  • The traces generator executes blocks that have been built by the sequencer, and preserves data relating to the traces of each transaction.

How does it do it ?

  • Once the sequencer has built its blocks, they are executed; and in the process, the EVM produces data known as traces.
  • These traces specify that state of the network, and the state of the accounts involved in the transaction, at each granular step of each transaction's execution.
  • This is the infinite improbability drive at the heart of Linea and its zero-knowledge technology: these traces are the very data that the prover will use to produce a proof.
  • The proof allows Ethereum to know that everything that occurs on Linea truly did occur without knowing any of it.
  • Linea's sequnecer puts these traces through an additional process: trace conflation.