-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b8eacb
commit e4b5c18
Showing
47 changed files
with
1,533 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
\input{_local} | ||
|
||
\section{Block data module} | ||
\subsection{Introduction} \label{block data: intro} \input{intro} | ||
\subsection{Columns} \label{block data: columns} \input{columns} | ||
\subsection{Introduction} \label{block data: intro} \input{intro} | ||
\subsection{Columns} \label{block data: columns} \input{columns} | ||
\subsection{Module call macros} \label{block data: module calls} \input{calls} | ||
|
||
\section{Constraints} | ||
\subsection{Heartbeat} \label{block data: heartbeat} \input{heartbeat} | ||
\subsection{Constancies} \label{block data: constancies} \input{constancies} | ||
\subsection{Bytehood and byte decomposition constraints} \label{block data: byte decomposition} \input{byteDec} | ||
\subsection{Value Constraints} \label{block data: value constraints} \input{value_constraint} | ||
\subsection{Shorthands} \label{block data: shorthands} \input{shorthands} | ||
\subsection{Binary constraints} \label{block data: binarities} \input{binarities} | ||
\subsection{Unconditional constraints} \label{block data: unconditional} \input{unconditional} | ||
\subsection{Constancies} \label{block data: constancies} \input{constancies} | ||
\subsection{Heartbeat} \label{block data: heartbeat} \input{heartbeat} | ||
\subsection{Representation} \label{block data: representation} \input{representation} | ||
|
||
\section{Lookups} \label{block data: lookups} \input{lookups/_inputs} | ||
\section{Computations and checks} \label{block data: computations and checks} \input{computations/_inputs} | ||
|
||
\section{Lookups} \label{block data: lookups} \input{lookups/_inputs} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
\def\rOne {\redm{1}} | ||
|
||
\def\locIsCoinbase {\col{is\_CB}} | ||
\def\locIsTimestamp {\col{is\_TS}} | ||
\def\locIsNumber {\col{is\_NB}} | ||
\def\locIsDifficulty {\col{is\_DF}} | ||
\def\locIsGaslimit {\col{is\_GL}} | ||
\def\locIsChainid {\col{is\_ID}} | ||
\def\locIsBasefee {\col{is\_BF}} | ||
|
||
\def\locIsCurrConf {\col{is\_curr}} | ||
\def\locIsPrevConf {\col{is\_prev}} | ||
\def\locPrevCurrWghtSum {\col{curr\_prev\_wght\_sum}} | ||
|
||
\def\locFlagSum {\col{flag\_sum}} | ||
\def\locWghtSum {\col{wght\_sum}} | ||
\def\locInstSum {\col{inst\_sum}} | ||
\def\locMaxCtSum {\col{ct\_max\_sum}} | ||
\def\locPhaseEntry {\col{phase\_entry}} | ||
\def\locSamePhase {\col{same\_phase}} | ||
\def\locLegalTransitions {\col{allowable\_transitions}} | ||
\def\locExtractor {\col{extractor}} | ||
|
||
\def\ctMaxCoinbase {\redm{\texttt{nRows}_{\texttt{cb}}}} | ||
\def\ctMaxTimestamp {\redm{\texttt{nRows}_{\texttt{ts}}}} | ||
\def\ctMaxNumber {\redm{\texttt{nRows}_{\texttt{nb}}}} | ||
\def\ctMaxDifficulty {\redm{\texttt{nRows}_{\texttt{df}}}} | ||
\def\ctMaxGaslimit {\redm{\texttt{nRows}_{\texttt{gl}}}} | ||
\def\ctMaxChainid {\redm{\texttt{nRows}_{\texttt{id}}}} | ||
\def\ctMaxBasefee {\redm{\texttt{nRows}_{\texttt{bf}}}} | ||
\def\kappaDots {\redm{\texttt{nRows}_{\texttt{xx}}}} | ||
\def\blockDataDepth {\redm{\texttt{depth}}} | ||
|
||
\def\exoInstruction {\col{EXO\_}\instruction} | ||
\def\previousGasLimit {\col{prev\_gas\_limit}} | ||
\def\maxDeviation {\col{max\_deviation}} | ||
|
||
\def\locFirstBlockIsGenesisBlock {\col{first\_block\_is\_genesis\_block}} | ||
\def\ethereumMinBlockGasLimit {\red{\texttt{ETHEREUM\_MIN\_BLOCK\_GAS\_LIMIT}}} | ||
\def\lineaMinBlockGasLimit {\red{\texttt{LINEA\_MIN\_BLOCK\_GAS\_LIMIT}}} | ||
\def\lineaMaxBlockGasLimit {\red{\texttt{LINEA\_MAX\_BLOCK\_GAS\_LIMIT}}} | ||
\def\ethereumMinBlockGasLimitValue {\texttt{5\_000}} | ||
\def\lineaMinBlockGasLimitValue {\texttt{61\_000\_000}} | ||
\def\lineaMaxBlockGasLimitValue {\texttt{2\_000\_000\_000}} | ||
\def\ethereumGasLimitAdjustmentFactor {\red{\texttt{GAS\_LIMIT\_ADJUSTMENT\_FACTOR}}} | ||
\def\ethereumGasLimitAdjustmentFactorValue {\texttt{1024}} | ||
|
||
\def\locIsFirstBlock {\col{is\_first\_block}} | ||
\def\locIsntFirstBlock {\col{isnt\_first\_block}} | ||
\def\currDataHi {\col{curr\_data\_hi}} | ||
\def\currDataLo {\col{curr\_data\_lo}} | ||
\def\prevDataHi {\col{prev\_data\_hi}} | ||
\def\prevDataLo {\col{prev\_data\_lo}} | ||
|
||
\def\currBaseFeeHi {\col{curr\_BASEFEE\_hi}} | ||
\def\currBaseFeeLo {\col{curr\_BASEFEE\_lo}} | ||
\def\prevBaseFeeHi {\col{prev\_BASEFEE\_hi}} | ||
\def\prevBaseFeeLo {\col{prev\_BASEFEE\_lo}} | ||
|
||
\def\currChainIdHi {\col{curr\_CHAINID\_hi}} | ||
\def\currChainIdLo {\col{curr\_CHAINID\_lo}} | ||
\def\prevChainIdHi {\col{prev\_CHAINID\_hi}} | ||
\def\prevChainIdLo {\col{prev\_CHAINID\_lo}} | ||
|
||
\def\currCoinbaseHi {\col{curr\_COINBASE\_hi}} | ||
\def\currCoinbaseLo {\col{curr\_COINBASE\_lo}} | ||
\def\prevCoinbaseHi {\col{prev\_COINBASE\_hi}} | ||
\def\prevCoinbaseLo {\col{prev\_COINBASE\_lo}} | ||
|
||
\def\currDifficultyHi {\col{curr\_DIFFICULTY\_hi}} | ||
\def\currDifficultyLo {\col{curr\_DIFFICULTY\_lo}} | ||
\def\prevDifficultyHi {\col{prev\_DIFFICULTY\_hi}} | ||
\def\prevDifficultyLo {\col{prev\_DIFFICULTY\_lo}} | ||
|
||
\def\currGasLimitHi {\col{curr\_GASLIMIT\_hi}} | ||
\def\currGasLimitLo {\col{curr\_GASLIMIT\_lo}} | ||
\def\prevGasLimitHi {\col{prev\_GASLIMIT\_hi}} | ||
\def\prevGasLimitLo {\col{prev\_GASLIMIT\_lo}} | ||
|
||
\def\currNumberHi {\col{curr\_NUMBER\_hi}} | ||
\def\currNumberLo {\col{curr\_NUMBER\_lo}} | ||
\def\prevNumberHi {\col{prev\_NUMBER\_hi}} | ||
\def\prevNumberLo {\col{prev\_NUMBER\_lo}} | ||
|
||
\def\currTimeStampHi {\col{curr\_TIMESTAMP\_hi}} | ||
\def\currTimeStampLo {\col{curr\_TIMESTAMP\_lo}} | ||
\def\prevTimeStampHi {\col{prev\_TIMESTAMP\_hi}} | ||
\def\prevTimeStampLo {\col{prev\_TIMESTAMP\_lo}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
We impose \textbf{binary} constraints on the following columns: | ||
\begin{multicols}{3} | ||
\begin{enumerate} | ||
\item $\iomf$ | ||
\item $\isCoinbase$ | ||
\item $\isTimestamp$ | ||
\item $\isNumber$ | ||
\item $\isDifficulty$ | ||
\item $\isGaslimit$ | ||
\item $\isChainid$ | ||
\item $\isBasefee$ | ||
\end{enumerate} | ||
\end{multicols} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
We define several simple constraint systems to simplify the writing of constraints. | ||
\[ | ||
\left\{ \begin{array}{lcl} | ||
\wcpCallToLt { | ||
anchorRow = i , | ||
relOffset = \relof , | ||
argOneHi = \col{a\_hi} , | ||
argOneLo = \col{a\_lo} , | ||
argTwoHi = \col{b\_hi} , | ||
argTwoLo = \col{b\_lo} , | ||
} & \define & | ||
\left\{ \begin{array}{lcl} | ||
\wcpFlag _{i + \relof} & = & \rOne \\ | ||
\exoInstruction _{i + \relof} & = & \inst{LT} \\ | ||
\argOneHi _{i + \relof} & = & \col{a\_hi} \\ | ||
\argOneLo _{i + \relof} & = & \col{a\_lo} \\ | ||
\argTwoHi _{i + \relof} & = & \col{b\_hi} \\ | ||
\argTwoLo _{i + \relof} & = & \col{b\_lo} \\ | ||
\res _{i + \relof} & = & 1 \\ | ||
\end{array} \right. \vspace{2mm} \\ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\wcpCallToGt { | ||
anchorRow = i , | ||
relOffset = \relof , | ||
argOneHi = \col{a\_hi} , | ||
argOneLo = \col{a\_lo} , | ||
argTwoHi = \col{b\_hi} , | ||
argTwoLo = \col{b\_lo} , | ||
} & \define & | ||
\left\{ \begin{array}{lcl} | ||
\wcpFlag _{i + \relof} & = & \rOne \\ | ||
\exoInstruction _{i + \relof} & = & \inst{GT} \\ | ||
\argOneHi _{i + \relof} & = & \col{a\_hi} \\ | ||
\argOneLo _{i + \relof} & = & \col{a\_lo} \\ | ||
\argTwoHi _{i + \relof} & = & \col{b\_hi} \\ | ||
\argTwoLo _{i + \relof} & = & \col{b\_lo} \\ | ||
\res _{i + \relof} & = & 1 \\ | ||
\end{array} \right. \vspace{2mm} \\ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\wcpCallToLeq { | ||
anchorRow = i , | ||
relOffset = \relof , | ||
argOneHi = \col{a\_hi} , | ||
argOneLo = \col{a\_lo} , | ||
argTwoHi = \col{b\_hi} , | ||
argTwoLo = \col{b\_lo} , | ||
} & \define & | ||
\left\{ \begin{array}{lcl} | ||
\wcpFlag _{i + \relof} & = & \rOne \\ | ||
\exoInstruction _{i + \relof} & = & \inst{LEQ} \\ | ||
\argOneHi _{i + \relof} & = & \col{a\_hi} \\ | ||
\argOneLo _{i + \relof} & = & \col{a\_lo} \\ | ||
\argTwoHi _{i + \relof} & = & \col{b\_hi} \\ | ||
\argTwoLo _{i + \relof} & = & \col{b\_lo} \\ | ||
\res _{i + \relof} & = & 1 \\ | ||
\end{array} \right. \vspace{2mm} \\ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\wcpCallToGeq { | ||
anchorRow = i , | ||
relOffset = \relof , | ||
argOneHi = \col{a\_hi} , | ||
argOneLo = \col{a\_lo} , | ||
argTwoHi = \col{b\_hi} , | ||
argTwoLo = \col{b\_lo} , | ||
} & \define & | ||
\left\{ \begin{array}{lcl} | ||
\wcpFlag _{i + \relof} & = & \rOne \\ | ||
\exoInstruction _{i + \relof} & = & \inst{GEQ} \\ | ||
\argOneHi _{i + \relof} & = & \col{a\_hi} \\ | ||
\argOneLo _{i + \relof} & = & \col{a\_lo} \\ | ||
\argTwoHi _{i + \relof} & = & \col{b\_hi} \\ | ||
\argTwoLo _{i + \relof} & = & \col{b\_lo} \\ | ||
\res _{i + \relof} & = & 1 \\ | ||
\end{array} \right. \vspace{2mm} \\ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\wcpCallToIszero { | ||
anchorRow = i , | ||
relOffset = \relof , | ||
argOneHi = \col{a\_hi} , | ||
argOneLo = \col{a\_lo} , | ||
} & \define & | ||
\left\{ \begin{array}{lcl} | ||
\wcpFlag _{i + \relof} & = & \rOne \\ | ||
\exoInstruction _{i + \relof} & = & \inst{ISZERO} \\ | ||
\argOneHi _{i + \relof} & = & \col{a\_hi} \\ | ||
\argOneLo _{i + \relof} & = & \col{a\_lo} \\ | ||
\argTwoHi _{i + \relof} & = & 0 \\ | ||
\argTwoLo _{i + \relof} & = & 0 \\ | ||
\res _{i + \relof} & = & \relevantValue \\ | ||
\end{array} \right. \vspace{2mm} \\ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
\eucCall { | ||
anchorRow = i , | ||
relOffset = \relof , | ||
argOne = \col{a} , | ||
argTwo = \col{b} , | ||
} & \define & | ||
\left\{ \begin{array}{lcl} | ||
\eucFlag _{i + \relof} & = & \rOne \\ | ||
\argOneLo _{i + \relof} & = & \col{a} \\ | ||
\argTwoLo _{i + \relof} & = & \col{b} \\ | ||
\end{array} \right. \\ | ||
\end{array} \right. | ||
\] | ||
\saNote{} | ||
The result of all comparisons is required to be \texttt{true} except for \inst{ISZERO}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\subsection{For \inst{COINBASE }} \label{block data: computations and checks: coinbase} \input{computations/coinbase} | ||
\subsection{For \inst{TIMESTAMP }} \label{block data: computations and checks: timestamp} \input{computations/timestamp} | ||
\subsection{For \inst{NUMBER }} \label{block data: computations and checks: number} \input{computations/number} | ||
\subsection{For \inst{DIFFICULTY}} \label{block data: computations and checks: difficulty} \input{computations/difficulty} | ||
\subsection{For \inst{GASLIMIT }} \label{block data: computations and checks: gaslimit} \input{computations/gaslimit} | ||
\subsection{For \inst{CHAINID }} \label{block data: computations and checks: chainid} \input{computations/chainid} | ||
\subsection{For \inst{BASEFEE }} \label{block data: computations and checks: basefee} \input{computations/basefee} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
\begin{center} | ||
\boxed{\text{% | ||
The following constraints assume that | ||
$\left\{ \begin{array}{lcl} | ||
\isBasefee _{i - 1} & = & 0 \\ | ||
\isBasefee _{i} & = & 1 \\ | ||
\end{array} \right.$}} | ||
\end{center} | ||
We use the following shorthand | ||
\[ | ||
\left\{ \begin{array}{lc l} | ||
\currBaseFeeHi & \define & \currDataHi \\ | ||
\currBaseFeeLo & \define & \currDataLo \\ | ||
\end{array} \right. | ||
\] | ||
We impose the following constraints | ||
\begin{description} | ||
\item[\underline{\underline{Horizontalization of \inst{BASEFEE}:}}] | ||
we impose | ||
\[ | ||
\left\{ \begin{array}{lcl} | ||
\currBaseFeeHi & = & 0 \\ | ||
\currBaseFeeLo & = & \basefee _{i} \\ | ||
\end{array} \right. | ||
\] | ||
\saNote{} | ||
Implementations may further impose, by means of a constraint, the value returned by the \inst{BASEFEE} opcode to some network constant | ||
$\lineaBaseFee{}$. | ||
\item[\underline{\underline{\inst{BASEFEE} bound:}}] | ||
\def\rowOffset{\yellowm{0}} | ||
we impose | ||
\[ | ||
\wcpCallToGeq{ | ||
anchorRow = i , | ||
relOffset = \rowOffset , | ||
argOneHi = \currBaseFeeHi , | ||
argOneLo = \currBaseFeeLo , | ||
argTwoHi = 0 , | ||
argTwoLo = 0 , | ||
} | ||
\] | ||
\saNote{} | ||
The above ensures that $\basefee _{i} \geq 0$ is well formed (in terms of its high and low parts being $\llarge$-byte integers.) | ||
\end{description} |
Oops, something went wrong.