Skip to content
quan8 edited this page Feb 16, 2020 · 2 revisions

Epochs

Lachesis's event structure is a DAG of events. To optimize storage and retrieval, the DAG is separated into sub-DAGs, each of them is called epoch. Each epoch is comprised a number of (finalized) blocks.

Each epoch is sealed when one of the below conditions is satisfied:

  • Epoch contains MaxEpochBlocks blocks (decided frame is synonym for a block).
  • Epoch lasts for a duration >= MaxEpochDuration
  • At least one cheater is confirmed in this block

When an epoch gets sealed, its inner epoch indexes get pruned, and new events of the sealed epochs are ignored. Each epoch is forming a separate DAG, and thus parents from other epochs are not allowed.

For a sanity check, each event includes the hash of previous epoch.

The lowest possible epoch number is 1.

A note for experienced readers:

It's possible to ignore events for past (or future) epochs, because future epochs depend only on the finalized state of a previous epoch. Due to the aBFT consensus, the state is final unless more than 1/3W are Byzantine, so it may be safely assumed that new events for an already sealed epoch won't bring any new information (i.e. alter events order). It wouldn't be possible to prune old indexes (or whole events) with a monolith DAG, because event's parent could be from any past event, so we would always need to keep all the indexes in DB, or implement the complex redundant techniques or constraints.

Scheme

Validators group

Validators are chosen by SFC contract. Each validator has the right to create events. The total stake of a validator is used as a weight in the consensus algorithm. A validator ID is a uint32 number, chosen by SFC contract.

At the beginning of each epoch, validators group for the epoch are decided and their stakes are fixed for the entire epoch. When an epoch gets sealed, a new validators group will be calculated based on the validators list given at the end of the sealed epoch.

If a validator is found as a cheater, the validator will receive an economic penalty, immediately after the first block observing the fork. The epoch is sealed in the block, so cheater is pruned from the validators group right away.

Clone this wiki locally