Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute the account creation cost in STP only for CALL #7

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions stp/call/setting.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
78 changes: 54 additions & 24 deletions stp/call/shorthands.tex
Original file line number Diff line number Diff line change
@@ -1,42 +1,72 @@
For greater expressivity we use the following shorthands
\[
\left\{ \begin{array}{lrl}
\locTransfersValue & \define &
%
%
%
\locTransfersValue & \define &
\begin{cases}
\If \locCctv = 0: & 0 \\
\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 = 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 = 0: & G_\text{coldaccountaccess} \\
\end{cases} \\
\locGasTransfer & \define &
%
%
%
\locGasTransfer & \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} \\
\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 &
\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}
\\
& \define &
G_\text{newaccount} \cdot
\left[ \begin{array}{cr}
\cdot & \stpCall_{i} \\
\cdot & (1 - \locExists) \\
\cdot & \locTransfersValue \\
\end{array} \right]
\vspace{2mm} \\
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only meaningful change. It explicitly sets \locGasNewAcc to zero for anything but CALL.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recall: in this module \stpCall is what we could call \isCall most anywhere else.

%
%
%
\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 &
\begin{cases}
\If \locGasCompBit = 0 : & \locLOfGasDiff \\
\If \locGasCompBit = 1 : & \gasLo_{i} \\
Expand All @@ -46,7 +76,7 @@
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}
\]