Rollup Node Specification
The rollup node is the component responsible for deriving the L2 chain from L1 blocks (and their associated receipts).
The part of the rollup node that derives the L2 chain is called the rollup driver. This document is currently only concerned with the specification of the rollup driver.
Table of Contents
Driver
The task of the driver in the rollup node is to manage the derivation process:
- Keep track of L1 head block
- Keep track of the L2 chain sync progress
- Iterate over the derivation steps as new inputs become available
Derivation
This process happens in three steps:
- Select inputs from the L1 chain, on top of the last L2 block: a list of blocks, with transactions and associated data and receipts.
- Read L1 information, deposits, and sequencing batches in order to generate payload attributes (essentially a block without output properties).
- Pass the payload attributes to the execution engine, so that the L2 block (including output block properties) may be computed.
While this process is conceptually a pure function from the L1 chain to the L2 chain, it is in practice incremental. The L2 chain is extended whenever new L1 blocks are added to the L1 chain. Similarly, the L2 chain re-organizes whenever the L1 chain re-organizes.
For a complete specification of the L2 block derivation, refer to the L2 block derivation document.
L2 Output RPC method
The Rollup node has its own RPC method, optimism_outputAtBlock
which returns a 32
byte hash corresponding to the L2 output root.
Output Method API
The input and return types here are as defined by the engine API specs).
- method:
optimism_outputAtBlock
- params:
blockNumber
:QUANTITY
, 64 bits - L2 integer block number
ORString
- one of"safe"
,"latest"
, or"pending"
.
- returns:
version
:DATA
, 32 Bytes - the output root version number, beginning with 0.l2OutputRoot
:DATA
, 32 Bytes - the output root.