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

EIP-5656: MCOPY - Memory copying instruction #140

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

OlivierBBB
Copy link
Collaborator

No description provided.

@OlivierBBB OlivierBBB added the London to Prague London to Pectra label Mar 28, 2025
@OlivierBBB OlivierBBB added this to the London to Pectra milestone Mar 28, 2025
@OlivierBBB OlivierBBB self-assigned this Mar 28, 2025
Copy link

cla-assistant bot commented Mar 28, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
Copy link

cla-assistant bot commented Mar 28, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@OlivierBBB OlivierBBB linked an issue Mar 28, 2025 that may be closed by this pull request
3 tasks
\subsubsection{\zeroZeroSP{} \lispDone{}} \label{hub: stack patterns: 0_0} \input{stack/patterns/0_0}
\subsubsection{\oneZeroSP{} \lispDone{}} \label{hub: stack patterns: 1_0} \input{stack/patterns/1_0}
\subsubsection{\twoZeroSP{} \lispDone{}} \label{hub: stack patterns: 2_0} \input{stack/patterns/2_0}
\subsubsection{\threeZero{} \lispTodo{}} \label{hub: stack patterns: 3_0} \input{stack/patterns/3_0}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added this line

the knowledge whether the current execution context is the root context
(\emph{b})
the absolute transaction number.
The purpose of the former is to be able to retrieve the \textbf{transaction call data} whenever we are executing a \inst{CALLDATALOAD} in the root context of a transaction.
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 paragraph was more than likely a copy paste error from the COPY instruction family.

\item[\underline{Justifying the \mxpxSH{}:}]
we impose that $\stackMxpx_{i} = \locMxpx$
\item[\underline{Setting the gas cost:}]
we impose that
\begin{enumerate}
\item \If $\locMxpx = 0$ \Then \( \gasCost_{i} = \decStaticGas_{i} + \locMxpGas \)
\item \If $\locMxpx = 0$ \Then \( \gasCost_{i} = \stackStaticGas _{i} + \locMxpGas \)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using the correct column name.

\utt{Return at offset hi part:} & \cmdMXP@var@returnAtOffsetHi \\
\utt{Return at offset lo part:} & \cmdMXP@var@returnAtOffsetLo \\
\utt{Return at capacity hi part:} & \cmdMXP@var@returnAtCapacityHi \\
\utt{Return at capacity lo part:} & \cmdMXP@var@returnAtCapacityLo \\
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\utt{Offset hi part:} & \cmdMXP@var@offsetHi \\
\utt{Offset lo part:} & \cmdMXP@var@offsetLo \\
\utt{Size hi part:} & \cmdMXP@var@sizeHi \\
\utt{Size lo part:} & \cmdMXP@var@sizeLo \\
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\utt{Offset high part:} & \cmdMXP@var@offsetHi \\
\utt{Offset low part:} & \cmdMXP@var@offsetLo \\
\utt{Offset hi part:} & \cmdMXP@var@offsetHi \\
\utt{Offset lo part:} & \cmdMXP@var@offsetLo \\
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\utt{Rel. row offset:} & \cmdMXP@var@relOffset \\
\utt{Instruction:} & \cmdMXP@var@instruction \\
\utt{Offset hi part:} & \cmdMXP@var@offsetHi \\
\utt{Offset lo part:} & \cmdMXP@var@offsetLo \\
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\newcommand{\iMcopySELECT}{\imported{\mcopySELECT}}
\newcommand{\iMcopySelect}{\imported{\mcopySelect}}
\newcommand{\stackDecMcopyFlag}{\stackInstructionDecodedColumn{\mcopyFlag}}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ras: new auto-generated mcopy columns

\subsection{Common constraints \lispTodo{}} \label{hub: initialization phase: common constraints} \input{tx_init/rows/_collage}
\subsection{Shorthands \lispDone{}} \label{hub: initialization phase: shorthands} \input{tx_init/shorthands}
\subsection{Setting the peeking flags \lispDone{}} \label{hub: initialization phase: setting peeking flags} \input{tx_init/peeking}
\subsection{Common constraints \lispDone{}} \label{hub: initialization phase: common constraints} \input{tx_init/rows/_collage}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ras

\subsection{Common constraints \lispTodo{}} \label{hub: finalization phase: common constraints} \input{tx_finl/rows/_collage}
\subsection{Shorthands \lispDone{}} \label{hub: finalization phase: shorthands} \input{tx_finl/shorthands}
\subsection{Peeking flags \lispDone{}} \label{hub: finalization phase: peeking} \input{tx_finl/peeking}
\subsection{Common constraints \lispDone{}} \label{hub: finalization phase: common constraints} \input{tx_finl/rows/_collage}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ras

\subsubsection{\zeroZeroSP{} \lispDone{}} \label{hub: stack patterns: 0_0} \input{stack/patterns/0_0}
\subsubsection{\oneZeroSP{} \lispDone{}} \label{hub: stack patterns: 1_0} \input{stack/patterns/1_0}
\subsubsection{\twoZeroSP{} \lispDone{}} \label{hub: stack patterns: 2_0} \input{stack/patterns/2_0}
\subsubsection{\threeZeroSP{} \lispTodo{}} \label{hub: stack patterns: 3_0} \input{stack/patterns/3_0}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only new row, everything else is formatting

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New stack pattern

\stackItemHeight {k} _{i} & \col{h} & \col{h} - 1 & \graym{\varnothing} & \graym{\varnothing} \\ \hline
\stackItemValHi {k} _{i} / \stackItemValLo{k}_{i} & \col{arg1} & \col{arg2} & \graym{\varnothing} & \graym{\varnothing} \\ \hline
\stackItemPop {k} _{i} & 1 & 1 & \graym{\varnothing} & \graym{\varnothing} \\ \hline
\stackItemStamp {k} _{i} & \hubTau \cdot \col{st} & \hubTau \cdot \col{st} + 1 & \graym{\varnothing} & \graym{\varnothing} \\ \hline
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\vspace{2mm} \\
\qquad
\qquad
\define
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\qquad
\qquad
\define
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\qquad
\qquad
\define
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\qquad
\qquad
\define
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

\qquad
\qquad
\define
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated annotations

@OlivierBBB OlivierBBB changed the title EIP-5656: MCOPY - Memory copying instruction EIP-5656 Arithmetization: MCOPY - Memory copying instruction Mar 29, 2025
Copy link
Contributor

@letypequividelespoubelles letypequividelespoubelles left a comment

Choose a reason for hiding this comment

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

LGTM. Funny we need a new stack pattern :)

@OlivierBBB OlivierBBB added the hardfork cancun EIP's for the Cancun hardfork label Apr 6, 2025
@OlivierBBB OlivierBBB changed the title EIP-5656 Arithmetization: MCOPY - Memory copying instruction EIP-5656: MCOPY - Memory copying instruction Apr 8, 2025
@OlivierBBB OlivierBBB changed the title EIP-5656: MCOPY - Memory copying instruction EIP-5656: MCOPY - Memory copying instruction Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arithmetization hardfork cancun EIP's for the Cancun hardfork London to Prague London to Pectra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EIP-5656: MCOPY - Memory copying instruction
2 participants