Arbitrary Deduction of Total Bond Satoshi from Unbonding Delegation Handling
Description
The MsgBTCUndelegate
message handler, which supports early unbonding for delegations, allows unbonding even when the delegation is in the BTCDelegationStatus_PENDING
status rather than BTCDelegationStatus_ACTIVED
. (Reference↗)
When the scheduled block for BTCDelegationStatus_UNBONDED
arrives, the following code is executed:
Since BTCDelegationStatus_ACTIVED
was never emitted, no Delegated Satoshi was added for the affected FP. However, the BTCDelegationStatus_UNBONDED
event still causes the Delegated Satoshi to be deducted.
Impact
If the quorum is not met in time, the BTCDelegationStatus_ACTIVED
event is never emitted, yet the BTCDelegationStatus_UNBONDED
event still triggers a deduction of Delegated Satoshi for the affected Finality Provider. This could result in an arbitrary and unfair reduction of a specific FP’s Delegated Satoshi, even though no delegation was ever successfully activated.
This issue is similar to issue 3.10, but it occurs in a different part of the code and is more likely to happen.
Recommendations
Modify the expiration event handling logic to ensure that BTCDelegationStatus_UNBONDED
does not trigger a deduction if BTCDelegationStatus_ACTIVED
was never emitted.
Remediation
This issue has been acknowledged by Babylon Labs, and a fix was implemented in commit a8d24315↗.
This was remediated by the above recommendation.