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

Errata for EIP-1052 empty account #2144

Closed
wants to merge 1 commit into from
Closed

Conversation

sorpaas
Copy link
Contributor

@sorpaas sorpaas commented Jun 24, 2019

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 return 0x0 as well in openethereum/parity-ethereum#10775

Related to test stExtCodeHash/codeCopyZero.

@@ -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.
Copy link

@pepyakin pepyakin Jun 24, 2019

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?

Suggested change
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.

Copy link
Contributor Author

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.

Copy link

@pepyakin pepyakin Jun 25, 2019

Choose a reason for hiding this comment

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

Ah, I see, thanks!

Copy link
Member

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?

Copy link
Member

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)

@axic
Copy link
Member

axic commented Aug 11, 2019

@Arachnid @chfast can you please review and comment? Is this clarification matching how the fork was deployed? Is this clarification useful?

@axic
Copy link
Member

axic commented Nov 1, 2019

@chfast is it clear to merge?

Copy link
Member

@chfast chfast left a 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Member

Choose a reason for hiding this comment

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

@chfast can you approve?

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

Screenshot 2019-11-22 at 22 13 25

It seems @sorpaas has disabled maintainers' access to his fork. Will need to create a new PR.

Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants