refactoring
This commit is contained in:
@@ -4,7 +4,7 @@ We consider a static set $\Pi$ of $n$ processes with known identities, communica
|
||||
|
||||
\paragraph{Synchrony.} The network is asynchronous.
|
||||
|
||||
\paragraph{Communication.} Processes can exchange through a Reliable Broadcast ($\RB$) primitive (defined below) which is invoked with the functions $\RBcast(m)$ and $m = \RBreceived()$. There exists a shared object called DenyList ($\DL$) (defined below) that is interfaced with a set $O$ of operations. There exist three types of these operations: $\APPEND(x)$, $\PROVE(x)$ and $\READ()$.
|
||||
\paragraph{Communication.} Processes can exchange through a Reliable Broadcast ($\RB$) primitive (defined below) which is invoked with the functions $\RBcast(m)$ and $m = \rbreceived()$. There exists a shared object called DenyList ($\DL$) (defined below) that is interfaced with a set $O$ of operations. There exist three types of these operations: $\APPEND(x)$, $\PROVE(x)$ and $\READ()$.
|
||||
|
||||
\paragraph{Byzantine behaviour}
|
||||
A process is said to exhibit Byzantine behaviour if it deviates arbitrarily from the prescribed algorithm. Such deviations may, for instance, consist in invoking primitives ($\RBcast$, $\APPEND$, $\PROVE$, etc.) with invalid inputs or inputs crafted maliciously, colluding with other Byzantine processes in an attempt to manipulate the system state or violate its guarantees, deliberately delaying or accelerating the delivery of messages to selected nodes so as to disrupt the expected timing of operations, or withholding messages and responses in order to induce inconsistencies in the system state.
|
||||
@@ -65,21 +65,21 @@ For each $U \in \mathcal{U}$, we instantiate one DenyList object $DL_U$ whose au
|
||||
\vspace{1em}
|
||||
|
||||
\Fn{$\BFTPROVE(x)$}{
|
||||
$state \gets false$\;
|
||||
$\state \gets false$\;
|
||||
\For{\textbf{each } $U \in \mathcal{U}$}{
|
||||
$state \gets state \textbf{ OR } DL_U.\PROVE(x)$\;\nllabel{code:prove-or}
|
||||
$\state \gets \state \textbf{ OR } DL_U.\PROVE(x)$\;\nllabel{code:prove-or}
|
||||
}
|
||||
\Return{$state$}\;
|
||||
\Return{$\state$}\;
|
||||
}
|
||||
|
||||
\vspace{1em}
|
||||
|
||||
\Fn{$\BFTREAD()$}{
|
||||
$results \gets \emptyset$\;
|
||||
$\results \gets \emptyset$\;
|
||||
\For{\textbf{each } $U \in \mathcal{U}$}{
|
||||
$results \gets results \cup DL_U.\READ()$\;
|
||||
$\results \gets \results \cup DL_U.\READ()$\;
|
||||
}
|
||||
\Return{$results$}\;
|
||||
\Return{$\results$}\;
|
||||
}
|
||||
\end{algorithm}
|
||||
|
||||
@@ -92,7 +92,7 @@ For each $U \in \mathcal{U}$, we instantiate one DenyList object $DL_U$ whose au
|
||||
|
||||
\begin{itemize}
|
||||
\item \textbf{Case (i): $|A|\ge t+1$.}
|
||||
Fix any $U\in\mathcal{U}$. $A\cap U\neq\emptyset$. Pick $j\in A\cap U$. Since $j\in U$, the call $\BFTAPPEND_j(x)$ triggers $DL_U.\APPEND(x)$, and because $\BFTAPPEND_j(x)\prec op$ in $\Seq$, this induces a valid $DL_U.\APPEND(x)$ that appears before the induced $DL_U.\PROVE(x)$ by $p_i$. By \textbf{PROVE Validity} of $\DL$, the induced $DL_U.\PROVE(x)$ is invalid. As this holds for every $U\in\mathcal{U}$, there is \emph{no} component $DL_U$ where $\PROVE(x)$ is valid, so the field $state$ at line~\ref{code:prove-or} is never becoming true, and $op$ return false.
|
||||
Fix any $U\in\mathcal{U}$. $A\cap U\neq\emptyset$. Pick $j\in A\cap U$. Since $j\in U$, the call $\BFTAPPEND_j(x)$ triggers $DL_U.\APPEND(x)$, and because $\BFTAPPEND_j(x)\prec op$ in $\Seq$, this induces a valid $DL_U.\APPEND(x)$ that appears before the induced $DL_U.\PROVE(x)$ by $p_i$. By \textbf{PROVE Validity} of $\DL$, the induced $DL_U.\PROVE(x)$ is invalid. As this holds for every $U\in\mathcal{U}$, there is \emph{no} component $DL_U$ where $\PROVE(x)$ is valid, so the field $\state$ at line~\ref{code:prove-or} is never becoming true, and $op$ return false.
|
||||
|
||||
\item \textbf{Case (ii): $|A|\le t$.}
|
||||
There exists $U^\star\in\mathcal{U}$ such that $A\cap U^\star=\emptyset$. For any $j\in A$, we have $j\notin U^\star$, so $\BFTAPPEND_j(x)$ does \emph{not} call $DL_{U^\star}.\APPEND(x)$. Hence no valid $DL_{U^\star}.\APPEND(x)$ appears before the induced $DL_{U^\star}.\PROVE(x)$. Since also $i\in \Pi_V(DL_{U^\star})$, by \textbf{PROVE Validity} of $\DL$ the induced $DL_{U^\star}.\PROVE(x)$ is valid. Therefore, there exists a component with a valid $\PROVE(x)$, so $op$ is valid.
|
||||
@@ -177,72 +177,72 @@ For each $U \in \mathcal{U}$, we instantiate one DenyList object $DL_U$ whose au
|
||||
|
||||
\SetKwBlock{LocalVars}{Local Variables:}{}
|
||||
\LocalVars{
|
||||
$\mathit{unordered} \gets \emptyset$,
|
||||
$\mathit{ordered} \gets \epsilon$,
|
||||
$\mathit{delivered} \gets \epsilon$\;
|
||||
$\mathit{prop}[r][j] \gets \bot, \forall j, r \in \Pi \times \mathbb{N}$\;
|
||||
$\mathit{done}[r] \gets \emptyset, \forall r \in \mathbb{N}$\;
|
||||
$\unordered \gets \emptyset$,
|
||||
$\ordered \gets \epsilon$,
|
||||
$\delivered \gets \epsilon$\;
|
||||
$\prop[r][j] \gets \bot, \forall j, r \in \Pi \times \mathbb{N}$\;
|
||||
$\done[r] \gets \emptyset, \forall r \in \mathbb{N}$\;
|
||||
}
|
||||
|
||||
\vspace{0.3em}
|
||||
|
||||
\For{$r = 1, 2, \ldots$}{
|
||||
\textbf{wait until} $\mathit{unordered} \setminus \mathit{ordered} \neq \emptyset$\;
|
||||
$S \gets \mathit{unordered} \setminus \mathit{ordered}$;
|
||||
\textbf{wait until} $\unordered \setminus \ordered \neq \emptyset$\;
|
||||
$S \gets \unordered \setminus \ordered$;
|
||||
$\RBcast(i, \texttt{PROP}, S, r)$\;
|
||||
|
||||
\textbf{wait until} $|\textsf{validated}(r)| \geq n - t$\;
|
||||
\textbf{wait until} $|\validated(r)| \geq n - t$\;
|
||||
|
||||
\ForEach{$j \in \Pi$}{
|
||||
$\BFTAPPEND(\langle j, r\rangle)$\;
|
||||
}
|
||||
|
||||
\ForEach{$j \in \Pi$}{
|
||||
$\textsf{send}(j, \texttt{DONE}, r)$\;
|
||||
$\send(j, \texttt{DONE}, r)$\;
|
||||
}
|
||||
\textbf{wait until} $|\mathit{done}[r]| \geq n - t$\;
|
||||
\textbf{wait until} $|\done[r]| \geq n - t$\;
|
||||
|
||||
$\mathit{winners}[r] \gets \textsf{validated}(r)$\;
|
||||
$\winners[r] \gets \validated(r)$\;
|
||||
|
||||
\textbf{wait until} $\forall j \in \mathit{winners}[r],\ \mathit{prop}[r][j] \neq \bot$\;
|
||||
$M \gets \bigcup_{j \in \mathit{winners}[r]} \mathit{prop}[r][j]$\;\nllabel{code:Mcompute}
|
||||
$\mathit{ordered} \gets \mathit{ordered} \cdot \ordered(M)$\;
|
||||
\textbf{wait until} $\forall j \in \winners[r],\ \prop[r][j] \neq \bot$\;
|
||||
$M \gets \bigcup_{j \in \winners[r]} \prop[r][j]$\;\nllabel{code:Mcompute}
|
||||
$\ordered \gets \ordered \cdot \ordered(M)$\;
|
||||
}
|
||||
|
||||
\vspace{0.3em}
|
||||
|
||||
\Fn{\textsf{validated}($r$)}{
|
||||
\Fn{\validated($r$)}{
|
||||
\Return{$\{j: |\{k: (k, r) \in \BFTREAD()\}| \geq t+1\}$}\;
|
||||
}
|
||||
|
||||
\vspace{0.3em}
|
||||
|
||||
\Upon{$\ABbroadcast(m)$}{
|
||||
$\mathit{unordered} \gets \mathit{unordered} \cup \{m\}$\;
|
||||
$\unordered \gets \unordered \cup \{m\}$\;
|
||||
}
|
||||
|
||||
\vspace{0.3em}
|
||||
|
||||
\Upon{$\textsf{rdeliver}(\texttt{PROP}, S, \langle j, r \rangle)$ from process $p_j$}{
|
||||
$\mathit{unordered} \gets \mathit{unordered} \cup S$;
|
||||
$\mathit{prop}[r][j] \gets S$\;
|
||||
\Upon{$\rdeliver(\texttt{PROP}, S, \langle j, r \rangle)$ from process $p_j$}{
|
||||
$\unordered \gets \unordered \cup S$;
|
||||
$\prop[r][j] \gets S$\;
|
||||
$\BFTPROVE(\langle j, r\rangle)$\;
|
||||
}
|
||||
|
||||
\vspace{0.3em}
|
||||
|
||||
\Upon{$\textsf{receive}(\texttt{DONE}, r)$ from process $p_j$}{
|
||||
$\mathit{done}[r] \gets \mathit{done}[r] \cup \{j\}$\;
|
||||
\Upon{$\receive(\texttt{DONE}, r)$ from process $p_j$}{
|
||||
$\done[r] \gets \done[r] \cup \{j\}$\;
|
||||
}
|
||||
|
||||
\vspace{0.3em}
|
||||
|
||||
\Upon{$\ABdeliver()$}{
|
||||
\If{$\mathit{ordered} \setminus \mathit{delivered} = \emptyset$}{
|
||||
\If{$\ordered \setminus \delivered = \emptyset$}{
|
||||
\Return{$\bot$}
|
||||
}
|
||||
let $m$ be the first message in $\mathit{ordered} \setminus \mathit{delivered}$\;
|
||||
$\mathit{delivered} \gets \mathit{delivered} \cdot \{m\}$\;
|
||||
let $m$ be the first message in $\ordered \setminus \delivered$\;
|
||||
$\delivered \gets \delivered \cdot \{m\}$\;
|
||||
\Return{$m$}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user