nouvel algo + proofs

This commit is contained in:
Amaury JOLY
2025-05-19 16:50:06 +02:00
parent d1caa2e54a
commit b5719a7d6b
5 changed files with 2551 additions and 150 deletions

View File

@ -1,60 +1,59 @@
We consider a set of processes communicating asynchronously over reliable point-to-point channels. Each process maintains the following shared variables:
We consider a set of processes communicating asynchronously over reliable point-to-point channels. Each process maintains the following local or shared variables:
\begin{itemize}
\item \textbf{received}: the set of messages received (but not yet delivered).
\item \textbf{delivered}: the set of messages that have been received, ordered, and delivered.
\item \textbf{prop[$r$][$j$]}: the proposal set of process $j$ at round $r$. It contains the set of messages that process $j$ claims to have received but not yet delivered at round $r$, concatenated with its newly broadcast message.
\item \textbf{proves}: the current content of the \texttt{DenyList} registry, accessible via the operation \texttt{READ()}. It returns a list of tuples $(j, \texttt{PROVE}(r))$, each indicating that process $j$ has issued a valid \texttt{PROVE} for round $r$.
\item \textbf{winner$^r$}: the set of processes that have issued a valid \texttt{PROVE} operation for round $r$.
\item \textbf{RB-cast}: a reliable broadcast primitive that satisfies the properties defined in Section~1.1.2.
\item \textbf{APPEND$(r)$}, \textbf{PROVE$(r)$}: operations that respectively insert (APPEND) and attest (PROVE) the participation of a process in round $r$ in the DenyList registry.
\item \textbf{READ()}: retrieves the current local view of valid operations (APPENDs and PROVEs) from the DenyList.
\item \textbf{ordered$(S)$}: returns a deterministic total order over a set $S$ of messages (e.g., via hash or lexicographic order).
\item \textbf{\textit{received}}: the set of messages that have been received via the reliable broadcast primitive but not yet ordered.
\item \textbf{\textit{delivered}}: the set of messages that have been ordered.
\item \textbf{\textit{prop}[$r$][$j$]}: the proposal set announced by process $j$ at round $r$. It contains a set of messages that process $j$ claims to have received but not yet delivered.
\item \textbf{\textit{winner}$^r$}: the set of processes that have issued a valid \texttt{PROVE} for round $r$, as observed through the registry.
\item \textbf{\texttt{RB-cast}$(\texttt{PROP}, S, r, j)$}: a reliable broadcast invocation that disseminates the proposal $S$ from process $j$ for round $r$.
\item \textbf{\texttt{RB-delivered}$(\texttt{PROP}, S, r, j)$}: the handler invoked upon reception of a \texttt{RB-cast}, which stores the received proposal $S$ into $\textit{prop}[r][j]$.
\item \textbf{\texttt{READ}()} : returns the current view of all valid operations stored in the DenyList registry.
\item \textbf{\texttt{ordered}$(S)$}: returns a deterministic total order over a set $S$ of messages.
\end{itemize}
\resetalgline
\begin{algorithm}
\vspace{1em}
\textbf{RB-received$(m, S, r_0, j_0)$}
\caption{Atomic Broadcast with DenyList}
\begin{algorithmic}[1]
\State \nextalgline $\textit{received} \gets \textit{received} \cup \{m\}$
\State \nextalgline $\textit{prop}[r_0][j_0] \gets S$
\end{algorithmic}
\State $\textit{proves} \gets \emptyset$
\State $\textit{received} \gets \emptyset$
\State $\textit{delivered} \gets \emptyset$
\State $r_1 \gets 0$
\vspace{1em}
\textbf{AB-broadcast$(m, j_0)$}
\begin{algorithmic}[1]
\State \nextalgline $\textit{proves} \gets \texttt{READ}()$
\State \nextalgline $r_0 \gets \max\{r : \exists j,\ (j, \texttt{PROVE}(r)) \in \textit{proves}\} + 1$
\State \nextalgline $\texttt{RB-cast}(m, (\textit{received} \setminus \textit{delivered}) \cup \{m\}, r_0, j_0)$
\State \nextalgline \texttt{PROVE}$(r_0)$
\State \nextalgline \texttt{APPEND}$(r_0)$
\Repeat
\State \nextalgline $\textit{proves} \gets \texttt{READ}()$
\State \nextalgline $r_1 \gets \max\{r : \exists j,\ (j, \texttt{PROVE}(r)) \in \textit{proves}\} - 1$
\State \nextalgline $\textit{winner}^{r_1} \gets \{j : (j, \texttt{PROVE}(r_1)) \in \textit{proves}\}$
\State \nextalgline \textbf{wait} $\forall j \in \textit{winner}^{r_1},\ \textit{prop}[r_1][j] \neq \bot$
\Until{\nextalgline $\forall r_2,\ \exists j_2 \in \textit{winner}^{r_2},\ m \in \textit{prop}[r_2][j_2]$} \nextalgline
\end{algorithmic}
\vspace{1em}
% --- AB-Broadcast ---
\State \nextalgline \textbf{AB-Broadcast}$_j(m)$
\State \nextalgline \hspace{1em} $\texttt{RB-Broadcast}_j(m)$
\vspace{1em}
% --- RB-delivered ---
\State \nextalgline \textbf{RB-delivered}$_j(m)$
\State \nextalgline \hspace{1em} $\textit{received} \gets \textit{received} \cup \{m\}$
\State \nextalgline \hspace{1em} \textbf{repeat until} $\textit{received} \setminus \textit{delivered} \neq \emptyset$
\State \nextalgline \hspace{2em} $S \gets \textit{received} \setminus \textit{delivered}$
\State \nextalgline \hspace{2em} $\textit{proves} \gets \texttt{READ}()$
\State \nextalgline \hspace{2em} $r_2 \gets \max\{r : j,\ (j, \texttt{PROVE}(r)) \in \textit{proves}\} + 1$
\State \nextalgline \hspace{2em} $\texttt{RB-cast}(\texttt{PROP}, S, r_2, j)$
\State \nextalgline \hspace{2em} $\texttt{PROVE}(r_2)$
\vspace{0.5em}
\State \nextalgline \hspace{2em} \textbf{for } $r \in [r_1 + 1, \dots, r_2]$ \textbf{do}
\State \nextalgline \hspace{3em} $\texttt{APPEND}(r)$
\State \nextalgline \hspace{3em} $\textit{proves} \gets \texttt{READ}()$
\State \nextalgline \hspace{3em} $\textit{winner}^r \gets \{j : (j, \texttt{PROVE}(r)) \in \textit{proves}\}$
\State \nextalgline \hspace{3em} \textbf{wait } $\forall j \in \textit{winner}^r,\ \textit{prop}[r][j] \neq \bot$
\State \nextalgline \hspace{3em} $T \gets \bigcup_{j \in \textit{winner}^r} \textit{prop}[r][j] \setminus \textit{delivered}$
\vspace{0.5em}
\State \nextalgline \hspace{3em} \textbf{for each } $m \in \texttt{ordered}(T)$
\State \nextalgline \hspace{4em} $\textit{delivered} \gets \textit{delivered} \cup \{m\}$
\State \nextalgline \hspace{4em} $\texttt{AB-deliver}_j(m)$
\State \nextalgline \hspace{2em} $r_1 \gets r_2$
\vspace{1em}
% --- RB-deliver(Prop) handler ---
\State \nextalgline \textbf{RB-delivered}$_j(\texttt{PROP}, S, r_1, j_1)$
\State \nextalgline \hspace{1em} $\textit{prop}[r_1][j_1] \gets S$
\vspace{1em}
\textbf{AB-listen}
\begin{algorithmic}[1]
\While{true}
\State \nextalgline $\textit{proves} \gets \texttt{READ}()$
\State \nextalgline $r_1 \gets \max\{r : \exists j,\ (j, \texttt{PROVE}(r)) \in \textit{proves}\} - 1$
\For{$r_2 \in [r_0, \dots, r_1]$} \nextalgline
\State \nextalgline \texttt{APPEND}$(r_2)$
\State \nextalgline $\textit{proves} \gets \texttt{READ}()$
\State \nextalgline $\textit{winner}^{r_2} \gets \{j : (i, \texttt{PROVE}(r_2)) \in \textit{proves}\}$
\State \nextalgline \textbf{wait} $\forall j \in \textit{winner}^{r_2},\ \textit{prop}[r_2][j] \neq \bot$
\State \nextalgline $M^{r_2} \gets \bigcup_{j \in \textit{winner}^{r_2}} \textit{prop}[r_2][j]$
\ForAll{$m \in \texttt{ordered}(M^{r_2})$} \nextalgline
\State \nextalgline $\textit{delivered} \gets \textit{delivered} \cup \{m\}$
\State \nextalgline \texttt{AB-deliver}$(m)$
\EndFor
\EndFor
\EndWhile
\end{algorithmic}
\end{algorithm}