Primary Actors

The epoch preparation protocol defines how information about the next epoch is determined and propagated to the protocol state.

There are two primary actors in this protocol:

This document describes the communication protocol between these two actors and the impact on the protocol state.

Communication

The Epoch Smart Contract can send messages to the Consensus Committee using Service Events. The Consensus Committee can update the protocol state, which can be read by the Epoch Smart Contract from a Cadence interface.

Both of these communication mechanisms are fundamentally asynchronous, due to the latency between block execution, finalization, and sealing. Furthermore, both of these communication methods are fork-specific. See Service Events for more details.

Epoch Length

<aside> 💡 The length of an Epoch is measured in terms of consensus views.

</aside>

Let:

For Epoch N, $V^{(N)}$ and $\hat{V}^{(N)}$ are known before the Epoch begins. The number of views in an epoch and in different epoch phases are constants stored in the epoch smart contracts.

The length of an epoch is not ****fork-dependent, as it is measured in views. Generally, there is not a block for every view. However this does not pose a problem, as for each fork, the first and last block of each Epoch are clearly defined.

<aside> 🔩 Definition: first block of Epoch A block $\\Omega$ is said to be the first block of Epoch N (in its respective fork), if and only if • $\Omega\textnormal{.view} \ge V^{(N)}$ and • $\Omega\textnormal{.parent.view} < V^{(N)}$

</aside>

📖[Context] Motivation for measuring epoch length in consensus views: