Skip to content

Commit

Permalink
fix preNonces and validatorList cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng762 committed Dec 20, 2024
1 parent b4f69ce commit 92b2026
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions x/plugin/staking_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3166,9 +3166,10 @@ func vrfElection(validatorList staking.ValidatorQueue, shiftLen int, nonce []byt
return nil, err
}
if len(preNonces) < len(validatorList) {
log.Error("Failed to vrfElection on Election", "blockNumber", blockNumber, "validatorListSize", len(validatorList),
"nonceSize", len(nonce), "preNoncesSize", len(preNonces), "parentHash", hex.EncodeToString(parentHash.Bytes()))
return nil, staking.ErrWrongFuncParams
validatorList = validatorList[:len(preNonces)]
//log.Error("Failed to vrfElection on Election", "blockNumber", blockNumber, "validatorListSize", len(validatorList),
// "nonceSize", len(nonce), "preNoncesSize", len(preNonces), "parentHash", hex.EncodeToString(parentHash.Bytes()))
//return nil, staking.ErrWrongFuncParams
}
if len(preNonces) > len(validatorList) {
preNonces = preNonces[len(preNonces)-len(validatorList):]
Expand Down

0 comments on commit 92b2026

Please sign in to comment.