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

Validate staking functionalities for sovereign -> consumer changeover #781

Closed
Tracked by #756
shaspitz opened this issue Mar 15, 2023 · 5 comments · Fixed by #794
Closed
Tracked by #756

Validate staking functionalities for sovereign -> consumer changeover #781

shaspitz opened this issue Mar 15, 2023 · 5 comments · Fixed by #794
Assignees

Comments

@shaspitz
Copy link
Contributor

shaspitz commented Mar 15, 2023

Slashing, jailing, etc. must work correctly after the upgrade and before the provider valset starts validating blocks. Confirm that consumer initiated slashing is functional even before CCV is established. We also need the "old" staking keeper around for at least the consumer unbonding period.

@shaspitz shaspitz self-assigned this Mar 15, 2023
@shaspitz shaspitz changed the title Staking functionalities must work correctly after the upgrade and before the provider valset starts validating blocks. Confirm that consumer initiated slashing is functional even before CCV is established Validate staking functionalities for sovereign -> consumer migration Mar 15, 2023
@shaspitz shaspitz changed the title Validate staking functionalities for sovereign -> consumer migration Validate staking functionalities for sovereign -> consumer changeover Mar 15, 2023
@mpoke mpoke added this to Cosmos Hub Mar 17, 2023
@github-project-automation github-project-automation bot moved this to 🩹 Triage in Cosmos Hub Mar 17, 2023
@mpoke mpoke moved this from 🩹 Triage to 🏗 In progress in Cosmos Hub Mar 17, 2023
@shaspitz
Copy link
Contributor Author

@mpoke here's an update after brainstorming and drafting up some code:

Concerns / notables

  • How are delegation records migrated between staking keepers?
  • Consider that staking token before changeover is STRD, and after it’s ATOM
  • previously sovereign staking module (that satisfies democracy module?) needs to have slashing capabilities to slash STRD

Slash behavior

After upgrade, before changeover complete After changeover complete
val in old Valset only call sovStaking.Slash() to slash STRD call sovStaking.Slash() for STRD. Would need to add some tests around this confirming STRD can still be burned. Sov staking should handle unbonding
val in new Valset only no-op call ccvStaking.Slash() to send slash req
In both sets call sovStaking.Slash() do one of two above boxes depending on infraction height

Jail Behavior - TLDR always No-op

After upgrade, before changeover complete After changeover complete
Old Valset only Call sovStaking.Jail(). essentially a no-op. new valset in effect by the time jailing happens Validator already has zero power. No way to punish (no-op)
New Valset only no-op ccvStaking.Jail() (no-op)
In both sets no-op ccvStaking.Jail() (no-op)

Unjail Behavior

Always a no-op as well. Unjailing from the new valset is done on provider. Unjailing from old valset is n/a after the changeover is complete. Unjailing from old valset after upgrade, before changeover is complete doesn't really do much since the new valset takes over in 2-3 blocks anyways

The remaining methods from validators.go can be handled on a case by case basis, but I don't think we'd break anything if we just leave them unimplemented. Further testing can confirm this. Lmk if you have any thoughts

@mpoke
Copy link
Contributor

mpoke commented Mar 20, 2023

Regarding the Slash behavior, I'm not sure we need the In both sets scenario. An infraction happens at an infractionHeight. If the "sovereign" valset was producing blocks at that height, then call sovStaking.Slash(). Otherwise, call ccvStaking.Slash() to send slash req.

Similarly for Jail Behavior.

Regarding the no-op of Jail Behavior, it may be useful to jail validators in the old valset as that will still affect their involvement in governance. However, this has very low priority. This opens the question of whether representatives can be jailed. @jtremback? If they can, this means that the Unjail must be directed to the gov-staking module.

@shaspitz
Copy link
Contributor Author

On the topic of jailing a democracy power, I believe we could add an implementation to Jail in this file to achieve what you're talking about.

I will say it seems like an odd design to jail someone for some short amount of time from voting on gov proposals. Seems like it'd be fine and quite simple to just keep Jail() as fully a no-op

@shaspitz
Copy link
Contributor Author

@mpoke a normal democracy consumer (not going through the changeover process) will treat Jail() as a no-op, I say we keep that functionality unless some consumer chain (esp Stride) desires other functionality

@shaspitz
Copy link
Contributor Author

shaspitz commented Apr 6, 2023

Confirm that consumer initiated slashing is functional even before CCV is established

@mpoke I believe this was a concern that was brought up during one of our conversations a couple weeks ago. To confirm the concern is already addressed by our code, I've added this test to the PR solving this issue

@shaspitz shaspitz moved this from 🏗 In progress to 👀 In review in Cosmos Hub Apr 10, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Cosmos Hub Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants