diff --git a/hub/instruction_handling/call/precompiles/generalities.tex b/hub/instruction_handling/call/precompiles/generalities.tex index e9ec929..057b2b0 100644 --- a/hub/instruction_handling/call/precompiles/generalities.tex +++ b/hub/instruction_handling/call/precompiles/generalities.tex @@ -22,7 +22,7 @@ \begin{enumerate} \item $\gasNext_{i} = \locPrcCallerGas + \locPrcReturnGas$ \item \If $\scenPrcFailure_{i} = 1$ \Then $\locPrcReturnGas = 0$. - \item \If $\scenPrcSuccess_{i} = 1$ \Then we must work on a precompile per precompile basis; + \item \If $\scenPrcSuccess_{i} = 1$ \Then \dots{} will be done on a precompile by precompile basis; \end{enumerate} \item[\underline{Setting \nonStackRows{}:}] we impose diff --git a/stp/_local.tex b/stp/_local.tex index 5dea234..be7458a 100644 --- a/stp/_local.tex +++ b/stp/_local.tex @@ -17,7 +17,7 @@ \def\locGasCost {\col{gas\_cost}} \def\locGasAccess {\col{gas\_access}} \def\locGasNewAcc {\col{gas\_new\_account}} -\def\locGasTransfer {\col{gas\_transfer}} +\def\locValueTransferGasCost {\col{gas\_transfer}} \def\locDiff {\col{gas\_diff}} \def\locGasDiff {\locDiff} \def\locMin {\col{gas\_min}} diff --git a/stp/call/constraints.tex b/stp/call/constraints.tex index 565338a..7688f00 100644 --- a/stp/call/constraints.tex +++ b/stp/call/constraints.tex @@ -48,17 +48,6 @@ \exoInst_{i + 2} & = & \inst{LT} \\ \end{array} \right. \] - % Where we use the following shorthand: - % \[ - % \left[ \begin{array}{lcl} - % \locGasUpfrontCall & := & \gasMxp_{i} + \locGasXtra \\ - % \locGasXtra & := & \locGasAccess + \locGasNewAcc + \locGasTransfer \\ - % \locGasAccess & := & \warm_{i} \cdot G_{\text{warmaccess}} \\ - % & & ~ + (1 - \warm_{i}) \cdot G_{\text{coldaccountaccess}} \\ - % \locGasNewAcc & := & \cctv_{i} \cdot (1 - \resLo_{i + 1}) \cdot (1 - \existence_{i}) \cdot G_{\text{newaccount}} \\ - % \locGasTransfer & := & \cctv_{i} \cdot (1 - \resLo_{i + 1}) \cdot G_{\text{callvalue}} \\ - % \end{array} \right] - % \] \end{description} These constraints thus establish $\oogx$; indeed \[ diff --git a/stp/call/setting.tex b/stp/call/setting.tex index cbe7b65..5fadcef 100644 --- a/stp/call/setting.tex +++ b/stp/call/setting.tex @@ -10,7 +10,7 @@ \item[\underline{The ``no \oogxSH{}'' case:}] \If $\oogx_{i} = 0$ \Then \begin{enumerate} \item $\gasUpfront_{i} = \locGasUpfrontCall$ - \item $\gasPoop_{i} = \locMin$ + \item $\gasPoop_{i} = \locMin$ \item $\gasStipend_{i} = \cctv_{i} \cdot \locTransfersValue \cdot G_{\text{callstipend}}$ % Where we set % \begin{IEEEeqnarray*}{LCL} @@ -26,7 +26,7 @@ \item[\underline{The ``\oogxSH{}'' case:}] \If $\oogx_{i} = 1$ \Then \begin{enumerate} \item $\gasUpfront_{i} = \locGasUpfrontCall$ - \item $\gasPoop_{i} = 0$ + \item $\gasPoop_{i} = 0$ \item $\gasStipend_{i} = 0$ \end{enumerate} \end{description} diff --git a/stp/call/shorthands.tex b/stp/call/shorthands.tex index fb11864..279964b 100644 --- a/stp/call/shorthands.tex +++ b/stp/call/shorthands.tex @@ -1,52 +1,73 @@ For greater expressivity we use the following shorthands \[ \left\{ \begin{array}{lrl} - \locTransfersValue & \define & + \locTransfersValue & \define & \begin{cases} \If \locCctv = 0: & 0 \\ \If \locCctv = 1: & 1 - \resLo_{i + 1} \\ \end{cases} \\ - & \equiv & \locCctv \cdot (1 - \resLo_{i + 1}) \vspace{2mm} \\ - \locZeroValue & \define & + & \define & + \locCctv \cdot (1 - \resLo_{i + 1}) + \vspace{2mm} \\ + %%%%%%%%%% + \locZeroValue & \define & \begin{cases} \If \locCctv = 0: & 0 \\ \If \locCctv = 1: & \resLo_{i + 1} \\ \end{cases} \\ - & \equiv & \locCctv \cdot \resLo_{i + 1} \vspace{2mm} \\ - \locGasAccess & \define & + & \define & \locCctv \cdot \resLo_{i + 1} + \vspace{2mm} \\ + %%%%%%%%%% + \locGasAccess & \define & \begin{cases} - \If \locWarm = 1: & G_\text{warmaccess} \\ + \If \locWarm = 1: & G_\text{warmaccess} \\ \If \locWarm = 0: & G_\text{coldaccountaccess} \\ - \end{cases} \\ - \locGasTransfer & \define & + \end{cases} + \vspace{2mm} \\ + %%%%%%%%%% + \locValueTransferGasCost & \define & \begin{cases} \If \locTransfersValue = 1: & G_\text{callvalue} \\ - \If \locTransfersValue = 0: & 0 \\ + \If \locTransfersValue = 0: & 0 \\ \end{cases} \\ - & \equiv & \locTransfersValue \cdot G_\text{callvalue} \vspace{2mm} \\ - \locGasNewAcc & \define & + & \define & \locTransfersValue \cdot G_\text{callvalue} + \vspace{2mm} \\ + %%%%%%%%%% + \locGasNewAcc & \define & \begin{cases} - \If \locExists = 1 \vee \locTransfersValue = 0: & 0 \\ - \If \locExists = 0 \wedge \locTransfersValue = 1: & G_\text{newaccount} \\ + \If \stpCall_{i} = 0 ~ \Then & 0 \\ + \If \stpCall_{i} = 1 ~ \Then & + \begin{cases} + \If \locExists = 1 \vee \locTransfersValue = 0 : & 0 \\ + \If \locExists = 0 \wedge \locTransfersValue = 1 : & G_\text{newaccount} \\ + \end{cases} \end{cases} \\ - & \equiv & (1 - \locExists) \cdot \locTransfersValue \cdot G_\text{newaccount} \vspace{2mm} \\ - \locGasXtra & \define & \locGasAccess + \locGasTransfer + \locGasNewAcc \\ - \locGasUpfrontCall & \define & \locGasMxp + \locGasXtra \vspace{2mm} \\ - \locOneSixtyFourth & \define & \resLo_{i + 3} \\ - \locGasCompBit & \define & \resLo_{i + 4} \\ - \locDiff & \define & \locGasActl ~ - ~ \locGasUpfrontCall \\ - \locLOfGasDiff & \define & \locGasDiff ~ - ~ \locOneSixtyFourth \\ - \locMin & \define & + & \define & + G_\text{newaccount} \cdot + \left[ \begin{array}{cr} + \cdot & \stpCall_{i} \\ + \cdot & (1 - \locExists) \\ + \cdot & \locTransfersValue \\ + \end{array} \right] + \vspace{2mm} \\ + %%%%%%%%%% + \locGasXtra & \define & \locGasAccess + \locValueTransferGasCost + \locGasNewAcc \\ + \locGasUpfrontCall & \define & \locGasMxp + \locGasXtra \vspace{2mm} \\ + \locOneSixtyFourth & \define & \resLo_{i + 3} \\ + \locGasCompBit & \define & \resLo_{i + 4} \\ + \locDiff & \define & \locGasActl ~ - ~ \locGasUpfrontCall \\ + \locLOfGasDiff & \define & \locGasDiff ~ - ~ \locOneSixtyFourth \\ + \locMin & \define & \begin{cases} \If \locGasCompBit = 0 : & \locLOfGasDiff \\ - \If \locGasCompBit = 1 : & \gasLo_{i} \\ + \If \locGasCompBit = 1 : & \gasLo_{i} \\ \end{cases} \\ \end{array} \right. \] These are only to be used if the row index $i$ is such that \[ \begin{cases} - \stpStamp_{i} \neq \stpStamp_{i - 1} \\ - \isCall _{i} = 1 \\ + \stpStamp _{i} \neq \stpStamp_{i - 1} \\ + \isCall _{i} = 1 \\ \end{cases} \]