Skip to content

Commit bc64213

Browse files
committed
Implement EIP-2681: Limit account nonce to 2^64-1
1 parent fcf1d13 commit bc64213

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Biblio.bib

+8
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ @Misc{EIP-2929
170170
month = "September",
171171
}
172172

173+
@Misc{EIP-2681,
174+
url = "https://eips.ethereum.org/EIPS/eip-2681",
175+
author = "Alex Beregszaszi",
176+
title = "{EIP}-2681: Limit account nonce to $2^64-1$",
177+
year = "2020",
178+
month = "April",
179+
}
180+
173181
@Misc{EIP-3554,
174182
url = "https://eips.ethereum.org/EIPS/eip-3554",
175183
title = "{EIP}-3554: Difficulty Bomb Delay to {December} 2021",

Paper.tex

+3-2
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ \subsection{World State} \label{ch:state}
247247
The account state, $\boldsymbol{\sigma}[a]$, comprises the following four fields:
248248

249249
\begin{description}
250-
\item[nonce] \linkdest{account_nonce}A scalar value equal to the number of transactions sent from this address or, in the case of accounts with associated code, the number of contract-creations made by this account. For account of address $a$ in state $\boldsymbol{\sigma}$, this would be formally denoted $\boldsymbol{\sigma}[a]_{\mathrm{n}}$.
250+
\item[nonce] \linkdest{account_nonce}A 64-bit scalar value equal to the number of transactions sent from this address or, in the case of accounts with associated code, the number of contract-creations made by this account. For account of address $a$ in state $\boldsymbol{\sigma}$, this would be formally denoted $\boldsymbol{\sigma}[a]_{\mathrm{n}}$.
251251
\item[balance] A scalar value equal to the number of Wei owned by this address. Formally denoted $\boldsymbol{\sigma}[a]_{\mathrm{b}}$.
252252
\item[storageRoot] A 256-bit hash of the root node of a Merkle Patricia tree that encodes the storage contents of the account (a mapping between 256-bit integer values), encoded into the trie as a mapping from the Keccak 256-bit hash of the 256-bit integer keys to the RLP-encoded 256-bit integer values. The hash is formally denoted $\boldsymbol{\sigma}[a]_{\mathrm{s}}$.
253253
\item[codeHash] The hash of the EVM code of this account---this is the code that gets executed should this address receive a message call; it is immutable and thus, unlike all other fields, cannot be changed after construction. All such code fragments are contained in the state database under their corresponding hashes for later retrieval. This hash is formally denoted $\boldsymbol{\sigma}[a]_{\mathrm{c}}$, and thus the code may be denoted as $\mathbf{b}$, given that $\texttt{KEC}(\mathbf{b}) = \boldsymbol{\sigma}[a]_{\mathrm{c}}$.
@@ -306,7 +306,7 @@ \subsection{The Transaction} \label{subsec:transaction}
306306
A transaction (formally, $T$) is a single cryptographically-signed instruction constructed by an actor externally to the scope of Ethereum. The sender of a transaction can not be a contract. While it is assumed that the ultimate external actor will be human in nature, software tools will be used in its construction and dissemination\footnote{Notably, such `tools' could ultimately become so causally removed from their human-based initiation---or humans may become so causally-neutral---that there could be a point at which they rightly be considered autonomous agents. \eg contracts may offer bounties to humans for being sent transactions to initiate their execution.}. There are two types of transactions: those which result in message calls and those which result in the creation of new accounts with associated code (known informally as `contract creation'). Both types specify a number of common fields:
307307

308308
\begin{description}
309-
\item[nonce]\linkdest{tx_nonce}{} A scalar value equal to the number of transactions sent by the sender; formally $T_{\mathrm{n}}$.
309+
\item[nonce]\linkdest{tx_nonce}{} A 64-bit scalar value equal to the number of transactions sent by the sender; formally $T_{\mathrm{n}}$.
310310
\item[gasPrice]\linkdest{tx_gas_price_T__p}{} A scalar value equal to the number of Wei to be paid per unit of \textit{gas} for all computation costs incurred as a result of the execution of this transaction; formally $T_{\mathrm{p}}$.
311311
\item[gasLimit]\linkdest{tx_gas_limit_T__g}{} A scalar value equal to the maximum amount of gas that should be used in executing this transaction. This is paid up-front, before any computation is done and may not be increased later; formally $T_{\mathrm{g}}$.
312312
\item[to]\linkdest{tx_to_address_T__t}{} The 160-bit address of the message call's recipient or, for a contract creation transaction, $\varnothing$, used here to denote the only member of $\mathbb{B}_0$ ; formally $T_{\mathrm{t}}$.
@@ -606,6 +606,7 @@ \section{Transaction Execution} \label{ch:transactions}
606606
\begin{enumerate}
607607
\item The transaction is well-formed RLP, with no additional trailing bytes;
608608
\item the transaction signature is valid;
609+
\item the \hyperlink{transaction_nonce}{transaction nonce} does not equal or exceed $2^64-1$ (see EIP-2681 by \cite{EIP-2681});
609610
\item the \hyperlink{transaction_nonce}{transaction nonce} is valid (equivalent to the \hyperlink{account_nonce}{sender account's current nonce});
610611
\item the sender account has no contract code deployed (see EIP-3607 by \cite{EIP-3607});
611612
\item the gas limit is no smaller than the intrinsic gas, $g_0$, used by the transaction; and

0 commit comments

Comments
 (0)