Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minor comments #93

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion reports/discussion.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
various perspectives. Initially, we developed a direct translation of the
protocol's Python specification into \tlap{}, but this approach proved
unsatisfactory due to the reliance on recursion. To address this, we modified
the specification to use folds in place of recursion, theoretically enabling
the specification to use folds\rs{if possible, quickly explain what folds are or provide a reference} in place of recursion, theoretically enabling
thpani marked this conversation as resolved.
Show resolved Hide resolved
model-checking with Apalache. However, this approach also proved impractical
due to the high computational complexity involved. Subsequently, we applied a
series of abstractions to improve the model-checking efficiency.
Expand Down
1 change: 1 addition & 0 deletions reports/report.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

\newcommand{\tth}[1]{\footnote{\textcolor{blue}{#1}}}
\newcommand{\tbh}[1]{\textsc{\textbf{#1}}}
\newcommand{\rs}[1]{\footnote{\textcolor{purple}{#1}}}

\title{Technical Report:\\
Exploring Automatic Model-Checking of the Ethereum specification\footnote{%
Expand Down
2 changes: 1 addition & 1 deletion reports/spec1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ \subsection{Shape of the Python Specification}

\paragraph{Functions.} The function definitions are mostly pure functions that
thpani marked this conversation as resolved.
Show resolved Hide resolved
take some input and return some output -- side-effects are rare and limited to
auxiliary state when computing the function output. Some functions are
auxiliary state when computing the function output.\rs{Not sure this is correct as all functions should be side-effect free.} Some functions are
thpani marked this conversation as resolved.
Show resolved Hide resolved
(mutually) recursive, as can be seen in Figure~\ref{fig:callgraph}.

\paragraph{Similarities between Python and \tlap{}.} Despite being a programming
Expand Down
1 change: 1 addition & 0 deletions reports/spec2.tex
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ \subsection{Checking the Specification}
forest. The graphs in Figures~\ref{fig:tricky1}--\ref{fig:tricky2} do not
represent chains. The graph~\texttt{I1} is a direct-acyclic graph but not a
forest. The graph~\texttt{I2} has a loop.
\rs{Perhaps this was something that we failed to make clear, but there is no need to consider graphs that are not trees. Or perhaps I don't fully understand the point that we are making above. Let's discuss.}
thpani marked this conversation as resolved.
Show resolved Hide resolved

\begin{figure}
\input{block-graphs}
Expand Down
3 changes: 2 additions & 1 deletion reports/spec3-alloy.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ \section{\SpecThreeB{} in Alloy}\label{sec:alloy}
restrict the number of checkpoints and votes to 5 and 12, respectively.
Although we introduced similar restrictions with Apalache, Alloy has even
finer level of parameter tuning.
\rs{Is there some inherent limitation of Apalache that we should discuss?}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No inherent limitation per se, there is just no finer-grained control that Apalache implements or exposes right now. We actually mention it as a possible extension in §1.3.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we touched upon that in para 1.3. Beyond that, it is hard to explain the difference without explaining the technique implemented by Alloy.


\item Alloy translates the model checking problem to a Boolean satisfiability
problem (SAT), in constrast to Apalache, which translates it to satisfiability-modulo-theory (SMT). This
Expand Down Expand Up @@ -50,7 +51,7 @@ \subsection{From \tlap{} to Alloy}
\end{lstlisting}

In contrast to~\SpecThree{}, our Alloy specification does not describe a
state machine, but it specifies an arbitrary single state of the protocol. As
state machine, but it specifies an arbitrary single state of the protocol.\rs{Like the SMT spec, right? if so, perhaps we should say so} As
thpani marked this conversation as resolved.
Show resolved Hide resolved
in~\SpecThree{}, we compute the set of justified checkpoints as a fixpoint:

\begin{lstlisting}[language=alloy,columns=fullflexible]
Expand Down
4 changes: 2 additions & 2 deletions reports/spec4b.tex
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ \subsection{Constraints over set cardinalities}
\cdot T + 1$ set elements to show that Equation~(\ref{eq:card-comparison2})
holds true. This gives us a linear number of constraints, instead of a
quadratic one. For example, when $T=1$ and the set may contain up to~$n$
elements, the model checker produces $3 \cdot O(n)$ constraints to check
elements, the model checker produces $3 \cdot O(n)$\rs{Why write $3\cdot O(n)$ rather than just $O(n)$ given that $3 \cdot O(n) \in O(n)$.} constraints to check
thpani marked this conversation as resolved.
Show resolved Hide resolved
Equation~(\ref{eq:card-comparison2}). A similar optimization is used in the
specification of Tendermint~\cite{TendermintSpec2020}.

\subsection{Quorum sets}

To further optimize the constraints over set cardinalities, we have applied the
well-known pattern of replacing cardinality tests with quorum sets. For
example, this approach is used in the specification of Paxos\footnote{%
example, this approach is used in the specification of Paxos\rs{Why use footnote here rather than a citation?}\footnote{%
thpani marked this conversation as resolved.
Show resolved Hide resolved
\tlap{} specification of Paxos:
\url{https://github.com/tlaplus/Examples/blob/master/specifications/Paxos/Paxos.tla}.}

Expand Down
Loading