Skip to content

Commit 6fb2bf5

Browse files
EIP-3651 Arithmetization: warm coinbase (#143)
Signed-off-by: F Bojarski <[email protected]>
1 parent eeeecbe commit 6fb2bf5

File tree

8 files changed

+51
-19
lines changed

8 files changed

+51
-19
lines changed

hub/tx_init/_local.tex

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616

1717
\def\locTxInitRoffMisc {\yellowm{0}}
1818
\def\locTxInitRoffTxn {\yellowm{1}}
19-
\def\locTxInitRoffAccDoingSndPayGas {\yellowm{2}}
20-
\def\locTxInitRoffAccDoingSenderValueTransfer {\yellowm{3}}
21-
\def\locTxInitRoffAccDoingRecipientValueReception {\yellowm{4}}
19+
\def\locTxInitWarmCoinbase {\yellowm{2}}
20+
\def\locTxInitRoffAccDoingSndPayGas {\yellowm{3}}
21+
\def\locTxInitRoffAccDoingSenderValueTransfer {\yellowm{4}}
22+
\def\locTxInitRoffAccDoingRecipientValueReception {\yellowm{5}}
2223
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23-
\def\locTxInitRoffConUnexceptionalContextRowOffset {\orangem{5}}
24-
\def\locTxInitRoffUnexceptionalFirstExecutionRow {\greenm {6}}
24+
\def\locTxInitRoffConUnexceptionalContextRowOffset {\orangem{6}}
25+
\def\locTxInitRoffUnexceptionalFirstExecutionRow {\greenm {7}}
2526
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26-
\def\locTxInitRoffAccUndoingSenderValueTransfer {\yellowm{5}}
27-
\def\locTxInitRoffAccUndoingRecipientValueReception {\yellowm{6}}
28-
\def\locTxInitRoffConExceptionalContextRowOffset {\orangem{7}}
29-
\def\locTxInitRoffExceptionalFirstExecutionRow {\greenm {8}}
27+
\def\locTxInitRoffAccUndoingSenderValueTransfer {\yellowm{6}}
28+
\def\locTxInitRoffAccUndoingRecipientValueReception {\yellowm{7}}
29+
\def\locTxInitRoffConExceptionalContextRowOffset {\orangem{8}}
30+
\def\locTxInitRoffExceptionalFirstExecutionRow {\greenm {9}}
3031

31-
\def\nsrTxInitWillRevert {\greenm{8}}
32-
\def\nsrTxInitWontRevert {\greenm{6}}
32+
\def\nsrTxInitWillRevert {\greenm{9}}
33+
\def\nsrTxInitWontRevert {\greenm{7}}

hub/tx_init/peeking.tex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
\begin{enumerate}
77
\item
88
\label{hub: initialization phase: the first rows are misc and transaction rows}
9-
$\peekMisc _{i + \locTxInitRoffMisc} + \peekTransaction _{i + \locTxInitRoffTxn} = 2$
9+
$\peekMisc _{i + \locTxInitRoffMisc} + \peekTransaction _{i + \locTxInitRoffTxn} + \peekAccount _{i + \locTxInitWarmCoinbase} = 3$
1010
\end{enumerate}
1111
Given peeking flag exclusivity,
1212
see section~(\ref{hub: heartbeat: peeking flag exclusivity}),
1313
the above translates precisely to
1414
\begin{enumerate}[resume]
15-
\item $\peekMisc _{i + \locTxInitRoffMisc} = 1$ ~ (\trash)
16-
\item $\peekTransaction _{i + \locTxInitRoffTxn} = 1$ ~ (\trash)
15+
\item $\peekMisc _{i + \locTxInitRoffMisc} = 1$ ~ (\trash)
16+
\item $\peekTransaction _{i + \locTxInitRoffTxn} = 1$ ~ (\trash)
17+
\item $\peekAccount _{i + \locTxInitWarmCoinbase} = 1$ ~ (\trash)
1718
\end{enumerate}
18-
This way the first row of the initialization phase is necessarily an miscellaneous-row and the next one a transaction row.
1919
\begin{enumerate}[resume]
2020
\item \If $\locTransactionWillRevert = 1$ \Then
2121
\begin{enumerate}
@@ -31,6 +31,7 @@
3131
\left[ \begin{array}{cl}
3232
+ & \peekMisc _{i + \locTxInitRoffMisc } \\
3333
+ & \peekTransaction _{i + \locTxInitRoffTxn } \\
34+
+ & \peekAccount _{i + \locTxInitWarmCoinbase } \\
3435
+ & \peekAccount _{i + \locTxInitRoffAccDoingSndPayGas } \\
3536
+ & \peekAccount _{i + \locTxInitRoffAccDoingSenderValueTransfer } \\
3637
+ & \peekAccount _{i + \locTxInitRoffAccDoingRecipientValueReception } \\
@@ -55,6 +56,7 @@
5556
\left[ \begin{array}{cl}
5657
+ & \peekMisc _{i + \locTxInitRoffMisc } \\
5758
+ & \peekTransaction _{i + \locTxInitRoffTxn } \\
59+
+ & \peekAccount _{i + \locTxInitWarmCoinbase } \\
5860
+ & \peekAccount _{i + \locTxInitRoffAccDoingSndPayGas } \\
5961
+ & \peekAccount _{i + \locTxInitRoffAccDoingSenderValueTransfer } \\
6062
+ & \peekAccount _{i + \locTxInitRoffAccDoingRecipientValueReception } \\

hub/tx_init/rows/_collage.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
\input{tx_init/rows/misc}
88
\item[\underline{\underline{Transaction-row n$^°~(\bm{i + \locTxInitRoffTxn})$:}}]
99
\input{tx_init/rows/txn}
10+
\item[\underline{\underline{Coinbase-row n$^°~(\bm{i + \locTxInitWarmCoinbase})$:}}]
11+
\input{tx_init/rows/acc_coinbase_warm}
1012
\item[\underline{\underline{Sender account-row n$\bm{(i + \locTxInitRoffAccDoingSndPayGas)}$:}}]
1113
\input{tx_init/rows/acc_sender_gas}
1214
\item[\underline{\underline{Sender account-row n$\bm{(i + \locTxInitRoffAccDoingSenderValueTransfer)}$:}}]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
In accordance with \cite{EIP-3651}, the purpose of the current row is to prewarm the coinbase address:
2+
\[
3+
\left\{ \begin{array}{lclr}
4+
\accAddress \high _{i + \locTxInitWarmCoinbase} & = & \locTxInitCoinbaseAddressHi \\
5+
\accAddress \low _{i + \locTxInitWarmCoinbase} & = & \locTxInitCoinbaseAddressLo \\
6+
\multicolumn{4}{l}{
7+
\accTrimAddress
8+
{i}{\locTxInitWarmCoinbase}
9+
{\locTxInitCoinbaseAddressHi}
10+
{\locTxInitCoinbaseAddressLo}} \vspace{2mm} \\
11+
\multicolumn{3}{l}{\accSameBalance {i}{\locTxInitWarmCoinbase}} \\
12+
\multicolumn{3}{l}{\accSameNonce {i}{\locTxInitWarmCoinbase}} \\
13+
\multicolumn{3}{l}{\accSameCode {i}{\locTxInitWarmCoinbase}} \\
14+
\multicolumn{3}{l}{\accSameDeployment {i}{\locTxInitWarmCoinbase}} \\
15+
\multicolumn{3}{l}{\accTurnOnWarmth {i}{\locTxInitWarmCoinbase}} \\
16+
\multicolumn{3}{l}{\accSameMarkedForSelfdestructFlag {i}{\locTxInitWarmCoinbase}} \\
17+
% \multicolumn{3}{l}{\accIsntPrecompile {i}{\locTxInitWarmCoinbase}} \\
18+
\multicolumn{3}{l}{
19+
\standardDomSubStamps {
20+
anchorRow = i ,
21+
relOffset = \locTxInitWarmCoinbase ,
22+
domOffset = 0 ,
23+
}
24+
} \\
25+
\end{array} \right.
26+
\]

hub/tx_init/rows/acc_recipient_value.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
\standardDomSubStamps {
2121
anchorRow = i ,
2222
relOffset = \locTxInitRoffAccDoingRecipientValueReception ,
23-
domOffset = 2 ,
23+
domOffset = 3 ,
2424
}
2525
} \\
2626
\end{array} \right.

hub/tx_init/rows/acc_sender_gas.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
\standardDomSubStamps {
2020
anchorRow = i ,
2121
relOffset = \locTxInitRoffAccDoingSndPayGas ,
22-
domOffset = 0 ,
22+
domOffset = 1 ,
2323
}
2424
} \\
2525
\end{array} \right.

hub/tx_init/rows/acc_sender_value.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
\standardDomSubStamps {
1414
anchorRow = i ,
1515
relOffset = \locTxInitRoffAccDoingSenderValueTransfer ,
16-
domOffset = 1 ,
16+
domOffset = 2 ,
1717
}
1818
} \\
1919
\end{array} \right.

hub/tx_init/shorthands.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
\locTxInitIsDeployment & \define & \txIsDeployment _{i + \locTxInitRoffTxn} \\
1616
\locTxInitIsMessageCall & \define & 1 - \txIsDeployment _{i + \locTxInitRoffTxn} \\
1717
\locTxInitGasCost & \define & \txGasPrice _{i + \locTxInitRoffTxn} \cdot \txGasLimit _{i + \locTxInitRoffTxn} \\
18-
\locTxInitValue & \define & \txValue _{i + \locTxInitRoffTxn} \\
18+
\locTxInitCoinbaseAddressHi & \define & \txCoinbase\high _{i + \locTxInitRoffTxn} \\
19+
\locTxInitCoinbaseAddressLo & \define & \txCoinbase\low _{i + \locTxInitRoffTxn} \\
1920
\end{array} \right.
2021
\]

0 commit comments

Comments
 (0)