mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 07:58:22 -05:00
Fix Withdrawal Credentials (#3517)
This commit is contained in:
committed by
terence tsao
parent
037c01f4d7
commit
d9664d3b6b
@@ -113,6 +113,6 @@ func createDepositData(privKey *bls.SecretKey, pubKey *bls.PublicKey) (*ethpb.De
|
||||
// withdrawal_credentials[1:] == hash(withdrawal_pubkey)[1:]
|
||||
// where withdrawal_credentials is of type bytes32.
|
||||
func withdrawalCredentialsHash(pubKey []byte) []byte {
|
||||
h := hashutil.HashKeccak256(pubKey)
|
||||
return append([]byte{blsWithdrawalPrefixByte}, h[0:]...)[:32]
|
||||
h := hashutil.Hash(pubKey)
|
||||
return append([]byte{blsWithdrawalPrefixByte}, h[1:]...)[:32]
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ go_library(
|
||||
deps = [
|
||||
"//proto/eth/v1alpha1:go_default_library",
|
||||
"//shared/bls:go_default_library",
|
||||
"//shared/hashutil:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"@com_github_minio_sha256_simd//:go_default_library",
|
||||
"@com_github_pborman_uuid//:go_default_library",
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"github.com/prysmaticlabs/go-ssz"
|
||||
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/shared/bls"
|
||||
"github.com/prysmaticlabs/prysm/shared/hashutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
)
|
||||
|
||||
@@ -47,6 +48,6 @@ func DepositInput(depositKey *Key, withdrawalKey *Key, amountInGwei uint64) (*et
|
||||
// withdrawal_credentials[1:] == hash(withdrawal_pubkey)[1:]
|
||||
// where withdrawal_credentials is of type bytes32.
|
||||
func withdrawalCredentialsHash(withdrawalKey *Key) []byte {
|
||||
h := Keccak256(withdrawalKey.PublicKey.Marshal())
|
||||
return append([]byte{params.BeaconConfig().BLSWithdrawalPrefixByte}, h[0:]...)[:32]
|
||||
h := hashutil.Hash(withdrawalKey.PublicKey.Marshal())
|
||||
return append([]byte{params.BeaconConfig().BLSWithdrawalPrefixByte}, h[1:]...)[:32]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user