From 89a32451aeb418db3fd5d9c427a0c29fddb1e85b Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 4 Oct 2018 17:15:37 +0200 Subject: core/vm: faster create/create2 (#17806) * core/vm/runtim: benchmark create/create2 * core/vm: do less hashing in CREATE2 * core/vm: avoid storing jumpdest analysis for initcode * core/vm: avoid unneccesary lookups, remove unused fields * core/vm: go formatting tests * core/vm: save jumpdest analysis locally * core/vm: use common.Hash instead of nil, fix review comments * core/vm: removed type destinations * core/vm: correct check for empty hash * eth: more elegant api_tracer * core/vm: address review concerns --- crypto/crypto.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crypto') diff --git a/crypto/crypto.go b/crypto/crypto.go index 3211957e0..9b3e76d40 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -77,9 +77,9 @@ func CreateAddress(b common.Address, nonce uint64) common.Address { } // CreateAddress2 creates an ethereum address given the address bytes, initial -// contract code and a salt. -func CreateAddress2(b common.Address, salt [32]byte, code []byte) common.Address { - return common.BytesToAddress(Keccak256([]byte{0xff}, b.Bytes(), salt[:], Keccak256(code))[12:]) +// contract code hash and a salt. +func CreateAddress2(b common.Address, salt [32]byte, inithash []byte) common.Address { + return common.BytesToAddress(Keccak256([]byte{0xff}, b.Bytes(), salt[:], inithash)[12:]) } // ToECDSA creates a private key with the given D value. -- cgit