The initialisePoolRuleIntermediateValues() function in UpdateRule fails to properly handle rules like MinimumVarianceUpdateRule that require double the number of moving averages (current + previous) due to a length validation check in _setInitialMovingAverages().
The issue occurs in the following call flow:
The MinimumVarianceUpdateRule requires double the assets count for moving averages:
And this how storage should look for that rule by DEV comment
The validation check _initialMovingAverages.length == _numberOfAssets prevents setting both current and previous moving averages, only allowing current ones to be set.
This will leave two options to the admin:
Not using the function
Use the function setting only moving average of the length of number of assets
If its the first one, then the availability of function is lost
If its the second option, then other integrators of that stored previous moving averages will be cornuted
Admin cannot properly set/override moving averages for rules requiring previous values
Loss of historical moving average data when manual override is needed
Breaks integrations from other protocols relying on both current and previous moving average values
Manual review
Modify the validation in _setInitialMovingAverages() to handle rules requiring different moving average lengths or there can be a check to assure that new values are the same length as movingAverageLength retrieved from the mapping
Likelihood: Low, when setting a new UpdateWeightRunner (for hotfixes) Impact: High, DoS performUpdate and force redeployment
Likelihood: Low, admin needs to use the breakglass function on a rule with prevMovAverage set to true. Impact: Medium/High, DoS that breakglass function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.