Skip to content

Commit

Permalink
hack: Prevent node from starting up with invalid timeout_commit of 0
Browse files Browse the repository at this point in the history
Since newest cometbft defaults to timeout_commit of 0 we always
default to that in our config.toml file as this code is generated
by cosmossdk init function handler.

To fix this properly I need to figure out how to pass in the config
as context value to the cobra.command as a viper instance.

Until then putting this error here as to preventing us forgetting
to set it to the correct time_commit (which I assume will be 1sec)
  • Loading branch information
fridrik01 committed Dec 19, 2024
1 parent d1c950b commit 7fb4868
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/commands/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package server

import (
"context"
"fmt"

pruningtypes "cosmossdk.io/store/pruning/types"
types "github.com/berachain/beacon-kit/cli/commands/server/types"
Expand Down Expand Up @@ -106,6 +107,10 @@ custom: allow pruning options to be manually specified through 'pruning-keep-rec
RunE: func(cmd *cobra.Command, _ []string) error {
logger := clicontext.GetLoggerFromCmd[LoggerT](cmd)
cfg := clicontext.GetConfigFromCmd(cmd)
if cfg.Consensus.TimeoutCommit == 0 {
return fmt.Errorf("please edit your config.toml file and set timeout_commit to 1s")

Check failure on line 111 in cli/commands/server/start.go

View workflow job for this annotation

GitHub Actions / lint

fmt.Errorf can be replaced with errors.New (perfsprint)
}

v := clicontext.GetViperFromCmd(cmd)
_, err := GetPruningOptionsFromFlags(v)
if err != nil {
Expand Down

0 comments on commit 7fb4868

Please sign in to comment.