Lachesis represents Fantom aBFT consensus algorithm. In simpler terms, a consensus mechanism that serves as the driving force behind the blockchain.
Compared to Classical and Nakamoto consensus, Lachesis stands out as a swifter, more scalable, and more secure option. Developers have the flexibility to utilize Lachesis for constructing peer-to-peer applications without the necessity of crafting their own networking layer.
Fantom’s Lachesis Consists of:
Asynchronous: Participants retain the liberty to process commands at varying times.
Leaderless: No participant assumes a “special” role.
Byzantine Fault-Tolerant: It accommodates one-third of faulty nodes, including malicious behavior.
Note: The output of it is immediately usable. There is no need for block confirmations; transactions receive confirmation in 1-2 seconds.
How does Lachesis operate?
Every Lachesis node stores a local acyclic directed graph (DAG) consisting of event blocks, each containing transactions. The DAG, capturing the happens-before relationship between events, is employed to compute an exact final order of events—hence transactions—autonomously on each node. Event blocks are categorized into confirmed and unconfirmed event blocks. Novel event blocks are unconfirmed, whereas event blocks from the past 2-3+ frames are all confirmed, subsequently arranged by honest nodes.
Consensus yields batches of confirmed event blocks, termed a block for each event batch. The finalized blocks constituting the ultimate chain are independently computed from event blocks on each node.
Diverging from Proof-of-Work, round-robin Proof-of-Stake, coinage Proof-of-Stake, and sync BFT, Lachesis nodes refrain from sending blocks to one another. Only events synchronize between nodes. Validators don’t vote on a precise state of the network; instead, they periodically exchange observed transactions and events with peers.
Unlike Classical consensus, such as pBFT, Lachesis doesn’t incorporate new events in the ongoing election. Instead, new events are used to vote for events in 2-3+ previous virtual elections concurrently. This results in a reduced number of created consensus messages, as the same event is repurposed in different elections.
Thus, Lachesis achieves a diminished time to finality and decreased communication overhead in comparison to synchronous BFT.
What are epochs in Lachesis?
Fantom Lachesis’s event structure manifests as a DAG of events. To optimize storage and retrieval, the DAG is segmented into sub-DAGs, each termed an epoch. Each epoch encompasses numerous finalized blocks.
Each epoch concludes when one of these conditions is met:
-The epoch attains a specified number of blocks.
-The epoch endures for a designated time.
-At least one cheater is confirmed in this block.
-Epoch sealing is initiated by the NodeDriver contract.
-Upon sealing an epoch, its inner epoch indexes are pruned, and new events from the sealed epochs are disregarded. Each epoch constitutes a distinct DAG, disallowing parents from other epochs. For validation, each event includes the hash of the prior epoch.