diff --git a/preamble.tex b/preamble.tex index 3c865ce..5e4c15c 100644 --- a/preamble.tex +++ b/preamble.tex @@ -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}} diff --git a/text/accounts.tex b/text/accounts.tex index cf0e714..d59295b 100644 --- a/text/accounts.tex +++ b/text/accounts.tex @@ -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\,,\ @@ -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}}$. diff --git a/text/definitions.tex b/text/definitions.tex index 2e9f70e..86442b2 100644 --- a/text/definitions.tex +++ b/text/definitions.tex @@ -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}. diff --git a/text/merklization.tex b/text/merklization.tex index 4608bb4..dc07ef7 100644 --- a/text/merklization.tex +++ b/text/merklization.tex @@ -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} \;, \\ diff --git a/text/pvm_invocations.tex b/text/pvm_invocations.tex index ccf4540..ea0a73f 100644 --- a/text/pvm_invocations.tex +++ b/text/pvm_invocations.tex @@ -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} @@ -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} \\ @@ -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{} \\ @@ -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 \\ @@ -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 \\ @@ -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{} \\