-
Notifications
You must be signed in to change notification settings - Fork 5
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
Only CALL may actually transfer value #9
Changes from all commits
885cce1
709d92d
75859e0
96cec3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,10 +45,29 @@ | |
{i}{\callFirstCallerAccountRowOffset} | ||
\] | ||
\item \If $\scenCallBalanceUpdateRequired _{i} = 1$ \Then | ||
\begin{enumerate} | ||
\item \If $\locIsCall = 1$ \Then | ||
\[ | ||
\accDecrementBalance | ||
{i}{\callFirstCallerAccountRowOffset}{\locValueLo} | ||
\] | ||
\item \If $\locIsCallcode + \locIsDelegatecall + \locIsStaticcall = 1$ \Then | ||
\[ | ||
\accSameBalance | ||
{i}{\callFirstCallerAccountRowOffset} | ||
\] | ||
\end{enumerate} | ||
\saNote{} \label{hub: instruction handling: call: generalities: first account rows: value transfer subtleties} | ||
The above may alternatively be implemented without case disjunction as | ||
\[ | ||
\accDecrementBalance | ||
{i}{\callFirstCallerAccountRowOffset}{\locValueLo} | ||
{i}{\callFirstCallerAccountRowOffset}{\locIsCall \cdot \locValueLo} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is actually implemented, see commit Consensys/linea-constraints@2087e3f |
||
\] | ||
Either way the above reflects that fact that only \inst{CALL} may \emph{actually} transfer value. | ||
The \inst{CALL}-type instruction \inst{CALLCODE} also has a ``\locValue'' argument but it doesn't set off a value transfer. | ||
This ``\locValue'' becomes the ``call value'' of the child context. | ||
It is noteworthy that while no \emph{actual} value transfer takes place, | ||
\inst{CALLCODE} may nonetheless incur a value transfer cost. | ||
\end{enumerate} | ||
\item[\underline{First \calleee{} account-row $n^°(i + \callFirstCalleeAccountRowOffset)$:}] | ||
we impose that | ||
|
@@ -87,7 +106,27 @@ | |
we impose that | ||
\begin{enumerate} | ||
\item \If $\scenCallBalanceUpdateNotRequired _{i} = 1$ \Then $\accSameBalance {i}{\callFirstCalleeAccountRowOffset}$ | ||
\item \If $\scenCallBalanceUpdateRequired _{i} = 1$ \Then $\accIncrementBalance {i}{\callFirstCalleeAccountRowOffset}{\locValueLo}$ | ||
\item \If $\scenCallBalanceUpdateRequired _{i} = 1$ \Then | ||
\begin{enumerate} | ||
\item \If $\locIsCall = 1$ \Then | ||
\[ | ||
\accIncrementBalance | ||
{i}{\callFirstCalleeAccountRowOffset}{\locValueLo} | ||
\] | ||
\item \If $\locIsCallcode + \locIsDelegatecall + \locIsStaticcall = 1$ \Then | ||
\[ | ||
\accSameBalance | ||
{i}{\callFirstCalleeAccountRowOffset} | ||
\] | ||
\end{enumerate} | ||
\saNote{} | ||
Echoing | ||
note~(\ref{hub: instruction handling: call: generalities: first account rows: value transfer subtleties}), | ||
the above may alternatively be implemented without case disjunction as | ||
\[ | ||
\accIncrementBalance | ||
{i}{\callFirstCalleeAccountRowOffset}{\locIsCall \cdot \locValueLo} | ||
\] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is actually implemented, see commit Consensys/linea-constraints@2087e3f |
||
\end{enumerate} | ||
\item[\underline{Setting the \calleee{} warmth update on account-row $n^°(i + \callFirstCalleeAccountRowOffset)$:}] | ||
we impose that | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. every CALL-type instruction besides
CALL
.