mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 04:00:05 +00:00
Recompute SqrRootSlotsPerEpoch at startup for custom configs (#9554)
* Recompute SqrRootSlotsPerEpoch at startup for custom configs * Fix bazel deps Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
This commit is contained in:
parent
a6abfa5dd8
commit
5325558f03
@ -21,6 +21,7 @@ go_library(
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//shared/bytesutil:go_default_library",
|
||||
"//shared/mathutil:go_default_library",
|
||||
"@com_github_ethereum_go_ethereum//params:go_default_library",
|
||||
"@com_github_mohae_deepcopy//:go_default_library",
|
||||
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
|
||||
|
@ -5,6 +5,8 @@ import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
types "github.com/prysmaticlabs/eth2-types"
|
||||
"github.com/prysmaticlabs/prysm/shared/mathutil"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
@ -42,6 +44,8 @@ func LoadChainConfigFile(chainConfigFileName string) {
|
||||
log.WithError(err).Error("There were some issues parsing the config from a yaml file")
|
||||
}
|
||||
}
|
||||
// recompute SqrRootSlotsPerEpoch constant to handle non-standard values of SlotsPerEpoch
|
||||
conf.SqrRootSlotsPerEpoch = types.Slot(mathutil.IntegerSquareRoot(uint64(conf.SlotsPerEpoch)))
|
||||
log.Debugf("Config file values: %+v", conf)
|
||||
OverrideBeaconConfig(conf)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user