Skip to content

Commit

Permalink
feat: remove consensus config overrides in the cli (#2079)
Browse files Browse the repository at this point in the history
## Overview

removes consensus config overrides in the cli

## Checklist

- [x] New and updated code has appropriate documentation
- [x] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [x] Visual proof for any user facing features like CLI or
documentation updates
- [ ] Linked issues closed with keywords
  • Loading branch information
evan-forbes authored Jul 11, 2023
1 parent 9de969c commit 8b5db4b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
11 changes: 0 additions & 11 deletions cmd/celestia-appd/cmd/overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,10 @@ package cmd

import (
"github.com/celestiaorg/celestia-app/app"
"github.com/celestiaorg/celestia-app/pkg/appconsts"
"github.com/cosmos/cosmos-sdk/server"
"github.com/spf13/cobra"
)

// overrideServerConfig applies overrides to the embedded server context's
// configurations.
func overrideServerConfig(command *cobra.Command) error {
ctx := server.GetServerContextFromCmd(command)
ctx.Config.Consensus.TimeoutPropose = appconsts.TimeoutPropose
ctx.Config.Consensus.TimeoutCommit = appconsts.TimeoutCommit
ctx.Config.Consensus.SkipTimeoutCommit = false
return server.SetCmdServerContext(command, ctx)
}

// setDefaultConsensusParams sets the default consensus parameters for the
// embedded server context.
func setDefaultConsensusParams(command *cobra.Command) error {
Expand Down
7 changes: 1 addition & 6 deletions cmd/celestia-appd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,7 @@ func NewRootCmd() *cobra.Command {
return err
}

err = setDefaultConsensusParams(cmd)
if err != nil {
return err
}

return overrideServerConfig(cmd)
return setDefaultConsensusParams(cmd)
},
SilenceUsage: true,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/appconsts/consensus_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import "time"

const (
TimeoutPropose = time.Second * 10
TimeoutCommit = time.Second * 15
TimeoutCommit = time.Second * 11
)

0 comments on commit 8b5db4b

Please sign in to comment.