From 720ab6fe9303c3497f6e6147afccb65d7db6597c Mon Sep 17 00:00:00 2001 From: Dan Kanefsky <56059752+boojamya@users.noreply.github.com> Date: Wed, 4 Dec 2024 07:52:55 -0700 Subject: [PATCH] chore: overwrite default cometbft `timeout_commit` (#438) Co-authored-by: John Letey --- cmd/root.go | 7 ++++++- local.sh | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index dc5858a9..5e223853 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,6 +15,8 @@ package cmd import ( + "time" + cmtcfg "github.com/cometbft/cometbft/config" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" @@ -70,8 +72,11 @@ func NewRootCmd() *cobra.Command { srvCfg := serverconfig.DefaultConfig() srvCfg.MinGasPrices = "0uusdc,0ausdy,0ueure" srvCfg.API.Enable = true + // overwrite default commit timeout from the cometbft configuration + cmtCfg := cmtcfg.DefaultConfig() + cmtCfg.Consensus.TimeoutCommit = 500 * time.Millisecond - return server.InterceptConfigsPreRunHandler(cmd, serverconfig.DefaultConfigTemplate, srvCfg, cmtcfg.DefaultConfig()) + return server.InterceptConfigsPreRunHandler(cmd, serverconfig.DefaultConfigTemplate, srvCfg, cmtCfg) }, } diff --git a/local.sh b/local.sh index 159b877d..0fb0b9ad 100644 --- a/local.sh +++ b/local.sh @@ -29,8 +29,6 @@ if ! [ -f .duke/data/priv_validator_state.json ]; then nobled genesis gentx validator 1000000ustake --chain-id "duke-1" --home .duke --keyring-backend test &> /dev/null nobled genesis collect-gentxs --home .duke &> /dev/null - - sed -i '' 's/timeout_commit = "5s"/timeout_commit = "1s"/g' .duke/config/config.toml fi nobled start --home .duke