fix: do not overwrite comet config when set in InterceptConfigsPreRunHandler (#16395)

This commit is contained in:
Julien Robert
2023-06-01 11:21:28 +00:00
committed by GitHub
parent b54bc7b2d4
commit 0bded0d195
2 changed files with 11 additions and 4 deletions
+10 -4
View File
@@ -247,10 +247,16 @@ func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customCo
return nil, fmt.Errorf("error in config file: %w", err)
}
conf.RPC.PprofListenAddress = "localhost:6060"
conf.P2P.RecvRate = 5120000
conf.P2P.SendRate = 5120000
conf.Consensus.TimeoutCommit = 5 * time.Second
defaultCometCfg := cmtcfg.DefaultConfig()
// The SDK is opinionated about those comet values, so we set them here.
// We verify first that the user has not changed them for not overriding them.
if conf.Consensus.TimeoutCommit == defaultCometCfg.Consensus.TimeoutCommit {
conf.Consensus.TimeoutCommit = 5 * time.Second
}
if conf.RPC.PprofListenAddress == defaultCometCfg.RPC.PprofListenAddress {
conf.RPC.PprofListenAddress = "localhost:6060"
}
cmtcfg.WriteConfigFile(cmtCfgFile, conf)
case err != nil: