Skip to content

Commit 4e74ed1

Browse files
committed
Fix wrapping sub
1 parent ceb59e3 commit 4e74ed1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

beacon_node/store/src/hdiff.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,9 @@ impl ValidatorsDiff {
454454
Hash256::ZERO
455455
},
456456
// effective_balance can increase and decrease
457-
effective_balance: y.effective_balance - x.effective_balance,
457+
effective_balance: y
458+
.effective_balance
459+
.wrapping_sub(x.effective_balance),
458460
// slashed can only change from false into true. In an index re-use it can
459461
// switch back to false, but in that case the pubkey will also change.
460462
slashed: y.slashed,

0 commit comments

Comments
 (0)