diff --git a/internal/state/current_round_state.go b/internal/state/current_round_state.go index 77eee2715..45ed183db 100644 --- a/internal/state/current_round_state.go +++ b/internal/state/current_round_state.go @@ -105,12 +105,6 @@ func (candidate *CurrentRoundState) UpdateState(target *State) error { return nil } -// UpdateFunc implements UpdateFunc -func (candidate *CurrentRoundState) UpdateFunc(state State) (State, error) { - err := candidate.UpdateState(&state) - return state, err -} - // GetHeight returns height of current block func (candidate *CurrentRoundState) GetHeight() int64 { if candidate.Base.LastBlockHeight == 0 { @@ -202,7 +196,7 @@ func (candidate *CurrentRoundState) populateValsetUpdates() error { // we take validator sets as they arrive from InitChainSource response if updateSource != InitChainSource { - newValSet.IncrementProposerPriority(1 + candidate.Round) + newValSet.IncrementProposerPriority(1 + candidate.Params.Round) } candidate.NextValidators = newValSet diff --git a/internal/state/store.go b/internal/state/store.go index 0c97f9af3..129791226 100644 --- a/internal/state/store.go +++ b/internal/state/store.go @@ -499,6 +499,9 @@ func (store dbStore) SaveValidatorSets(lowerHeight, upperHeight int64, vals *typ // LoadValidators loads the ValidatorSet for a given height. // Returns ErrNoValSetForHeight if the validator set can't be found for this height. +// +// TODO: The returned ValidatorSet proposer score does not take into account changing round numbers +// and is not guaranteed to be correct. func (store dbStore) LoadValidators(height int64) (*types.ValidatorSet, error) { valInfo, err := loadValidatorsInfo(store.db, height) @@ -525,7 +528,7 @@ func (store dbStore) LoadValidators(height int64) (*types.ValidatorSet, error) { if err != nil { return nil, err } - + // TODO: rounds should be also considered here vs.IncrementProposerPriority(h) // mutate vi2, err := vs.ToProto() if err != nil {