Sequencing
Sequencing is the essential first step for handling your transactions. Think of it as an organizer that takes all incoming transactions, puts them in a clear order, and then groups them into batches. This process is vital for keeping everything consistent and making the rollup run. Rollkit uses a "Sequencing Interface" with key functions like submitting, retrieving, and verifying these transaction batches, ensuring smooth communication between the rollup and the sequencing mechanism, which often acts as a bridge to the underlying network.
Sequencing Interface
Sequencing Interface defines a sequencing interface for communicating between any sequencing network and Rollkit. The key functions of the interface are defined as shown below.
SubmitRollupTransaction(rollupId, data) returns (error)
GetNextBatch(rollupId, lastBatchHash, maxBytes) returns (batch, timestamp)
VerifyBatch(rollupId, batchHash) returns (status)
It mainly consists of:
SubmitRollupTransaction
relays the rollup transactions from Rollkit rollup to the sequencing networkGetNextBatch
returns the next batch of transactions along with a deterministic timestampVerifyBatch
validates the sequenced batch
Sequencing Implementations
An implementation of the sequencing interface mainly acts as a middleware that connects Rollkit rollup and the sequencing layer. It implements the sequencing interface functions described above. There are several implementations of the sequencer but for now only one is available in Rollkit.
- single-sequencer - The simplest and most widely used sequencing model, where a single node (the sequencer) is responsible for ordering transactions and producing blocks.