-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Errata for EIP-1052 empty account #2144
Conversation
@@ -24,7 +24,7 @@ takes one argument from the stack, zeros the first 96 bits | |||
and pushes to the stack the keccak256 hash of the code of the account | |||
at the address being the remaining 160 bits. | |||
|
|||
In case the account does not exist `0` is pushed to the stack. | |||
In case the account does not exist or is empty `0` is pushed to the stack. |
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.
Did you mean it's bytecode empty or is there another notion of emptyness?
In case the account does not exist or is empty `0` is pushed to the stack. | |
In case the account does not exist or the bytecode is empty `0` is pushed to the stack. |
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.
We’re using EIP-161’s definition of “empty” here — having no nonce, balance or code.
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.
Ah, I see, thanks!
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.
Shouldn't it note as a comment that EIP-161's definition is used?
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.
Yes, I'd like to have this comment as well. Something like
or is empty (as defined by EIP-161)
@chfast is it clear to merge? |
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.
Sorry for long wait. I planned to add more tests for this case.
@@ -24,7 +24,7 @@ takes one argument from the stack, zeros the first 96 bits | |||
and pushes to the stack the keccak256 hash of the code of the account | |||
at the address being the remaining 160 bits. | |||
|
|||
In case the account does not exist `0` is pushed to the stack. | |||
In case the account does not exist or is empty `0` is pushed to the stack. |
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.
In case the account does not exist or is empty `0` is pushed to the stack. | |
In case the account does not exist or is empty (as defined by [EIP-161](https://eips.ethereum.org/EIPS/eip-161)) `0` is pushed to the stack. |
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.
@chfast can you approve?
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.
👍
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.
It seems @sorpaas has disabled maintainers' access to his fork. Will need to create a new PR.
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.
Done in #2388.
@@ -24,7 +24,7 @@ takes one argument from the stack, zeros the first 96 bits | |||
and pushes to the stack the keccak256 hash of the code of the account | |||
at the address being the remaining 160 bits. | |||
|
|||
In case the account does not exist `0` is pushed to the stack. | |||
In case the account does not exist or is empty `0` is pushed to the stack. |
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.
👍
Errata to clarify EIP-1052's behavior in case it meets with EIP-161's empty account. Geth/Aleth is having this behavior already. Parity previously will return
keccak([])
for empty accounts, and now changed to return0x0
as well in openethereum/parity-ethereum#10775Related to test
stExtCodeHash/codeCopyZero
.