Formalization of the Consensus Algorithm
Definition: Consensus State
Given two checkpoints and , where is also called the finalized checkpoint and the current justified checkpoint. We call the ordered pair a Consensus State, when is a predecessor of .
Algorithm: Atomic Finalization
Input:
- A consensus state .
- A sequence of supermajority links .
Procedure:
The algorithm proceeds only if the final link in the sequence, , satisfies the condition . Otherwise, the operation aborts.
Output:
- The new consensus state
Compatibility Analysis with Casper FFG
We argue the compatibility of our Consensus Algorithm with Casper FFG, assuming no 2-finalizations occur. The finalized_checkpoint
and current_justified_checkpoint
fields in the Beacon state induce a valid consensus state.
Definition: Induced Consensus State
We call a consensus state induced by the Beacon state at checkpoint , when matches the finalized_checkpoint
field and matches the current_justified_checkpoint
field of the Beacon state as referenced by the checkpoint .
Theorem 1
Let and be two finalized checkpoints in a view of Casper FFG, where is a predecessor of . Let be the chain of supermajority links ("attestations") included in the blocks between and that cause to be finalized. Executing the Atomic Finalization algorithm with the consensus state induced by and the chain of supermajority links ("attestations") included in the blocks between and , will return the consensus state induced by .
Proof:
By definition, for Casper FFG to finalize a checkpoint , there must exist a supermajority link from a justified checkpoint to , where . The sequence of attestations represents the chain of justifications leading to this final link. Our algorithm's procedural check, , directly mirrors this requirement. The algorithm's output therefore corresponds to , which is precisely the new (finalized_checkpoint
, current_justified_checkpoint
) state in Casper FFG.∎
This shows that our consensus algorithm will always be able to follow the Beacon chain's consensus, as long as there are no cases of 2-finality.
Theorem 2
Let be a finalized checkpoint in a view of Casper FFG. Let denote the output of our algorithm when executed with the consensus state induced by and a valid set of supermajority links as input. Under the accountable safety assumption ( of the validators by weight violate a slashing condition), will also be finalized for .
Proof Sketch:
This follows directly from Casper FFG's guarantee against finalizing conflicting checkpoints. Assume for contradiction that our algorithm finalizes but does not. This would require to justify a pair of checkpoints that "surround" the supermajority link that our algorithm used.
The existence of both the link and a surrounding link is a slashable "surround vote" offense. Therefore, a supermajority of honest validators would never create this situation. Any valid view must respect the finalization of . ∎
While is safe, is only justified. Due to malicious behavior or network latency issues, a failure to justify in is theoretically possible and would represent a liveness fault, not a safety violation.
A Note on 2-Finality
This algorithm deliberately excludes cases of 2-finality, as they introduce significant complexity to our atomic, single-chain model.
The core challenge lies with finalization rules such as a supermajority link , which finalizes . For this rule to be valid, both and must be justified. Our algorithm is designed to process one continuous chain of justifications from a single starting checkpoint (), whereas a 2-finality rule would require verifying two distinct justification chains.
One might think the Beacon state's previous_justified_checkpoint
and current_justified_checkpoint
fields could serve as these two required checkpoints. However, this is not a reliable solution. The previous_justified_checkpoint
field is defined as the current_justified_checkpoint
of the previous epoch. This can lead to situations with an intermediate justified checkpoint that isn't captured by either field. For example, previous_justified_checkpoint
could be and current_justified_checkpoint
could become , while was justified in the interim (Case 1 and Case 3 of Fig. 8. in Combining GHOST and Casper).
Fortunately, the FFG version implemented in the Ethereum Beacon Chain introduces practical constraints that simplify this problem. By only considering the justification status of the last four epochs and imposing other timing conditions, it prevents the most complex theoretical 2-finality scenarios from occurring. This ensures the conditions can be verified without needing a more complex algorithm that takes multiple justification chains as input.
Nevertheless, adapting our clean, single-chain model to formally handle even these simplified 2-finality rules would add considerable complexity. We therefore leave this extension for a future revision.