Did you know that before mainnet deployment the Metis decentralized sequencer was battle-tested processing millions of transactions?
Let’s dive into what a sequencer is and how it does work in simple terms.
Sequencers aggregate individual transactions into batches. What this means is that the sequencer will receive multiple transactions over a period of time and it will order them into a sequence of transactions before batching them into a block. The architecture of a decentralized sequencer network can be quite complex, but in simple terms what a decentralized sequencer means is a network of nodes that rotate to order and sequence transactions that are sent by users.
What happens when I send a transaction in Metis L2?
When a user initiates a transaction, it is sent directly to a sequencer, specifically to an RPC node. The RPC (remote procedure call) is a piece of code that allows communication with a remote program. The RPC node acts as a proxy for sending transactions. After this stage, the Bridge and Adapter layer comes into play.
The Bridge and Adapter layer acts as the connection between the Consensus layer (using PoS) and the sequencer node. The adapter is responsible for interacting with the other external modules on the consensus layer. After the consensus is reached, the Bridge and Adapter send the information back to the sequencer. This piece also monitors the locking information of the sequencer on Ethereum. Once the sequencer gets the confirmed transactions, it creates a block containing these.
The block with the transactions is then transmitted to the P2P network. The Bridge and Adapter randomly decides whether to initiate a node rotation and checks the transaction status with the sequencer. The PoS node helps to check both. Next comes signing the batch of transactions.
At this stage the sequencer requests this signature from the MPC module. The Multi-Party Computation module is a component that is responsible for the management of the entire life-cycle of the multisignature keys. The signing process includes multiple steps.
First, the MPC module checks the transaction sign-in batch with the PoS node. Second, the MPC module signs the batch of transactions and sends it to Ethereum, completing the transaction. Finally, the verifier in the sequencer node synchronizes the data.
This post was just a high-level explanation of the Metis decentralized sequencer and the transaction journey. There are several additional details and technicalities, but hopefully this provides a clear overview. For more details please have a look at the official documentation.