Link Search Menu Expand Document

Slots


Slots are what allow validators to produce micro blocks and propose and sign macro blocks. A validator uses its slots as the means to the end of producing, proposing, and signing blocks.


There are two types of slots:

View slots: These allow a validator to produce one micro block or propose a macro block at a specific block height and a specific view number.

Validator slots: These allow validators to be part of the consensus, sign macro blocks, and receive rewards.


Random seed generation

The initial random seed will be generated at the genesis block. To generate a random seed for the subsequent blocks, the protocol will lean on the VXEDdSA algorithm instantiated as a verifiable random function. This random seed is present in every block. To generate the validator slot list, the random seed of the election macro block is used. However, to elect each view slot list, the random seed used is the one from the previous block.


Validator selection

In the protocol, there are two cases in which is required to select a subset of validators:

  • A new validator slot list is elected from the active validator set at the end of every epoch.
  • A new view slot list is generated by randomly shuffling the validator slot list before producing a micro block or proposing a macro block.


To select the subset of validators, a random seed is used to generate both the view slot list and the validator list. The view slot list changes each block, while the validator list changes every epoch.


Validator slot list: In each epoch, a new validator slot list is elected from the active validator set. The active validator set is in the staking contract, where the information of the validators is, such as their addresses and balances. To create the list, we get the validators addresses, their balances, and the random seed of the election block. Validators are then randomly sampled, proportionally to their balance, using the Alias method. The distribution ends when the list completes 512 slots. Note that validators with a higher balance tend to own more slots.

Lastly, the addresses are ordered alphabetically, creating a slot range for the validators such that compresses the validator slot list. The following figure illustrates hypothetically how the validator slot list is saved, how the validators are ordered, and the range of validator slots each validator owns:



In the example of validator 1, it holds 25 validator slots from slot 0 to slot 24.


View slot list: In each block, a new view slot list is generated by randomly shuffling the validator slot list. We generate a random order for the view slot list given the random seed from the previous block and the validator slot list, resulting in a neat distribution of the validators that will produce the next micro block or propose the next macro block. If the first validator from the view slot list doesn’t produce a micro block or propose a macro block in time, the following view slot is selected to produce the micro block or propose the macro block. If the next view slot doesn’t produce or propose in time, another view slot is selected, and so on. Note that validators use their view slots to propose macro blocks, but to sign macro blocks validators use their validator slots.



In the figure above, we demonstrate where the random seed is applied to the view slot lists. The random seed of macro block B is used to create the view slot list for micro block C. To create the view slot list for micro block D, the random seed of micro block C is used. And so on.


Back to top