Skip to content

Commit

Permalink
feat(cometbft): mitigate slow blocks due to inactive validators (#1818)
Browse files Browse the repository at this point in the history
Decreases default cometBFT consensus config param `timeout_propose` from
3s to 1s.

This aim to mitigate slow blocks when the proposing validator is
offline/inactive. Currently, when 1 of 3 validators are offline, the
block times on staging decreases from 1s to 4s.

I had a look at some other cosmos chains and aligning timeout_commit and
timeout_propose seems to be common practice:
-
[Sei](https://github.com/sei-protocol/sei-chain/blob/main/app/params/config.go#L98-L103):
`timeout_commit=200ms, timeout_propose=300s`
- [Moonbridge](https://services.moonbridge.team/testnet/kopi/install/)
and [kopi](https://docs.kopi.money/nodes.html#setting-up-a-node):
`timeout_commit=1s, timeout_propose=1s`

This change aims to mitigate the affect of offline validators on block
times.

issue: #1812
  • Loading branch information
corverroos authored Sep 5, 2024
1 parent dc86268 commit eb00f04
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions halo/cmd/cometconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func DefaultCometConfig(homeDir string) cfg.Config {
conf.Mempool.Type = cfg.MempoolTypeNop // Disable cometBFT mempool
conf.ProxyApp = "" // Only support built-in ABCI app supported.
conf.ABCI = "" // Only support built-in ABCI app supported.
conf.Consensus.TimeoutPropose = time.Second // Mitigate slow blocks when proposer inactive (default=3s).

return *conf
}
Expand Down
2 changes: 1 addition & 1 deletion halo/cmd/testdata/TestRunCmd_defaults.golden
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"Consensus": {
"RootDir": "./halo",
"WalPath": "data/cs.wal/wal",
"TimeoutPropose": 3000000000,
"TimeoutPropose": 1000000000,
"TimeoutProposeDelta": 500000000,
"TimeoutPrevote": 1000000000,
"TimeoutPrevoteDelta": 500000000,
Expand Down
2 changes: 1 addition & 1 deletion halo/cmd/testdata/TestRunCmd_flags.golden
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"Consensus": {
"RootDir": "foo",
"WalPath": "data/cs.wal/wal",
"TimeoutPropose": 3000000000,
"TimeoutPropose": 1000000000,
"TimeoutProposeDelta": 500000000,
"TimeoutPrevote": 1000000000,
"TimeoutPrevoteDelta": 500000000,
Expand Down
2 changes: 1 addition & 1 deletion halo/cmd/testdata/TestRunCmd_json_files.golden
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"Consensus": {
"RootDir": "testinput/input2",
"WalPath": "data/cs.wal/wal",
"TimeoutPropose": 3000000000,
"TimeoutPropose": 1000000000,
"TimeoutProposeDelta": 500000000,
"TimeoutPrevote": 1000000000,
"TimeoutPrevoteDelta": 500000000,
Expand Down
2 changes: 1 addition & 1 deletion halo/cmd/testdata/TestRunCmd_toml_files.golden
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"Consensus": {
"RootDir": "testinput/input1",
"WalPath": "data/cs.wal/wal",
"TimeoutPropose": 3000000000,
"TimeoutPropose": 1000000000,
"TimeoutProposeDelta": 500000000,
"TimeoutPrevote": 1000000000,
"TimeoutPrevoteDelta": 500000000,
Expand Down

0 comments on commit eb00f04

Please sign in to comment.