From cf81f291df0b2357c2dbf5686d920829544d711f Mon Sep 17 00:00:00 2001 From: chengzhinei Date: Sun, 27 Nov 2022 22:09:34 +0800 Subject: [PATCH] Merge PR: fix config of timeout_commit (#2806) * fix config of timeout_commit * fix config fmt * add db_backend * add pendingPool=false * del setEnv rocksdb * unify timeout_commit define in one place * testnet.sh * add log * add log Co-authored-by: xiangjianmeng <805442788@qq.com> --- app/node_mode.go | 6 ++++-- cmd/exchaind/main.go | 1 + libs/tendermint/config/config.go | 2 +- libs/tendermint/types/params.go | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/node_mode.go b/app/node_mode.go index 61ad5ca63f..5b6a07f0c8 100644 --- a/app/node_mode.go +++ b/app/node_mode.go @@ -78,11 +78,13 @@ func setValidatorConfig(ctx *server.Context) { viper.SetDefault(evmtypes.FlagEnableBloomFilter, false) viper.SetDefault(watcher.FlagFastQuery, false) viper.SetDefault(appconfig.FlagMaxGasUsedPerBlock, 120000000) + viper.SetDefault(mempool.FlagEnablePendingPool, false) - ctx.Logger.Info(fmt.Sprintf("Set --%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v by validator node mode", + ctx.Logger.Info(fmt.Sprintf("Set --%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v\n--%s=%v by validator node mode", abcitypes.FlagDisableABCIQueryMutex, true, appconfig.FlagDynamicGpMode, types.CloseMode, iavl.FlagIavlEnableAsyncCommit, true, store.FlagIavlCacheSize, 10000000, server.FlagPruning, "everything", - evmtypes.FlagEnableBloomFilter, false, watcher.FlagFastQuery, false, appconfig.FlagMaxGasUsedPerBlock, 120000000)) + evmtypes.FlagEnableBloomFilter, false, watcher.FlagFastQuery, false, appconfig.FlagMaxGasUsedPerBlock, 120000000, + mempool.FlagEnablePendingPool, false)) } func setArchiveConfig(ctx *server.Context) { diff --git a/cmd/exchaind/main.go b/cmd/exchaind/main.go index 397962e57e..e75d73a529 100644 --- a/cmd/exchaind/main.go +++ b/cmd/exchaind/main.go @@ -126,6 +126,7 @@ func initEnv() { checkSetEnv("mempool_cache_size", "300000") checkSetEnv("mempool_force_recheck_gap", "2000") checkSetEnv("mempool_recheck", "false") + checkSetEnv("consensus_timeout_commit", fmt.Sprintf("%dms", tmtypes.TimeoutCommit)) } func checkSetEnv(envName string, value string) { diff --git a/libs/tendermint/config/config.go b/libs/tendermint/config/config.go index 4c175f3f43..b86666d770 100644 --- a/libs/tendermint/config/config.go +++ b/libs/tendermint/config/config.go @@ -830,7 +830,7 @@ func DefaultConsensusConfig() *ConsensusConfig { TimeoutPrevoteDelta: 500 * time.Millisecond, TimeoutPrecommit: 1000 * time.Millisecond, TimeoutPrecommitDelta: 500 * time.Millisecond, - TimeoutCommit: 3800 * time.Millisecond, + TimeoutCommit: types.TimeoutCommit * time.Millisecond, TimeoutConsensus: 1000 * time.Millisecond, SkipTimeoutCommit: false, CreateEmptyBlocks: true, diff --git a/libs/tendermint/types/params.go b/libs/tendermint/types/params.go index a58aae115c..4f5d204741 100644 --- a/libs/tendermint/types/params.go +++ b/libs/tendermint/types/params.go @@ -13,6 +13,9 @@ import ( const ( // MaxBlockSizeBytes is the maximum permitted size of the blocks. MaxBlockSizeBytes = 104857600 // 100MB + + // TimeoutCommit is set for the stable of blockTime + TimeoutCommit = 3800 // 3.8s ) var (