-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathapis.tex
58 lines (49 loc) · 1.99 KB
/
apis.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
\section{APIs}\label{apis}
\subsubsection{Master-chain APIs}\label{master-chain-apis}
Example APIs for certain components of the master chain:
\paragraph{Validator set}\label{validator-set}
\begin{itemize}
\tightlist
\item
\texttt{register\_validator()}
\item
\texttt{unregister\_validator()}
\item
\texttt{delegate\_to(validator)}
\end{itemize}
\paragraph{Sessions}\label{sessions}
\begin{itemize}
\tightlist
\item
\texttt{set\_session\_key()}
\item
\texttt{revoke\_session\_key} (from: validator) revokes the
validator's session key; that party forfeits any further payout of this session.
\item
\texttt{session\_validators()}
\end{itemize}
\paragraph{Invalidity Reporting}\label{invalidity-reporting}
\begin{itemize}
\tightlist
\item
\texttt{inform\_invalid\_subchain\_block(chain\_id,\ block,\ proof)}
(from: fisherman/validator) verify \texttt{number} is less than
\texttt{MAX\_REORG\_DEPTH}, if so verify \texttt{block} was the
ratified sub-chain \texttt{chain-id} block at according number; if so,
verify that the \texttt{block} is an invalid child according to
\texttt{proof}; if so, call \texttt{EXILE\_VALIDATORS} with
\texttt{bad} as the validators who actively ratified that sub-chain
block, with \texttt{honest} as all other validators and with
\texttt{informant} as the caller. if not, \texttt{EXILE\_FISHERMAN}
with \texttt{bad} as the caller.\\
\item
\texttt{inform\_double\_signed\_blocks(number,\ alt\_header,\ signatures{[}{]})}
(from: fisherman/validator) verify \texttt{alt\_header} is a sibling
of the ratified block at height \texttt{number}, if so verify that
each of \texttt{signatures} are ratification signatures; if so, call
\texttt{EXILE\_VALIDATORS} with \texttt{bad} as the validator owning
the session key, with \texttt{honest} as all other validators, with
\texttt{master\_quotient} as \texttt{signatures.len()} and with
\texttt{informant} as the caller. if not, \texttt{EXILE\_FISHERMAN}
with \texttt{bad} as the caller.
\end{itemize}