diff --git a/state/store.go b/state/store.go index 4f47ace5f..18476660f 100644 --- a/state/store.go +++ b/state/store.go @@ -194,21 +194,12 @@ func LoadValidators(db dbm.DB, height int64) (*types.ValidatorSet, error) { lastStoredHeight := lastStoredHeightFor(height, valInfo.LastHeightChanged) valInfo2 := loadValidatorsInfo(db, lastStoredHeight) if valInfo2 == nil || valInfo2.ValidatorSet == nil { - // TODO (melekes): remove the below if condition in the 0.33 major - // release and just panic. Old chains might panic otherwise if they - // haven't saved validators at intermediate (%valSetCheckpointInterval) - // height yet. - // https://github.com/tendermint/tendermint/issues/3543 - valInfo2 = loadValidatorsInfo(db, valInfo.LastHeightChanged) - lastStoredHeight = valInfo.LastHeightChanged - if valInfo2 == nil || valInfo2.ValidatorSet == nil { - panic( - fmt.Sprintf("Couldn't find validators at height %d (height %d was originally requested)", - lastStoredHeight, - height, - ), - ) - } + panic( + fmt.Sprintf("Couldn't find validators at height %d (height %d was originally requested)", + lastStoredHeight, + height, + ), + ) } valInfo2.ValidatorSet.IncrementProposerPriority(int(height - lastStoredHeight)) // mutate valInfo = valInfo2 diff --git a/state/store_test.go b/state/store_test.go index 0a190446e..5b201b202 100644 --- a/state/store_test.go +++ b/state/store_test.go @@ -28,25 +28,6 @@ func TestStoreLoadValidators(t *testing.T) { // 2) LoadValidators loads validators using a checkpoint height - // TODO(melekes): REMOVE in 0.33 release - // https://github.com/tendermint/tendermint/issues/3543 - // for releases prior to v0.31.4, it uses last height changed - valInfo := &sm.ValidatorsInfo{ - LastHeightChanged: sm.ValSetCheckpointInterval, - } - stateDB.Set(sm.CalcValidatorsKey(sm.ValSetCheckpointInterval), valInfo.Bytes()) - assert.NotPanics(t, func() { - sm.SaveValidatorsInfo(stateDB, sm.ValSetCheckpointInterval+1, 1, vals) - loadedVals, err := sm.LoadValidators(stateDB, sm.ValSetCheckpointInterval+1) - if err != nil { - t.Fatal(err) - } - if loadedVals.Size() == 0 { - t.Fatal("Expected validators to be non-empty") - } - }) - // ENDREMOVE - sm.SaveValidatorsInfo(stateDB, sm.ValSetCheckpointInterval, 1, vals) loadedVals, err = sm.LoadValidators(stateDB, sm.ValSetCheckpointInterval)