-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2faa0af
commit eed92e4
Showing
4 changed files
with
6 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
abi-bindings/go/staking/ERC20TokenStakingManager/ERC20TokenStakingManager.go
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
abi-bindings/go/staking/NativeTokenStakingManager/NativeTokenStakingManager.go
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
abi-bindings/go/staking/PoAValidatorManager/PoAValidatorManager.go
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -434,7 +434,9 @@ abstract contract ValidatorManager is | |
"ValidatorManager: maximum churn rate exceeded" | ||
); | ||
|
||
churnTracker.totalWeight += newWeight - oldWeight; | ||
// Two separate calculations because we're using uints and (newWeight - oldWeight) could underflow. | ||
churnTracker.totalWeight += newWeight; | ||
churnTracker.totalWeight -= oldWeight; | ||
|
||
$._churnTracker = churnTracker; | ||
} | ||
Check notice Code scanning / Slither Block timestamp Low
ValidatorManager._checkAndUpdateChurnTracker(uint64,uint64) uses timestamp for comparisons
Dangerous comparisons: - churnTracker.startedAt == 0 || currentTime >= churnTracker.startedAt + $._churnPeriodSeconds - require(bool,string)($._maximumChurnPercentage * churnTracker.initialWeight >= churnTracker.churnAmount * 100,ValidatorManager: maximum churn rate exceeded) |
||
|