Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
\newcommand*{\balance}{\N_B}
\newcommand*{\serviceid}{\N_S}
\newcommand*{\bloblength}{\N_L}
\newcommand*{\preimagelen}{\N_P}
\newcommand*{\gas}{\N_G}
\newcommand*{\Nmax}[1]{\N_{#1}}
\newcommand*{\Nclamp}[2]{\N_{#1 \dots #2}}
Expand Down
7 changes: 6 additions & 1 deletion text/accounts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ \section{Service Accounts}\label{sec:accounts}
\serviceaccount \equiv \tuple{\ \begin{aligned}
\sa¬storage &\in \dictionary{\blob}{\blob}\,,\
\sa¬preimages \in \dictionary{\hash}{\blob}\,,\\
\sa¬requests &\in \dictionary{\tuple{\hash,\bloblength}}{\sequence[:3]{\timeslot}}\,,\\
\sa¬requests &\in \dictionary{\tuple{\hash,\preimagelen}}{\sequence[:3]{\timeslot}}\,,\\
\sa¬gratis &\in \balance\,,\
\sa¬codehash \in \hash\,,\
\sa¬balance \in \balance\,,\
Expand All @@ -26,6 +26,11 @@ \section{Service Accounts}\label{sec:accounts}
\end{aligned}\,}
\end{align}

Here, $\preimagelen$ is the set of lengths under which a preimage may be solicited; this is the subset of $\bloblength$ omitting its two greatest values, since these are reserved as the discriminators of storage and preimage items respectively in the state-key derivation of equation \ref{eq:stateserialization}. Formally:
\begin{align}\label{eq:preimagelen}
\preimagelen &\equiv \Nmax{2^{32} - 2}
\end{align}

Thus, the balance of the service of index $s$ would be denoted $\accounts\subb{s}_\sa¬balance$ and the storage item of key $\mathbf{k} \in \blob$ for that service is written $\accounts\subb{s}_\sa¬storage\subb{\mathbf{k}}$.


Expand Down
1 change: 1 addition & 0 deletions text/definitions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ \subsubsection{Regular Notation}
\item[$\balance$] The set of balance values. Equivalent to $\Nbits{64}$. See equation \ref{eq:balance}.
\item[$\gas$] The set of unsigned gas values. Equivalent to $\Nbits{64}$. See equation \ref{eq:gasregentry}.
\item[$\bloblength$] The set of blob length values. Equivalent to $\Nbits{32}$. See section \ref{sec:numbers}.
\item[$\preimagelen$] The set of lengths under which a preimage may be solicited. A subset of $\bloblength$, equivalent to $\Nmax{2^{32} - 2}$. See equation \ref{eq:preimagelen}.
\item[$\pvmreg$] The set of register values. Equivalent to $\Nbits{64}$. See equation \ref{eq:gasregentry}.
\item[$\serviceid$] The set from which service indices are drawn. Equivalent to $\Nbits{32}$. See section \ref{eq:serviceaccounts}.
\item[$\timeslot$] The set of timeslot values. Equivalent to $\Nbits{32}$. See equation \ref{eq:time}.
Expand Down
2 changes: 1 addition & 1 deletion text/merklization.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ \subsection{Serialization}
\end{equation}

The state serialization is then defined as the dictionary built from the amalgamation of each of the components. Cryptographic hashing ensures that there will be no duplicate state-keys given that there are no duplicate inputs to $C$. Formally, we define $T$ which transforms some state $\thestate$ into its serialized form:
\begin{equation}
\begin{equation}\label{eq:stateserialization}
T(\thestate) \equiv \abracegroup{
&&C(1) &\mapsto \encode{\sq{\build{\var{x}}{x \orderedin \authpool}}} \;, \\
&&C(2) &\mapsto \encode{\authqueue} \;, \\
Expand Down
13 changes: 7 additions & 6 deletions text/pvm_invocations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ \subsubsection{Accumulate Functions}\label{sec:accumulatefunctions}
$\begin{aligned}
\using \sq{o, l, \sa¬minaccgas, \sa¬minmemogas, \sa¬gratis, \local¬desiredid} &= \registers\subrange{7}{6} \\
\using \sa¬codehash &= \begin{cases}
\memory\subrange{o}{32} &\when \Nrange{o}{32} \subseteq \readable{\memory} \wedge l \in \Nbits{32} \\
\memory\subrange{o}{32} &\when \Nrange{o}{32} \subseteq \readable{\memory} \\
\error &\otherwise
\end{cases}\\
\using \mathbf{a} \in \serviceaccount \cup \set{\error} &= \begin{cases}
Expand All @@ -810,7 +810,8 @@ \subsubsection{Accumulate Functions}\label{sec:accumulatefunctions}
\end{cases} \\
\using \mathbf{s} &= \imX_\im¬self \exc \mathbf{s}_\sa¬balance = (\imX_\im¬self)_\sa¬balance - \mathbf{a}_\sa¬minbalance \\
\tup{\execst', \registers'_7, \imX'_\im¬nextfreeid, (\imX'_\im¬state)_\ps¬accounts} &\equiv \begin{cases}
\tup{\panic, \registers_7, \imX_\im¬nextfreeid, (\imX_\im¬state)_\ps¬accounts} &\when c = \error \\
\tup{\continue, \mathtt{HUH}, \imX_\im¬nextfreeid, (\imX_\im¬state)_\ps¬accounts} &\when l \not\in \preimagelen \\
\tup{\panic, \registers_7, \imX_\im¬nextfreeid, (\imX_\im¬state)_\ps¬accounts} &\otherwhen c = \error \\
\tup{\continue, \mathtt{HUH}, \imX_\im¬nextfreeid, (\imX_\im¬state)_\ps¬accounts} &\otherwhen f \ne 0 \wedge \imX_\im¬id \ne (\imX_\im¬state)_\ps¬manager \\
\tup{\continue, \mathtt{CASH}, \imX_\im¬nextfreeid, (\imX_\im¬state)_\ps¬accounts} &\otherwhen \mathbf{s}_\sa¬balance < (\imX_\im¬self)_\sa¬minbalance \\
\tup{\continue, \mathtt{FULL}, \imX_\im¬nextfreeid, (\imX_\im¬state)_\ps¬accounts} &\otherwhen \imX_\im¬id = (\imX_\im¬state)_\ps¬registrar \wedge \local¬desiredid < \Cminpublicindex \wedge \local¬desiredid \in \keys{(\imX_\im¬state)_\ps¬accounts} \\
Expand Down Expand Up @@ -910,7 +911,7 @@ \subsubsection{Accumulate Functions}\label{sec:accumulatefunctions}
\error &\otherwise\\
\end{cases} \\
\tup{\execst', \registers'_7, \registers'_8} &\equiv \begin{cases}
\tup{\continue, \mathtt{HUH}, \registers_8} &\when z \not\in \bloblength \\
\tup{\continue, \mathtt{HUH}, \registers_8} &\when z \not\in \preimagelen \\
\tup{\panic, \registers_7, \registers_8} &\otherwhen h = \error \\
\tup{\continue, \mathtt{NONE}, 0} &\otherwhen \mathbf{a} = \error \\
\tup{\continue, 0, 0} &\otherwhen \mathbf{a} = \sq{} \\
Expand All @@ -937,7 +938,7 @@ \subsubsection{Accumulate Functions}\label{sec:accumulatefunctions}
\error &\otherwise\\
\end{cases} \\
\tup{\execst', \registers'_7, \imX'_\im¬self} &\equiv \begin{cases}
\tup{\continue, \mathtt{HUH}, \imX_\im¬self} &\when z \not \in \bloblength \\
\tup{\continue, \mathtt{HUH}, \imX_\im¬self} &\when z \not \in \preimagelen \\
\tup{\panic, \registers_7, \imX_\im¬self} &\otherwhen h = \error \\
\tup{\continue, \mathtt{HUH}, \imX_\im¬self} &\otherwhen \mathbf{a} = \error \\
\tup{\continue, \mathtt{FULL}, \imX_\im¬self} &\otherwhen \mathbf{a}_\sa¬balance < \mathbf{a}_\sa¬minbalance \\
Expand Down Expand Up @@ -968,7 +969,7 @@ \subsubsection{Accumulate Functions}\label{sec:accumulatefunctions}
\error &\otherwise\\
\end{cases} \\
\tup{\execst', \registers'_7, \imX'_\im¬self} &\equiv \begin{cases}
\tup{\continue, \mathtt{HUH}, \imX_\im¬self} &\when z \not \in \bloblength \\
\tup{\continue, \mathtt{HUH}, \imX_\im¬self} &\when z \not \in \preimagelen \\
\tup{\panic, \registers_7, \imX_\im¬self} &\otherwhen h = \error \\
\tup{\continue, \mathtt{HUH}, \imX_\im¬self} &\otherwhen \mathbf{a} = \error \\
\tup{\continue, \mathtt{OK}, \mathbf{a}} &\otherwise \\
Expand Down Expand Up @@ -1011,7 +1012,7 @@ \subsubsection{Accumulate Functions}\label{sec:accumulatefunctions}
\none &\otherwise
\end{cases} \\
\tup{\execst', \registers'_7, \imX'_\im¬provisions} &\equiv \begin{cases}
\tup{\continue, \mathtt{HUH}, \imX_\im¬provisions} &\when z \not \in \bloblength \\
\tup{\continue, \mathtt{HUH}, \imX_\im¬provisions} &\when z \not \in \preimagelen \\
\tup{\panic, \registers_7, \imX_\im¬provisions} &\otherwhen \mathbf{i} = \error \\
\tup{\continue, \mathtt{WHO}, \imX_\im¬provisions} &\otherwhen \mathbf{a} = \none \\
\tup{\continue, \mathtt{HUH}, \imX_\im¬provisions} &\otherwhen \mathbf{a}_\sa¬requests[\tup{\blake{\mathbf{i}}, z}] \ne \sq{} \\
Expand Down