parallel icon indicating copy to clipboard operation
parallel copied to clipboard

How to handle bond | unbond | rebond's failure?

Open 0x8f701 opened this issue 3 years ago • 4 comments

The exchange rate of every era will not be the same. Let's image that exchange_rate will always increase. Then if unbond fails, the next unbond will unbond more on the relaychain. This is still ok, because requests in unstake queue use old exchange rate (smaller). The money withdrawn from relaychain will definitely be bigger enough to cover them.

However, if the exchange_rate goes down then maybe we cannot cover unstake requests in that era

0x8f701 avatar Feb 17 '22 15:02 0x8f701

To solve this, maybe total_unstake_amount should be staking currency 's amount

0x8f701 avatar Feb 17 '22 15:02 0x8f701

If unbond fails, shall UnbondIndex still increase? seems we shouldn't

0x8f701 avatar Feb 17 '22 15:02 0x8f701

Maybe we can consider store 'MatchingLedger' in each period, so if unbond failed in current period, it won't affect next period. we can fix the failed period by governance

mclyk avatar Feb 18 '22 08:02 mclyk

Maybe unbond_index should advance if:

  • unbond_amount == 0 => unbond_index += 1
  • unbond_amount != 0 => after receiving notification, unbond_index += 1

0x8f701 avatar Feb 20 '22 13:02 0x8f701