Submitted by Jeiwan, also found by yixxas, Franfran, and 0xbepresent
After recreation, minipools will receive more AVAX than the sum of their owners current stake and the rewards that they generated.
Multipools that successfully finished validation may be recreated by multisigs, before staked GGP and deposited AVAX have been withdrawn by minipool owners (MinipoolManager.sol#L444). The function compounds deposited AVAX by adding the rewards earned during previous validation periods to the AVAX amounts deposited and requested from stakers (MinipoolManager.sol#L450-L452):
The function assumes that a node operator and liquid stakers earned an equal reward amount: compoundedAvaxNodeOpAmt is calculated as the sum of the current AVAX deposit of the minipool owner and the node operator reward earned so far. However, liquid stakers get a smaller reward than node operators: the minipool node commission fee is applied to their share (MinipoolManager.sol#L417):
As a result, the avaxLiquidStakerAmt set in the recreateMinipool function will always be bigger than the actual amount since it equals to the compounded node operator amount, which includes node operator rewards.
Next, in the recreateMinipool function, the assigned AVAX amount is increased by the amount borrowed from liquid stakers + the node operator amount, which is again wrong because the assigned AVAX amount can only be increased by the liquid stakers reward share (MinipoolManager.sol#L457-L459):
As a result, the amount of AVAX borrowed from liquid stakers by the minipool will be increased by the minipool node commission fee, the increased amount will be sent to the validator, and it will be required to end the validation period.
The following PoC demonstrates the wrong calculation:
When compounding rewards in the recreateMinipool function, consider using an average reward so that node operators and liquid stakers deposits are increased equally and the entire reward amount is used:
Also, consider sending equal amounts of rewards to the vault and the ggAVAX token in the recordStakingEnd function.
emersoncloud (GoGoPool) disagreed with severity and commented:
0xju1ie (GoGoPool) commented:
0xju1ie (GoGoPool) disputed and commented:
Alex the Entreprenerd (judge) commented:
Franfran (warden) commented:
emersoncloud (GoGoPool) commented:
Alex the Entreprenerd (judge) set severity to Medium and commented:
Jeiwan (warden) commented:
emersoncloud (GoGoPool) mitigated:
Status: Mitigation not confirmed. Full details in report from RaymondFam, and also included in Mitigation Review section below.
