Skip to content

Commit

Permalink
fix: fix valset upgrade (#1533)
Browse files Browse the repository at this point in the history
* fix validatorset issue

* chore: add doc

* chore: review changes
  • Loading branch information
aleem1314 authored Oct 7, 2022
1 parent 4f9fe79 commit 1d4e554
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,25 @@ func (app *RegenApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.
inStakingValidatorSet[valCons.String()] = true
}
} else {
updates = append(updates, abci.ValidatorUpdate{
PubKey: tmProtoPk,
Power: validator.ConsensusPower(sdk.DefaultPowerReduction),
})
// ignore validator with zero consensus power and not part
// of tendermint valset.
if validator.ConsensusPower(sdk.DefaultPowerReduction) == 0 {
if _, ok := validatorsVoteInfo[valCons.String()]; ok {
updates = append(updates, abci.ValidatorUpdate{
PubKey: tmProtoPk,
Power: 0,
})

inStakingValidatorSet[valCons.String()] = true
}
} else {
updates = append(updates, abci.ValidatorUpdate{
PubKey: tmProtoPk,
Power: validator.ConsensusPower(sdk.DefaultPowerReduction),
})
inStakingValidatorSet[valCons.String()] = true
}

inStakingValidatorSet[valCons.String()] = true
}
}

Expand Down

0 comments on commit 1d4e554

Please sign in to comment.