update validate/complete logic for consensus params

This commit is contained in:
William Banfield
2022-01-28 17:41:02 -05:00
parent f50721c36a
commit 31e61d937c
6 changed files with 22 additions and 7 deletions
+1 -1
View File
@@ -455,7 +455,7 @@ func updateState(
if abciResponses.EndBlock.ConsensusParamUpdates != nil {
// NOTE: must not mutate s.ConsensusParams
nextParams = state.ConsensusParams.UpdateConsensusParams(abciResponses.EndBlock.ConsensusParamUpdates)
err := nextParams.ValidateConsensusParams()
err := nextParams.Validate()
if err != nil {
return state, fmt.Errorf("error updating consensus params: %w", err)
}
+3 -1
View File
@@ -239,7 +239,9 @@ func FromProto(pb *tmstate.State) (*State, error) {
}
state.LastHeightValidatorsChanged = pb.LastHeightValidatorsChanged
state.ConsensusParams = types.ConsensusParamsFromProto(pb.ConsensusParams)
c := types.ConsensusParamsFromProto(pb.ConsensusParams)
(&c).Complete()
state.ConsensusParams = c
state.LastHeightConsensusParamsChanged = pb.LastHeightConsensusParamsChanged
state.LastResultsHash = pb.LastResultsHash
state.AppHash = pb.AppHash