Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Revise staking origins #12930

Closed
kianenigma opened this issue Dec 14, 2022 · 2 comments
Closed

Revise staking origins #12930

kianenigma opened this issue Dec 14, 2022 · 2 comments
Assignees
Labels
J0-enhancement An additional feature request. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@kianenigma
Copy link
Contributor

Currently,

cancel_defered_slash has a custom origin.
everything else, including:

  • changing validator count
  • forcing era change
  • force_unstake
  • set_config (sets the count bounds, min bonds, and min-commission)

are all root. Some of these are not justifiable to be root, and not in-line with gov v2.

An easy fix is to make all of this be one custom origin, and map them to StakingAdmin on Kusama (and Root in Polkadot while we're at Gov v1). So rename and reuse the existing SlashCancelOrigin for more things.

I thought about splitting them up, but it doesn't make sense. Almost all of these are equally important, and with obtaining any of them you can attack a chain.

For example:

  • you can set the validator count to 0
  • you can force-unstake everyone
  • you can misbehave and cancel the slash
  • you can set a very high min-bon, such that no one can nominator or validate.
  • you can set a very low max validator / max-nominator
  • the combination of the above two gives you power to chill everyone and create nothing at stake

So all of them can be equally destructive and should be well protected.

Long term, it would be good if we can extract setting commission into another transaction that has a slightly weaker origin, as this one is the only non-attackbale one.

@kianenigma kianenigma added J0-enhancement An additional feature request. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder labels Dec 14, 2022
@kianenigma kianenigma moved this to 📕 Backlog in (Nominated) Proof of Stake Dec 14, 2022
@kianenigma kianenigma added the Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. label Dec 14, 2022
@Ank4n Ank4n self-assigned this Dec 15, 2022
@Ank4n
Copy link
Contributor

Ank4n commented Dec 26, 2022

Should we extract out set_min_commission with a weaker origin and close this issue?

I think one idea is, in long term, we can look into overloading most transactions to allow weaker origin to execute it if the code determines the change is not significant (eg: validator count changes up to 10% of its value). Otherwise require root. But admittedly, it might just be over-engineering and we should revisit this when we next hit a bottle neck in handling staking related governance decisions.

@Ank4n Ank4n closed this as completed Jan 16, 2023
@github-project-automation github-project-automation bot moved this from 📕 Backlog to ✅ Done in (Nominated) Proof of Stake Jan 16, 2023
@Polkadot-Forum
Copy link

This issue has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-37/1736/1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants