Queue MapleWithdrawalManager may revert due to honest removeShares() or manual redeem calls
Description
The queue withdrawal manager limits the sharesToProcess in processRedemptions() to the totalShares.
This might make the call revert if non malicious users remove shares or do manual redeems.
Another concurrency issue is if the available liquidity is just enough to cover for a processRedemptions() call, but someone frontruns it and does a manual redeem.
Recommendation
Instead of reverting if the processedShares argument is bigger than totalShares, limit it:
function processRedemptions(uint256 sharesToProcess_) external override
whenProtocolNotPaused nonReentrant onlyRedeemer {
... uint256 cachedTotalShares_ = totalShares;
if (sharesToProcess_ > cachedTotalShares_) sharesToProcess_ = cachedTotalShares_;
... }It's trickier to solve the lack of liquidity concurrency issue, as it would require allowing partial redemptions.
Status
Addressed in #7dbcd37