hysteresis to -0.25/+1.25
This commit is contained in:
parent
a02aac43c2
commit
0122081d05
|
@ -1405,7 +1405,7 @@ def process_final_updates(state: BeaconState) -> None:
|
|||
QUARTER_INCREMENT = EFFECTIVE_BALANCE_INCREMENT // 4
|
||||
if (
|
||||
balance + QUARTER_INCREMENT < validator.effective_balance
|
||||
or validator.effective_balance + 7 * QUARTER_INCREMENT < balance
|
||||
or validator.effective_balance + 5 * QUARTER_INCREMENT < balance
|
||||
):
|
||||
validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE)
|
||||
# Reset slashings
|
||||
|
|
|
@ -62,8 +62,8 @@ def test_effective_balance_hysteresis(spec, state):
|
|||
(max, max - inc, max - inc, "exactly 1 step lower"),
|
||||
(max, max - inc - 1, max - (2 * inc), "past 1 step lower, double step"),
|
||||
(max, max - inc + 1, max - inc, "close to 1 step lower"),
|
||||
(min, min + (quar_inc * 7), min, "bigger balance, but not high enough"),
|
||||
(min, min + (quar_inc * 7) + 1, min + inc, "bigger balance, high enough, but small step"),
|
||||
(min, min + (quar_inc * 5), min, "bigger balance, but not high enough"),
|
||||
(min, min + (quar_inc * 5) + 1, min + inc, "bigger balance, high enough, but small step"),
|
||||
(min, min + (quar_inc * 8) - 1, min + inc, "bigger balance, high enough, close to double step"),
|
||||
(min, min + (quar_inc * 8), min + (2 * inc), "exact two step balance increment"),
|
||||
(min, min + (quar_inc * 8) + 1, min + (2 * inc), "over two steps, round down"),
|
||||
|
|
Loading…
Reference in New Issue