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

docs: Update x/staking spec #8395

Merged
merged 13 commits into from
Feb 1, 2021
92 changes: 48 additions & 44 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5024,8 +5024,8 @@ Commission defines commission parameters for a given validator.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `commission_rates` | [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) | | |
| `update_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | |
| `commission_rates` | [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) | | commission_rates defines the initial commission rates to be used for creating a validator. |
| `update_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | update_time is the last time the commission rate was changed. |



Expand All @@ -5041,9 +5041,9 @@ a validator.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `rate` | [string](#string) | | |
| `max_rate` | [string](#string) | | |
| `max_change_rate` | [string](#string) | | |
| `rate` | [string](#string) | | rate is the commission rate charged to delegators, as a fraction. |
| `max_rate` | [string](#string) | | max_rate defines the maximum commission rate which validator can ever charge, as a fraction. |
| `max_change_rate` | [string](#string) | | max_change_rate defines the maximum daily increase of the validator commission, as a fraction. |



Expand Down Expand Up @@ -5128,9 +5128,9 @@ validator.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `delegator_address` | [string](#string) | | |
| `validator_address` | [string](#string) | | |
| `shares` | [string](#string) | | |
| `delegator_address` | [string](#string) | | delegator_address is the bech32-encoded address of the delegator. |
| `validator_address` | [string](#string) | | validator_address is the bech32-encoded address of the validator. |
| `shares` | [string](#string) | | shared define the delegation shares received. |



Expand Down Expand Up @@ -5162,11 +5162,11 @@ Description defines a validator description.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `moniker` | [string](#string) | | |
| `identity` | [string](#string) | | |
| `website` | [string](#string) | | |
| `security_contact` | [string](#string) | | |
| `details` | [string](#string) | | |
| `moniker` | [string](#string) | | moniker defines a human-readable name for the validator. |
| `identity` | [string](#string) | | identity defines an optional identity signature (ex. UPort or Keybase). |
| `website` | [string](#string) | | website defines an optional website link. |
| `security_contact` | [string](#string) | | security_contact defines an optional email for security contact. |
| `details` | [string](#string) | | details define other optional details. |



Expand Down Expand Up @@ -5200,11 +5200,11 @@ Params defines the parameters for the staking module.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `unbonding_time` | [google.protobuf.Duration](#google.protobuf.Duration) | | |
| `max_validators` | [uint32](#uint32) | | |
| `max_entries` | [uint32](#uint32) | | |
| `historical_entries` | [uint32](#uint32) | | |
| `bond_denom` | [string](#string) | | |
| `unbonding_time` | [google.protobuf.Duration](#google.protobuf.Duration) | | unbonding_time is the time duration of unbonding. |
| `max_validators` | [uint32](#uint32) | | max_validators is the maximum number of validators. |
| `max_entries` | [uint32](#uint32) | | max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). |
| `historical_entries` | [uint32](#uint32) | | historical_entries is the number of historical entries to persist. |
| `bond_denom` | [string](#string) | | bond_denom defines the bondable coin denomination. |



Expand Down Expand Up @@ -5237,10 +5237,12 @@ from a particular source validator to a particular destination validator.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `delegator_address` | [string](#string) | | |
| `validator_src_address` | [string](#string) | | |
| `validator_dst_address` | [string](#string) | | |
| `entries` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | repeated | redelegation entries |
| `delegator_address` | [string](#string) | | delegator_address is the bech32-encoded address of the delegator. |
| `validator_src_address` | [string](#string) | | validator_src_address is the validator redelegation source operator address. |
| `validator_dst_address` | [string](#string) | | validator_dst_address is the validator redelegation destination operator address. |
| `entries` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | repeated | entries are the redelegation entries.

redelegation entries |



Expand All @@ -5255,10 +5257,10 @@ RedelegationEntry defines a redelegation object with relevant metadata.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `creation_height` | [int64](#int64) | | |
| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | |
| `initial_balance` | [string](#string) | | |
| `shares_dst` | [string](#string) | | |
| `creation_height` | [int64](#int64) | | creation_height defines the height which the redelegation took place. |
| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | completion_time defines the unix time for redelegation completion. |
| `initial_balance` | [string](#string) | | initial_balance defines the initial balance when redelegation started. |
| `shares_dst` | [string](#string) | | shares_dst is the amount of destination-validator shares created by redelegation. |



Expand Down Expand Up @@ -5310,9 +5312,11 @@ for a single validator in an time-ordered list.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `delegator_address` | [string](#string) | | |
| `validator_address` | [string](#string) | | |
| `entries` | [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) | repeated | unbonding delegation entries |
| `delegator_address` | [string](#string) | | delegator_address is the bech32-encoded address of the delegator. |
| `validator_address` | [string](#string) | | validator_address is the bech32-encoded address of the validator. |
| `entries` | [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) | repeated | entries are the unbonding delegation entries.

unbonding delegation entries |



Expand All @@ -5327,10 +5331,10 @@ UnbondingDelegationEntry defines an unbonding object with relevant metadata.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `creation_height` | [int64](#int64) | | |
| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | |
| `initial_balance` | [string](#string) | | |
| `balance` | [string](#string) | | |
| `creation_height` | [int64](#int64) | | creation_height is the height which the unbonding took place. |
| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | completion_time is the unix time for unbonding completion. |
| `initial_balance` | [string](#string) | | initial_balance defines the tokens initially scheduled to receive at completion. |
| `balance` | [string](#string) | | balance defines the tokens to receive at completion. |



Expand Down Expand Up @@ -5367,17 +5371,17 @@ multiplied by exchange rate.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `operator_address` | [string](#string) | | |
| `consensus_pubkey` | [google.protobuf.Any](#google.protobuf.Any) | | |
| `jailed` | [bool](#bool) | | |
| `status` | [BondStatus](#cosmos.staking.v1beta1.BondStatus) | | |
| `tokens` | [string](#string) | | |
| `delegator_shares` | [string](#string) | | |
| `description` | [Description](#cosmos.staking.v1beta1.Description) | | |
| `unbonding_height` | [int64](#int64) | | |
| `unbonding_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | |
| `commission` | [Commission](#cosmos.staking.v1beta1.Commission) | | |
| `min_self_delegation` | [string](#string) | | |
| `operator_address` | [string](#string) | | operator_address defines the address of the validator's operator; bech encoded in JSON. |
| `consensus_pubkey` | [google.protobuf.Any](#google.protobuf.Any) | | consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. |
| `jailed` | [bool](#bool) | | jailed defined whether the validator has been jailed from bonded status or not. |
| `status` | [BondStatus](#cosmos.staking.v1beta1.BondStatus) | | status is the validator status (bonded/unbonding/unbonded). |
| `tokens` | [string](#string) | | tokens define the delegated tokens (incl. self-delegation). |
| `delegator_shares` | [string](#string) | | delegator_shares defines total shares issued to a validator's delegators. |
| `description` | [Description](#cosmos.staking.v1beta1.Description) | | description defines the description terms for the validator. |
| `unbonding_height` | [int64](#int64) | | unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. |
| `unbonding_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. |
| `commission` | [Commission](#cosmos.staking.v1beta1.Commission) | | commission defines the commission parameters. |
| `min_self_delegation` | [string](#string) | | min_self_delegation is the validator's self declared minimum self delegation. |



Expand Down
44 changes: 44 additions & 0 deletions proto/cosmos/staking/v1beta1/staking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ message CommissionRates {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;

// rate is the commission rate charged to delegators, as a fraction.
string rate = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
// max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
string max_rate = 2 [
(gogoproto.moretags) = "yaml:\"max_rate\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
// max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
string max_change_rate = 3 [
(gogoproto.moretags) = "yaml:\"max_change_rate\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
Expand All @@ -45,7 +48,9 @@ message Commission {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;

// commission_rates defines the initial commission rates to be used for creating a validator.
CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// update_time is the last time the commission rate was changed.
google.protobuf.Timestamp update_time = 2
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"update_time\""];
}
Expand All @@ -55,10 +60,15 @@ message Description {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;

// moniker defines a human-readable name for the validator.
string moniker = 1;
// identity defines an optional identity signature (ex. UPort or Keybase).
string identity = 2;
// website defines an optional website link.
string website = 3;
// security_contact defines an optional email for security contact.
string security_contact = 4 [(gogoproto.moretags) = "yaml:\"security_contact\""];
// details define other optional details.
string details = 5;
}

Expand All @@ -75,22 +85,33 @@ message Validator {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;

// operator_address defines the address of the validator's operator; bech encoded in JSON.
string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""];
// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
google.protobuf.Any consensus_pubkey = 2
[(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", (gogoproto.moretags) = "yaml:\"consensus_pubkey\""];
// jailed defined whether the validator has been jailed from bonded status or not.
bool jailed = 3;
// status is the validator status (bonded/unbonding/unbonded).
BondStatus status = 4;
// tokens define the delegated tokens (incl. self-delegation).
string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
// delegator_shares defines total shares issued to a validator's delegators.
string delegator_shares = 6 [
(gogoproto.moretags) = "yaml:\"delegator_shares\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
// description defines the description terms for the validator.
Description description = 7 [(gogoproto.nullable) = false];
// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""];
// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
google.protobuf.Timestamp unbonding_time = 9
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""];
// commission defines the commission parameters.
Commission commission = 10 [(gogoproto.nullable) = false];
// min_self_delegation is the validator's self declared minimum self delegation.
string min_self_delegation = 11 [
(gogoproto.moretags) = "yaml:\"min_self_delegation\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
Expand Down Expand Up @@ -164,8 +185,11 @@ message Delegation {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

// delegator_address is the bech32-encoded address of the delegator.
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
// validator_address is the bech32-encoded address of the validator.
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
// shared define the delegation shares received.
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
string shares = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
}

Expand All @@ -176,8 +200,11 @@ message UnbondingDelegation {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

// delegator_address is the bech32-encoded address of the delegator.
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
// validator_address is the bech32-encoded address of the validator.
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
// entries are the unbonding delegation entries.
repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries
}

Expand All @@ -186,14 +213,18 @@ message UnbondingDelegationEntry {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;

// creation_height is the height which the unbonding took place.
int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""];
// completion_time is the unix time for unbonding completion.
google.protobuf.Timestamp completion_time = 2
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""];
// initial_balance defines the tokens initially scheduled to receive at completion.
string initial_balance = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"initial_balance\""
];
// balance defines the tokens to receive at completion.
string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
}

Expand All @@ -202,14 +233,18 @@ message RedelegationEntry {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;

// creation_height defines the height which the redelegation took place.
int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""];
// completion_time defines the unix time for redelegation completion.
google.protobuf.Timestamp completion_time = 2
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""];
// initial_balance defines the initial balance when redelegation started.
string initial_balance = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"initial_balance\""
];
// shares_dst is the amount of destination-validator shares created by redelegation.
string shares_dst = 4
[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
}
Expand All @@ -221,9 +256,13 @@ message Redelegation {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

// delegator_address is the bech32-encoded address of the delegator.
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
// validator_src_address is the validator redelegation source operator address.
string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
// validator_dst_address is the validator redelegation destination operator address.
string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
// entries are the redelegation entries.
repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries
}

Expand All @@ -232,11 +271,16 @@ message Params {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;

// unbonding_time is the time duration of unbonding.
google.protobuf.Duration unbonding_time = 1
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""];
// max_validators is the maximum number of validators.
uint32 max_validators = 2 [(gogoproto.moretags) = "yaml:\"max_validators\""];
// max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio).
uint32 max_entries = 3 [(gogoproto.moretags) = "yaml:\"max_entries\""];
// historical_entries is the number of historical entries to persist.
uint32 historical_entries = 4 [(gogoproto.moretags) = "yaml:\"historical_entries\""];
// bond_denom defines the bondable coin denomination.
string bond_denom = 5 [(gogoproto.moretags) = "yaml:\"bond_denom\""];
}

Expand Down
Loading