Merge PR #2284: Prevent create_empty_blocks=false
This commit is contained in:
parent
2e0fc15dd4
commit
2a49406e9b
|
@ -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.
|
||||
|
|
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue