Skip to content

Commit

Permalink
fix: when selection algo upgrade set to 0, do not use new one
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbeng committed Nov 24, 2024
1 parent 3bf8cc9 commit cd8e84f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metis/selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func SelectNextProducers(ctx sdk.Context, blkHash common.Hash, spanEligibleValid
*/

var targetWeight uint64
if ctx.BlockHeight() < helper.GetNewSelectionAlgoHeight() {
if helper.GetNewSelectionAlgoHeight() == 0 || ctx.BlockHeight() < helper.GetNewSelectionAlgoHeight() {
targetWeight = randomRangeInclusive(1, totalVotingPower)
ctx.Logger().Debug("Selecting new proposer", "algoVersion", 0, "totalVotingPower",
totalVotingPower, "targetWeight", targetWeight,
Expand Down

0 comments on commit cd8e84f

Please sign in to comment.