mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user