From 5265e0bb548901ee4af0ec8c8e30ecb36d56f5d0 Mon Sep 17 00:00:00 2001 From: Marius Poke Date: Mon, 27 Jun 2022 11:08:20 +0200 Subject: [PATCH] ICS28: Removing the only consumer chain (#770) * remove unbonding op with no consumer chains * add postcondition --- spec/app/ics-028-cross-chain-validation/methods.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/app/ics-028-cross-chain-validation/methods.md b/spec/app/ics-028-cross-chain-validation/methods.md index b93d27e64..a1ab357b2 100644 --- a/spec/app/ics-028-cross-chain-validation/methods.md +++ b/spec/app/ics-028-cross-chain-validation/methods.md @@ -918,6 +918,13 @@ function StopConsumerChain(chainId: string, lockUnbonding: Bool) { // remove chainId form all outstanding unbonding operations foreach id IN vscToUnbondingOps[(chainId, _)] { unbondingOps[id].unbondingChainIds.Remove(chainId) + // if the unbonding operation has unbonded on all consumer chains + if unbondingOps[id].unbondingChainIds.IsEmpty() { + // notify the Staking module that the unbonding can complete + stakingKeeper.UnbondingCanComplete(id) + // remove unbonding operation + unbondingOps.Remove(id) + } } // clean up vscToUnbondingOps mapping vscToUnbondingOps.Remove((chainId, _)) @@ -944,6 +951,9 @@ function StopConsumerChain(chainId: string, lockUnbonding: Bool) { - `downtimeSlashRequests[chainId]` is emptied. - If `lockUnbonding == false`, then - `chainId` is removed from all outstanding unbonding operations; + - if an outstanding unbonding operation has matured on all consumer chains, + - the `UnbondingCanComplete()` method of the Staking module is invoked; + - the unbonding operation is removed from `unbondingOps`. - all the entries with `chainId` are removed from the `vscToUnbondingOps` mapping. - **Error Condition** - None