intro et algo propre. Proof en cours
This commit is contained in:
@ -1,73 +1,60 @@
|
||||
We define $k$ as the id of the round \\
|
||||
the $getMax(proves)$ return $MAX({(\_, r) : \exists (\_, PROVE(r)) \in proves})$ \\
|
||||
$buffer$ a FIFO list with $buffer[front]$ returning the first element
|
||||
We consider a set of processes communicating asynchronously over reliable point-to-point channels. Each process maintains the following 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).
|
||||
\end{itemize}
|
||||
|
||||
\begin{algorithm}[H]
|
||||
\DontPrintSemicolon
|
||||
\SetAlgoLined
|
||||
\resetalgline
|
||||
\begin{algorithm}
|
||||
|
||||
$rcved = rcved \bigcup \{m\}$ \;
|
||||
\textbf{upon} RB\_deliver(PROP, r, S) \textbf{from} j \;
|
||||
prop[r][j] = S
|
||||
\vspace{1em}
|
||||
\textbf{RB-received$(m, S, r_0, j_0)$}
|
||||
\begin{algorithmic}[1]
|
||||
\State \nextalgline $\textit{received} \gets \textit{received} \cup \{m\}$
|
||||
\State \nextalgline $\textit{prop}[r_0][j_0] \gets S$
|
||||
\end{algorithmic}
|
||||
|
||||
\caption{\textbf{Upon} RB\_deliver(m)}
|
||||
\end{algorithm}
|
||||
\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}
|
||||
|
||||
\begin{algorithm}[H]
|
||||
\DontPrintSemicolon
|
||||
\SetAlgoLined
|
||||
\KwIn{le message $m$}
|
||||
|
||||
\KwData{rcved = $\emptyset$ \;
|
||||
delivered = $\emptyset$ \;
|
||||
r = 0 \;}
|
||||
|
||||
\BlankLine
|
||||
|
||||
RB\_cast(m) \;
|
||||
$rcved = rcvd \bigcup \{m\}$ \;
|
||||
|
||||
\While{true}{
|
||||
$r = r+1$ \;
|
||||
$RB\_cast(PROP, r, S)$ \;
|
||||
PROVE(r) \;
|
||||
APPEND(r) \;
|
||||
proves = READ() \;
|
||||
$winner^r = \{j : (j, PROVE(r)) \in proves\}$ \;
|
||||
\textbf{wait until} $(\forall j \in winner^k: prop[r][j])$ \;
|
||||
\If{$\exists j \in winner^k : m \in prop[r][j]$}{
|
||||
break \;
|
||||
}
|
||||
}
|
||||
|
||||
\caption{AB\_Broadcast}
|
||||
\end{algorithm}
|
||||
|
||||
\begin{algorithm}[H]
|
||||
\DontPrintSemicolon
|
||||
\SetAlgoLined
|
||||
|
||||
r\_prev = 0 \;
|
||||
\While{true}{
|
||||
proves = READ() \;
|
||||
$r\_max = MAX(\{r : \exists i, (i, PROVE(r)) \in proves\})$ \;
|
||||
\For{$r = r\_prev + 1 \textbf{to} r\_max$}{
|
||||
APPEND(r) \;
|
||||
proves = READ() \;
|
||||
$winner^k = \{j : (j, PROVE(r)) \in proves \}$ \;
|
||||
$\textbf{wait until} (\forall j \in winner^k : prop[r][j] \neq \emptyset)$ \;
|
||||
$M^r = (\bigcup_{j \in winner^k} prop[r][j]) \setminus delivered$ \;
|
||||
|
||||
\tcc*{we assume $M^r$ as an ordered list s.a. $\forall m_1, m_2, if m_1 < m_2$, $m_1$ appears before $m_2$ in $M^r$}
|
||||
|
||||
\BlankLine
|
||||
|
||||
\ForEach{$m \in M^r$}{
|
||||
$delivered = delivered \bigcup \{m\}$ \;
|
||||
AB\_deliver(m) \;
|
||||
}
|
||||
}
|
||||
}
|
||||
\caption{AB\_Listen}
|
||||
\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}
|
Reference in New Issue
Block a user