-
Notifications
You must be signed in to change notification settings - Fork 7
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
_get_sum
and _get_weight
like function can run out of gas
#384
Comments
141345 marked the issue as duplicate of #129 |
141345 marked the issue as not a duplicate |
141345 marked the issue as primary issue |
OpenCoreCH marked the issue as sponsor disputed |
The loops are bounded and will never reach the block gas limit, so without a PoC that shows a situation where the limit is reached, this seems invalid to me |
None of those loops seem to modify state within the loop. |
alcueca marked the issue as unsatisfactory: |
Lines of code
https://github.com/code-423n4/2023-08-verwa/blob/main/src/GaugeController.sol#L66
https://github.com/code-423n4/2023-08-verwa/blob/main/src/GaugeController.sol#L91
Vulnerability details
Impact
codebase relies on several loops that can iterate 500 times with costly gas consumption. This design is error-prone and may cause the contract to be trapped because it runs out of gas.
functions like
_get_sum
,_get_weight
,_checkpoint
inVotingEscrow.sol
iterate multiple times and changing state( consume high gas ) i.e reading and writing state variables.These loops are executed on high frequency.However, it's unlikely there will be a long period of time in which these function are not called. but if it does come in such situation contract will be trapped.
Proof of Concept
Above function iterate manytimes and do a lot operations with state variables(read/write)
Tools Used
Manual
Recommended Mitigation Steps
Create a bot that will call these function atleast once per week
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: