Skip to content

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 system run. Rollkit uses a "Sequencing Interface" with key functions like submitting, retrieving, and verifying these transaction batches, ensuring smooth communication between the Rollkit instance 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.

go
SubmitTransaction(data) returns (error)

GetNextBatch(lastBatchHash, maxBytes) returns (batch, timestamp)

VerifyBatch(batchHash) returns (status)

It mainly consists of:

  • SubmitTransaction relays the transactions from a Rollkit instance to the sequencing network
  • GetNextBatch returns the next batch of transactions along with a deterministic timestamp
  • VerifyBatch validates the sequenced batch

Sequencing Implementations

An implementation of the sequencing interface mainly acts as a middleware that connects a Rollkit instance and the sequencing layer. It implements the sequencing interface functions described above. For example, single-sequencer is the refactored functionality from Rollkit prior to v1.0.0. The single sequencer is the middleware run by the aggregator node of the Rollkit instance. The aggregator node relays transactions to single sequencer which then submits them to the DA network (Celestia). The header producer node then retrieves (via GetNextBatch) the batched transaction from the single sequencer to execute the transactions and produce the updated system state. Similarly, there are other sequencing middlewares which can be built for various sequencing strategies or even for connecting to different third-party sequencing networks.

The sequencing implementations that are currently work in progress:

Released under the APACHE-2.0 License