parallel
parallel copied to clipboard
Cancel unstake improvement
currently it supports only cancel at the same era. We should support cancel at any era
Seems like in cancel_unstake
, we can easily convert "the DOT amount stored in Unlockings
" into sDOT amount, and directly add it to matchingpool.total_stake_amount.free
. the steps are following:
-
- decrease DOT amount in
Unlockings
, just like whatrebond
does.
- decrease DOT amount in
-
- calculate sDOT amount according to the current exchange rate, and mint to users
-
- add DOT amount to
matchingpool.total_stake_amount.free
.
- add DOT amount to
That's all we should do in cancel_unstake
. did I miss anything?
Option2: User rebond directly via XCM
- In Era 1, Alice stake 50, Bob stake 50, matching result is bond 100 on relaychain
- In Era 2, Alice stake 100, Bob unstake 50, matching result is bond 50 on relaychain
- In Era 3, Bob wants to cancel_unstake 50, if Bob can rebond directly on relaychain, there are no unlocking chunks on relaychain. rebond operation on relaychain will Fail.
This option can not work.