Skip to content

Commit 3b1afed

Browse files
authored
Merge pull request #734 from w3f/skalman--fix-grandpa-best-pre-vote-candidate
Fix Best Pre-Vote Candidate in GRANDPA Spec
2 parents 5a89419 + f88326e commit 3b1afed

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

algorithms/bestPrevoteCandidate.tex

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
\caption{Best-PreVote-Candidate}
33
\begin{algorithmic}
44
\input $r$
5-
\state $B^{r, pv}_v \leftarrow$ \call{GRANDPA-GHOST}{$r$}
6-
\if{\call{Received}{$M_{v_{primary}}^{r, prim}(B))$ \and $B^{r, pv}_v \geqslant B > L$}}
5+
\state $B^{r-1, pv}_v \leftarrow$ \call{GRANDPA-GHOST}{$r-1$}
6+
\if{\call{Received}{$M_{v_{primary}}^{r, prim}(B))$ \and $B^{r-1, pv}_v \geqslant B > L$}}
77
\state $N \leftarrow B$
88
\else
9-
\state $N \leftarrow B^{r, pv}_v$
9+
\state $N \leftarrow B^{r-1, pv}_v$
1010
\endif
11+
\return \call{Best-Chain-Safe-Head}{N}
1112
\end{algorithmic}
12-
\end{algorithm}
13+
\end{algorithm}

docs/sect-finality.md

+2
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ where $\#{{V}_{{\text{obv}{\left({v}\right)},{p}{o}{t}}}^{{{r},{p}{c}}}}$ is def
337337
algID="bestPrevoteCandidate"
338338
options={{ "lineNumber": true }}
339339
/>
340+
341+
where $\text{Best-Chain-Safe-Head}$ function is provided by the block production algorithm to choose a preferred head of the best sub-chain which must contain block $N$ provided to it..
340342
:::
341343

342344
###### Algorithm -algo-num- Attempt To Finalize At Round {#algo-attempt-to–finalize}

0 commit comments

Comments
 (0)