-
Notifications
You must be signed in to change notification settings - Fork 1
Audit cyfrin #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Audit cyfrin #155
Conversation
63674d6
to
ce10fda
Compare
ce10fda
to
001cf04
Compare
68b8241
to
43e09e6
Compare
30cf6a4
to
fa75a8c
Compare
emit AllNodeStakesUpdated(operator, newTotalStake); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a revert
@@ -812,8 +803,27 @@ contract AvalancheL1Middleware is IAvalancheL1Middleware, AssetClassRegistry { | |||
if (!balancerValidatorManager.isValidatorPendingWeightUpdate(validationID)) { | |||
revert AvalancheL1Middleware__WeightUpdateNotPending(validationID); | |||
} | |||
// if the completeValidatorWeightUpdate fails, not sure if the previous bool is secure. | |||
|
|||
// Finish the weight update on the P-Chain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is not super acurate. Could be "Complete weight update upon P-Chain confirmation"
// Check ratio vs. class's min stake, could add an emit here to debug | ||
if (stake / (nodeCount + extraNode) < assetClasses[classId].minValidatorStake) { | ||
if (stake / nodeCount < assetClasses[classId].minValidatorStake) { | ||
emit DebugSecondaryAssetClassCheck(operator, classId, stake, nodeCount, assetClasses[classId].minValidatorStake); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebugSecondaryAssetClassCheck
event should be removed
// Check ratio vs. class's min stake, could add an emit here to debug | ||
if (stake / (nodeCount + extraNode) < assetClasses[classId].minValidatorStake) { | ||
if (stake / nodeCount < assetClasses[classId].minValidatorStake) { | ||
emit DebugSecondaryAssetClassCheck(operator, classId, stake, nodeCount, assetClasses[classId].minValidatorStake); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebugSecondaryAssetClassCheck
event should be removed
fa75a8c
to
5157351
Compare
Summary by OctaneNew Contracts
Updated Contracts
🔗 Commit Hash: 6c37d1c |
1e21780
to
dc63daa
Compare
Overview
Detailed findings
|
9083931
to
1659adb
Compare
1659adb
to
457c1d1
Compare
50bce4a
to
becc395
Compare
4b7b03b
to
9891478
Compare
9891478
to
f9bfdf7
Compare
7a9764c
to
6c37d1c
Compare
@@ -95,6 +96,8 @@ contract Rewards is AccessControlUpgradeable, IRewards { | |||
uptimeTracker = UptimeTracker(uptimeTracker_); | |||
epochDuration = l1Middleware.EPOCH_DURATION(); | |||
|
|||
_checkFees(protocolFee_, operatorFee_, curatorFee_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe redundant with L86-87
@@ -136,10 +139,10 @@ contract Rewards is AccessControlUpgradeable, IRewards { | |||
|
|||
// Claiming functions | |||
/// @inheritdoc IRewards | |||
function claimRewards(address rewardsToken, address recipient) external { | |||
function claimRewards(address rewardsToken, address recipient) external nonReentrant { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did all *claim
functions became nonReentrant
?
Linked issues
Solved
_requireMinSecondaryAssetClasses
DuringforceUpdateNodes
(Now M10) #169On-going:
forceUpdateNodes
potentially enables mass validator removal when new asset classes are added #194registerL1
#195Aknowledged
Changes
Modified tests o work correctly (some may be missing in this list):