From c668307b75dce0961c8360cc8780599b126eac0c Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:20:18 +0900 Subject: [PATCH 1/3] correct block time to 2s --- cmd/initiad/config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/initiad/config.go b/cmd/initiad/config.go index a980002a..d2d2402a 100644 --- a/cmd/initiad/config.go +++ b/cmd/initiad/config.go @@ -63,14 +63,14 @@ 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 + // set block time to 2s + cfg.Consensus.TimeoutPropose = 2 * time.Second + cfg.Consensus.TimeoutProposeDelta = 500 * time.Millisecond + cfg.Consensus.TimeoutPrevote = 1 * time.Second + cfg.Consensus.TimeoutPrevoteDelta = 500 * time.Millisecond + cfg.Consensus.TimeoutPrecommit = 1 * time.Second + cfg.Consensus.TimeoutPrecommitDelta = 500 * time.Millisecond + cfg.Consensus.TimeoutCommit = 2 * time.Second return cfg } From 15973c9c8af67596082922fb5fef2ee517e17996 Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:01:34 +0900 Subject: [PATCH 2/3] add more performance turning --- cmd/initiad/config.go | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/cmd/initiad/config.go b/cmd/initiad/config.go index d2d2402a..d57d546c 100644 --- a/cmd/initiad/config.go +++ b/cmd/initiad/config.go @@ -63,13 +63,29 @@ func initAppConfig() (string, interface{}) { func initTendermintConfig() *tmcfg.Config { cfg := tmcfg.DefaultConfig() - // set block time to 2s - cfg.Consensus.TimeoutPropose = 2 * time.Second + // 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 - cfg.Consensus.TimeoutPrevote = 1 * time.Second - cfg.Consensus.TimeoutPrevoteDelta = 500 * time.Millisecond - cfg.Consensus.TimeoutPrecommit = 1 * time.Second - cfg.Consensus.TimeoutPrecommitDelta = 500 * time.Millisecond + + // no need to increase wait timeout(delta) for prevote and precommit + cfg.Consensus.TimeoutPrevote = 500 * time.Millisecond + cfg.Consensus.TimeoutPrevoteDelta = 50 * time.Millisecond + cfg.Consensus.TimeoutPrecommit = 500 * time.Millisecond + cfg.Consensus.TimeoutPrecommitDelta = 50 * time.Millisecond + + // set commit timeout to 2s cfg.Consensus.TimeoutCommit = 2 * time.Second return cfg From 00de1b18dc11dc00a8db62081640e69ed30a4fa3 Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:07:53 +0900 Subject: [PATCH 3/3] remove prevote and precommit delta --- cmd/initiad/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/initiad/config.go b/cmd/initiad/config.go index d57d546c..b3ca800c 100644 --- a/cmd/initiad/config.go +++ b/cmd/initiad/config.go @@ -81,9 +81,9 @@ func initTendermintConfig() *tmcfg.Config { // no need to increase wait timeout(delta) for prevote and precommit cfg.Consensus.TimeoutPrevote = 500 * time.Millisecond - cfg.Consensus.TimeoutPrevoteDelta = 50 * time.Millisecond + cfg.Consensus.TimeoutPrevoteDelta = 0 * time.Millisecond cfg.Consensus.TimeoutPrecommit = 500 * time.Millisecond - cfg.Consensus.TimeoutPrecommitDelta = 50 * time.Millisecond + cfg.Consensus.TimeoutPrecommitDelta = 0 * time.Millisecond // set commit timeout to 2s cfg.Consensus.TimeoutCommit = 2 * time.Second