make BlockTimeIota a consensus parameter, not a locally configurable … (#3048)

* make BlockTimeIota a consensus parameter, not a locally configurable option

Refs #2920

* make TimeIota int64 ms

Refs #2920

* update Gopkg.toml

* fixes after Ethan's review

* fix TestRemoteSignerProposalSigningFailed

* update changelog
This commit is contained in:
Anton Kaliaev
2019-03-04 13:24:44 +04:00
committed by GitHub
parent f39138aa2e
commit 52771e1287
24 changed files with 471 additions and 391 deletions

View File

@@ -125,9 +125,10 @@ func (tm2pb) ValidatorUpdates(vals *ValidatorSet) []abci.ValidatorUpdate {
func (tm2pb) ConsensusParams(params *ConsensusParams) *abci.ConsensusParams {
return &abci.ConsensusParams{
BlockSize: &abci.BlockSizeParams{
MaxBytes: params.BlockSize.MaxBytes,
MaxGas: params.BlockSize.MaxGas,
Block: &abci.BlockParams{
MaxBytes: params.Block.MaxBytes,
MaxGas: params.Block.MaxGas,
TimeIotaMs: params.Block.TimeIotaMs,
},
Evidence: &abci.EvidenceParams{
MaxAge: params.Evidence.MaxAge,
@@ -222,16 +223,28 @@ func (pb2tm) ValidatorUpdates(vals []abci.ValidatorUpdate) ([]*Validator, error)
}
func (pb2tm) ConsensusParams(csp *abci.ConsensusParams) ConsensusParams {
return ConsensusParams{
BlockSize: BlockSizeParams{
MaxBytes: csp.BlockSize.MaxBytes,
MaxGas: csp.BlockSize.MaxGas,
},
Evidence: EvidenceParams{
MaxAge: csp.Evidence.MaxAge,
},
Validator: ValidatorParams{
PubKeyTypes: csp.Validator.PubKeyTypes,
},
params := ConsensusParams{}
// we must defensively consider any structs may be nil
if csp.Block != nil {
params.Block = BlockParams{
MaxBytes: csp.Block.MaxBytes,
MaxGas: csp.Block.MaxGas,
TimeIotaMs: csp.Block.TimeIotaMs,
}
}
if csp.Evidence != nil {
params.Evidence = EvidenceParams{
MaxAge: csp.Evidence.MaxAge,
}
}
if csp.Validator != nil {
params.Validator = ValidatorParams{
PubKeyTypes: csp.Validator.PubKeyTypes,
}
}
return params
}