Comparison in Unbonding Period Verification Forces Users to Wait Extra Block Before Claiming Tokens
claimUnstake uses strict > comparisons instead of >= for unbonding completion checks. The off-by-one extends the actual unbonding window by one block beyond what UNBONDING_PERIOD specifies.
Description
The LiquidStakingPool contract implements an incorrect condition check in the claimUnstake() function when verifying if unbonding periods have been satisfied. The function uses strict comparison operators (>) instead of inclusive comparison operators (>=), which extends the actual unbonding period by one block beyond what is intended.
uint256 blocksSinceRequest = block.number - request.requestBlock;bool lspUnbondingComplete = (blocksSinceRequest > UNBONDING_PERIOD);bool poolUnbondingComplete = (blocksSinceRequest > poolUnbondingPeriod);
When a user requests an unstake at block N with an unbonding period of X blocks:
- At block N+X (when the period should complete), the condition
X > Xevaluates to false - Users can only claim at block N+X+1, extending the unbonding period by one block
Impact
This implementation error has the following impact:
- Users who attempt to claim their tokens exactly at the end of the unbonding period will have their transactions revert with
UnbondingNotComplete(), even though the period has technically elapsed. - The actual unbonding duration is extended by one block beyond what is specified by
UNBONDING_PERIODandpoolUnbondingPeriodconstants.
The issue affects all unstake claims in the protocol and represents a deviation from the intended functionality.
Recommendation
The comparison operators should be changed to inclusive comparisons to accurately reflect the intended unbonding period:
bool lspUnbondingComplete = (blocksSinceRequest >= UNBONDING_PERIOD);bool poolUnbondingComplete = (blocksSinceRequest >= poolUnbondingPeriod);

