diff --git a/hub/instruction_handling/create/_local.tex b/hub/instruction_handling/create/_local.tex index 6b044ca..2277089 100644 --- a/hub/instruction_handling/create/_local.tex +++ b/hub/instruction_handling/create/_local.tex @@ -16,10 +16,12 @@ \def\locMxpx {\col{STACK\_mxpx}} \def\locOogx {\col{STACK\_oogx}} % -\def\relevantValue {\texttt{}} +\def\relevantValue {\texttt{}} % \def\locTriggerHashInfo {\col{trigger\_\hashInfoMod}} \def\locHashInfoStamp {\col{hash\_info\_stamp}} +\def\locHashInfoKeccakHi {\hashInfoMod\col{\_kec\_hi}} +\def\locHashInfoKeccakLo {\hashInfoMod\col{\_kec\_lo}} \def\locInitCodeHashHi {\col{init\_code\_hash\_hi}} \def\locInitCodeHashLo {\col{init\_code\_hash\_lo}} \def\locInitCodeSize {\col{init\_code\_size}} diff --git a/hub/instruction_handling/create/generalities/unexceptional.tex b/hub/instruction_handling/create/generalities/unexceptional.tex index 007be8f..1fcd952 100644 --- a/hub/instruction_handling/create/generalities/unexceptional.tex +++ b/hub/instruction_handling/create/generalities/unexceptional.tex @@ -60,23 +60,62 @@ \[ \left\{ \begin{array}{lcl} % \accRlpAddrFlag _{i + \createFirstCreatorAccountRowOffset} & = & \rOne \\ - \accRlpAddrRecipe _{i + \createFirstCreatorAccountRowOffset} & = & \locRlpAddrRecipe \\ - \accRlpAddrDepAddrHi _{i + \createFirstCreatorAccountRowOffset} & = & \relevantValue \\ - \accRlpAddrDepAddrLo _{i + \createFirstCreatorAccountRowOffset} & = & \relevantValue \\ - \accRlpAddrSaltHi _{i + \createFirstCreatorAccountRowOffset} & = & \locSaltHi \\ - \accRlpAddrSaltLo _{i + \createFirstCreatorAccountRowOffset} & = & \locSaltLo \\ - \accRlpAddrKecHi _{i + \createFirstCreatorAccountRowOffset} & = & \locInitCodeHashHi \\ - \accRlpAddrKecLo _{i + \createFirstCreatorAccountRowOffset} & = & \locInitCodeHashLo \\ + \accRlpAddrRecipe _{i + \createFirstCreatorAccountRowOffset} & = & \locRlpAddrRecipe \\ + \accRlpAddrDepAddrHi _{i + \createFirstCreatorAccountRowOffset} & = & \relevantValue \\ + \accRlpAddrDepAddrLo _{i + \createFirstCreatorAccountRowOffset} & = & \relevantValue \\ + \accRlpAddrSaltHi _{i + \createFirstCreatorAccountRowOffset} & = & \locSaltHi \\ + \accRlpAddrSaltLo _{i + \createFirstCreatorAccountRowOffset} & = & \locSaltLo \\ + \accRlpAddrKecHi _{i + \createFirstCreatorAccountRowOffset} & = & \locInitCodeHashHi \\ + \accRlpAddrKecLo _{i + \createFirstCreatorAccountRowOffset} & = & \locInitCodeHashLo \\ \end{array} \right. \] where we set \[ - \locRlpAddrRecipe := - \left[ \begin{array}{lrcl} - + & \locIsCreate & \!\!\! \cdot \!\!\! & \addressCreationRecipeConstantStd \\ - + & \locIsCreateTwo & \!\!\! \cdot \!\!\! & \addressCreationRecipeConstantTwo \\ - \end{array} \right] + \left\{ \begin{array}{lcl} + \locRlpAddrRecipe & \define & + \left[ \begin{array}{lrcl} + + & \locIsCreate & \!\!\! \cdot \!\!\! & \addressCreationRecipeConstantStd \\ + + & \locIsCreateTwo & \!\!\! \cdot \!\!\! & \addressCreationRecipeConstantTwo \\ + \end{array} \right] \vspace{2mm} \\ + \locInitCodeHashHi & \define & \locIsCreateTwo \cdot + \left[ \begin{array}{crcl} + + & \locTriggerHashInfo & \cdot & \locHashInfoKeccakHi \\ + + & (1 - \locTriggerHashInfo) & \cdot & \emptyKeccakHi \\ + \end{array} \right] \vspace{2mm} \\ + \locInitCodeHashLo & \define & \locIsCreateTwo \cdot + \left[ \begin{array}{crcl} + + & \locTriggerHashInfo & \cdot & \locHashInfoKeccakLo \\ + + & (1 - \locTriggerHashInfo) & \cdot & \emptyKeccakLo \\ + \end{array} \right] \\ + \end{array} \right. \] + In other words + \begin{enumerate} + \item \If $\locIsCreateTwo = 0$ \Then + \[ + \left\{ \begin{array}{lclr} + \locInitCodeHashHi & \define & 0 & (\trash) \\ + \locInitCodeHashLo & \define & 0 & (\trash) \\ + \end{array} \right. + \] + \item \If $\locIsCreateTwo = 1$ \Then + \begin{enumerate} + \item \If $\locTriggerHashInfo = 0$ + \[ + \left\{ \begin{array}{lclr} + \locInitCodeHashHi & \define & \emptyKeccakHi & (\trash) \\ + \locInitCodeHashLo & \define & \emptyKeccakLo & (\trash) \\ + \end{array} \right. + \] + \item \If $\locTriggerHashInfo = 1$ + \[ + \left\{ \begin{array}{lclr} + \locInitCodeHashHi & \define & \locHashInfoKeccakHi & (\trash) \\ + \locInitCodeHashLo & \define & \locHashInfoKeccakLo & (\trash) \\ + \end{array} \right. + \] + \end{enumerate} + \end{enumerate} \saNote{} We remind the reader that section~(\ref{rlpAddr: create computation constants}) defines two nonzero constants $\addressCreationRecipeConstantStd$ and $\addressCreationRecipeConstantTwo$. \end{description} \saNote{} The \zkEvm{} thus loads the account whose address corresponds to $I_\text{a}$ in the \cite{EYP}. diff --git a/hub/instruction_handling/create/shorthands.tex b/hub/instruction_handling/create/shorthands.tex index 606c3f0..5361168 100644 --- a/hub/instruction_handling/create/shorthands.tex +++ b/hub/instruction_handling/create/shorthands.tex @@ -2,28 +2,28 @@ \[ \hspace*{-2.3cm} \left\{ \begin{array}{lcl} - \locInst & \define & \stackInst _{i - \createFirstStackRowOffset} \\ - \locIsCreate & \define & \decFlag{1} _{i - \createFirstStackRowOffset} \\ - \locIsCreateTwo & \define & \decFlag{2} _{i - \createFirstStackRowOffset} \\ - \locStaticx & \define & \stackStaticx _{i - \createFirstStackRowOffset} \\ - \locMxpx & \define & \stackMxpx _{i - \createFirstStackRowOffset} \\ - \locOogx & \define & \stackOogx _{i - \createFirstStackRowOffset} \\ - \locOffsetHi & \define & \stackItemValHi{1} _{i - \createFirstStackRowOffset} \\ - \locOffsetLo & \define & \stackItemValLo{1} _{i - \createFirstStackRowOffset} \\ - \locSizeHi & \define & \stackItemValHi{2} _{i - \createFirstStackRowOffset} \\ - \locSizeLo & \define & \stackItemValLo{2} _{i - \createFirstStackRowOffset} \\ - \locCnWillRevert & \define & \cnWillRev _{i - \createFirstStackRowOffset} \\ - \locCnRevertStamp & \define & \cnRevStamp _{i - \createFirstStackRowOffset} \\ - \locInitCodeHashHi & \define & \stackHashInfoValHi _{i - \createFirstStackRowOffset} \\ - \locInitCodeHashLo & \define & \stackHashInfoValLo _{i - \createFirstStackRowOffset} \\ - \locInitCodeSize & \define & \stackItemValLo{2} _{i - \createFirstStackRowOffset} \\ % TODO: make sure this is doesn't fuck things up + \locInst & \define & \stackInst _{i - \createFirstStackRowOffset} \\ + \locIsCreate & \define & \decFlag{1} _{i - \createFirstStackRowOffset} \\ + \locIsCreateTwo & \define & \decFlag{2} _{i - \createFirstStackRowOffset} \\ + \locStaticx & \define & \stackStaticx _{i - \createFirstStackRowOffset} \\ + \locMxpx & \define & \stackMxpx _{i - \createFirstStackRowOffset} \\ + \locOogx & \define & \stackOogx _{i - \createFirstStackRowOffset} \\ + \locOffsetHi & \define & \stackItemValHi{1} _{i - \createFirstStackRowOffset} \\ + \locOffsetLo & \define & \stackItemValLo{1} _{i - \createFirstStackRowOffset} \\ + \locSizeHi & \define & \stackItemValHi{2} _{i - \createFirstStackRowOffset} \\ + \locSizeLo & \define & \stackItemValLo{2} _{i - \createFirstStackRowOffset} \\ + \locCnWillRevert & \define & \cnWillRev _{i - \createFirstStackRowOffset} \\ + \locCnRevertStamp & \define & \cnRevStamp _{i - \createFirstStackRowOffset} \\ + \locHashInfoKeccakHi & \define & \stackHashInfoValHi _{i - \createFirstStackRowOffset} \\ + \locHashInfoKeccakLo & \define & \stackHashInfoValLo _{i - \createFirstStackRowOffset} \\ + \locInitCodeSize & \define & \stackItemValLo{2} _{i - \createFirstStackRowOffset} \\ % TODO: make sure this is doesn't fuck things up % - \locSaltHi & \define & \stackItemValHi{2} _{i - \createSecondStackRowOffset} \\ - \locSaltLo & \define & \stackItemValLo{2} _{i - \createSecondStackRowOffset} \\ - \locValueHi & \define & \stackItemValHi{3} _{i - \createSecondStackRowOffset} \\ - \locValueLo & \define & \stackItemValLo{3} _{i - \createSecondStackRowOffset} \\ - \locOutputHi & \define & \stackItemValHi{4} _{i - \createSecondStackRowOffset} \\ - \locOutputLo & \define & \stackItemValLo{4} _{i - \createSecondStackRowOffset} \\ + \locSaltHi & \define & \stackItemValHi{2} _{i - \createSecondStackRowOffset} \\ + \locSaltLo & \define & \stackItemValLo{2} _{i - \createSecondStackRowOffset} \\ + \locValueHi & \define & \stackItemValHi{3} _{i - \createSecondStackRowOffset} \\ + \locValueLo & \define & \stackItemValLo{3} _{i - \createSecondStackRowOffset} \\ + \locOutputHi & \define & \stackItemValHi{4} _{i - \createSecondStackRowOffset} \\ + \locOutputLo & \define & \stackItemValLo{4} _{i - \createSecondStackRowOffset} \\ \end{array} \right. \quad\text{and}\quad \left\{ \begin{array}{lcl}