Skip to main content

Data Format

This chapter specifies the format of data stored by the sequencer network.

Genesis state

The genesis state of the Warp Sequencer is the initial data that is used to start the blockchain. This data includes:

  • Information about the Arweave block from which the sequencer will start.
  • Data required to calculate the prev sort key for interactions handled by the sequencer.

Arweave Block Information

The first type of data needed for the sequencer to start is information about the Arweave block that was last processed by the previous centralized sequencer, as well as data about the Arweave block that will be added first to the sequencer blockchain, along with the interactions it contains. These details are extracted from the arweave_block.json file, and a sample representation is provided below:



  • lastArweaveBlock is information about the block that was last processed by the previous sequencer.
  • nextArweaveBlock is the Arweave block that will be added first to the sequencer.

Previous Sort Keys for Contracts

Information about the sort key of the last interaction for each contract is crucial for assigning prev sort keys to interactions handled by the sequencer. This data is sourced from the prev_sort_keys.json file, structured as follows:


Messages format

Sequencer blocks encapsulate transactions, which in turn contain messages. Within the realm of Warp Sequencer, two fundamental types of messages play a pivotal role: those tailored for incoming interactions and those designed for Arweave blocks retrieved by the sequencer. Messages are defined and serialized in the Protocol Buffers format.

Interaction message

The MsgDataItem message is used to store an interaction sent to the sequencer. The message has the following structure:

message MsgDataItem {
bytes data_item = 1;
string sort_key = 2;
string prev_sort_key = 3;
bytes random = 4;

Arweave block message

The MsgArweaveBlock message is used to store an Arweave block that has been downloaded by the sequencer. The message has the following fields:

message MsgArweaveBlock {
ArweaveBlockInfo block_info = 1;
repeated ArweaveTransactionWithInfo transactions = 2;

The first field of the message consists of basic information about the Arweave block:

message ArweaveBlockInfo {
uint64 height = 1;
uint64 timestamp = 2;
string hash = 3;

The second field contains a list of the following interaction data:

message ArweaveTransactionWithInfo {
ArweaveTransaction transaction = 1;
string prev_sort_key = 2;
bytes random = 3;

Above, we have the values assigned by the sequencer, as well as the data about the original interaction with Arweave:

message ArweaveTransaction {
string id = 1;
string contract = 2;
string sort_key = 3;

Data stored in sequencer nodes

Sequencer nodes need to store certain data in order to process interactions. This data includes:

  • The data of the last Arweave block that has been added to the sequencer.
  • The sort key of the last interactions for all contracts.

The consistency of this data between nodes is checked with each sequencer block, which contains the AppHash - a hash that is calculated based on the above data, among other things.

Last Arweave block

Information about the most recent Arweave block added to the sequencer is crucial for various processes, particularly in the calculation of sort key values for incoming interactions. It is essential to recall that the first component of this key is the height of the referenced Arweave block.

The details about the last block can be obtained by traversing backward through the last sequencer blocks until the message with the Arweave block is found. However, for performance reasons, this data is stored in a dedicated store and is easily accessible.

The format of the data stored is as follows:

message LastArweaveBlock {
ArweaveBlockInfo arweave_block = 1;
int64 sequencer_block_height = 2;

This struct contains two fields:

  • arweave_block - basic Arweave block data.
  • sequencer_block_height - height of the sequencer block where the last Arweave block was added.

Previous sort keys

Every interaction passing through the sequencer that is not the initial interaction of a particular contract must be assigned a prev sort key. To achieve this, sequencer nodes maintain a map where, for each key representing the transaction identifier of a contract, a value is set as the sort key of the last interaction for that contract. Each entry in this map takes the following form:

message PrevSortKey {
string contract = 1;
string sortKey = 2;

Arweave blocks queue

In addition to the above stores, each validator in the sequencer network downloads and maintains a list of upcoming Arweave blocks to be added to the sequencer network. The block synchronization process is detailed here.

Unlike the aforementioned stores, the Arweave blocks queue is not cross-validated between nodes because nodes may be at different stages of block retrieval. This consistency is verified when adding an Arweave block to the sequencer block and validating these blocks.

The data format stored in the queue is as follows:

message NextArweaveBlock {
ArweaveBlockInfo blockInfo = 1;
repeated ArweaveTransaction transactions = 2;

This structure includes information about the upcoming Arweave block and a list of transactions that will be incorporated into the sequencer network upon processing.