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

Unbonding pausing waits for uninvolved consumer chains #1727

Closed
p-offtermatt opened this issue Mar 26, 2024 · 1 comment · Fixed by #1728
Closed

Unbonding pausing waits for uninvolved consumer chains #1727

p-offtermatt opened this issue Mar 26, 2024 · 1 comment · Fixed by #1728
Assignees
Labels
S: NewThings Work towards your business objectives with new products, features, or integrations source: modelling To indicate an issue found while modelling, e.g. in Quint. type: bug Issues that need priority attention -- something isn't working

Comments

@p-offtermatt
Copy link
Contributor

Problem

For unbondings from validator V, we currently pause an unbonding from V,
even if we have received VSCMatured (VSCM) packets from all consumers that V is opted in on.
Specifically, it is because we wait for VSCM packets from ALL consumers, even ones that V is not even opted in on.

This means ANY consumer chain not responding with a VSCM (even a tiny opt in chain with a single validator) will pause ALL unbondings on the hub.

Less importantly, we also send VSCPackets to ALL consumers if there is an unbonding, even if for a given consumer that unbonding doesn't affect any validator that is currently validating on that chain, which means we send more VSCPackets than necessary.

Closing criteria

  1. we do not pause unbondings for which only consumer chains that aren't affected by the unbonding have not responded.

Problem details

The current PSS implementation sends VSCPackets for updates to a chain if either
a) the new validator set for this chain and the last one we sent to this chain are different; or
b) there were any unbondings during the epoch.

unbondingOps := k.GetUnbondingOpsFromIndex(ctx, chain.ChainId, valUpdateID)

Notice that b) means we send VSCPackets to all consumers if we have any unbondings during the block, in particular we even send VSCPackets to consumers that may not even have any validators opted in that had an unbonding happen.

Together with unbonding pausing (when unbonding, we wait for a VSCMaturedPacket from all consumers acknowledging that the unbonding is ok to go ahead), this means that e.g. unbondings from validators that aren't even opted in on any consumer could still be paused by ANY consumer not replying with a VSCMaturedPacket in time.

More code details
Notice that here we check whether there are any unbondings from the block

unbondingOps := k.GetUnbondingOpsFromIndex(ctx, chain.ChainId, valUpdateID)

these are set in a hook upon unbondings, see here
h.k.SetUnbondingOpIndex(ctx, consumerChainID, valsetUpdateID, index)

and further above all consumer chains are simply added here
for _, chain := range h.k.GetAllConsumerChains(ctx) {

@p-offtermatt p-offtermatt added type: bug Issues that need priority attention -- something isn't working S: NewThings Work towards your business objectives with new products, features, or integrations labels Mar 26, 2024
@github-project-automation github-project-automation bot moved this to 🩹 F1: Triage in Cosmos Hub Mar 26, 2024
@p-offtermatt
Copy link
Contributor Author

p-offtermatt commented Mar 26, 2024

It seems trickier to solve than I thought yesterday - to do this properly, we'd need a more differentiated pausing mechanism which individually pauses unbondings from a validator V exactly until all chains that V is opted in on at the time of unbonding have responded.

@p-offtermatt p-offtermatt added the source: modelling To indicate an issue found while modelling, e.g. in Quint. label Mar 27, 2024
@sainoe sainoe self-assigned this Apr 4, 2024
@sainoe sainoe moved this from 🩹 F1: Triage to 🏗 F3: InProgress in Cosmos Hub Apr 4, 2024
@sainoe sainoe closed this as completed Apr 11, 2024
@github-project-automation github-project-automation bot moved this from 🏗 F3: InProgress to 👍 F4: Assessment in Cosmos Hub Apr 11, 2024
@mpoke mpoke moved this from 👍 F4: Assessment to ✅ Done in Cosmos Hub Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: NewThings Work towards your business objectives with new products, features, or integrations source: modelling To indicate an issue found while modelling, e.g. in Quint. type: bug Issues that need priority attention -- something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants