Hardcode Domain Version For Compute Domain (#3876)

* hardcode domain version to zeroed byte array

* remove todo

* gazelle
This commit is contained in:
Nishant Das 2019-11-04 07:37:01 +08:00 committed by Preston Van Loon
parent 2b0acffe7f
commit db26c0d012
2 changed files with 2 additions and 6 deletions

View File

@ -9,7 +9,6 @@ go_library(
"//shared/bytesutil:go_default_library",
"//shared/featureconfig:go_default_library",
"//shared/hashutil:go_default_library",
"//shared/params:go_default_library",
"@com_github_karlseguin_ccache//:go_default_library",
"@com_github_kilic_bls12-381//:go_default_library",
"@com_github_pkg_errors//:go_default_library",

View File

@ -11,13 +11,11 @@ import (
"time"
"github.com/karlseguin/ccache"
bls12 "github.com/kilic/bls12-381"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/prysmaticlabs/prysm/shared/hashutil"
"github.com/prysmaticlabs/prysm/shared/params"
bls12 "github.com/kilic/bls12-381"
)
var pubkeyCache = ccache.New(ccache.Configure())
@ -287,8 +285,7 @@ func Domain(domainType []byte, forkVersion []byte) uint64 {
// """
// return Domain(domain_type + fork_version)
func ComputeDomain(domainType []byte) uint64 {
// TODO(#3853): Hardcode the fork version to []byte{0,0,0,0}
return Domain(domainType, params.BeaconConfig().GenesisForkVersion)
return Domain(domainType, []byte{0, 0, 0, 0})
}
// HashWithDomain hashes 32 byte message and uint64 domain parameters a Fp2 element