From 3e6f64894159d2383921dfff1c379d6ffff1256d Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Thu, 19 Sep 2024 21:27:34 -0700 Subject: [PATCH] refactor: config checker one rule was broken due to new semantics of confDepth flag, which can't be negative anymore --- server/config.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/config.go b/server/config.go index a2aa3984..91ec1587 100644 --- a/server/config.go +++ b/server/config.go @@ -246,16 +246,20 @@ func (cfg *Config) Check() error { return fmt.Errorf("max blob length is 0") } - if cfg.SvcManagerAddr != "" && cfg.EthRPC == "" { - return fmt.Errorf("svc manager address is set, but Eth RPC is not set") - } + // memstore not enabled means we use eigenda as a backend, which requires these fields to be set + if !cfg.MemstoreEnabled { + if cfg.ClientConfig.RPC == "" { + return fmt.Errorf("eigenda disperser rpc url is not set") + } - if cfg.EthRPC != "" && cfg.SvcManagerAddr == "" { - return fmt.Errorf("eth rpc is set, but svc manager address is not set") - } + if cfg.EthRPC == "" { + return fmt.Errorf("eth rpc is not set") + } + + if cfg.SvcManagerAddr == "" { + return fmt.Errorf("svc manager address is not set") + } - if cfg.EthConfirmationDepth >= 0 && (cfg.SvcManagerAddr == "" || cfg.EthRPC == "") { - return fmt.Errorf("eth confirmation depth is set for certificate verification, but Eth RPC or SvcManagerAddr is not set") } if cfg.S3Config.S3CredentialType == store.S3CredentialUnknown && cfg.S3Config.Endpoint != "" { @@ -271,10 +275,6 @@ func (cfg *Config) Check() error { return fmt.Errorf("redis password is set, but endpoint is not") } - if !cfg.MemstoreEnabled && cfg.ClientConfig.RPC == "" { - return fmt.Errorf("eigenda disperser rpc url is not set") - } - err = cfg.checkTargets(cfg.FallbackTargets) if err != nil { return err