diff --git a/pkg/rlp_tx.sty b/pkg/rlp_tx.sty index 75eef67b..17d3910d 100644 --- a/pkg/rlp_tx.sty +++ b/pkg/rlp_tx.sty @@ -42,6 +42,7 @@ \newcommand{\phaseValueValue} {\rlpTxnPhase{value}} \newcommand{\phaseDataValue} {\rlpTxnPhase{data}} \newcommand{\phaseAccessListValue} {\rlpTxnPhase{access\_list}} +\newcommand{\phaseAuthorizationListValue} {\rlpTxnPhase{authorization\_list}} \newcommand{\phaseBetaValue} {\rlpTxnPhase{beta}} \newcommand{\phaseYValue} {\rlpTxnPhase{y}} \newcommand{\phaseRValue} {\rlpTxnPhase{r}} @@ -60,6 +61,7 @@ \newcommand{\phaseValue} {\col{IS\_VALUE}} \newcommand{\phaseData} {\col{IS\_DATA}} \newcommand{\phaseAccessList} {\col{IS\_ACCESS\_LIST}} +\newcommand{\phaseAuthorizationList} {\col{IS\_AUTHORIZATION\_LIST}} \newcommand{\phaseBeta} {\col{IS\_BETA}} \newcommand{\phaseY} {\col{IS\_Y}} \newcommand{\phaseR} {\col{IS\_R}} diff --git a/pkg/rlp_txn_v2.sty b/pkg/rlp_txn_v2.sty index 940a0b73..0321e81b 100644 --- a/pkg/rlp_txn_v2.sty +++ b/pkg/rlp_txn_v2.sty @@ -43,8 +43,10 @@ \newcommand{\rlpTxnTransactionColumnNbWarmedStorageKey} {\rlpTxnTransactionColumn{\nbWarmedStorageKey}} \newcommand{\rlpTxnTransactionColumnRequiresEvmExecution} {\rlpTxnTransactionColumn{REQUIRES\_EVM\_EXECUTION}} + \newcommand{\rlpTxnCommonColumnReplayProtection} {\col{REPLAY\_PROTECTION}} \newcommand{\rlpTxnCommonColumnYparity} {\col{Y\_PARITY}} +\newcommand{\rlpTxnCommonColumnNumberOfAuthorizations} {\col{NUMBER\_OF\_AUTHORIZATIONS}} \newcommand{\rlpTxnComputationColumn} [1] {\col{cmp}\separator\col{{#1}}} @@ -75,7 +77,7 @@ \newcommand{\numberOfRlpUtilsDataColumns} {\yellowm{8}} \newcommand{\numberOfCounterConstantAuxiliaryDataColumns} {\yellowm{5}} -\newcommand{\numberOfAuxiliaryDataColumns} {\yellowm{2}} +\newcommand{\numberOfAuxiliaryDataColumns} {\yellowm{7}} diff --git a/rlp_txn/_local.tex b/rlp_txn/_local.tex index 58f5f30e..1470d1d6 100644 --- a/rlp_txn/_local.tex +++ b/rlp_txn/_local.tex @@ -16,11 +16,13 @@ \def\locValidPhaseTransitionTypeZero {\locValidPhaseTransition\loc{\_type\_0}} \def\locValidPhaseTransitionTypeOne {\locValidPhaseTransition\loc{\_type\_1}} \def\locValidPhaseTransitionTypeTwo {\locValidPhaseTransition\loc{\_type\_2}} +\def\locValidPhaseTransitionTypeFour {\locValidPhaseTransition\loc{\_type\_4}} \def\locWillRemainInSamePhase {\loc{will\_remain\_in\_same\_phase}} \def\locWillRemainInSamePhaseTypeZero {\locWillRemainInSamePhase\loc{\_type\_0}} \def\locWillRemainInSamePhaseTypeOne {\locWillRemainInSamePhase\loc{\_type\_1}} \def\locWillRemainInSamePhaseTypeTwo {\locWillRemainInSamePhase\loc{\_type\_2}} +\def\locWillRemainInSamePhaseTypeFour {\locWillRemainInSamePhase\loc{\_type\_4}} \def\locPhaseWillNotChangeAndPhaseIsntRlpPrefix {\loc{phase\_wont\_change\_and\_isnt\_global\_RLP\_prefix}} \def\locLimbUnconditionallyPartakesInLt {\loc{limb\_unconditionally\_partakes\_in\_LT}} @@ -30,6 +32,7 @@ \def\locRlpComponentsTypeZero {\locRlpComponents\loc{\_type\_0}} \def\locRlpComponentsTypeOne {\locRlpComponents\loc{\_type\_1}} \def\locRlpComponentsTypeTwo {\locRlpComponents\loc{\_type\_2}} +\def\locRlpComponentsTypeFour {\locRlpComponents\loc{\_type\_4}} \def\locAccessListLengthCountdown {\loc{AL\_RLP\_length\_countdown}} \def\locAccessListItemCountdown {\loc{access\_list\_item\_countdown}} @@ -139,3 +142,26 @@ \def\locStorageKeyLo {\loc{storage\_key\_lo}} \def\rlpIntoHubSelector {\loc{sel\_rlp\_txn\_into\_hub}} + +%% Authorization list +\def\locAuthorizationNumberOfRows {\numConst{19}} + +\def\locAuthorizationPrefix {\loc{first\_CMP\_row\_of\_auth\_phase}} +\def\locAuthorizationAgainAuthPhase {\loc{again\_CMP\_row\_of\_auth\_phase}} +\def\locAuthorizationFirstRow {\loc{first\_row\_of\_tuple\_processing}} +\def\locAuthorizationIndex {\loc{tuple\_index}} +\def\locAuthorizationData {\loc{row\_contains\_tuple\_data}} +\def\locAuthorizationNotFirstRow {\loc{not\_first\_row\_of\_tuple}} +\def\locAuthorizationLengthCountdown {\loc{auth\_list\_RLP\_length\_countdown}} +\def\locAuthorizationItemCountdown {\loc{auth\_item\_countdown}} +\def\locAuthorizationChainId {\loc{auth\_chain\_id}} +\def\locAuthorizationAddressHi {\loc{auth\_address\_hi}} +\def\locAuthorizationAddressLo {\loc{auth\_address\_lo}} +\def\locAuthorizationNonce {\loc{auth\_nonce}} +\def\locAuthorizationY {\loc{auth\_y}} +\def\locAuthorizationRHi {\loc{auth\_r\_hi}} +\def\locAuthorizationRLo {\loc{auth\_r\_lo}} +\def\locAuthorizationSHi {\loc{auth\_s\_hi}} +\def\locAuthorizationSLo {\loc{auth\_s\_lo}} +\def\locAuthorizationEndOfPhase {\loc{auth\_end\_of\_phase}} + diff --git a/rlp_txn/columns/shared.tex b/rlp_txn/columns/shared.tex index 6bf5c028..c7135bae 100644 --- a/rlp_txn/columns/shared.tex +++ b/rlp_txn/columns/shared.tex @@ -41,7 +41,7 @@ \item \typeOneTx{} \item \typeTwoTx{} % \item \typeThreeTx{} - % \item \typeFourTx{} + \item \typeFourTx{} \end{enumerate} \end{multicols} We further introduce ``phase flag columns'': @@ -60,6 +60,7 @@ \item \phaseBeta{} \item \phaseMaxPriorityFeePerGas{} \item \phaseMaxFeePerGas{} + \item \phaseAuthorizationList \item \phaseY{} \item \phaseR{} \item \phaseS{} @@ -111,3 +112,10 @@ \item \rlpTxnSharedColumnIsAccessListStorageKey \end{enumerate} \end{multicols} +for a \textbf{7702-transaction} (as witnessed by $\typeFourTx \equiv \true$). +\begin{enumerate}[resume] + \item + \markAsJustifiedHere{} + \rlpTxnCommonColumnNumberOfAuthorizations{}: + the number of authorization in the authorization list; +\end{enumerate} diff --git a/rlp_txn/columns/transaction.tex b/rlp_txn/columns/transaction.tex index bc9c32fa..e6ed1e9c 100644 --- a/rlp_txn/columns/transaction.tex +++ b/rlp_txn/columns/transaction.tex @@ -58,6 +58,13 @@ \rlpTxnTransactionColumnNumberOfNonZero{}: the number of nonzero bytes in the transaction's payload \textbf{p}; \end{enumerate} +for a \textbf{7702-transaction} (as witnessed by $\typeFourTx \equiv \true$). +\begin{enumerate}[resume] + \item + \markAsJustifiedHere{} + \rlpTxnTransactionColumnNumberOfZero{}: + the number of zero bytes in the transaction's payload \textbf{p}; +\end{enumerate} We recall the definition of the payload \textbf{p} of a transaction $T$ in section~(\ref{rlp txn: phase constraints: payload: payload size analysis: definition of payload in terms of transaction fields}). \begin{enumerate}[resume] diff --git a/rlp_txn/generalities/binarities.tex b/rlp_txn/generalities/binarities.tex index e3973c43..85acfde2 100644 --- a/rlp_txn/generalities/binarities.tex +++ b/rlp_txn/generalities/binarities.tex @@ -4,6 +4,7 @@ \item \typeZeroTx{} \item \typeOneTx{} \item \typeTwoTx{} + \item \typeFourTx{} \item \phaseRlpPrefix{} \item \phaseChainId{} \item \phaseNonce{} @@ -15,6 +16,7 @@ \item \phaseValue{} \item \phaseData{} \item \phaseAccessList{} + \item \phaseAuthorizationList{} \item \phaseBeta{} \item \phaseY{} \item \phaseR{} diff --git a/rlp_txn/generalities/constancies.tex b/rlp_txn/generalities/constancies.tex index 300a298b..20022981 100644 --- a/rlp_txn/generalities/constancies.tex +++ b/rlp_txn/generalities/constancies.tex @@ -22,6 +22,7 @@ \item \CFI \item \rlpTxnCommonColumnReplayProtection \item \rlpTxnCommonColumnYparity + \item \rlpTxnCommonColumnNumberOfAuthorizations \end{enumerate} \end{multicols} \noindent be \textbf{transaction-constant}. diff --git a/rlp_txn/generalities/lt_lx_lc_bits.tex b/rlp_txn/generalities/lt_lx_lc_bits.tex index a8bf69d5..23381bdb 100644 --- a/rlp_txn/generalities/lt_lx_lc_bits.tex +++ b/rlp_txn/generalities/lt_lx_lc_bits.tex @@ -25,6 +25,7 @@ + & \phaseValue _{i} \\ + & \phaseData _{i} \\ + & \phaseAccessList _{i} \\ + + & \phaseAuthorizationList _{i} \\ % + & \phaseBeta _{i} \\ % + & \phaseY _{i} \\ % + & \phaseR _{i} \\ diff --git a/rlp_txn/generalities/miscellaneous_transaction_columns.tex b/rlp_txn/generalities/miscellaneous_transaction_columns.tex index b9b4cac2..c23dd313 100644 --- a/rlp_txn/generalities/miscellaneous_transaction_columns.tex +++ b/rlp_txn/generalities/miscellaneous_transaction_columns.tex @@ -6,6 +6,7 @@ \item \If $\isTxn _{i} = 1$ \et $\rlpTxnTransactionColumnChainId _{i} \neq 0$ \Then $\rlpTxnCommonColumnReplayProtection _{i} = 1$ \item \If $\isTxn _{i} = 1$ \et $\rlpTxnTransactionColumnChainId _{i} = 0$ \Then $\rlpTxnCommonColumnReplayProtection _{i} = 0$ \item \If $\isTxn _{i} = 1$ \et $\typeZeroTx _{i} = 0$ \Then $\rlpTxnCommonColumnReplayProtection _{i} = 1$ + \item \If $\typeFourTx_{i} = 0$ \Then $\rlpTxnCommonColumnNumberOfAuthorizations_{i} = 0$ \end{enumerate} \saNote{} \label{rlp txn: generalities: transaction decoding: non legacy transaction can't be chainless} The above imposes that only legacy transactions can be chainless. diff --git a/rlp_txn/generalities/perspectives.tex b/rlp_txn/generalities/perspectives.tex index a5b66595..b61368b2 100644 --- a/rlp_txn/generalities/perspectives.tex +++ b/rlp_txn/generalities/perspectives.tex @@ -1,4 +1,4 @@ -We define the following shorthands: +We define the following shorthands: \[ \begin{array}{l} \locPerspFlagSum _{i} \define @@ -20,6 +20,7 @@ + & (1 - \phaseValue _{i}) & \!\!\!\cdot\!\!\! & \phaseValue _{i + 1} \\ + & (1 - \phaseData _{i}) & \!\!\!\cdot\!\!\! & \phaseData _{i + 1} \\ + & (1 - \phaseAccessList _{i}) & \!\!\!\cdot\!\!\! & \phaseAccessList _{i + 1} \\ + + & (1 - \phaseAuthorizationList _{i}) & \!\!\!\cdot\!\!\! & \phaseAuthorizationList _{i + 1} \\ + & (1 - \phaseBeta _{i}) & \!\!\!\cdot\!\!\! & \phaseBeta _{i + 1} \\ + & (1 - \phaseY _{i}) & \!\!\!\cdot\!\!\! & \phaseY _{i + 1} \\ + & (1 - \phaseR _{i}) & \!\!\!\cdot\!\!\! & \phaseR _{i + 1} \\ diff --git a/rlp_txn/generalities/phase_end.tex b/rlp_txn/generalities/phase_end.tex index 70ec5366..fcb468be 100644 --- a/rlp_txn/generalities/phase_end.tex +++ b/rlp_txn/generalities/phase_end.tex @@ -1,4 +1,4 @@ -We define the following shorthand +We define the following shorthand: \phaseAuthorizationList \[ \begin{array}{l} \locAboutToExitPhase _{i} \vspace{2mm} \\ @@ -14,7 +14,8 @@ + & \phaseTo _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseTo _{i + 1}) \\ + & \phaseValue _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseValue _{i + 1}) \\ + & \phaseData _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseData _{i + 1}) \\ - + & \phaseAccessList _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseAccessList _{i + 1}) \\ + + & \phaseAccessList _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseAccessList _{i + 1}) \\ + + & \phaseAuthorizationList _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseAuthorizationList _{i + 1}) \\ + & \phaseBeta _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseBeta _{i + 1}) \\ + & \phaseY _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseY _{i + 1}) \\ + & \phaseR _{i} & \!\!\!\cdot\!\!\! & (1 - \phaseR _{i + 1}) \\ diff --git a/rlp_txn/generalities/phase_flag_sum.tex b/rlp_txn/generalities/phase_flag_sum.tex index 9f6fbd32..48d4ae59 100644 --- a/rlp_txn/generalities/phase_flag_sum.tex +++ b/rlp_txn/generalities/phase_flag_sum.tex @@ -13,6 +13,7 @@ + & \phaseValue _{i} \\ + & \phaseData _{i} \\ + & \phaseAccessList _{i} \\ + + & \phaseAuthorizationList _{i} \\ + & \phaseBeta _{i} \\ + & \phaseY _{i} \\ + & \phaseR _{i} \\ diff --git a/rlp_txn/generalities/transaction_decoding.tex b/rlp_txn/generalities/transaction_decoding.tex index 365032a6..75d660e2 100644 --- a/rlp_txn/generalities/transaction_decoding.tex +++ b/rlp_txn/generalities/transaction_decoding.tex @@ -7,7 +7,7 @@ + & \typeOneTx _{i} \\ + & \typeTwoTx _{i} \\ % + & \typeThreeTx _{i} \\ - % + & \typeFourTx _{i} \\ + + & \typeFourTx _{i} \\ \end{array} \right] \vspace{2mm} \\ \locWeightedTransactionTypeSum _{i} & \define & @@ -16,7 +16,7 @@ + & 1 & \!\!\!\cdot\!\!\! & \typeOneTx _{i} \\ + & 2 & \!\!\!\cdot\!\!\! & \typeTwoTx _{i} \\ % + & 3 & \!\!\!\cdot\!\!\! & \typeThreeTx _{i} \\ - % + & 4 & \!\!\!\cdot\!\!\! & \typeFourTx _{i} \\ + + & 4 & \!\!\!\cdot\!\!\! & \typeFourTx _{i} \\ \end{array} \right] \end{array} \right. \] @@ -31,12 +31,6 @@ we impose that $\locTransactionTypeSum _{i} = \locPhaseFlagSum _{i}$ \item \If $\isTxn _{i} = 1$ \Then $\rlpTxnTransactionColumnTxType _{i} = \locWeightedTransactionTypeSum _{i}$ - % \begin{enumerate} - % \item $\ct _{i} = 0$ (\sanityCheck) - % \item $\maxCt _{i} = 0$ (\sanityCheck) - % \item $\phaseEnd _{i} = 0$ (\sanityCheck) - % \item $\lc _{i} = 0$ (\sanityCheck) - % \end{enumerate} \end{enumerate} \saNote{} \label{rlp txn: generalities: transaction decoding: flag exclusivity} The above implicitly imposes flag exclusivity on the ``transaction type flags.'' diff --git a/rlp_txn/generalities/transaction_type_phase_transitions.tex b/rlp_txn/generalities/transaction_type_phase_transitions.tex index 0484ed88..0c28280b 100644 --- a/rlp_txn/generalities/transaction_type_phase_transitions.tex +++ b/rlp_txn/generalities/transaction_type_phase_transitions.tex @@ -108,6 +108,48 @@ \\ \end{array} \right. \] +and +\[ + \hspace*{-2cm} + \left\{ \begin{array}{lcl} + \locValidPhaseTransitionTypeFour_{i} & \define & + \left[ \begin{array}{clcl} + + & \phaseRlpPrefix _{i} & \cdot & \phaseChainId _{i + 1} \\ + + & \phaseChainId _{i} & \cdot & \phaseNonce _{i + 1} \\ + + & \phaseNonce _{i} & \cdot & \phaseMaxPriorityFeePerGas _{i + 1} \\ + + & \phaseMaxPriorityFeePerGas _{i} & \cdot & \phaseMaxFeePerGas _{i + 1} \\ + + & \phaseMaxFeePerGas _{i} & \cdot & \phaseGasLimit _{i + 1} \\ + + & \phaseGasLimit _{i} & \cdot & \phaseTo _{i + 1} \\ + + & \phaseTo _{i} & \cdot & \phaseValue _{i + 1} \\ + + & \phaseValue _{i} & \cdot & \phaseData _{i + 1} \\ + + & \phaseData _{i} & \cdot & \phaseAccessList _{i + 1} \\ + + & \phaseAccessList _{i} & \cdot & \phaseAuthorizationList _{i + 1} \\ + + & \phaseAuthorizationList _{i} & \cdot & \phaseY _{i + 1} \\ + + & \phaseY _{i} & \cdot & \phaseR _{i + 1} \\ + + & \phaseR _{i} & \cdot & \phaseS _{i + 1} \\ + + & \phaseS _{i} & \cdot & \phaseRlpPrefix _{i + 1} \\ + \end{array} \right] + \vspace{2mm} \\ + \locWillRemainInSamePhaseTypeFour_{i} & \define & + \left[ \begin{array}{clcl} + + & \phaseRlpPrefix _{i} & \cdot & \phaseRlpPrefix _{i + 1} \\ + + & \phaseChainId _{i} & \cdot & \phaseChainId _{i + 1} \\ + + & \phaseNonce _{i} & \cdot & \phaseNonce _{i + 1} \\ + + & \phaseMaxPriorityFeePerGas _{i} & \cdot & \phaseMaxPriorityFeePerGas _{i + 1} \\ + + & \phaseMaxFeePerGas _{i} & \cdot & \phaseMaxFeePerGas _{i + 1} \\ + + & \phaseGasLimit _{i} & \cdot & \phaseGasLimit _{i + 1} \\ + + & \phaseTo _{i} & \cdot & \phaseTo _{i + 1} \\ + + & \phaseValue _{i} & \cdot & \phaseValue _{i + 1} \\ + + & \phaseData _{i} & \cdot & \phaseData _{i + 1} \\ + + & \phaseAccessList _{i} & \cdot & \phaseAccessList _{i + 1} \\ + + & \phaseAuthorizationList _{i} & \cdot & \phaseAuthorizationList _{i + 1} \\ + + & \phaseY _{i} & \cdot & \phaseY _{i + 1} \\ + + & \phaseR _{i} & \cdot & \phaseR _{i + 1} \\ + + & \phaseS _{i} & \cdot & \phaseS _{i + 1} \\ + \end{array} \right] + \\ + \end{array} \right. +\] and we impose that \begin{enumerate} \item @@ -131,4 +173,11 @@ + & \locWillRemainInSamePhaseTypeTwo _{i} \\ \end{array} \right] = 1 $ + \item + \If $\typeFourTx _{i} = 1$ \Then + $ \left[ \begin{array}{clcl} + + & \locValidPhaseTransitionTypeFour _{i} \\ + + & \locWillRemainInSamePhaseTypeFour_{i} \\ + \end{array} \right] + = 1 $ \end{enumerate} diff --git a/rlp_txn/generalities/transaction_type_rlp_components.tex b/rlp_txn/generalities/transaction_type_rlp_components.tex index 04397e07..ecc202e9 100644 --- a/rlp_txn/generalities/transaction_type_rlp_components.tex +++ b/rlp_txn/generalities/transaction_type_rlp_components.tex @@ -47,14 +47,33 @@ + & \phaseR _{i} \\ + & \phaseS _{i} \\ \end{array} \right] + \vspace{2mm} \\ + \locRlpComponentsTypeFour_{i} & \define & + \left[ \begin{array}{clcl} + + & \phaseRlpPrefix _{i} \\ + + & \phaseChainId _{i} \\ + + & \phaseNonce _{i} \\ + + & \phaseMaxPriorityFeePerGas _{i} \\ + + & \phaseMaxFeePerGas _{i} \\ + + & \phaseGasLimit _{i} \\ + + & \phaseTo _{i} \\ + + & \phaseValue _{i} \\ + + & \phaseData _{i} \\ + + & \phaseAccessList _{i} \\ + + & \phaseAuthorizationList _{i} \\ + + & \phaseY _{i} \\ + + & \phaseR _{i} \\ + + & \phaseS _{i} \\ + \end{array} \right] \\ - \end{array} \right. + \end{array} \right. \] and we impose \begin{enumerate} \item \If $\typeZeroTx _{i} = 1$ \Then $\locRlpComponentsTypeZero _{i} = 1$ \quad (\sanityCheck) \item \If $\typeOneTx _{i} = 1$ \Then $\locRlpComponentsTypeOne _{i} = 1$ \quad (\sanityCheck) \item \If $\typeTwoTx _{i} = 1$ \Then $\locRlpComponentsTypeTwo _{i} = 1$ \quad (\sanityCheck) + \item \If $\typeFourTx _{i} = 1$ \Then $\locRlpComponentsTypeFour _{i} = 1$ \quad (\sanityCheck) \end{enumerate} \saNote{} \label{rlp txn: generalities: transaction type rlp components: refinement of flag sum} The above refines diff --git a/rlp_txn/phase_constraints/_inputs.tex b/rlp_txn/phase_constraints/_inputs.tex index 1d16d008..da6977fc 100644 --- a/rlp_txn/phase_constraints/_inputs.tex +++ b/rlp_txn/phase_constraints/_inputs.tex @@ -6,4 +6,5 @@ \subsection{\localSectionTitle{} (\phaseChainId{}, \dots, \phaseY{}, \phaseR{} a \subsection{\rlp{}-ization of \texttt{to} (\phaseTo)} \label{rlp txn: phase constraints: to address} \input{phase_constraints/to_address} \subsection{\rlp{}-ization of \texttt{data} (\phaseData)} \label{rlp txn: phase constraints: payload} \input{phase_constraints/data/_inputs} \subsection{\rlp{}-ization of \texttt{access list} (\phaseAccessList)} \label{rlp txn: phase constraints: access list} \input{phase_constraints/access_list/_inputs} +\subsection{\rlp{}-ization of \texttt{authorization list} (\phaseAuthorizationList)} \label{rlp txn: phase constraints: authorization list} \input{phase_constraints/authorization_list/_inputs} \subsection{\rlp{}-ization of \texttt{beta} (\phaseBeta)} \label{rlp txn: phase constraints: beta} \input{phase_constraints/beta} diff --git a/rlp_txn/phase_constraints/access_list/.DS_Store b/rlp_txn/phase_constraints/access_list/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/rlp_txn/phase_constraints/access_list/.DS_Store differ diff --git a/rlp_txn/phase_constraints/access_list/_inputs.tex b/rlp_txn/phase_constraints/access_list/_inputs.tex index 07d3ad9b..bb2fbb88 100644 --- a/rlp_txn/phase_constraints/access_list/_inputs.tex +++ b/rlp_txn/phase_constraints/access_list/_inputs.tex @@ -4,4 +4,3 @@ \subsubsection{Access list bits } \label{rlp txn: phase constraints: acc \subsubsection{Legal bit transitions } \label{rlp txn: phase constraints: access list: legal transitions} \input{phase_constraints/access_list/legal_transitions} \subsubsection{Countdown constraints } \label{rlp txn: phase constraints: access list: countdowns} \input{phase_constraints/access_list/countdowns/_inputs} \subsubsection{Subphases of processing } \label{rlp txn: phase constraints: access list: access list prefix} \input{phase_constraints/access_list/subphases/_inputs} -% \subsubsection{Constraints } \label{rlp txn: phase constraints: access list: constraints} \input{phase_constraints/access_list/constraints} diff --git a/rlp_txn/phase_constraints/access_list/constraints.tex b/rlp_txn/phase_constraints/access_list/constraints.tex deleted file mode 100644 index 20a6ae62..00000000 --- a/rlp_txn/phase_constraints/access_list/constraints.tex +++ /dev/null @@ -1,145 +0,0 @@ -\begin{center} - \boxed{\text{Throughout this section it is assumed that $\phaseAccessList _{i} = 1$.}} -\end{center} -An access list tuple always starts with the \rlp{} prefix of the tuple, followed by the \rlp{} of an address: -\begin{enumerate}[resume] - \item \If $\rlpTxnSharedColumnIsPrefix _{i} = 1$ \et $\rlpTxnSharedColumnIsAccessListAddress _{i} = 1$ \et $\rlpTxnSharedColumnIsAccessListStorageKey _{i} = 0$ \Then: - \begin{enumerate} - \item we impose - \[ - \rlpProcessByteString { - anchorRow = i , - relOffset = 0 , - byteStringLength = \locAccessListItemRlpLengthCountdown _{i} , - firstByte = \nothing , - isList = \true , - mustBeNontrivial = \true , - } - \] - \item $\rlpTxnSharedColumnIsPrefix _{i + 1} = 0$ - \item $\rlpTxnSharedColumnIsAccessListAddress _{i + 1} = 1$ - \item $\rlpTxnSharedColumnIsAccessListStorageKey _{i + 1} = 0$ - \item - \[ - \rlpProcessAddress { - anchorRow = i , - relOffset = 1 , - addressHi = \locAddressHi , - addressLo = \locAddressLo , - } - \] - \end{enumerate} - - After the \rlp{} of an address, we have the \rlp{} of the list of the (possibly empty) list of storage keys: - \begin{enumerate}[resume] - \item \If $\rlpTxnSharedColumnIsPrefix _{i - 1} = 0$ \et $\rlpTxnSharedColumnIsAccessListAddress _{i - 1} = 1$ \et $\rlpTxnSharedColumnIsAccessListStorageKey _{i - 1} = 0$ \et $\done _{i - 1} =1$ Then: - \begin{enumerate} - \item $\rlpTxnSharedColumnIsPrefix _{i} = 1$ - \item $\rlpTxnSharedColumnIsAccessListAddress _{i} = 0$ - \item $\rlpTxnSharedColumnIsAccessListStorageKey _{i} = 1$ - \item $\rlpTxnComputationColumnExoDataColumn{1} _{i} = 33 \cdot \locStorageKeyListCountdown _{i}$ - \item - \[ - \rlpBytestringPrefix _{i} - \left( - \begin{array}{r} - \rlpTxnComputationColumnExoDataColumn{1}, - \rlpTxnComputationColumnExoDataColumn{2}, - \rlpTxnComputationColumnExoDataColumn{3}, - \ct, - \maxCt; \\ - \rlpTxnComputationColumnRlpUtilsFlag, - \rlpTxnComputationColumnRlpUtilsInstruction, - \rlpTxnComputationColumnExoDataColumn{4}, - \rlpTxnComputationColumnExoDataColumn{5}, - \rlpTxnComputationColumnExoDataColumn{8}; \\ - \rlpTxnComputationColumnLimb, - \lc, - \rlpTxnComputationColumnLimbSize; \\ - \end{array} - \right) - \] - - \item \If $\rlpTxnComputationColumnExoDataColumn{6} _{i} = 1$ \Then: - \begin{enumerate} - \item $\rlpTxnSharedColumnIsPrefix _{i + 1} = 0$ - \item $\rlpTxnSharedColumnIsAccessListAddress _{i + 1} = 0$ - \item $\rlpTxnSharedColumnIsAccessListStorageKey _{i + 1} = 1$ - \end{enumerate} - - \item \If $\rlpTxnComputationColumnExoDataColumn{6} _{i} = 0$ \et $\locAccessListItemCountdown _{i} \neq 0$ \Then: - \begin{enumerate} - \item $\rlpTxnSharedColumnIsPrefix _{i + 1} = 1$ - \item $\rlpTxnSharedColumnIsAccessListAddress _{i + 1} = 1$ - \item $\rlpTxnSharedColumnIsAccessListStorageKey _{i + 1} = 0$ - \end{enumerate} - - \item \If $\rlpTxnComputationColumnExoDataColumn{6} _{i} = 0$ \et $\locAccessListItemCountdown _{i} = 0$ \Then: - \begin{enumerate} - \item $\phaseEnd _{i} = 1$ - \end{enumerate} - \end{enumerate} - \end{enumerate} - - Here we constraint what happens when we have to do the \rlp{} of a storage key: - \begin{enumerate}[resume] - \item \If $\rlpTxnSharedColumnIsPrefix _{i - 1} = 0$ \et $\rlpTxnSharedColumnIsAccessListAddress _{i - 1} = 0$ \et $\rlpTxnSharedColumnIsAccessListStorageKey _{i - 1} = 1$ \et $\done _{i - 1} =1$ Then: - \begin{enumerate} - \item $\rlpTxnComputationColumnExoDataColumn{1} _{i} = \rlpTxnComputationColumnExoDataColumn{1} _{i + 1} = \rlpTxnComputationColumnExoDataColumn{1} _{i + 2}$ - \item $\rlpTxnComputationColumnExoDataColumn{2} _{i} = \rlpTxnComputationColumnExoDataColumn{2} _{i + 1} = \rlpTxnComputationColumnExoDataColumn{2} _{i + 2}$ - \item \[ - \rlpStorageKey _{i} - \left( - \begin{array}{r} - \rlpTxnComputationColumnExoDataColumn{1}, - \rlpTxnComputationColumnExoDataColumn{2}, - \ct, - \maxCt; \\ - \rlpTxnComputationColumnRlpUtilsFlag, - \rlpTxnComputationColumnRlpUtilsInstruction; \\ - \rlpTxnComputationColumnLimb, - \lc, - \rlpTxnComputationColumnLimbSize; \\ - \end{array} - \right) - \] - \end{enumerate} - \end{enumerate} - And the possibilities after the \rlp{} of a storage key: - \begin{enumerate}[resume] - \item \If $\rlpTxnSharedColumnIsPrefix _{i} = 0$ \et $\rlpTxnSharedColumnIsAccessListAddress _{i} = 0$ \et $\rlpTxnSharedColumnIsAccessListStorageKey _{i} = 1$ \et $\done _{i} =1$ \Then: - \begin{enumerate} - \item \If $\locStorageKeyListCountdown _{i} \neq 0$ \Then: $\rlpTxnSharedColumnIsPrefix _{i + 1} = 0$ \et $\rlpTxnSharedColumnIsAccessListAddress _{i + 1} = 0$ \et $\rlpTxnSharedColumnIsAccessListStorageKey _{i + 1} = 1$ - \item \If $\locStorageKeyListCountdown _{i} = 0$ \Then: - \begin{enumerate} - \item $\locAccessListItemRlpLengthCountdown _{i} = 0$ - \item \If $\locAccessListItemCountdown _{i} \neq 0$ \Then: $\rlpTxnSharedColumnIsPrefix _{i + 1} = 1$ \et $\rlpTxnSharedColumnIsAccessListAddress _{i + 1} = 1$ \et $\rlpTxnSharedColumnIsAccessListStorageKey _{i + 1} = 0$ - \item \If $\locAccessListItemCountdown _{i} = 0$ \Then: $\phaseEnd _{i} =1$ - \end{enumerate} - \end{enumerate} - \end{enumerate} - - We constraint finalize the phase before the end by imposing: - \begin{enumerate} - \item \If $\phaseEnd _{i} =1$ \Then: - \begin{enumerate} - \item $\locAccessListLengthCountdown _{i} =0$ - \item $\locAccessListItemCountdown _{i} =0$ - \item $\locStoragePrewarmingCountdown _{i} =0$ - \end{enumerate} - \end{enumerate} - - And some constancies properties: - \begin{enumerate} - \item $\locAccessListLengthCountdown _{i} = \locAccessListLengthCountdown _{i - 1} - \lc _{i} \cdot \rlpTxnComputationColumnLimbSize _{i}$ - \item \If $\rlpTxnSharedColumnIsAccessListStorageKey _{i} =1$ \Or ($\rlpTxnSharedColumnIsAccessListAddress _{i} =1$ \et $\rlpTxnSharedColumnIsPrefix _{i} =0$) \Then: $\locAccessListItemRlpLengthCountdown _{i} = \locAccessListItemRlpLengthCountdown _{i - 1} - \lc _{i} \cdot \rlpTxnComputationColumnLimbSize _{i}$ - \item $\locAccessListItemCountdown _{i} = \locAccessListItemCountdown _{i - 1} - \rlpTxnSharedColumnIsPrefix _{i} \cdot \rlpTxnSharedColumnIsAccessListAddress _{i}$ - \item \If $\rlpTxnSharedColumnIsAccessListAddress _{i} =1$ \et $\rlpTxnSharedColumnIsAccessListStorageKey _{i}=1$ \et $\locAccessListItemCountdown _{i} = \locAccessListItemCountdown _{i + 1}$ \Then: - \begin{enumerate} - \item $\locAddressHi _{i} = \locAddressHi _{i + 1}$ - \item $\locAddressLo _{i} = \locAddressLo _{i + 1}$ - \end{enumerate} - \item $\locStoragePrewarmingCountdown _{i} = \locStoragePrewarmingCountdown _{i} - \done _{i + 2} \cdot \rlpTxnSharedColumnIsAccessListStorageKey _{i + 2} \cdot (1 - \rlpTxnSharedColumnIsPrefix _{i + 2})$ - \item \If ($\rlpTxnSharedColumnIsPrefix _{i} =1$ \et $\rlpTxnSharedColumnIsAccessListAddress _{i} =1$) \Then: $\locStorageKeyListCountdown _{i} = \locStorageKeyListCountdown _{i} - \done _{i + 2} \cdot \rlpTxnSharedColumnIsAccessListStorageKey _{i + 2} \cdot (1 - \rlpTxnSharedColumnIsPrefix _{i + 2})$ - \end{enumerate} - \end{enumerate} diff --git a/rlp_txn/phase_constraints/authorization_list/_inputs.tex b/rlp_txn/phase_constraints/authorization_list/_inputs.tex new file mode 100644 index 00000000..d3d3a547 --- /dev/null +++ b/rlp_txn/phase_constraints/authorization_list/_inputs.tex @@ -0,0 +1,5 @@ +\subsubsection{Approach } \label{rlp txn: phase constraints: authorization list: approach} \input{phase_constraints/authorization_list/approach} +\subsubsection{Shorthands } \label{rlp txn: phase constraints: authorization list: shorthands} \input{phase_constraints/authorization_list/shorthands} +\subsubsection{\locAuthorizationIndex{} constraints } \label{rlp txn: phase constraints: authorization list: tuple index} \input{phase_constraints/authorization_list/index} +\subsubsection{Generalities } \label{rlp txn: phase constraints: authorization list: generalities} \input{phase_constraints/authorization_list/generalities} +\subsubsection{\rlp{}-ization constraints } \label{rlp txn: phase constraints: authorization list: rlpization} \input{phase_constraints/authorization_list/rlp} diff --git a/rlp_txn/phase_constraints/authorization_list/approach.tex b/rlp_txn/phase_constraints/authorization_list/approach.tex new file mode 100644 index 00000000..e8e4106d --- /dev/null +++ b/rlp_txn/phase_constraints/authorization_list/approach.tex @@ -0,0 +1 @@ +blabla \ No newline at end of file diff --git a/rlp_txn/phase_constraints/authorization_list/generalities.tex b/rlp_txn/phase_constraints/authorization_list/generalities.tex new file mode 100644 index 00000000..955d6118 --- /dev/null +++ b/rlp_txn/phase_constraints/authorization_list/generalities.tex @@ -0,0 +1,53 @@ +\begin{center} + \boxed{\text{In all this section, it is assumed that } + \phaseAuthorizationList _{i} = \true + } +\end{center} +We begin by transfering data to the $\isTxn$-perspective +\begin{enumerate} + \item + \If $\locAuthorizationPrefix _{i} = 1$ \Then + + \ob{TODO: We require a constraint that connects \rlpTxnCommonColumnNumberOfAuthorizations{} + to an eponymous column in the $\isTxn{}$-perspective.} +\end{enumerate} +We constrain the size counter: +\begin{enumerate}[resume] + \item \If $\locAuthorizationData _{i} = 1$ \Then + \[ + \locAuthorizationLengthCountdown _{i} = + \left[ \begin{array}{cl} + + & \locAuthorizationLengthCountdown _{i - 1} \\ + - & \lc _{i} \cdot \rlpTxnComputationColumnLimbSize _{i} \\ + \end{array} \right] + \] + \item \If $\locAuthorizationNotFirstRow _{i} = 1$ \Then + \[ + \locAuthorizationItemCountdown _{i} = + \left[ \begin{array}{cl} + + & \locAuthorizationItemCountdown _{i - 1} \\ + - & \lc _{i} \cdot \rlpTxnComputationColumnLimbSize _{i} \\ + \end{array} \right] + \] +\end{enumerate} +We define authorization constancy by: +\If $\locAuthorizationNotFirstRow _{i} = 1$ \Then $\col{X} _{i} = \col{X} _{i - 1} $. +\begin{enumerate}[resume] + \item And we impose authorization constancy for: + \begin{enumerate} + \item \locAuthorizationChainId {} + \item \locAuthorizationAddressHi {} + \item \locAuthorizationAddressLo {} + \item \locAuthorizationNonce {} + \item \locAuthorizationY {} + \item \locAuthorizationRHi {} + \item \locAuthorizationRLo {} + \item \locAuthorizationSHi {} + \item \locAuthorizationSLo {} + \end{enumerate} +\end{enumerate} +We enforce that authorization lists must be nonempty +\begin{enumerate}[resume] + \item\label{rlp txn: phase constraints: authorization list: constraints: authorization lists must be nonempty} + $\rlpTxnCommonColumnNumberOfAuthorizations _{i} \neq 0$ +\end{enumerate} diff --git a/rlp_txn/phase_constraints/authorization_list/index.tex b/rlp_txn/phase_constraints/authorization_list/index.tex new file mode 100644 index 00000000..9aefc5cb --- /dev/null +++ b/rlp_txn/phase_constraints/authorization_list/index.tex @@ -0,0 +1,114 @@ +\begin{center} + \boxed{\text{In all this section, it is assumed that } + \phaseAuthorizationList _{i} = \true + } +\end{center} +We impose some general constraints onto \locAuthorizationIndex{} +and also ensure that \phaseAuthorizationList{}-phases have a certain shape. +Recall that \locAuthorizationIndex{} is meant to count and label authority tuples from the \texttt{authority\_list} +in order of appearance therein. +As such we must ensure it remain constant along the rows pertaining to a given authorization tuple. +Tuple labeling will start at $1$ and go all the way up to $\rlpTxnCommonColumnNumberOfAuthorizations$. +Furthermore tuple processing will always occupy $\locAuthorizationNumberOfRows$ rows, +regardless of the validity of the underlying tuple. + +The constraints that follow pertain mostly to +\locAuthorizationIndex{} and enforce the following behaviour +on the \phaseAuthorizationList{} phase. +We wish to impose that these phases be structured as follows: +\begin{itemize} + \item + \numConst{1} ``transaction-row'' marks the beginning of + the \phaseAuthorizationList{} phase, as it + does for any of the phases; + it is therefore expected; + \item + \numConst{1} follow-up ``computation-row''; + again this is to be expected; + on this row we compute the + \rlp{}-prefix of the \rlp{}-ization of the + \texttt{authority\_list}; + \item + what follows are one or more batches of $\locAuthorizationNumberOfRows$ rows; + every such batch pertains to a given authorization tuple; + such batches should be characterized by a constant + \locAuthorizationIndex{}, and this index should + increment by one at the boundaries of said batches. +\end{itemize} +\label{rlp txn: phase constraints: authorization list: constraints: authorization lists must be nonempty} +The associated values of the \locAuthorizationIndex{} shorthand should look as follows +\[ + 0, 0, ~ + \underbrace{1, ~ \dots{} ~ , 1 } _{\displaystyle \locAuthorizationNumberOfRows \text{ terms}}, \quad + \underbrace{2, ~ \dots{} ~ , 2 } _{\displaystyle \locAuthorizationNumberOfRows \text{ terms}}, \quad \dots \quad, ~ + \underbrace{\ell, ~ \dots{} ~ , \ell } _{\displaystyle \locAuthorizationNumberOfRows \text{ terms}}. +\] +where we denote by $\ell$ the length of the \texttt{authorization\_list} i.e. $\ell \equiv \rlpTxnCommonColumnNumberOfAuthorizations$. + +We achieve this by imposing the following constraints: +\begin{enumerate} + \item\label{rlp txn: phase constraints: authorization list: constraints: setting values for the first few AUTH rows} + \If $\locAuthorizationPrefix _{i} = 1$ \Then + \[ + \left\{ \begin{array}{lclr} + \locAuthorizationIndex _{i - 1} & = & 0 \\ + \locAuthorizationIndex _{i} & = & 0 \\ + \locAuthorizationIndex _{i + 1} & = & 1 \vspace{2mm} \\ + \isCmp _{i + 1} & = & 1 \vspace{2mm} \\ + \phaseAuthorizationList _{i + 1} & = & 1 \\ + \phaseAuthorizationList _{i + 10} & = & 1 \\ + \phaseAuthorizationList _{i + \locAuthorizationNumberOfRows} & = & 1 \\ + \end{array} \right. + \] + \saNote{} + We include ``look ahead checkpoint constraints'' of the form $\phaseAuthorizationList _{i + \relof} \equiv 1$ + in order to prevent premature exits from the present phase. + The above ensures that the present phase lasts at least + $1 + 1 + \locAuthorizationNumberOfRows$ rows. + We will in the end ensure that the present phase lasts + $1 + 1 + \ell \cdot \locAuthorizationNumberOfRows$ rows + where $\ell$ is the length of the \texttt{authorization\_list} in the + current ``set code transaction'' i.e. $\ell \equiv \rlpTxnCommonColumnNumberOfAuthorizations$. + \item\label{rlp txn: phase constraints: authorization list: constraints: monotonicity of tuple index} + \If $\phaseAuthorizationList _{i - 1} = \true$ \Then $\locAuthorizationIndex _{i} \in \{ \locAuthorizationIndex _{i - 1}, 1 + \locAuthorizationIndex _{i - 1} \}$ + \item \If $\locAuthorizationIndex _{i} \neq \rlpTxnCommonColumnNumberOfAuthorizations _{i}$ + \Then + \[ + \left\{ \begin{array}{lcl} + \phaseAuthorizationList _{i + 1} & = & 1 \\ + \isCmp _{i + 1} & = & 1 \vspace{2mm} \\ + \phaseAuthorizationList _{i + \locAuthorizationNumberOfRows} & = & 1 \\ + \isCmp _{i + \locAuthorizationNumberOfRows} & = & 1 \vspace{2mm} \\ + \locAuthorizationIndex _{i + \locAuthorizationNumberOfRows} & = & 1 + \locAuthorizationIndex _{i} \\ + \end{array} \right. + \] + % \begin{enumerate} + % \item + % \If $\locAuthorizationIndex _{i} \neq \locAuthorizationIndex _{i - 1}$ + % \Then $\locAuthorizationIndex _{i + \locAuthorizationNumberOfRows - 1} = \locAuthorizationIndex _{i}$ + % \item + % \If $\locAuthorizationIndex _{i} \neq \rlpTxnCommonColumnNumberOfAuthorizations _{i}$ + % \Then + % \[ + % \left\{ \begin{array}{lcl} + % \locAuthorizationIndex _{i + \locAuthorizationNumberOfRows} & = & 1 + \locAuthorizationIndex _{i} \\ + % \phaseAuthorizationList _{i + \locAuthorizationNumberOfRows} & = & 1 \\ + % \end{array} \right. + % \] + % \end{enumerate} + \saNote{} + The above, along with the constraints setting the initial values for \locAuthorizationIndex{}, + see constraint~(\ref{rlp txn: phase constraints: authorization list: constraints: setting values for the first few AUTH rows}), + the monotonicity constraint for \locAuthorizationIndex{}, + see constraint~(\ref{rlp txn: phase constraints: authorization list: constraints: monotonicity of tuple index}), + enforce that past its two initial values \locAuthorizationIndex{} remains constant for $\locAuthorizationNumberOfRows$ consecutive rows + and then grows by $1$. + In other words we achieve the desired behaviour of + diagram~(\ref{rlp txn: phase constraints: authorization list: constraints: authorization lists must be nonempty}). + \item \If $\phaseAuthorizationList _{i + 1} = \false$ \Then $\locAuthorizationIndex _{i} = \rlpTxnCommonColumnNumberOfAuthorizations _{i}$ + % \item \If $\locAuthorizationFirstRow _{i} = 1$ \Then + % \begin{enumerate} + % \item $\locAuthorizationIndex _{i} = 1 + \locAuthorizationIndex _{i - 1}$ + % \item $\locAuthorizationIndex _{i + \locAuthorizationNumberOfRows - 1} = \locAuthorizationIndex _{i}$ + % \end{enumerate} +\end{enumerate} diff --git a/rlp_txn/phase_constraints/authorization_list/rlp.tex b/rlp_txn/phase_constraints/authorization_list/rlp.tex new file mode 100644 index 00000000..7ade3ef7 --- /dev/null +++ b/rlp_txn/phase_constraints/authorization_list/rlp.tex @@ -0,0 +1,138 @@ +\begin{center} + \boxed{\text{In all this section, it is assumed that } + \phaseAuthorizationList _{i} = \true + } +\end{center} +We now start the \rlp{}-ization related constraints. +\rlp{}-ization involves two different items +\begin{itemize} + \item the \rlp{}-prefix of the full authority list + \[ + \texttt{authority\_list} \equiv \texttt{[authority\_tuple, ...]} + \] + \item the \rlp{}-ization of the individual authority tuples + \[ + \texttt{authority\_tuple} \equiv \texttt{[chain\_id, address, nonce, y\_parity, r, s]} + \] +\end{itemize} +The first $\isCmp$-row of the \phaseAuthorizationList{}-phase is used to compute the \rlp{}-prefix of the full authorization list. +\begin{enumerate}[resume] + \item \If $\locAuthorizationPrefix _{i} = 1$ \Then + \[ + \rlpProcessByteString { + anchorRow = i , + relOffset = 0 , + byteStringLength = \locAuthorizationLengthCountdown , + firstByte = \nothing , + isList = \true , + mustBeNontrivial = \true , + } + \] +\end{enumerate} +And each authorization has the following constraint: +\begin{enumerate}[resume] + \item \If $\locAuthorizationFirstRow _{i} = 1$ \Then + \begin{enumerate} + % \item + % the processing of an authorization tuple happens over $\locAuthorizationNumberOfRows$ rows: + % $\locAuthorizationIndex _{i + \locAuthorizationNumberOfRows - 1} = \locAuthorizationIndex _{i}$ + \item $\locAuthorizationItemCountdown _{i + \locAuthorizationNumberOfRows - 1} = 0$ + \item + we process the \rlp{}-prefix of a new authorization tuple + \[ + \rlpProcessByteString { + anchorRow = i , + relOffset = 0 , + byteStringLength = \locAuthorizationItemCountdown , + firstByte = \nothing , + isList = \true , + mustBeNontrivial = \true , + } + \] + \item + we process the \rlp{}-ization of the authorization tuple's + \loc{chain\_id} + \[ + \rlpProcessInteger { + anchorRow = i , + relOffset = \yellowm{1} , + integerHi = 0 , + integerLo = \locAuthorizationChainId , + endOfPhase = \false , + } + \] + \item + we process the \rlp{}-ization of the authorization tuple's + \loc{address} + \[ + \rlpProcessAddress { + anchorRow = i , + relOffset = \yellowm{4} , + addressHi = \locAuthorizationAddressHi , + addressLo = \locAuthorizationAddressLo , + } + \] + \item + we process the \rlp{}-ization of the authorization tuple's + \loc{nonce} + \[ + \rlpProcessInteger { + anchorRow = i , + relOffset = \yellowm{7} , + integerHi = 0 , + integerLo = \locAuthorizationNonce , + endOfPhase = \false , + } + \] + \item + we process the \rlp{}-ization of the authorization tuple's + \loc{y\_parity} signature component + \[ + \rlpProcessInteger { + anchorRow = i , + relOffset = \yellowm{10} , + integerHi = 0 , + integerLo = \locAuthorizationY , + endOfPhase = \false , + } + \] + \item + we process the \rlp{}-ization of the authorization tuple's + \loc{r} signature component + \[ + \rlpProcessInteger { + anchorRow = i , + relOffset = \yellowm{13} , + integerHi = \locAuthorizationRHi , + integerLo = \locAuthorizationRLo , + endOfPhase = \false , + } + \] + \item + we process the \rlp{}-ization of the authorization tuple's + \loc{s} signature component + \[ + \rlpProcessInteger { + anchorRow = i , + relOffset = \yellowm{16} , + integerHi = \locAuthorizationSHi , + integerLo = \locAuthorizationSLo , + endOfPhase = \locAuthorizationEndOfPhase , + } + \] + \saNote{} + This is also the only point in time when the current phase + may come to a close. + \end{enumerate} + % Finally, if this authorization is not the last, we constrain to start a new one by: + % \begin{enumerate} + % \item + % \If $\rlpTxnCommonColumnNumberOfAuthorizations _{i} \neq \locAuthorizationIndex _{i} + 1 $ + % \Then $\locAuthorizationIndex _{i + \locAuthorizationNumberOfRows } = \locAuthorizationIndex _{i} + 1$ + % \end{enumerate} + \end{enumerate} + And a finalization constraint: + \begin{enumerate}[resume] + \item \If $\phaseEnd _{i} = 1$ \Then $\locAuthorizationLengthCountdown _{i} = 0$ + \end{enumerate} + diff --git a/rlp_txn/phase_constraints/authorization_list/shorthands.tex b/rlp_txn/phase_constraints/authorization_list/shorthands.tex new file mode 100644 index 00000000..e8464e66 --- /dev/null +++ b/rlp_txn/phase_constraints/authorization_list/shorthands.tex @@ -0,0 +1,37 @@ +\begin{center} + \boxed{\text{The following shorthands only make sense provided that $\phaseAuthorizationList _{i} = 1$.}} +\end{center} +We use the following shorthands: +\[ + \left\{ \begin{array}{lcl} + \locAuthorizationPrefix _{i} & \define & \isTxn _{i - 1} \cdot \isCmp _{i} \\ + \locAuthorizationAgainAuthPhase _{i} & \define & \isCmp _{i - 1} \cdot \isCmp _{i} \\ + \locAuthorizationData _{i} & \define & \isCmp _{i} \cdot ( 1 - \isTxn _{i - 1}) \\ + \locAuthorizationFirstRow _{i} & \define & \phaseAuthorizationList _{i - 1} \cdot (\locAuthorizationIndex _{i} - \locAuthorizationIndex_{i - 1}) \\ + \locAuthorizationNotFirstRow _{i} & \define & \locAuthorizationData _{i} \cdot (1 - \locAuthorizationFirstRow) _{i} \\ + \locAuthorizationLengthCountdown _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {1} _{i} \\ + \locAuthorizationItemCountdown _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {2} _{i} \\ + \locAuthorizationIndex _{i} & \define & \rlpTxnComputationColumnCounterConstantAuxiliaryData {1} _{i} \\ + \locAuthorizationChainId _{i} & \define & \rlpTxnComputationColumnCounterConstantAuxiliaryData {2} _{i} \\ + \locAuthorizationAddressHi _{i} & \define & \rlpTxnComputationColumnCounterConstantAuxiliaryData {4} _{i} \\ + \locAuthorizationAddressLo _{i} & \define & \rlpTxnComputationColumnCounterConstantAuxiliaryData {5} _{i} \\ + \locAuthorizationNonce _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {3} _{i} \\ + \locAuthorizationY _{i} & \define & \rlpTxnComputationColumnCounterConstantAuxiliaryData {3} _{i} \\ + \locAuthorizationRHi _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {4} _{i} \\ + \locAuthorizationRLo _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {5} _{i} \\ + \locAuthorizationSHi _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {6} _{i} \\ + \locAuthorizationSLo _{i} & \define & \rlpTxnComputationColumnAuxiliaryData {7} _{i} \\ + \locAuthorizationEndOfPhase _{i} & \define & \locAuthorizationIndex _{i} == \rlpTxnCommonColumnNumberOfAuthorizations _{i} \\ + \end{array} \right. +\] +\saNote{} +None of the above shorthands are required to satisfy counter-constancy conditions. +In the implementation they will be constant along the rows pertaining to a given authorization tuple. + +\saNote{} +The implementation should adopt the following \textbf{equivalent but lower degree} definition: +\[ + \locAuthorizationPrefix _{i} \define \isTxn _{i - 1} +\] +The equivalence of both definitions follows from +constraint~(\ref{rlp txn: generalities: perspectives: every transaction row is followed by a computation row}). diff --git a/rlp_txn/phase_constraints/definition.tex b/rlp_txn/phase_constraints/definition.tex index ac08433d..37035a7f 100644 --- a/rlp_txn/phase_constraints/definition.tex +++ b/rlp_txn/phase_constraints/definition.tex @@ -27,22 +27,24 @@ \renewcommand{\arraystretch}{1.5} \centering \begin{tabular}{|l|l|c|c|c|c|c|c|c|} \hline - \textsc{Phase flag} & \textsc{Description} & \typeZeroTx & \typeOneTx & \typeTwoTx & $\lt$ & $\lx$ \\ \hline \hline - $\phaseRlpPrefix$ & ``Global'' \rlp{} prefix & \gCM & \gCM & \gCM & \texttt{depends} & \texttt{depends} \\ \hline - $\phaseChainId$ & \texttt{chainId} & \rC & \gCM & \gCM & \true & \true \\ \hline - $\phaseNonce$ & \texttt{nonce} & \gCM & \gCM & \gCM & \true & \true \\ \hline - $\phaseGasPrice$ & \texttt{gasPrice} & \gCM & \gCM & \rC & \true & \true \\ \hline - $\phaseMaxPriorityFeePerGas$ & \texttt{maxPriorityFeePerGas} & \rC & \rC & \gCM & \true & \true \\ \hline - $\phaseMaxFeePerGas$ & \texttt{maxFeePerGas} & \rC & \rC & \gCM & \true & \true \\ \hline - $\phaseGasLimit$ & \texttt{gasLimit} & \gCM & \gCM & \gCM & \true & \true \\ \hline - $\phaseTo$ & \texttt{to} & \gCM & \gCM & \gCM & \true & \true \\ \hline - $\phaseValue$ & \texttt{value} & \gCM & \gCM & \gCM & \true & \true \\ \hline - $\phaseData$ & \texttt{data} & \gCM & \gCM & \gCM & \true & \true \\ \hline - $\phaseAccessList$ & \texttt{accessList} & \rC & \gCM & \gCM & \true & \true \\ \hline - $\phaseBeta$ & $\beta$ or w & \gCM & \rC & \rC & \texttt{depends} & \texttt{depends} \\ \hline - $\phaseY$ & \texttt{yParity} & \rC & \gCM & \gCM & \true & \false \\ \hline - $\phaseR$ & \texttt{r} & \gCM & \gCM & \gCM & \true & \false \\ \hline - $\phaseS$ & \texttt{s} & \gCM & \gCM & \gCM & \true & \false \\ \hline + \textsc{Phase flag} & \typeZeroTx & \typeOneTx & \typeTwoTx & \typeFourTx & $\lt$ & $\lx$ \\ \hline + \hline + $\phaseRlpPrefix$ & \gCM & \gCM & \gCM & \gCM & \texttt{depends} & \texttt{depends} \\ \hline + $\phaseChainId$ & \rC & \gCM & \gCM & \gCM & \true & \true \\ \hline + $\phaseNonce$ & \gCM & \gCM & \gCM & \gCM & \true & \true \\ \hline + $\phaseGasPrice$ & \gCM & \gCM & \rC & \rC & \true & \true \\ \hline + $\phaseMaxPriorityFeePerGas$ & \rC & \rC & \gCM & \gCM & \true & \true \\ \hline + $\phaseMaxFeePerGas$ & \rC & \rC & \gCM & \gCM & \true & \true \\ \hline + $\phaseGasLimit$ & \gCM & \gCM & \gCM & \gCM & \true & \true \\ \hline + $\phaseTo$ & \gCM & \gCM & \gCM & \gCM & \true & \true \\ \hline + $\phaseValue$ & \gCM & \gCM & \gCM & \gCM & \true & \true \\ \hline + $\phaseData$ & \gCM & \gCM & \gCM & \gCM & \true & \true \\ \hline + $\phaseAccessList$ & \rC & \gCM & \gCM & \gCM & \true & \true \\ \hline + $\phaseAuthorizationList$ & \rC & \rC & \rC & \gCM & \true & \true \\ \hline + $\phaseBeta$ & \gCM & \rC & \rC & \rC & \texttt{depends} & \texttt{depends} \\ \hline + $\phaseY$ & \rC & \gCM & \gCM & \gCM & \true & \false \\ \hline + $\phaseR$ & \gCM & \gCM & \gCM & \gCM & \true & \false \\ \hline + $\phaseS$ & \gCM & \gCM & \gCM & \gCM & \true & \false \\ \hline \end{tabular} \caption{Phase definition} \label{rlp txn: phase constraints: definitions: table} diff --git a/rlp_txn/phase_constraints/to_address.tex b/rlp_txn/phase_constraints/to_address.tex index dd84cfe0..233759bd 100644 --- a/rlp_txn/phase_constraints/to_address.tex +++ b/rlp_txn/phase_constraints/to_address.tex @@ -19,6 +19,8 @@ \item[\underline{\underline{The deployment transaction case:}}] \If $\locIsDeploymentTransaction = \true$ \Then \begin{description} + \item[\underline{7702-txs can't be deployment:}] + we impose $\typeFourTx_{i} = 0$ \item[\underline{Setting \maxCt{}:}] we impose $\maxCt _{i + 1} = 0$ \quad (\sanityCheck) \item[\underline{Writing the \rlp{} prefix to the \rlp{} string:}] diff --git a/rlp_txn/version.md b/rlp_txn/version.md deleted file mode 100644 index 2b375734..00000000 --- a/rlp_txn/version.md +++ /dev/null @@ -1 +0,0 @@ -previously called `rlp_txn_v2`