Limit account nonce to be between
This is motivated by Eth1.x / Stateless Ethereum discussions, more specifically discussion around the “witness format”. Introducing a restriction would allow storing the nonce in a more optimised way.
Additionally it could prove beneficial to transaction formats, where some improvements are potentially sought by at least three other proposals.
Lastly this facilitates a minor optimisation in clients, because the nonce no longer needs to be kept as a 256-bit number.
block.number >= FORK_BLOCK introduce two new restrictions:
- Consider any transaction invalid, where the nonce exceeds
CREATEinstruction to abort with an exceptional halt, where the account nonce is
It is unlikely for any nonce to reach or exceed the proposed limit. If one would want to reach that limit via external transactions, it would cost at least
21000 * (2^64-1) = 387_381_625_547_900_583_915_000gas.
It must be noted that in the past, in the Morden testnet, each new account had a starting nonce of
2^20in order to differentiate transactions from mainnet transactions. This mode of replay protection is out of fashion since EIP-155 introduced a more elegant way using chain identifiers.
Most clients already consider the nonce field to be 64-bit, such as go-ethereum.
While this is a breaking change, no actual effect should be visible:
There is no account in the state currently which would have a nonce exceeding that value. Need to double check, but would be very surprised.
go-ethereum already has this restriction in place (
types.txdata.AccountNonceit as a 64-bit number).
Copyright and related rights waived via CC0.
Please cite this document as:
Alex Beregszaszi, "EIP-2681: Limit account nonce to 2^64-1 [DRAFT]," Ethereum Improvement Proposals, no. 2681, April 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2681.