Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICS28: Unbonding ops are put on hold even w/o consumer chains #763

Merged
merged 4 commits into from
Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions spec/app/ics-028-cross-chain-validation/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -1302,19 +1302,21 @@ function GetUnbondingsFromVSC(
function AfterUnbondingInitiated(opId: uint64) {
// get the IDs of all consumer chains registered with this provider chain
chainIds = chainToClient.Keys()
// create and store a new unbonding operation
unbondingOps[opId] = UnbondingOperation{
id: opId,
unbondingChainIds: chainIds
}
// add the unbonding operation id to vscToUnbondingOps
foreach chainId in chainIds {
vscToUnbondingOps[(chainId, vscId)].Append(opId)
}
if len(chainIds) > 0 {
// create and store a new unbonding operation
unbondingOps[opId] = UnbondingOperation{
id: opId,
unbondingChainIds: chainIds
}
// add the unbonding operation id to vscToUnbondingOps
foreach chainId in chainIds {
vscToUnbondingOps[(chainId, vscId)].Append(opId)
}

// ask the Staking module to wait for this operation
// to reach maturity on the consumer chains
stakingKeeper.PutUnbondingOnHold(opId)
// ask the Staking module to wait for this operation
// to reach maturity on the consumer chains
stakingKeeper.PutUnbondingOnHold(opId)
}
}
```
- **Caller**
Expand All @@ -1324,9 +1326,11 @@ function AfterUnbondingInitiated(opId: uint64) {
- **Precondition**
- True.
- **Postcondition**
- An `UnbondingOperation` `op` is created and added to `unbondingOps`, such that `op.id = opId` and `op.unbondingChainIds` is the list of all consumer chains registered with this provider chain, i.e., `chainToClient.Keys()`.
- `opId` is appended to every list in `vscToUnbondingOps[(chainId, vscId)]`, where `chainId` is an ID of a consumer chains registered with this provider chain and `vscId` is the current VSC ID.
- The `PutUnbondingOnHold(opId)` of the Staking module is invoked.
- `chainIds` is set to the list of all consumer chains registered with this provider chain, i.e., `chainToClient.Keys()`.
- If there is at least one consumer chain in `chainIds`, then
- an `UnbondingOperation` `op` is created and added to `unbondingOps`, such that `op.id = opId` and `op.unbondingChainIds = chainIds`.
- `opId` is appended to every list in `vscToUnbondingOps[(chainId, vscId)]`, where `chainId` is an ID of a consumer chains registered with this provider chain and `vscId` is the current VSC ID.
- the `PutUnbondingOnHold(opId)` of the Staking module is invoked.
- **Error Condition**
- None.

Expand Down