Skip to content

Commit

Permalink
2681: Clarify that 2^64-1 is invalid as a transaction nonce (ethereum…
Browse files Browse the repository at this point in the history
…#4437)

* 2681: Clarify that 2^64-1 is invalid as a transaction nonce

* Update EIPS/eip-2681.md

Co-authored-by: Andrei Maiboroda <[email protected]>

* Update eip-2681.md

Co-authored-by: Andrei Maiboroda <[email protected]>
  • Loading branch information
2 people authored and PhABC committed Jan 25, 2022
1 parent 3a29aa6 commit 13ecd89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions EIPS/eip-2681.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Lastly, this facilitates a minor optimisation in clients, because the nonce no l

Introduce two new restrictions retroactively from genesis:

1. Consider any transaction invalid, where the nonce exceeds `2^64-1`.
1. Consider any transaction invalid, where the nonce exceeds or equals to `2^64-1`.
2. The `CREATE` and `CREATE2` instructions to abort with an exceptional halt, where the account nonce is `2^64-1`.

## Rationale
Expand All @@ -37,13 +37,15 @@ This mode of replay protection is out of fashion since [EIP-155](./eip-155.md) i

3. Most clients already consider the nonce field to be 64-bit, such as go-ethereum.

4. The reason a transaction with nonce `2^64-1` is invalid, because otherwise after inclusion the sender account's nonce would exceed `2^64-1`.

## Backwards Compatibility

While this is a breaking change, no actual effect should be visible:

1. There is no account in the state currently which would have a nonce exceeding that value. As of November 2020, the account `0xea674fdde714fd979de3edf0f56aa9716b898ec8` is responsible for the highest account nonce at approximately 29 million.

2. go-ethereum already has this restriction in place (`state.Account.Nonce` and `types.txdata.AccountNonce` it as a 64-bit number).
2. go-ethereum already has this restriction partially in place (`state.Account.Nonce` and `types.txdata.AccountNonce` it as a 64-bit number).

## Security Considerations

Expand Down

0 comments on commit 13ecd89

Please sign in to comment.