aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-10-04 23:15:37 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-10-04 23:15:37 +0800
commit89a32451aeb418db3fd5d9c427a0c29fddb1e85b (patch)
tree24df0d470d52030635712364a947bc7a8293d366 /crypto
parent8c63d0d2e44128c6a0f12fb9db8f0a32528b4a7d (diff)
downloaddexon-89a32451aeb418db3fd5d9c427a0c29fddb1e85b.tar.gz
dexon-89a32451aeb418db3fd5d9c427a0c29fddb1e85b.tar.zst
dexon-89a32451aeb418db3fd5d9c427a0c29fddb1e85b.zip
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
Diffstat (limited to 'crypto')
-rw-r--r--crypto/crypto.go6
1 files changed, 3 insertions, 3 deletions
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.