Skip to content

Commit

Permalink
fix(cmd/cfg): Use Babe Lead value from toml config (ChainSafe#2032)
Browse files Browse the repository at this point in the history
Earlier, babe lead value was read only from "babe-lead" cli flag.
cfg.BABELead was being set to false in case this flag was not provided.

This commit sets cfg.BABELead from toml config and uses "babe-lead" cli
flag only when it is set.
  • Loading branch information
kishansagathiya committed Nov 15, 2021
1 parent 84883c6 commit 06aa3e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/gossamer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,11 @@ func setDotCoreConfig(ctx *cli.Context, tomlCfg ctoml.CoreConfig, cfg *dot.CoreC
cfg.BabeAuthority = tomlCfg.Roles == types.AuthorityRole
cfg.GrandpaAuthority = tomlCfg.Roles == types.AuthorityRole
cfg.GrandpaInterval = time.Second * time.Duration(tomlCfg.GrandpaInterval)
cfg.BABELead = ctx.GlobalBool(BABELeadFlag.Name)

cfg.BABELead = tomlCfg.BABELead
if ctx.IsSet(BABELeadFlag.Name) {
cfg.BABELead = ctx.GlobalBool(BABELeadFlag.Name)
}

// check --roles flag and update node configuration
if roles := ctx.GlobalString(RolesFlag.Name); roles != "" {
Expand Down
1 change: 1 addition & 0 deletions dot/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ func DevConfig() *Config {
BabeAuthority: dev.DefaultBabeAuthority,
GrandpaAuthority: dev.DefaultGrandpaAuthority,
WasmInterpreter: dev.DefaultWasmInterpreter,
BABELead: dev.DefaultBabeAuthority,
},
Network: NetworkConfig{
Port: dev.DefaultNetworkPort,
Expand Down

0 comments on commit 06aa3e3

Please sign in to comment.