Skip to content

Commit

Permalink
ROMLEX flag setting macro (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierBBB authored Dec 12, 2024
1 parent 650c69a commit 447de2e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
15 changes: 10 additions & 5 deletions hub/instruction_handling/copy/specifics/codecopy.tex
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,20 @@
We may nonetheless include some ``sanity check'' constraints labeled by (\sanityCheck) to make the intent explicit:
\[
\left\{ \begin{array}{lcll}
\accDeploymentNumber _{i + \locCopyCurrentAccountRow} & = & \cnCodeDepNum _{i + \locCopyCurrentContextRow} & (\sanityCheck) \\
\accDeploymentStatus _{i + \locCopyCurrentAccountRow} & = & \cnCodeDepStatus _{i + \locCopyCurrentContextRow} & (\sanityCheck) \\
\accCfi _{i + \locCopyCurrentAccountRow} & = & \cnCodeCfi _{i + \locCopyCurrentContextRow} & (\sanityCheck) \\
\accCfi _{i + \locCopyCurrentAccountRow} & = & \cfi_{i} & (\sanityCheck) \vspace{2mm} \\
\accRomLexFlag _{i + \locCopyCurrentAccountRow} & = & \rOne & (\sanityCheck) ~ (\trash) \\
\accDeploymentNumber _{i + \locCopyCurrentAccountRow} & = & \cnCodeDepNum _{i + \locCopyCurrentContextRow} & (\sanityCheck) \\
\accDeploymentStatus _{i + \locCopyCurrentAccountRow} & = & \cnCodeDepStatus _{i + \locCopyCurrentContextRow} & (\sanityCheck) \\
\accCfi _{i + \locCopyCurrentAccountRow} & = & \cnCodeCfi _{i + \locCopyCurrentContextRow} & (\sanityCheck) \\
\accCfi _{i + \locCopyCurrentAccountRow} & = & \cfi_{i} & (\sanityCheck) \vspace{2mm} \\
\multicolumn{3}{l}{\accRetrieveCodeFragmentIndex {i} {\locCopyCurrentAccountRow}} & (\sanityCheck) \\
\end{array} \right.
\]
These constraints confront \textbf{account data} with \textbf{context data}.
One constraint confronts \textbf{account data} with \textbf{shared data}.
Note furthermore that turning on the \accRomLexFlag{} also leads to a confrontation between \textbf{account data} and \romMod{} module data.

\saNote{}
If one wants to implement these ``sanity check'' constraints,
in particular that involving $\accCfi$, on \textbf{must} force $\accCfi$ to be the right one one.
For this it is \textbf{necessary} that one turn on the relevant $\accRomLexFlag$ via $\accRetrieveCodeFragmentIndex {i} {\locCopyCurrentAccountRow}$.
\end{description}
\end{description}
2 changes: 1 addition & 1 deletion hub/instruction_handling/copy/specifics/extcodecopy.tex
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
{i}{\locCopyOutsideAccountRowFirst}
{\locAddressParamHi}
{\locAddressParamLo}} \\
\accRomLexFlag _{i + 2} & = & \locTriggerCfi \vspace{2mm} \\
\accRomLexFlag _{i + \locCopyOutsideAccountRowFirst} & = & \locTriggerCfi \vspace{2mm} \\
\multicolumn{4}{l}{\accSameBalance {i}{\locCopyOutsideAccountRowFirst}} \\
\multicolumn{4}{l}{\accSameNonce {i}{\locCopyOutsideAccountRowFirst}} \\
\multicolumn{4}{l}{\accSameCode {i}{\locCopyOutsideAccountRowFirst}} \\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
\accDeploymentStatus\new _{i + \locNonemptyDeploymentFirstAccountRowOffset} & = & 0 \vspace{2mm} \\
\multicolumn{3}{l}{\accSameWarmth {i} {\locNonemptyDeploymentFirstAccountRowOffset}} \\
\multicolumn{3}{l}{\accSameMarkedForSelfdestructFlag {i} {\locNonemptyDeploymentFirstAccountRowOffset}} \\
\accRomLexFlag _{i + \locNonemptyDeploymentFirstAccountRowOffset} & = & \rOne \\
\multicolumn{3}{l}{\accRetrieveCodeFragmentIndex {i} {\locNonemptyDeploymentFirstAccountRowOffset}} \\
% \accRomLexFlag _{i + \locNonemptyDeploymentFirstAccountRowOffset} & = & \rOne \\
\accTrmFlag _{i + \locNonemptyDeploymentFirstAccountRowOffset} & = & \gZero \\
\multicolumn{3}{l}{
\standardDomSubStamps {
Expand Down
4 changes: 2 additions & 2 deletions pkg/env.sty
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@
\newcommand{\accTrimAddress} [4] {\accountSignifier\texttt{trimAddress} _{#1}
\left[ \begin{array}{ll}
\utt{Rel. row offset:} & #2 \\
\utt{Raw address (high part):} & #3 \\
\utt{Raw address (low part):} & #4 \\
\utt{Raw address (hi part):} & #3 \\
\utt{Raw address (lo part):} & #4 \\
\end{array} \right]}

\newcommand{\accIsntPrecompile} [2] {\accountSignifier\texttt{isntPrecompile} _{#1} \big[ #2 \big] }
Expand Down

0 comments on commit 447de2e

Please sign in to comment.