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

Build a validator preferences module #408

Closed
antstalepresh opened this issue Aug 11, 2021 · 2 comments
Closed

Build a validator preferences module #408

antstalepresh opened this issue Aug 11, 2021 · 2 comments
Labels
feature New feature or request

Comments

@antstalepresh
Copy link
Contributor

For auto-staking, we will need to build a validator preference module where a user can configure multiple preferred validators.

In progress in #381

@antstalepresh antstalepresh added the feature New feature or request label Aug 11, 2021
@ValarDragon
Copy link
Member

ValarDragon commented Jan 30, 2022

What we need out of a validator set preferences module is:

A proto definition of validator set preference

message ValidatorPreference {
  string val_oper_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
  // weight as a decimal between 0 and 1
  string weight = 2 [
    (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
    (gogoproto.moretags) = "yaml:\"autostake_rate\"",
    (gogoproto.nullable) = false
  ];
}

message ValidatorSetPreference {
  repeated ValidatorPreference preferences = 1 [ (gogoproto.nullable) = false ];
}
  • A state entry indexed by delegator address to specify a ValidatorSetPreference object
  • A message where a delegator can specify ValidatorSetPreference, and it writes to above state entry
  • A query, where you can query a delegators ValidatorSetPreferences.
    • If the delegator has no validator set preference object, see if they have staked any tokens. If so, construct a validator set preference object by looking at all of their existing delegations on the fly as a query
    • If there is no validator set preference + no staked tokens, make the response clearly indicate this.
  • A proto message to delegate according to your validator set preferences

@ValarDragon
Copy link
Member

Replaced with #2579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants