Formalization of the Consensus Algorithm

Definition: Consensus State

Given two checkpoints ff and cc, where ff is also called the finalized checkpoint and cc the current justified checkpoint. We call the ordered pair (f,c)(f,c) a Consensus State, when ff is a predecessor of cc.

Algorithm: Atomic Finalization

Input:

  • A consensus state (f,c)(f,c).
  • A sequence of kk supermajority links (cb1,b1b2,,bk1bk)\left(c\to b_1,b_1 \to b_2, \dots, b_{k-1} \to b_k \right).

Procedure:

The algorithm proceeds only if the final link in the sequence, bk1bkb_{k-1} \to b_k, satisfies the condition epoch(bk)=epoch(bk1)+1epoch(b_k) = epoch(b_{k-1}) + 1. Otherwise, the operation aborts.

Output:

  • The new consensus state (bk1,bk)(b_{k-1}, b_k)

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 (f,c)(f,c) induced by the Beacon state at checkpoint ss, when ff matches the finalized_checkpoint field and cc matches the current_justified_checkpoint field of the Beacon state as referenced by the checkpoint ss.

Theorem 1

Let ss and tt be two finalized checkpoints in a view GG of Casper FFG, where ss is a predecessor of tt. Let A\mathcal{A} be the chain of supermajority links ("attestations") included in the blocks between ss and tt that cause tt to be finalized. Executing the Atomic Finalization algorithm with the consensus state (f,c)(f,c) induced by ss and the chain of supermajority links ("attestations") included in the blocks between ss and tt, will return the consensus state induced by tt.

Proof:

By definition, for Casper FFG to finalize a checkpoint tt, there must exist a supermajority link from a justified checkpoint tt' to tt, where epoch(t)=epoch(t)+1epoch(t) = epoch(t') + 1. The sequence of attestations A\mathcal{A} represents the chain of justifications leading to this final link. Our algorithm's procedural check, epoch(bk)epoch(bk1)=1epoch(b_k) - epoch(b_{k-1}) = 1, directly mirrors this requirement. The algorithm's output (bk1,bk)(b_{k-1}, b_k) therefore corresponds to (t,t)(t', t), 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 ss be a finalized checkpoint in a view GG of Casper FFG. Let (f,c)(f',c') denote the output of our algorithm when executed with the consensus state induced by ss and a valid set of supermajority links as input. Under the accountable safety assumption (<13< \frac{1}{3} of the validators by weight violate a slashing condition), ff' will also be finalized for GG.

Proof Sketch:

This follows directly from Casper FFG's guarantee against finalizing conflicting checkpoints. Assume for contradiction that our algorithm finalizes ff' but GG does not. This would require GG to justify a pair of checkpoints (am,am+1)(a_m, a_{m+1}) that "surround" the supermajority link fcf' \to c' that our algorithm used.

The existence of both the link fcf' \to c' and a surrounding link amam+1a_m \to a_{m+1} is a slashable "surround vote" offense. Therefore, a supermajority of honest validators would never create this situation. Any valid view GG must respect the finalization of ff'. ∎

While ff' is safe, cc' is only justified. Due to malicious behavior or network latency issues, a failure to justify cc' in GG 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 bn2bnb_{n-2} \to b_n, which finalizes bn2b_{n-2}. For this rule to be valid, both bn2b_{n-2} and bn1b_{n-1} must be justified. Our algorithm is designed to process one continuous chain of justifications from a single starting checkpoint (cc), 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 B2B_2 and current_justified_checkpoint could become B4B_4, while B3B_3 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.