The calculation for nextGroupTotalUnbonded in FundFlowController::_getVaultUpdateData incorrectly includes non-grouped vaults in its computation. The purpose of this function is to return data necessary to execute a vault group update for a strategy, excluding vaults that are not in the group. However, by including all vaults, both grouped and non-grouped, in the calculation, the returned nextGroupTotalUnbonded value becomes inaccurate. This leads to several downstream issues in the protocol, especially in the updateVaultGroups function, where this value is used for further calculations affecting withdrawals and deposits.
The _getVaultUpdateData function is intended to calculate and return data only for grouped vaults, but it mistakenly includes non-grouped vaults in its calculation of nextGroupTotalUnbonded. Here’s the relevant code section:
The issue lies in the fact that _vcs.getVaults() returns all vaults, both grouped and non-grouped, and passes them into _getTotalUnbonded. This causes all vaults to be factored into the totalUnbonded calculation:
The calculation erroneously includes non-grouped vaults, which can receive deposits once grouped vaults are full. These non-group vaults are only added to a group when the group deposit index reaches the next vault in the list. As a result, the totalUnbonded value returned is incorrect.
In contrast, the _getTotalDepositRoom function, called earlier in _getVaultUpdateData, correctly uses the depositIndex to ensure that non-grouped vaults are not included in its calculation:
Because _getVaultUpdateData is used in the updateVaultGroups function, this error leads to an incorrect nextGroupOpVaultsTotalUnbonded value, which affects the updates to both operatorVCS and communityVCS. This miscalculation can lead to several accounting issues, ultimately causing deposit and withdrawal functions to malfunction.
If the totalUnbonded value is higher than it should be, withdrawals could be blocked when the requested amount exceeds the incorrect totalUnbonded value.
The incorrect totalUnbonded value returned by _getVaultUpdateData leads to misaligned accounting in the updateVaultGroups function. This can cause:
Blocked withdrawals if the system calculates an inflated totalUnbonded value that exceeds the available unbonded balance.
Potentially malfunctioning deposit and withdrawal functions due to misalignment between grouped and non-grouped vault calculations.
These issues disrupt the protocol’s core operations, negatively impacting user experience and the protocol’s financial integrity.
Manual
Modify the _getTotalUnbonded function to exclude non-grouped vaults from its calculation by introducing a similar mechanism as used in _getTotalDepositRoom, ensuring that only grouped vaults are considered. This will align the nextGroupTotalUnbonded value with the actual vault state and prevent future miscalculations.
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.