-
Notifications
You must be signed in to change notification settings - Fork 79
Epoch
The Lachesis's events structure isn't a monolith DAG.
In more detail, it's a DAG which is separated into sub-DAGs,
where each sub-DAG is called epoch
.
The epoch is sealed when whichever of conditions comes first:
- Epoch contains
MaxEpochBlocks
blocks (decided frame
is synonym for a block). - Epoch duration >=
MaxEpochDuration
- At least one cheater is confirmed in this block
When epoch epoch gets sealed, it inner epoch indexes get pruned, and the new events for the sealed epochs are ignored. Each epoch is a separate DAG, so parents from other epochs are not allowed.
As 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.

Validators are chosen by SFC contract. Validator has a right to create events. Validator's total stake is a consensus weight. Validator's ID is a uint32 number, chosen by SFC contract.
Validators group and their stakes are fixed for the whole epoch. When epoch gets sealed, the new validators group is calculated, given with validators list at the end of epoch.
If validator becomes a cheater, validator receives the economic penalty after the first block where fork was observed. Epoch is sealed in the block, so cheater is pruned from the validators group right away.