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

Make a slash governance proposal #64

Closed
4 tasks
ValarDragon opened this issue Jan 26, 2022 · 2 comments
Closed
4 tasks

Make a slash governance proposal #64

ValarDragon opened this issue Jan 26, 2022 · 2 comments
Labels

Comments

@ValarDragon
Copy link
Member

Summary

There should be a governance proposal type to slash a validator. It would specify slash_percentage and validator address.

Problem Definition

This has a number of use cases. It allows blockchain communities to codify social standards that validators have to adhere to, and in the event they are 'caught' by the community, it allows them to slash them on-chain. (Without needing a hard fork)

A social slashing standard that has interest from the Osmosis community is essentially a "No Sybilling" condition, where they can all agree that if governance is presented with sufficiently persuasive evidence of a validator sybilling in order to game airdrops, newer staking reward designs, etc. they would be slashed for a certain factor. (With some carveout for cotenancy situations etc.). This is in part motivated by some validator-sybil-gameable decentralization ideas, cref https://commonwealth.im/osmosis/discussion/2036-proposal-per-validator-epoch-bonus-for-better-decentralization

I'm generally of the view that this is important for many chains, if validators commit malicious activities not yet thought about in advance, or on other chains. I propose we add this as a governance proposal type to the slashing module. Chains can simply choose not to add this governance proposal type to their governance router if they don't want this feature.

Proposal

Make a new governance proposal type in slashing with the following proto:

message SlashValidatorProposal {
  option (gogoproto.equal) = true;
  option (gogoproto.goproto_getters) = false;
  option (gogoproto.goproto_stringer) = false;

  string title = 1;
  string description = 2;
  string  validator_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  string slash_factor_percent = 4 [
    (cosmos_proto.scalar)  = "cosmos.Dec",
    (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
    (gogoproto.nullable)   = false
  ];
}

Heres an example of how you do custom governance proposal types if folks are interested:

Happy to help guide anyone interested in implementing this

To do this, you'd implement:

Reference SDK issue

There is a reference issue in the SDK here cosmos#10917 . I expect that I'm only going to track this one for the foreseeable future, since that one is blocked on a multi-month gov refactor.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ValarDragon
Copy link
Member Author

From @hleb-albau

I created a small draft, now lets discuss next:

  1. What validator state should be considered for slashing(now, proposal creating or other)? How it should influence delegations and re-delegations before and after slashing point? Should we allow safe re-delegate tokens during vote or during deposit or not?
  2. What if chain has unbounding period is less than vote period? (maybe just leave it as is, just make sanity check before call actual slash). We loose info about delegations and re-delegations after unbound succeed.
  3. Can validator and its delegators vote on prop?
  4. It seems that gov module has very simple route handler that not allow to register more advanced checks on proposal creation. For example, it is not possible to validate on proposal creation that validator exist and in active set. Maybe we need to advance route architecture?(or it should be done in ADR in other issue?)

@ValarDragon
Copy link
Member Author

Re the questions:

  1. I think the only way to do it efficiently in the SDK atm is Now. That will cover unbondings / redelegations though.
  2. Hrm, I think thats an ok edge case. Would be good to potentially emit a warning if theres a sensible way of doing so.
  3. Yup! If your being slashed, you should be allowed to say that you don't agree
  4. Yeah, this is really unfortunate that none of the relevant validation methods get the context passed in. I think for a v1 of this feature, we'd have to be ok with the edge case of being able to slash inactives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant