When CommunityVCS::deposit is called, it retrieves the maximum deposit limit for a staker from the Chainlink stakeController. If the new maxDeposits is greater than the previously recorded value, the totalDepositRoom for each vault group is updated. However, the function fails to account for cases where maxDeposits is decreased. This causes the recorded VaultGroups.totalDepositRoom to become outdated, resulting in inefficient use of vault capacity and premature termination of the deposit function.
The CommunityVCS::deposit function updates the totalDepositRoom for each vault group when maxDeposits increases. Here's the relevant code:
The problem arises when maxDeposits is decreased. The totalDepositRoom value recorded for each vault group remains larger than the new, lower maxDeposits, causing an issue when deposits are processed in VaultDepositController::_depositToVaults. The check in _depositToVaults compares the outdated totalDepositRoom with the updated _maxDeposits, leading to premature termination of the deposit process:
This results in inefficient vault capacity utilization and prevents the correct amount of tokens from being deposited into the vaults. Furthermore, there is no function in the contract that can adjust the totalDepositRoom to the correct value when maxDeposits decreases, leaving the problem unresolved until the Chainlink staker limit increases again to the previous or higher value.
This issue leads to inefficient use of vault capacity, as the protocol unintentionally limits the amount of staked tokens it can support per vault group. This affects the protocol's staking operations and prevents the full utilization of available staking capacity.
Manual
Ensure that the deposit function accounts for cases where the maxDeposits on Chainlink is decreased. The protocol should update the totalDepositRoom for each vault group accordingly to prevent outdated values from interfering with deposits and efficient staking operations.
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.