From 790cea3e2cf4f4dbb4a4851c5ef7b1b96efa1714 Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 20 Jun 2022 10:16:30 +0200 Subject: [PATCH 1/2] remove unbonding op with no consumer chains --- spec/app/ics-028-cross-chain-validation/methods.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/app/ics-028-cross-chain-validation/methods.md b/spec/app/ics-028-cross-chain-validation/methods.md index 01a425f2f..b0e919505 100644 --- a/spec/app/ics-028-cross-chain-validation/methods.md +++ b/spec/app/ics-028-cross-chain-validation/methods.md @@ -886,6 +886,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, _)) From 31ee990ee934a97da331e3cf05519dc3bdf15a9b Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 20 Jun 2022 11:17:17 +0200 Subject: [PATCH 2/2] add postcondition --- spec/app/ics-028-cross-chain-validation/methods.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/app/ics-028-cross-chain-validation/methods.md b/spec/app/ics-028-cross-chain-validation/methods.md index b0e919505..ac6c0a32c 100644 --- a/spec/app/ics-028-cross-chain-validation/methods.md +++ b/spec/app/ics-028-cross-chain-validation/methods.md @@ -919,6 +919,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