Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct block time to 2s #224

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions cmd/initiad/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Loading