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

updated comet consensus config for lower block time #167

Merged
merged 4 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions builder/files/genesis-mainnet-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"chain_id": "heimdall-137",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "25000000",
"max_bytes": "2097152",
"max_gas": "10000000",
"time_iota_ms": "1000"
},
"evidence": {
Expand Down
4 changes: 2 additions & 2 deletions builder/files/genesis-testnet-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"chain_id": "heimdall-80001",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "25000000",
"max_bytes": "2097152",
"max_gas": "10000000",
"time_iota_ms": "1000"
},
"evidence": {
Expand Down
14 changes: 13 additions & 1 deletion cmd/heimdalld/cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,19 @@ func GetSignerInfo(pub crypto.PubKey, privKey []byte, cdc *codec.LegacyAmino) Va
// initCometBFTConfig helps to override default CometBFT Config values.
// It returns cmtcfg.DefaultConfig if no custom configuration is required for the application.
func initCometBFTConfig() *cmtcfg.Config {
return cmtcfg.DefaultConfig()
customCMTConfig := cmtcfg.DefaultConfig()

customCMTConfig.Consensus.TimeoutPropose = 1000 * time.Millisecond
customCMTConfig.Consensus.TimeoutProposeDelta = 200 * time.Millisecond
customCMTConfig.Consensus.TimeoutPrevote = 500 * time.Millisecond
customCMTConfig.Consensus.TimeoutPrevoteDelta = 200 * time.Millisecond
customCMTConfig.Consensus.TimeoutPrecommit = 500 * time.Millisecond
customCMTConfig.Consensus.TimeoutPrecommitDelta = 200 * time.Millisecond
customCMTConfig.Consensus.TimeoutCommit = 500 * time.Millisecond
customCMTConfig.Consensus.PeerGossipSleepDuration = 25 * time.Millisecond
customCMTConfig.Consensus.PeerQueryMaj23SleepDuration = 200 * time.Millisecond

return customCMTConfig
}

// initAppConfig helps to override default appConfig template and configs.
Expand Down
12 changes: 2 additions & 10 deletions cmd/heimdalld/cmd/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,23 +821,15 @@ func addMissingCometBFTConsensusParams(genesisData map[string]interface{}, initi
return err
}

if err := utils.AddProperty(genesisData, "consensus_params.block", "max_gas", "25000000"); err != nil {
return err
}

if err := utils.AddProperty(genesisData, "consensus_params.block", "max_gas", "25000000"); err != nil {
return err
}

if err := utils.AddProperty(genesisData, "consensus_params", "block", make(map[string]interface{})); err != nil {
return err
}

if err := utils.AddProperty(genesisData, "consensus_params.block", "max_gas", "25000000"); err != nil {
if err := utils.AddProperty(genesisData, "consensus_params.block", "max_gas", "10000000"); err != nil {
return err
}

if err := utils.AddProperty(genesisData, "consensus_params.block", "max_bytes", "102400"); err != nil {
if err := utils.AddProperty(genesisData, "consensus_params.block", "max_bytes", "2097152"); err != nil {
return err
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/heimdalld/cmd/testdata/dump-genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"chain_id": "heimdall-sCCAH4",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"max_bytes": "2097152",
"max_gas": "10000000",
"time_iota_ms": "1000"
},
"evidence": {
Expand Down
4 changes: 2 additions & 2 deletions cmd/heimdalld/cmd/testdata/migrated_dump-genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -1665,8 +1665,8 @@
"vote_extensions_enable_height": "1"
},
"block": {
"max_bytes": "102400",
"max_gas": "25000000"
"max_bytes": "2097152",
"max_gas": "10000000"
},
"evidence": {
"max_age_duration": "172800000000000",
Expand Down
4 changes: 2 additions & 2 deletions packaging/templates/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"chain_id": "heimdall-80001",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "25000000",
"max_bytes": "2097152",
"max_gas": "10000000",
"time_iota_ms": "1000"
},
"evidence": {
Expand Down
Loading