Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Nov 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a normative change, which makes me fairly uncomfortable making it as an edit to a final EIP. One could create a new EIP that adds 2^64-1 to the set of allowed nonces, but policy is that final EIPs can have non-normative changes only.

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