Skip to content

Commit

Permalink
ICS28: Removing the only consumer chain (#770)
Browse files Browse the repository at this point in the history
* remove unbonding op with no consumer chains

* add postcondition
  • Loading branch information
mpoke authored Jun 27, 2022
1 parent 6ebbd60 commit 5265e0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/app/ics-028-cross-chain-validation/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, _))
Expand All @@ -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
Expand Down

0 comments on commit 5265e0b

Please sign in to comment.