Skip to content

Commit

Permalink
Merge pull request #734 from w3f/skalman--fix-grandpa-best-pre-vote-c…
Browse files Browse the repository at this point in the history
…andidate

Fix Best Pre-Vote Candidate in GRANDPA Spec
  • Loading branch information
Noc2 authored Jan 17, 2025
2 parents 5a89419 + f88326e commit 3b1afed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions algorithms/bestPrevoteCandidate.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
\caption{Best-PreVote-Candidate}
\begin{algorithmic}
\input $r$
\state $B^{r, pv}_v \leftarrow$ \call{GRANDPA-GHOST}{$r$}
\if{\call{Received}{$M_{v_{primary}}^{r, prim}(B))$ \and $B^{r, pv}_v \geqslant B > L$}}
\state $B^{r-1, pv}_v \leftarrow$ \call{GRANDPA-GHOST}{$r-1$}
\if{\call{Received}{$M_{v_{primary}}^{r, prim}(B))$ \and $B^{r-1, pv}_v \geqslant B > L$}}
\state $N \leftarrow B$
\else
\state $N \leftarrow B^{r, pv}_v$
\state $N \leftarrow B^{r-1, pv}_v$
\endif
\return \call{Best-Chain-Safe-Head}{N}
\end{algorithmic}
\end{algorithm}
\end{algorithm}
2 changes: 2 additions & 0 deletions docs/sect-finality.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ where $\#{{V}_{{\text{obv}{\left({v}\right)},{p}{o}{t}}}^{{{r},{p}{c}}}}$ is def
algID="bestPrevoteCandidate"
options={{ "lineNumber": true }}
/>

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..
:::

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

0 comments on commit 3b1afed

Please sign in to comment.