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
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
3 changes: 2 additions & 1 deletion eth/vm/logic/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,14 @@ def get_stack_data(self, computation: BaseComputation) -> CreateOpcodeStackData:
return CreateOpcodeStackData(endowment, memory_start, memory_length, salt)

def get_gas_cost(self, data: CreateOpcodeStackData) -> int:
return constants.GAS_SHA3WORD * ceil32(data.memory_length) // 32
return constants.GAS_CREATE + constants.GAS_SHA3WORD * ceil32(data.memory_length) // 32

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.

return generate_safe_contract_address(
computation.msg.storage_address,
stack_data.salt,
Expand Down