-
Notifications
You must be signed in to change notification settings - Fork 5.9k
EIP-2681: Fix CREATE/CREATE2 max nonce error reporting rule #4784
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
Conversation
All tests passed; auto-merging...(pass) eip-2681.md
|
lightclient
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this change. I think creating a new EIP to convey this behavior would be more confusing that simply updating the final EIP.
7f9236e to
4ac570c
Compare
|
I've added a clarification regarding what happens to gas passed to CREATE in case of failure. |
|
@lightclient, @gumb0 applied another clarification, can you please check again? |
MicahZoltu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the code block backticks got lost in the update.
EIPS/eip-2681.md
Outdated
|
|
||
| 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`. | ||
| 2. The CREATE and CREATE2 instructions execution ends with the result `0` pushed on stack, where the account nonce is `2^64-1`. Gas for initcode execution is not deducted in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. The CREATE and CREATE2 instructions execution ends with the result `0` pushed on stack, where the account nonce is `2^64-1`. Gas for initcode execution is not deducted in this case. | |
| 2. The `CREATE` and `CREATE2` instruction's execution ends with the result `0` pushed on stack, where the account nonce is `2^64-1`. Gas for initcode execution is not deducted in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed these, thanks.
Shouldn't it be instructions' (plural) as it's about 2 instructions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, I initially used instructions' in my suggestion by my confidence on when the right time to do that is incredibly low so I went with the "safer" instruction's and hoped no one would notice/correct me. 😬
I think instructions' is correct... if you are confident then lets go with that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. The CREATE and CREATE2 instructions execution ends with the result `0` pushed on stack, where the account nonce is `2^64-1`. Gas for initcode execution is not deducted in this case. | |
| 2. The `CREATE` and `CREATE2` instructions' execution ends with the result `0` pushed on stack, where the account nonce is `2^64-1`. Gas for initcode execution is not deducted in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
4ac570c to
ebbc7cd
Compare
ebbc7cd to
bdf1d74
Compare
Unfortunately we have to update the spec of this retroactive EIP, because there was misunderstanding regarding how CREATE/CREATE2 instructions report nonce overflow error.
It makes much more sense to return 0 rather than abort entire execution in this case, because this is like all other create-specific errors are reported (e.g. insufficient balance for transfer, account already exists, code size above limit, code starts with 0xEF)
And in fact I assumed that 0 result is the expected behavior both in go-ethereum implementation and in tests, and these are already merged and released.
cc @axic @holiman