From cb37f15ba459755cd21efa2d0d2e4290b86ab72e Mon Sep 17 00:00:00 2001 From: Skalman Date: Mon, 13 Jan 2025 13:33:41 -0500 Subject: [PATCH 1/2] - Best Prevote should come from last round's GHOST. - We should return the best chain safe head of that GHOST. --- algorithms/bestPrevoteCandidate.tex | 9 +++++---- docs/sect-finality.md | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/algorithms/bestPrevoteCandidate.tex b/algorithms/bestPrevoteCandidate.tex index 38636fa8d..2f17c8e77 100644 --- a/algorithms/bestPrevoteCandidate.tex +++ b/algorithms/bestPrevoteCandidate.tex @@ -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} \ No newline at end of file +\end{algorithm} diff --git a/docs/sect-finality.md b/docs/sect-finality.md index 056915682..221fd5a28 100644 --- a/docs/sect-finality.md +++ b/docs/sect-finality.md @@ -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. ::: ###### Algorithm -algo-num- Attempt To Finalize At Round {#algo-attempt-to–finalize} From f88326ed18272d26b86b92ec4c38d409f28ae389 Mon Sep 17 00:00:00 2001 From: Skalman Date: Mon, 13 Jan 2025 16:33:30 -0500 Subject: [PATCH 2/2] mention that the best chain must contain the chosen GHOST --- docs/sect-finality.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sect-finality.md b/docs/sect-finality.md index 221fd5a28..507d949f2 100644 --- a/docs/sect-finality.md +++ b/docs/sect-finality.md @@ -338,7 +338,7 @@ where $\#{{V}_{{\text{obv}{\left({v}\right)},{p}{o}{t}}}^{{{r},{p}{c}}}}$ is def options={{ "lineNumber": true }} /> -where $\text{Best-Chain-Safe-Head}$ function is provided by the block production algorithm. +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}