diff --git a/cmd/zetaclientd/init.go b/cmd/zetaclientd/init.go index 97cdf9e36a..d48722ee52 100644 --- a/cmd/zetaclientd/init.go +++ b/cmd/zetaclientd/init.go @@ -32,6 +32,7 @@ type initArguments struct { p2pDiagnostic bool p2pDiagnosticTicker uint64 TssPath string + TestTssKeysign bool } func init() { @@ -52,6 +53,8 @@ func init() { InitCmd.Flags().Uint64Var(&initArgs.p2pDiagnosticTicker, "p2p-diagnostic-ticker", 30, "p2p diagnostic ticker (default: 0 means no ticker)") InitCmd.Flags().Uint64Var(&initArgs.configUpdateTicker, "config-update-ticker", 6, "config update ticker (default: 0 means no ticker)") InitCmd.Flags().StringVar(&initArgs.TssPath, "tss-path", "~/.tss", "path to tss location") + InitCmd.Flags().BoolVar(&initArgs.TestTssKeysign, "test-tss", false, "set to to true to run a check for TSS keysign on startup") + } func Initialize(_ *cobra.Command, _ []string) error { diff --git a/cmd/zetaclientd/keygen_tss.go b/cmd/zetaclientd/keygen_tss.go index 445cc5a0d2..a4ac22fe88 100644 --- a/cmd/zetaclientd/keygen_tss.go +++ b/cmd/zetaclientd/keygen_tss.go @@ -39,6 +39,7 @@ func GenerateTss(logger zerolog.Logger, cfg *config.Config, zetaBridge *mc.ZetaC // If keygen is unsuccessful , it will reset the triedKeygenAtBlock flag and try again at a new keygen block. if cfg.Keygen.Status == crosschaintypes.KeygenStatus_KeyGenSuccess { + cfg.TestTssKeysign = true return tss, nil } // Arrive at this stage only if keygen is unsuccessfully reported by every node . This will reset the flag and to try again at a new keygen block diff --git a/cmd/zetaclientd/start.go b/cmd/zetaclientd/start.go index f81fd14008..2e3ac21ede 100644 --- a/cmd/zetaclientd/start.go +++ b/cmd/zetaclientd/start.go @@ -120,9 +120,11 @@ func start(_ *cobra.Command, _ []string) error { if err != nil { return err } - err = TestTSS(tss, masterLogger) - if err != nil { - startLogger.Error().Err(err).Msg("TestTSS error") + if cfg.TestTssKeysign { + err = TestTSS(tss, masterLogger) + if err != nil { + startLogger.Error().Err(err).Msg("TestTSS error") + } } startLogger.Info().Msgf("TSS address \n ETH : %s \n BTC : %s \n PubKey : %s ", tss.EVMAddress(), tss.BTCAddress(), tss.CurrentPubkey) diff --git a/zetaclient/config/types.go b/zetaclient/config/types.go index 937e839a72..9b05f8262a 100644 --- a/zetaclient/config/types.go +++ b/zetaclient/config/types.go @@ -82,6 +82,7 @@ type Config struct { ConfigUpdateTicker uint64 P2PDiagnosticTicker uint64 TssPath string + TestTssKeysign bool } func (c Config) GetAuthzHotkey() string {