Skip to content

Commit

Permalink
Merge #3217
Browse files Browse the repository at this point in the history
3217: Fixed Req/Rep protocol documentation r=bolt12 a=bolt12

Tackles #3201 

Co-authored-by: Armando Santos <armando@well-typed.com>
  • Loading branch information
iohk-bors[bot] and bolt12 committed Jun 16, 2021
2 parents d670830 + 82c2314 commit be47fbb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docs/network-spec/miniprotocols.tex
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ \subsection{Request Response Protocol}
\renewcommand{\StDone}{\state{StDone}}
\newcommand{\Request}{\msg{MsgReq}}
\newcommand{\Response}{\msg{MsgResp}}
\newcommand{\RespDone}{\msg{MsgDone}}

\subsubsection{Description}
The request response protocol is polymorphic in the request and response data that is being transmitted.
Expand All @@ -328,10 +329,11 @@ \subsubsection{State machine}
\tikzstyle{every state}=[fill=red,draw=none,text=white]
\node[state, green, initial] (Idle) {\StIdle};
\node[state, blue, right of=Idle] (Busy) {\StBusy};
\node[state, right of=Busy] (Done) {\StDone};
\node[state, below of=Idle] (Done) {\StDone};

\draw (Idle) edge[] node{\Request} (Busy);
\draw (Busy) edge[] node{\Response} (Done);
\draw (Idle) edge[below, bend right] node{\Request} (Busy);
\draw (Busy) edge[above, bend right] node{\Response} (Idle);
\draw (Idle) edge[right] node{\RespDone} (Done);
\end{tikzpicture}
{\vskip 10pt}
The protocol uses the following messages.
Expand All @@ -340,13 +342,16 @@ \subsubsection{State machine}
The client sends a request to the server.
\item [\Response{} $(response)$]
The server replies with a response.
\item [\RespDone{} $(done)$]
Terminate the protocol.
\end{description}

\begin{tabular}{|l|l|l|l|} \hline
\multicolumn{4}{|c|}{Transition table} \\ \hline
from & message & parameters & to \\ \hline\hline
from & message & parameters & to \\ \hline\hline
\StIdle & \Request & $request$ & \StBusy \\ \hline
\StBusy & \Response & $response$ & \StDone \\ \hline
\StBusy & \Response & $response$ & \StIdle \\ \hline
\StIdle & \RespDone & & \StDone \\ \hline
\end{tabular}

\section{Handshake Mini Protocol}
Expand Down

0 comments on commit be47fbb

Please sign in to comment.