Skip to content

eth/vm/logic/system: fix CREATE2 failures on BadOpcode test fixture #1560

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

Merged
merged 1 commit into from
Dec 8, 2018

Conversation

veox
Copy link
Contributor

@veox veox commented Dec 7, 2018

What was wrong?

CREATE2 does not match the spec, EIP-1014.

PR #1181 was therefore failing fixtures.

How was it fixed?

Use missing gas amount of 32000 (as CREATE does); increment nonce.

Cute Animal Picture

put a cute animal picture link inside the parentheses

Source: unknown; found here

2 COMMITS SQUASHED:

eth/vm/logic/system: CREATE2 consumes the fixed 32000 gas that CREATE does.

For reference, EIP-1014:

https://eips.ethereum.org/EIPS/eip-1014

eth/vm/logic/system: increment nonce in CREATE2 (was missing).
Copy link
Contributor

@cburgdorf cburgdorf left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for helping to debug this 🙏


def generate_contract_address(self,
stack_data: CreateOpcodeStackData,
call_data: bytes,
computation: BaseComputation) -> Address:

computation.state.account_db.increment_nonce(computation.msg.storage_address)
Copy link
Contributor

Choose a reason for hiding this comment

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

You are the man! 👍 I must have missed that detail in the spec. Thanks for helping out with this 🙏

Copy link
Contributor Author

@veox veox Dec 8, 2018

Choose a reason for hiding this comment

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

Heh. Sorry for making so much noise out of one missing line. ^_^


BTW, the detail is only implicit in the "Behaves identically to CREATE", so easy to skip.

@cburgdorf cburgdorf merged commit d053f8b into ethereum:master Dec 8, 2018
@veox veox deleted the fix-create2 branch October 4, 2019 12:53
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.

2 participants