diff --git a/cmd/initiad/config.go b/cmd/initiad/config.go index a980002a..b3ca800c 100644 --- a/cmd/initiad/config.go +++ b/cmd/initiad/config.go @@ -63,14 +63,30 @@ func initAppConfig() (string, interface{}) { func initTendermintConfig() *tmcfg.Config { cfg := tmcfg.DefaultConfig() - // set block time to 3s - cfg.Consensus.TimeoutPropose = 1800 * time.Millisecond - cfg.Consensus.TimeoutProposeDelta = 300 * time.Millisecond - cfg.Consensus.TimeoutPrevote = 600 * time.Millisecond - cfg.Consensus.TimeoutPrevoteDelta = 300 * time.Millisecond - cfg.Consensus.TimeoutPrecommit = 600 * time.Millisecond - cfg.Consensus.TimeoutPrecommitDelta = 300 * time.Millisecond - cfg.Consensus.TimeoutCommit = 3000 * time.Millisecond + // performance turning configs + cfg.P2P.SendRate = 20480000 + cfg.P2P.RecvRate = 20480000 + cfg.P2P.MaxPacketMsgPayloadSize = 1000000 // 1MB + cfg.P2P.FlushThrottleTimeout = 10 * time.Millisecond + cfg.Consensus.PeerGossipSleepDuration = 30 * time.Millisecond + + // mempool configs + cfg.Mempool.Size = 1000 + cfg.Mempool.MaxTxsBytes = 10737418240 + cfg.Mempool.MaxTxBytes = 2048576 + + // set propose timeout to 3s and increase timeout by 500ms each round + cfg.Consensus.TimeoutPropose = 3 * time.Second + cfg.Consensus.TimeoutProposeDelta = 500 * time.Millisecond + + // no need to increase wait timeout(delta) for prevote and precommit + cfg.Consensus.TimeoutPrevote = 500 * time.Millisecond + cfg.Consensus.TimeoutPrevoteDelta = 0 * time.Millisecond + cfg.Consensus.TimeoutPrecommit = 500 * time.Millisecond + cfg.Consensus.TimeoutPrecommitDelta = 0 * time.Millisecond + + // set commit timeout to 2s + cfg.Consensus.TimeoutCommit = 2 * time.Second return cfg }