forked from gavofyork/graypaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
best_chain.tex
33 lines (26 loc) · 1.54 KB
/
best_chain.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
\section{Grandpa and the Best Chain}\label{sec:bestchain}\label{sec:grandpa}
Nodes take part in the \textsc{Grandpa} protocol as defined by \cite{stewart2020grandpa}.
\newcommand{\final}{\natural}
\newcommand{\best}{\flat}
We define the latest finalized block as $\mathbf{B}^\final$. All associated terms concerning block and state are similarly superscripted. We consider the \emph{best block}, $\mathbf{B}^\best$ to be that which is drawn from the set of acceptable blocks of the following criteria:
\begin{itemize}
\item Has the finalized block as an ancestor.
\item Contains no unfinalized blocks where we see an equivocation (two valid blocks at the same timeslot).
\item Is considered audited.
\end{itemize}
Formally:
\begin{align}
\mathbf{A}(\mathbf{H}^\best) &\owns \mathbf{H}^\final \\
\mathbf{U}^\best &\equiv \top \\
\not\exists \mathbf{H}^A, \mathbf{H}^B &: \bigwedge \left\{\,\begin{aligned}
\mathbf{H}^A &\ne \mathbf{H}^B \\
\mathbf{H}^A_T &= \mathbf{H}^B_T \\
\mathbf{H}^A &\in \mathbf{A}(\mathbf{H}^\best) \\
\mathbf{H}^A &\not\in \mathbf{A}(\mathbf{H}^\final)
\end{aligned}\right.
\end{align}
Of these acceptable blocks, that which contains the most ancestor blocks whose author used a seal-key ticket, rather than a fallback key should be selected as the best head, and thus the chain on which the participant should make \textsc{Grandpa} votes.
Formally, we aim to select $\mathbf{B}^\best$ to maximize the value $m$ where:
\begin{equation}
m = \sum_{\mathbf{H}^A \in \mathbf{A}^\best} \mathbf{T}^A
\end{equation}