Skip to content

Commit d053f8b

Browse files
veoxcburgdorf
authored andcommitted
eth/vm/logic/system: fix CREATE2 failures on BadOpcode test fixture.
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).
1 parent fdf04a7 commit d053f8b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eth/vm/logic/system.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,14 @@ def get_stack_data(self, computation: BaseComputation) -> CreateOpcodeStackData:
227227
return CreateOpcodeStackData(endowment, memory_start, memory_length, salt)
228228

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

232232
def generate_contract_address(self,
233233
stack_data: CreateOpcodeStackData,
234234
call_data: bytes,
235235
computation: BaseComputation) -> Address:
236236

237+
computation.state.account_db.increment_nonce(computation.msg.storage_address)
237238
return generate_safe_contract_address(
238239
computation.msg.storage_address,
239240
stack_data.salt,

0 commit comments

Comments
 (0)