Skip to content

Commit

Permalink
fix(config): ignore abci section on seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed May 9, 2024
1 parent e358a1c commit df033d9
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,29 +134,36 @@ func (cfg *Config) SetRoot(root string) *Config {
// ValidateBasic performs basic validation (checking param bounds, etc.) and
// returns an error if any check fails.
func (cfg *Config) ValidateBasic() error {
var errs error

if err := cfg.Abci.ValidateBasic(); err != nil {
return fmt.Errorf("error in [abci] section: %w", err)
}
if err := cfg.BaseConfig.ValidateBasic(); err != nil {
return err
errs = multierror.Append(errs, err)
}

// ignore [abci] section on seed nodes
if cfg.Mode != ModeSeed {
if err := cfg.Abci.ValidateBasic(); err != nil {
errs = multierror.Append(errs, fmt.Errorf("error in [abci] section: %w", err))
}
}

if err := cfg.RPC.ValidateBasic(); err != nil {
return fmt.Errorf("error in [rpc] section: %w", err)
errs = multierror.Append(errs, fmt.Errorf("error in [rpc] section: %w", err))
}
if err := cfg.Mempool.ValidateBasic(); err != nil {
return fmt.Errorf("error in [mempool] section: %w", err)
errs = multierror.Append(errs, fmt.Errorf("error in [mempool] section: %w", err))
}
if err := cfg.StateSync.ValidateBasic(); err != nil {
return fmt.Errorf("error in [statesync] section: %w", err)
errs = multierror.Append(errs, fmt.Errorf("error in [statesync] section: %w", err))
}
if err := cfg.Consensus.ValidateBasic(); err != nil {
return fmt.Errorf("error in [consensus] section: %w", err)
errs = multierror.Append(errs, fmt.Errorf("error in [consensus] section: %w", err))
}
if err := cfg.Instrumentation.ValidateBasic(); err != nil {
return fmt.Errorf("error in [instrumentation] section: %w", err)
errs = multierror.Append(errs, fmt.Errorf("error in [instrumentation] section: %w", err))
}
return nil

return errs
}

func (cfg *Config) DeprecatedFieldWarning() error {
Expand Down

0 comments on commit df033d9

Please sign in to comment.