Skip to content

Commit

Permalink
Merge PR #2284: Prevent create_empty_blocks=false
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored and cwgoes committed Sep 11, 2018
1 parent 2e0fc15 commit 2a49406
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ IMPROVEMENTS
* [x/stake] [x/slashing] Ensure delegation invariants to jailed validators [#1883](https://github.com/cosmos/cosmos-sdk/issues/1883).
* [x/stake] Improve speed of GetValidator, which was shown to be a performance bottleneck. [#2046](https://github.com/tendermint/tendermint/pull/2200)
* [genesis] \#2229 Ensure that there are no duplicate accounts or validators in the genesis state.
* Add SDK validation to `config.toml` (namely disabling `create_empty_blocks`) \#1571

* SDK
* [tools] Make get_vendor_deps deletes `.vendor-new` directories, in case scratch files are present.
Expand Down
12 changes: 12 additions & 0 deletions server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error
if err != nil {
return err
}
err = validateConfig(config)
if err != nil {
return err
}
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
logger, err = tmflags.ParseLogLevel(config.LogLevel, logger, cfg.DefaultLogLevel())
if err != nil {
Expand Down Expand Up @@ -96,6 +100,14 @@ func interceptLoadConfig() (conf *cfg.Config, err error) {
return
}

// validate the config with the sdk's requirements.
func validateConfig(conf *cfg.Config) error {
if conf.Consensus.CreateEmptyBlocks == false {
return errors.New("config option CreateEmptyBlocks = false is currently unsupported")
}
return nil
}

// add server commands
func AddCommands(
ctx *Context, cdc *wire.Codec,
Expand Down

0 comments on commit 2a49406

Please sign in to comment.