Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions contracts/ConsensusUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,11 @@ contract ConsensusUtils is EternalStorage, ValidatorSet {
uint256 expectedNumberOfBlocks = getCycleDurationBlocks().mul(VALIDATOR_PRODUCTIVITY_BP).div(_validatorSet.length).div(10000);
for (uint i = 0; i < _validatorSet.length; i++) {
if(blockCounter(_validatorSet[i]) < expectedNumberOfBlocks) {
// Validator hasn't met the desired uptime jail them and remove them from the next cycle
_jailValidator(_validatorSet[i]);
// Don't jail below 4 validators
if (pendingValidatorsLength() > 4) {
// Validator hasn't met the desired uptime jail them and remove them from the next cycle
_jailValidator(_validatorSet[i]);
}
} else if (getStrikes(_validatorSet[i]) != 0) {
// Validator has met desired uptime and has strikes, inc the strike reset
_incStrikeReset(_validatorSet[i]);
Expand Down