diff --git a/block_data/binarities.tex b/block_data/binarities.tex index 656bd46..7f0cbb8 100644 --- a/block_data/binarities.tex +++ b/block_data/binarities.tex @@ -1,7 +1,9 @@ We impose \textbf{binary} constraints on the following columns: -\begin{multicols}{3} +\begin{multicols}{4} \begin{enumerate} \item $\iomf$ + \item $\wcpFlag$ + \item $\eucFlag$ \item $\isCoinbase$ \item $\isTimestamp$ \item $\isNumber$ diff --git a/spec/_all_spec.tex b/spec/_all_spec.tex index b4c434d..ccca814 100644 --- a/spec/_all_spec.tex +++ b/spec/_all_spec.tex @@ -13,6 +13,7 @@ \usepackage{../pkg/xkeyval_macros/stp_instructions} \usepackage{../pkg/xkeyval_macros/wcp_calls} \usepackage{../pkg/xkeyval_macros/ext_calls} +\usepackage{../pkg/xkeyval_macros/euc_calls} \usepackage{../pkg/flags_stamps_selectors} \usepackage{../pkg/instruction_flags} \usepackage{../pkg/IEEEtrantools} @@ -91,9 +92,7 @@ Olivier Bégassat, Alexandre Belling, François Bojarski - Nasretdinov, -Franklin Delehelle, Lorenzo Gentile, -Emile Hautefeuille, Nicolas Liochon } \date{March 2024} diff --git a/zzz_block_data/_all_block_data.tex b/zzz_block_data/_all_block_data.tex deleted file mode 100644 index b9803b5..0000000 --- a/zzz_block_data/_all_block_data.tex +++ /dev/null @@ -1,41 +0,0 @@ -\documentclass{article} -\usepackage[dvipsnames]{xcolor} -\usepackage{../pkg/common} -% \usepackage{../pkg/dark_theme} -\usepackage{../pkg/std} -\usepackage{../pkg/IEEEtrantools} -\usepackage{../pkg/rom} -\usepackage{../pkg/bin} -\usepackage{../pkg/wc3} -\usepackage{../pkg/ram} -\usepackage{../pkg/alu} -\usepackage{../pkg/env} -\usepackage{../pkg/warm} -\usepackage{../pkg/storage} -\usepackage{../pkg/call_stack} -\usepackage{../pkg/access} -\usepackage{../pkg/expansion} -\usepackage{../pkg/exceptions} -\usepackage{../pkg/exponent} -\usepackage{../pkg/thm_env} -\usepackage{../pkg/trm} -\usepackage{../pkg/flags_stamps_selectors} -\usepackage{../pkg/instruction_flags} -\usepackage{../pkg/block_data} -\usepackage{../pkg/block_hash} -\usepackage{../pkg/txn_data} - -\usepackage{../pkg/draculatheme} - -\title{Block data module} -\author{Rollup team} -\date{March 2023} - -\begin{document} - -\maketitle -\tableofcontents - -\input{_inputs} - -\end{document} diff --git a/zzz_block_data/_inputs.tex b/zzz_block_data/_inputs.tex deleted file mode 100644 index 8793306..0000000 --- a/zzz_block_data/_inputs.tex +++ /dev/null @@ -1,13 +0,0 @@ -\section{Block data module} -\subsection{Introduction} \label{block data: intro} \input{intro} -\subsection{Columns} \label{block data: columns} \input{columns} - -\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} - -\section{Lookups} \label{block data: lookups} \input{lookups/_inputs} - - diff --git a/zzz_block_data/byteDec.tex b/zzz_block_data/byteDec.tex deleted file mode 100644 index 0d473d5..0000000 --- a/zzz_block_data/byteDec.tex +++ /dev/null @@ -1,22 +0,0 @@ -We impose bytehood constraints on the following columns -\begin{multicols}{2} - \begin{enumerate} - \item $\byteCol{HI\_k}$, $k = 0, 1, \dots, \llargeMO$ - \item $\byteCol{LO\_k}$, $k = 0, 1, \dots, \llargeMO$ - \end{enumerate} -\end{multicols} -\noindent We impose horizontal byte decomposition constraints: -\[ - \left\{ \begin{array}{lcl} - \blockDataHi _{i} - & \!\!\! = \!\!\! & - \displaystyle \sum_{k = 0}^{\llargeMO} 256^{\llargeMO - k} \cdot \byteCol{HI\_k}_{i} \\ - \blockDataLo _{i} - & \!\!\! = \!\!\! & - \displaystyle \sum_{k = 0}^{\llargeMO} 256^{\llargeMO - k} \cdot \byteCol{LO\_k}_{i} \\ - \end{array} \right. -\] - -% evm.codes ≡ 1636704767 -% etherscan ≡ 1714989956 -% 0x 6638AB84 diff --git a/zzz_block_data/columns.tex b/zzz_block_data/columns.tex deleted file mode 100644 index d0679df..0000000 --- a/zzz_block_data/columns.tex +++ /dev/null @@ -1,29 +0,0 @@ -We remind the reader that \ccc{} stands for ``counter-constant column.'' -\begin{enumerate} - \item $\ct$: - counter column; hovers around zero and then cycles from $0$ to $\maxCtBtcData$; - \item \blockNumberOfFirstBlockInConflation{}: - ``conflation-constant'' column containing the block number\footnote{In the sense of the \evm{}} of the first block of this conflation; - \item $\relBlock$: - \ccc{} containing the relative block number; - \item $\relTxMax$: - \ccc{} containing the number of transactions in this block; - \item $\INST$: - instruction column; - \item $\blockDataHi$, $\blockDataLo$: - columns containing block data; - \item $\coinbase\high$ and $\coinbase\low$: - \ccc{} containing the - coinbase address; - \item \blockGasLimit{}: - \ccc{} containing the - block gas limit; - \item \basefee{}: - \ccc{} containing the - base fee; - \item $\byteCol{HI\_k}$, and $\byteCol{LO\_k}$, $k = 0, 1, \dots, \llargeMO$: - \item $\wcpFlag$: - binary flags used as selector for lookups; -\end{enumerate} -\saNote{} -The \INST{} column is $0$ during padding then cycles through a selection of ``block data'' specific opcodes e.g. \texttt{0x\,10} (i.e. \inst{COINBASE}), \texttt{0x\,46} (i.e. \inst{CHAINID}) etc\dots{} see section~(\ref{block data: value constraints}). diff --git a/zzz_block_data/constancies.tex b/zzz_block_data/constancies.tex deleted file mode 100644 index e200ee1..0000000 --- a/zzz_block_data/constancies.tex +++ /dev/null @@ -1,14 +0,0 @@ -As per usual we declare a column \col{X} to be \textbf{counter-constant} if it satisfies -\[ - \If \ct _{i} \neq 0 ~ \Then \col{X}_{i} = \col{X}_{i - 1}. -\] -We impose that the following columns be counter-constant -\begin{multicols}{2} - \begin{enumerate} - \item $\relTxMax$ - \item $\coinbase\high$ - \item $\coinbase\low$ - \item \blockGasLimit - \item \basefee - \end{enumerate} -\end{multicols} diff --git a/zzz_block_data/heartbeat.tex b/zzz_block_data/heartbeat.tex deleted file mode 100644 index 17eeb83..0000000 --- a/zzz_block_data/heartbeat.tex +++ /dev/null @@ -1,25 +0,0 @@ -The heartbeat is standard and simple: -\begin{enumerate} - \item $\relBlock_{0} = 0$ - \item \If $\relBlock_{i} = 0$ \Then - \[ - \left\{ \begin{array}{lcl} - \blockNumberOfFirstBlockInConflation & \!\!\! = \!\!\! & 0 \\ - \INST_{i} & \!\!\! = \!\!\! & 0 \\ - \ct_{i} & \!\!\! = \!\!\! & 0 \quad (\trash) \\ - \end{array} \right. - \] - \item $\relBlock_{i + 1} \in \{ \relBlock_{i}, 1 + \relBlock_{i} \}$ - \item \If $\relBlock_{i} \neq \relBlock_{i-1}$ \Then $\ct_{i} = 0$ - \item \If $\relBlock_{i} \neq 0$ \Then - \[ - \left\{ \begin{array}{lcl} - \blockNumberOfFirstBlockInConflation_{i+1} & = & \blockNumberOfFirstBlockInConflation_{i} \\ - \If \ct_{i} \neq \maxCtBtcData ~ \Then \ct_{i + 1} & = & 1 + \ct_{i} \\ - \If \ct_{i} = \maxCtBtcData ~ \Then \relBlock_{i + 1} & = & 1 + \relBlock_{i} \vspace{2mm} \\ - \end{array} \right. - \] - \item $\ct_{N} = \maxCtBtcData$ -\end{enumerate} -\saNote{} -We impose the ``finalization'' constraint unconditionally as the \zkEvm{} cannot process empty conflations. diff --git a/zzz_block_data/intro.tex b/zzz_block_data/intro.tex deleted file mode 100644 index a8bc0e7..0000000 --- a/zzz_block_data/intro.tex +++ /dev/null @@ -1,14 +0,0 @@ -The \textbf{block data} module \btcMod{} is the \zkEvm{}'s storage place for \evm{}-relevant block data of the blocks in a conflation. -As such it serves the \hubMod{} data to the following instructions: -\begin{multicols}{3} - \begin{enumerate} - \item \inst{COINBASE} - \item \inst{TIMESTAMP} - \item \inst{NUMBER} - \item \inst{PREVRANDAO} - \item \inst{GASLIMIT} - \item \inst{CHAINID} - \end{enumerate} -\end{multicols} -Along with the \textsc{rom} and the \textsc{transaction data} module it serves as an entry point of outside data into the \zkEvm{}. -As such one of its duties is to make sure the data it serves is correctly segmented (i.e. satisfies size constraints.) diff --git a/zzz_block_data/lookups/_inputs.tex b/zzz_block_data/lookups/_inputs.tex deleted file mode 100644 index 6b61c42..0000000 --- a/zzz_block_data/lookups/_inputs.tex +++ /dev/null @@ -1,2 +0,0 @@ -\subsection{Into \wcpMod{}} \label{block_data: lookups: into_wcp} \input{lookups/btcdata_into_wcp} -\subsection{Into \txnDataMod{}} \label{block_data: lookups: into_txnDAta} \input{lookups/btcdata_into_txndata} diff --git a/zzz_block_data/lookups/btcdata_into_txndata.tex b/zzz_block_data/lookups/btcdata_into_txndata.tex deleted file mode 100644 index 4b43e8c..0000000 --- a/zzz_block_data/lookups/btcdata_into_txndata.tex +++ /dev/null @@ -1,16 +0,0 @@ -The lookup is structured as follows: -\begin{description} - \item[\underline{Selector:}] none required. - \item[\underline{Source columns:}] --- - \begin{multicols}{1} - \begin{enumerate} - \item $\relBlock$ - \end{enumerate} - \end{multicols} - \item[\underline{Target columns:}] --- - \begin{multicols}{1} - \begin{enumerate} - \item $\relBlock$ - \end{enumerate} - \end{multicols} -\end{description} diff --git a/zzz_block_data/lookups/btcdata_into_wcp.tex b/zzz_block_data/lookups/btcdata_into_wcp.tex deleted file mode 100644 index 01030e2..0000000 --- a/zzz_block_data/lookups/btcdata_into_wcp.tex +++ /dev/null @@ -1,27 +0,0 @@ -The purpose of the present lookup argument is to delegate the proof of the lexicographic order of the \inst{TIMESTAMP} of the block in a given conflation to the \wcpMod{} module. -The lookup is structured as follows: -\begin{description} - \item[\underline{Selector:}] we use $\col{wcp\_selector} \define \wcpFlag$ - \item[\underline{Source columns:}] --- - \begin{multicols}{3} - \begin{enumerate} - \item $\blockDataHi_{i}$ - \item $\blockDataLo_{i}$ - \item $\blockDataHi_{i - (\maxCtBtcData + 1)}$ - \item $\blockDataLo_{i - (\maxCtBtcData + 1)}$ - \item $1$ - \item $\inst{GT}$ - \end{enumerate} - \end{multicols} - \item[\underline{Target columns:}] --- - \begin{multicols}{3} - \begin{enumerate} - \item $\argOneHi$ - \item $\argOneLo$ - \item $\argTwoHi$ - \item $\argTwoLo$ - \item $\resLo$ - \item $\INST$ - \end{enumerate} - \end{multicols} -\end{description} diff --git a/zzz_block_data/lua/layout.lua.tex b/zzz_block_data/lua/layout.lua.tex deleted file mode 100644 index f19e06a..0000000 --- a/zzz_block_data/lua/layout.lua.tex +++ /dev/null @@ -1,74 +0,0 @@ -% !TeX TS-program = lualatex -\documentclass[varwidth=\maxdimen,margin=0.5cm,multi={verbatim}]{standalone} - -\usepackage{../../pkg/draculatheme} - -\usepackage{fontspec} -\directlua{luaotfload.add_fallback - ("emojifallback", - { - "NotoColorEmoji:mode=harf;" - } - )} - -\setmonofont{JetBrains Mono NF Regular}[ - RawFeature={fallback=emojifallback} -] - -\usepackage{../../pkg/draculatheme} - -\begin{document} -\begin{verbatim} - -███████\ ██\ -██ __██\ ██ | -██ | ██ | ██████\ ██████\ ██████\ -██ | ██ | \____██\\_██ _| \____██\ -██ | ██ | ███████ | ██ | ███████ | -██ | ██ |██ __██ | ██ |██\ ██ __██ | -███████ |\███████ | \████ |\███████ | -\_______/ \_______| \____/ \_______| - -██\ ██\ -██ | ██ | -██ | ██████\ ██\ ██\ ██████\ ██\ ██\ ██████\ -██ | \____██\ ██ | ██ |██ __██\ ██ | ██ |\_██ _| -██ | ███████ |██ | ██ |██ / ██ |██ | ██ | ██ | -██ |██ __██ |██ | ██ |██ | ██ |██ | ██ | ██ |██\ -██ |\███████ |\███████ |\██████ |\██████ | \████ | -\__| \_______| \____██ | \______/ \______/ \____/ - ██\ ██ | - \██████ | - \______/ - - -|-------+-----+----------+----+-------------------+----------------+-----------------| -| BTC_∞ | BTC | REL_∞ | CT | INST | BTC_DATA_HI | BTC_DATA_LO | -|:-----:+:---:+:--------:+:--:+:------------------+:--------------:+:---------------:| -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | a | r_∞[b-1] | ⋯ | ⋯ | ⋯ | ⋯ | -|-------+-----+----------+----+-------------------+----------------+-----------------| -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | b | r_∞[b] | 0 | 0x40 (BLOCKHASH) | 0 | 0 | -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | b | r_∞[b] | 1 | 0x41 (COINBASE) | COINBASE_HI | COINBASE_HI | -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | b | r_∞[b] | 2 | 0x42 (TIMESTAMP) | 0 | TIME_STAMP | -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | b | r_∞[b] | 3 | 0x43 (NUMBER) | 0 | BLOCK_NUMBER | -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | b | r_∞[b] | 4 | 0x44 (PREVRANDAO) | PREV_RANDAO_HI | PREV_RANDAO_LO | -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | b | r_∞[b] | 5 | 0x45 (GASLIMIT) | 0 | BLOCK_GAS_LIMIT | -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | b | r_∞[b] | 6 | 0x46 (CHAINID) | 0 | LINEA_CHAIN_ID | -|-------+-----+----------+----+-------------------+----------------+-----------------| -|-------+-----+----------+----+-------------------+----------------+-----------------| -| b_∞ | c | r_∞[b-1] | ⋯ | ⋯ | ⋯ | ⋯ | - -NOTE. The above contains BLOCKHASH which is incorrect. This opcode is dealt with -differently. Atm the design is "spit out the correct (unjustified) result." We could -easily improve on this design (see #382) but for now we will just deal with the opcode -as specified in the design docs. -\end{verbatim} -\end{document} diff --git a/zzz_block_data/value_constraint.tex b/zzz_block_data/value_constraint.tex deleted file mode 100644 index 336c097..0000000 --- a/zzz_block_data/value_constraint.tex +++ /dev/null @@ -1,66 +0,0 @@ -\begin{center} - \boxed{\text{In all this section, it is assumed that $\relBlock_{i} \neq \relBlock_{i-1}$.}} -\end{center} -\begin{enumerate} - \item Setting $\inst{COINBASE}$: - \begin{enumerate} - \item $\INST_{i + \rowShiftCoinbase} = \inst{COINBASE}$ - \item $\blockDataHi _{i + \rowShiftCoinbase} = \coinbase\high_{i}$ - \item $\blockDataLo _{i + \rowShiftCoinbase} = \coinbase\low_{i}$ - \item $\sum_{k = 0}^{\llargeMO-\yellowm{4}} \byteCol{HI\_k}_{i + \rowShiftCoinbase} = 0$ - \end{enumerate} - \saNote{} The final constraint imposes that $\blockDataHi_{i + \rowShiftCoinbase}$ be a $\yellowm{4}$ byte integer, thus the high part of an address. - \item Setting $\inst{TIMESTAMP}$: - \begin{enumerate}[resume] - \item $\INST_{i + \rowShiftTimestamp} = \inst{TIMESTAMP}$ - \item \If $\relBlock_{i} \neq 1$ \Then $\wcpFlag_{i + \rowShiftTimestamp} = 1$ - \end{enumerate} - \saNote{} This imposes a lookup to the \wcpMod{} module, constraining the timestamp to be greater than the previous one. - We don't need it for the first block of the conflation. - \begin{enumerate}[resume] - \item $\blockDataHi _{i + \rowShiftTimestamp} = 0$ - \item $\sum_{k = 0}^{\llargeMO-\yellowm{6}} \byteCol{LO\_k}_{i + \rowShiftTimestamp} = 0$ - \end{enumerate} - \saNote{} - The above imposes that \inst{TIMESTAMP}'s are ``small'' (in the sense that they are $\yellowm{6}$ byte integers.) - \item Setting $\inst{NUMBER}$: - \begin{enumerate}[resume] - \item $\INST_{i + \rowShiftNumber} = \inst{NUMBER}$ - \item $\blockDataHi_{i + \rowShiftNumber} = 0$ - \item $\blockDataLo_{i + \rowShiftNumber} = \blockNumberOfFirstBlockInConflation_{i} + \relBlock_{i} - 1$ - \item $\sum_{k = 0}^{\llargeMO-\yellowm{6}} \byteCol{LO\_k}_{i + \rowShiftNumber} = 0$ - \end{enumerate} - \saNote{} - The same remark applies as in the \inst{TIMESTAMP} case. - \item Setting $\inst{DIFFICULTY}$: - \begin{enumerate}[resume] - \item $\INST_{i + \rowShiftDifficulty} = \inst{DIFFICULTY}$ - \item $\blockDataHi_{i + \rowShiftDifficulty} = 0$ - \item $\blockDataHi_{i + \rowShiftDifficulty} = \lineaDifficulty$ - \end{enumerate} - \item Setting $\inst{GASLIMIT}$: - \begin{enumerate}[resume] - \item $\INST_{i + \rowShiftGaslimit} = \inst{GASLIMIT}$ - \item $\blockDataHi _{i + \rowShiftGaslimit} = 0$ - \item $\blockDataLo _{i + \rowShiftGaslimit} = \lineaBlockGasLimit$ - \item $\blockGasLimit_{i} = \blockDataLo _{i + \rowShiftGaslimit}$ - \end{enumerate} - \item Setting $\inst{CHAINID}$: - \begin{enumerate}[resume] - \item $\INST_{i + \rowShiftChainId} = \inst{CHAINID}$ - \item $\blockDataHi_{i + \rowShiftChainId} = 0$ - \item $\blockDataLo_{i + \rowShiftChainId} = \lineaChainId$ \quad (\trash) - \end{enumerate} - \ob{TODO: this constraint is not enabled at the moment. We are on several networks at the moment.} - \item Setting $\inst{BASEFEE}$: - \begin{enumerate}[resume] - \item $\INST_{i + \rowShiftBaseFee} = \inst{BASEFEE}$ - \item $\blockDataHi _{i + \rowShiftBaseFee} = 0$ - \item $\blockDataLo _{i + \rowShiftBaseFee} = \lineaBaseFee$ - \item $\basefee_{i} = \blockDataLo _{i + \rowShiftBaseFee}$ - \end{enumerate} -\end{enumerate} -\saNote{} -$\lineaBlockGasLimit{}$, -$\lineaChainId{}$ and -$\lineaBaseFee{}$ are network constants.