docs: Update x/staking spec (#8395)
* Finish updating state * Add messages * Update events * proto-gen * Update proto/cosmos/staking/v1beta1/staking.proto Co-authored-by: Anil Kumar Kammari <anil@vitwit.com> * progo-gen * Update Msg with slash * Rerun proto docs Co-authored-by: Anil Kumar Kammari <anil@vitwit.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
8128357956
commit
896eee213a
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
@ -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\""];
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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",
|
||||
@ -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\""];
|
||||
// shares define the delegation shares received.
|
||||
string shares = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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];
|
||||
}
|
||||
|
||||
@ -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];
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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\""];
|
||||
}
|
||||
|
||||
|
||||
@ -8,23 +8,16 @@ order: 1
|
||||
|
||||
LastTotalPower tracks the total amounts of bonded tokens recorded during the previous end block.
|
||||
|
||||
- LastTotalPower: `0x12 -> amino(sdk.Int)`
|
||||
- LastTotalPower: `0x12 -> ProtocolBuffer(sdk.Int)`
|
||||
|
||||
## Params
|
||||
|
||||
Params is a module-wide configuration structure that stores system parameters
|
||||
and defines overall functioning of the staking module.
|
||||
|
||||
- Params: `Paramsspace("staking") -> amino(params)`
|
||||
- Params: `Paramsspace("staking") -> legacy_amino(params)`
|
||||
|
||||
```go
|
||||
type Params struct {
|
||||
UnbondingTime time.Duration // time duration of unbonding
|
||||
MaxValidators uint16 // maximum number of validators
|
||||
MaxEntries uint16 // max entries for either unbonding delegation or redelegation (per pair/trio)
|
||||
BondDenom string // bondable coin denomination
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.1/proto/cosmos/staking/v1beta1/staking.proto#L230-L241
|
||||
|
||||
## Validator
|
||||
|
||||
@ -37,8 +30,8 @@ Validators can have one of three statuses
|
||||
They are signing blocks and receiving rewards. They can receive further delegations.
|
||||
They can be slashed for misbehavior. Delegators to this validator who unbond their delegation
|
||||
must wait the duration of the UnbondingTime, a chain-specific param. during which time
|
||||
they are still slashable for offences of the source validator if those offences were committed
|
||||
during the period of time that the tokens were bonded.
|
||||
they are still slashable for offences of the source validator if those offences were committed
|
||||
during the period of time that the tokens were bonded.
|
||||
- `Unbonding`: When a validator leaves the active set, either by choice or due to slashing or
|
||||
tombstoning, an unbonding of all their delegations begins. All delegations must then wait the UnbondingTime
|
||||
before moving receiving their tokens to their accounts from the `BondedPool`.
|
||||
@ -51,10 +44,10 @@ required lookups for slashing and validator-set updates. A third special index
|
||||
throughout each block, unlike the first two indices which mirror the validator
|
||||
records within a block.
|
||||
|
||||
- Validators: `0x21 | OperatorAddr -> amino(validator)`
|
||||
- Validators: `0x21 | OperatorAddr -> ProtocolBuffer(validator)`
|
||||
- ValidatorsByConsAddr: `0x22 | ConsAddr -> OperatorAddr`
|
||||
- ValidatorsByPower: `0x23 | BigEndian(ConsensusPower) | OperatorAddr -> OperatorAddr`
|
||||
- LastValidatorsPower: `0x11 OperatorAddr -> amino(ConsensusPower)`
|
||||
- LastValidatorsPower: `0x11 OperatorAddr -> ProtocolBuffer(ConsensusPower)`
|
||||
|
||||
`Validators` is the primary index - it ensures that each operator can have only one
|
||||
associated validator, where the public key of that validator can change in the
|
||||
@ -68,7 +61,7 @@ address which can be derived from the validator's `ConsPubKey`.
|
||||
|
||||
`ValidatorsByPower` is an additional index that provides a sorted list o
|
||||
potential validators to quickly determine the current active set. Here
|
||||
ConsensusPower is validator.Tokens/10^6. Note that all validators where
|
||||
ConsensusPower is validator.Tokens/10^6. Note that all validators where
|
||||
`Jailed` is true are not stored within this index.
|
||||
|
||||
`LastValidatorsPower` is a special index that provides a historical list of the
|
||||
@ -77,60 +70,23 @@ is updated during the validator set update process which takes place in [`EndBlo
|
||||
|
||||
Each validator's state is stored in a `Validator` struct:
|
||||
|
||||
```go
|
||||
type Validator struct {
|
||||
OperatorAddress sdk.ValAddress // address of the validator's operator; bech encoded in JSON
|
||||
ConsPubKey crypto.PubKey // the consensus public key of the validator; bech encoded in JSON
|
||||
Jailed bool // has the validator been jailed from bonded status?
|
||||
Status sdk.BondStatus // validator status (bonded/unbonding/unbonded)
|
||||
Tokens sdk.Int // delegated tokens (incl. self-delegation)
|
||||
DelegatorShares sdk.Dec // total shares issued to a validator's delegators
|
||||
Description Description // description terms for the validator
|
||||
UnbondingHeight int64 // if unbonding, height at which this validator has begun unbonding
|
||||
UnbondingCompletionTime time.Time // if unbonding, min time for the validator to complete unbonding
|
||||
Commission Commission // commission parameters
|
||||
MinSelfDelegation sdk.Int // validator's self declared minimum self delegation
|
||||
}
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L65-L99
|
||||
|
||||
type Commission struct {
|
||||
CommissionRates
|
||||
UpdateTime time.Time // the last time the commission rate was changed
|
||||
}
|
||||
|
||||
CommissionRates struct {
|
||||
Rate sdk.Dec // the commission rate charged to delegators, as a fraction
|
||||
MaxRate sdk.Dec // maximum commission rate which validator can ever charge, as a fraction
|
||||
MaxChangeRate sdk.Dec // maximum daily increase of the validator commission, as a fraction
|
||||
}
|
||||
|
||||
type Description struct {
|
||||
Moniker string // name
|
||||
Identity string // optional identity signature (ex. UPort or Keybase)
|
||||
Website string // optional website link
|
||||
SecurityContact string // optional email for security contact
|
||||
Details string // optional details
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L24-L63
|
||||
|
||||
## Delegation
|
||||
|
||||
Delegations are identified by combining `DelegatorAddr` (the address of the delegator)
|
||||
with the `ValidatorAddr` Delegators are indexed in the store as follows:
|
||||
|
||||
- Delegation: `0x31 | DelegatorAddr | ValidatorAddr -> amino(delegation)`
|
||||
- Delegation: `0x31 | DelegatorAddr | ValidatorAddr -> ProtocolBuffer(delegation)`
|
||||
|
||||
Stake holders may delegate coins to validators; under this circumstance their
|
||||
funds are held in a `Delegation` data structure. It is owned by one
|
||||
delegator, and is associated with the shares for one validator. The sender of
|
||||
the transaction is the owner of the bond.
|
||||
|
||||
```go
|
||||
type Delegation struct {
|
||||
DelegatorAddr sdk.AccAddress
|
||||
ValidatorAddr sdk.ValAddress
|
||||
Shares sdk.Dec // delegation shares received
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L159-L170
|
||||
|
||||
### Delegator Shares
|
||||
|
||||
@ -159,10 +115,8 @@ detected.
|
||||
|
||||
`UnbondingDelegation` are indexed in the store as:
|
||||
|
||||
- UnbondingDelegation: `0x32 | DelegatorAddr | ValidatorAddr ->
|
||||
amino(unbondingDelegation)`
|
||||
- UnbondingDelegationsFromValidator: `0x33 | ValidatorAddr | DelegatorAddr ->
|
||||
nil`
|
||||
- UnbondingDelegation: `0x32 | DelegatorAddr | ValidatorAddr -> ProtocolBuffer(unbondingDelegation)`
|
||||
- UnbondingDelegationsFromValidator: `0x33 | ValidatorAddr | DelegatorAddr -> nil`
|
||||
|
||||
The first map here is used in queries, to lookup all unbonding delegations for
|
||||
a given delegator, while the second map is used in slashing, to lookup all
|
||||
@ -171,20 +125,7 @@ slashed.
|
||||
|
||||
A UnbondingDelegation object is created every time an unbonding is initiated.
|
||||
|
||||
```go
|
||||
type UnbondingDelegation struct {
|
||||
DelegatorAddr sdk.AccAddress // delegator
|
||||
ValidatorAddr sdk.ValAddress // validator unbonding from operator addr
|
||||
Entries []UnbondingDelegationEntry // unbonding delegation entries
|
||||
}
|
||||
|
||||
type UnbondingDelegationEntry struct {
|
||||
CreationHeight int64 // height which the unbonding took place
|
||||
CompletionTime time.Time // unix time for unbonding completion
|
||||
InitialBalance sdk.Coin // atoms initially scheduled to receive at completion
|
||||
Balance sdk.Coin // atoms to receive at completion
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L172-L198
|
||||
|
||||
## Redelegation
|
||||
|
||||
@ -196,7 +137,7 @@ committed by the source validator.
|
||||
|
||||
`Redelegation` are indexed in the store as:
|
||||
|
||||
- Redelegations: `0x34 | DelegatorAddr | ValidatorSrcAddr | ValidatorDstAddr -> amino(redelegation)`
|
||||
- Redelegations: `0x34 | DelegatorAddr | ValidatorSrcAddr | ValidatorDstAddr -> ProtocolBuffer(redelegation)`
|
||||
- RedelegationsBySrc: `0x35 | ValidatorSrcAddr | ValidatorDstAddr | DelegatorAddr -> nil`
|
||||
- RedelegationsByDst: `0x36 | ValidatorDstAddr | ValidatorSrcAddr | DelegatorAddr -> nil`
|
||||
|
||||
@ -204,30 +145,15 @@ The first map here is used for queries, to lookup all redelegations for a given
|
||||
delegator. The second map is used for slashing based on the `ValidatorSrcAddr`,
|
||||
while the third map is for slashing based on the `ValidatorDstAddr`.
|
||||
|
||||
A redelegation object is created every time a redelegation occurs. To prevent
|
||||
A redelegation object is created every time a redelegation occurs. To prevent
|
||||
"redelegation hopping" redelegations may not occur under the situation that:
|
||||
|
||||
- the (re)delegator already has another immature redelegation in progress
|
||||
with a destination to a validator (let's call it `Validator X`)
|
||||
with a destination to a validator (let's call it `Validator X`)
|
||||
- and, the (re)delegator is attempting to create a _new_ redelegation
|
||||
where the source validator for this new redelegation is `Validator-X`.
|
||||
where the source validator for this new redelegation is `Validator-X`.
|
||||
|
||||
```go
|
||||
type Redelegation struct {
|
||||
DelegatorAddr sdk.AccAddress // delegator
|
||||
ValidatorSrcAddr sdk.ValAddress // validator redelegation source operator addr
|
||||
ValidatorDstAddr sdk.ValAddress // validator redelegation destination operator addr
|
||||
Entries []RedelegationEntry // redelegation entries
|
||||
}
|
||||
|
||||
type RedelegationEntry struct {
|
||||
CreationHeight int64 // height which the redelegation took place
|
||||
CompletionTime time.Time // unix time for redelegation completion
|
||||
InitialBalance sdk.Coin // initial balance when redelegation started
|
||||
Balance sdk.Coin // current balance (current value held in destination validator)
|
||||
SharesDst sdk.Dec // amount of destination-validator shares created by redelegation
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L200-L228
|
||||
|
||||
## Queues
|
||||
|
||||
@ -249,12 +175,7 @@ delegations queue is kept.
|
||||
|
||||
- UnbondingDelegation: `0x41 | format(time) -> []DVPair`
|
||||
|
||||
```go
|
||||
type DVPair struct {
|
||||
DelegatorAddr sdk.AccAddress
|
||||
ValidatorAddr sdk.ValAddress
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L123-L133
|
||||
|
||||
### RedelegationQueue
|
||||
|
||||
@ -263,13 +184,7 @@ kept.
|
||||
|
||||
- UnbondingDelegation: `0x42 | format(time) -> []DVVTriplet`
|
||||
|
||||
```go
|
||||
type DVVTriplet struct {
|
||||
DelegatorAddr sdk.AccAddress
|
||||
ValidatorSrcAddr sdk.ValAddress
|
||||
ValidatorDstAddr sdk.ValAddress
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L140-L152
|
||||
|
||||
### ValidatorQueue
|
||||
|
||||
@ -279,7 +194,7 @@ queue is kept.
|
||||
- ValidatorQueueTime: `0x43 | format(time) -> []sdk.ValAddress`
|
||||
|
||||
The stored object as each key is an array of validator operator addresses from
|
||||
which the validator object can be accessed. Typically it is expected that only
|
||||
which the validator object can be accessed. Typically it is expected that only
|
||||
a single validator record will be associated with a given timestamp however it is possible
|
||||
that multiple validators exist in the queue at the same location.
|
||||
|
||||
@ -288,15 +203,10 @@ that multiple validators exist in the queue at the same location.
|
||||
HistoricalInfo objects are stored and pruned at each block such that the staking keeper persists
|
||||
the `n` most recent historical info defined by staking module parameter: `HistoricalEntries`.
|
||||
|
||||
```go
|
||||
type HistoricalInfo struct {
|
||||
Header tmproto.Header
|
||||
ValSet []types.Validator
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L15-L22
|
||||
|
||||
At each BeginBlock, the staking keeper will persist the current Header and the Validators that committed
|
||||
the current block in a `HistoricalInfo` object. The Validators are sorted on their address to ensure that
|
||||
the current block in a `HistoricalInfo` object. The Validators are sorted on their address to ensure that
|
||||
they are in a determisnistic order.
|
||||
The oldest HistoricalEntries will be pruned to ensure that there only exist the parameter-defined number of
|
||||
The oldest HistoricalEntries will be pruned to ensure that there only exist the parameter-defined number of
|
||||
historical entries.
|
||||
|
||||
@ -11,12 +11,13 @@ This document describes the state transition operations pertaining to:
|
||||
3. [Slashing](./02_state_transitions.md#slashing)
|
||||
|
||||
## Validators
|
||||
State transitions in validators are performed on every [`EndBlock`](./05_end_block.md#validator-set-changes)
|
||||
|
||||
State transitions in validators are performed on every [`EndBlock`](./05_end_block.md#validator-set-changes)
|
||||
in order to check for changes in the active `ValidatorSet`.
|
||||
|
||||
### Unbonded to Bonded
|
||||
|
||||
The following transition occurs when a validator's ranking in the `ValidatorPowerIndex` surpasses
|
||||
The following transition occurs when a validator's ranking in the `ValidatorPowerIndex` surpasses
|
||||
that of the `LastValidator`.
|
||||
|
||||
- set `validator.Status` to `Bonded`
|
||||
@ -98,9 +99,9 @@ Redelegations affect the delegation, source and destination validators.
|
||||
|
||||
- perform an `unbond` delegation from the source validator to retrieve the tokens worth of the unbonded shares
|
||||
- using the unbonded tokens, `Delegate` them to the destination validator
|
||||
- if the `sourceValidator.Status` is `Bonded`, and the `destinationValidator` is not,
|
||||
- if the `sourceValidator.Status` is `Bonded`, and the `destinationValidator` is not,
|
||||
transfer the newly delegated tokens from the `BondedPool` to the `NotBondedPool` `ModuleAccount`
|
||||
- otherwise, if the `sourceValidator.Status` is not `Bonded`, and the `destinationValidator`
|
||||
- otherwise, if the `sourceValidator.Status` is not `Bonded`, and the `destinationValidator`
|
||||
is `Bonded`, transfer the newly delegated tokens from the `NotBondedPool` to the `BondedPool` `ModuleAccount`
|
||||
- record the token amount in an new entry in the relevant `Redelegation`
|
||||
|
||||
@ -116,20 +117,20 @@ When a redelegations complete the following occurs:
|
||||
|
||||
When a Validator is slashed, the following occurs:
|
||||
|
||||
- The total `slashAmount` is calculated as the `slashFactor` (a chain parameter) * `TokensFromConsensusPower`,
|
||||
the total number of tokens bonded to the validator at the time of the infraction.
|
||||
- The total `slashAmount` is calculated as the `slashFactor` (a chain parameter) \* `TokensFromConsensusPower`,
|
||||
the total number of tokens bonded to the validator at the time of the infraction.
|
||||
- Every unbonding delegation and redelegation from the validator are slashed by the `slashFactor`
|
||||
percentage of the initialBalance.
|
||||
percentage of the initialBalance.
|
||||
- Each amount slashed from redelegations and unbonding delegations is subtracted from the
|
||||
total slash amount.
|
||||
total slash amount.
|
||||
- The `remaingSlashAmount` is then slashed from the validator's tokens in the `BondedPool` or
|
||||
`NonBondedPool` depending on the validator's status. This reduces the total supply of tokens.
|
||||
`NonBondedPool` depending on the validator's status. This reduces the total supply of tokens.
|
||||
|
||||
### Slash Unbonding Delegation
|
||||
|
||||
When a validator is slashed, so are those unbonding delegations from the validator that began unbonding
|
||||
after the time of the infraction. Every entry in every unbonding delegation from the validator
|
||||
is slashed by `slashFactor`. The amount slashed is calculated from the `InitialBalance` of the
|
||||
When a validator is slashed, so are those unbonding delegations from the validator that began unbonding
|
||||
after the time of the infraction. Every entry in every unbonding delegation from the validator
|
||||
is slashed by `slashFactor`. The amount slashed is calculated from the `InitialBalance` of the
|
||||
delegation and is capped to prevent a resulting negative balance. Completed (or mature) unbondings are not slashed.
|
||||
|
||||
### Slash Redelegation
|
||||
|
||||
@ -6,23 +6,15 @@ order: 3
|
||||
|
||||
In this section we describe the processing of the staking messages and the corresponding updates to the state. All created/modified state objects specified by each message are defined within the [state](./02_state_transitions.md) section.
|
||||
|
||||
## MsgCreateValidator
|
||||
## Msg/CreateValidator
|
||||
|
||||
A validator is created using the `MsgCreateValidator` message.
|
||||
A validator is created using the `Msg/CreateValidator` service message.
|
||||
|
||||
```go
|
||||
type MsgCreateValidator struct {
|
||||
Description Description
|
||||
Commission Commission
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L16-L17
|
||||
|
||||
DelegatorAddr sdk.AccAddress
|
||||
ValidatorAddr sdk.ValAddress
|
||||
PubKey crypto.PubKey
|
||||
Delegation sdk.Coin
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L35-L51
|
||||
|
||||
This message is expected to fail if:
|
||||
This service message is expected to fail if:
|
||||
|
||||
- another validator with this operator address is already registered
|
||||
- another validator with this pubkey is already registered
|
||||
@ -33,71 +25,63 @@ This message is expected to fail if:
|
||||
- the initial `MaxChangeRate` is either negative or > `MaxRate`
|
||||
- the description fields are too large
|
||||
|
||||
This message creates and stores the `Validator` object at appropriate indexes.
|
||||
This service message creates and stores the `Validator` object at appropriate indexes.
|
||||
Additionally a self-delegation is made with the initial tokens delegation
|
||||
tokens `Delegation`. The validator always starts as unbonded but may be bonded
|
||||
in the first end-block.
|
||||
|
||||
## MsgEditValidator
|
||||
## Msg/EditValidator
|
||||
|
||||
The `Description`, `CommissionRate` of a validator can be updated using the
|
||||
`MsgEditCandidacy`.
|
||||
`Msg/EditCandidacy` service message.
|
||||
|
||||
```go
|
||||
type MsgEditCandidacy struct {
|
||||
Description Description
|
||||
ValidatorAddr sdk.ValAddress
|
||||
CommissionRate sdk.Dec
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L19-L20
|
||||
|
||||
This message is expected to fail if:
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L56-L76
|
||||
|
||||
This service message is expected to fail if:
|
||||
|
||||
- the initial `CommissionRate` is either negative or > `MaxRate`
|
||||
- the `CommissionRate` has already been updated within the previous 24 hours
|
||||
- the `CommissionRate` is > `MaxChangeRate`
|
||||
- the description fields are too large
|
||||
|
||||
This message stores the updated `Validator` object.
|
||||
This service message stores the updated `Validator` object.
|
||||
|
||||
## MsgDelegate
|
||||
## Msg/Delegate
|
||||
|
||||
Within this message the delegator provides coins, and in return receives
|
||||
Within this service message the delegator provides coins, and in return receives
|
||||
some amount of their validator's (newly created) delegator-shares that are
|
||||
assigned to `Delegation.Shares`.
|
||||
|
||||
```go
|
||||
type MsgDelegate struct {
|
||||
DelegatorAddr sdk.AccAddress
|
||||
ValidatorAddr sdk.ValAddress
|
||||
Amount sdk.Coin
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L22-L24
|
||||
|
||||
This message is expected to fail if:
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90
|
||||
|
||||
This service message is expected to fail if:
|
||||
|
||||
- the validator is does not exist
|
||||
- the validator is jailed
|
||||
- the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom`
|
||||
|
||||
If an existing `Delegation` object for provided addresses does not already
|
||||
exist than it is created as part of this message otherwise the existing
|
||||
exist than it is created as part of this service message otherwise the existing
|
||||
`Delegation` is updated to include the newly received shares.
|
||||
|
||||
## MsgBeginUnbonding
|
||||
## Msg/Undelegate
|
||||
|
||||
The begin unbonding message allows delegators to undelegate their tokens from
|
||||
The `Msg/Undelegate` service message allows delegators to undelegate their tokens from
|
||||
validator.
|
||||
|
||||
```go
|
||||
type MsgBeginUnbonding struct {
|
||||
DelegatorAddr sdk.AccAddress
|
||||
ValidatorAddr sdk.ValAddress
|
||||
Amount sdk.Coin
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L30-L32
|
||||
|
||||
This message is expected to fail if:
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121
|
||||
|
||||
This service message returns a response containing the completion time of the undelegation:
|
||||
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L123-L126
|
||||
|
||||
This service message is expected to fail if:
|
||||
|
||||
- the delegation doesn't exist
|
||||
- the validator doesn't exist
|
||||
@ -105,7 +89,7 @@ This message is expected to fail if:
|
||||
- existing `UnbondingDelegation` has maximum entries as defined by `params.MaxEntries`
|
||||
- the `Amount` has a denomination different than one defined by `params.BondDenom`
|
||||
|
||||
When this message is processed the following actions occur:
|
||||
When this service message is processed the following actions occur:
|
||||
|
||||
- validator's `DelegatorShares` and the delegation's `Shares` are both reduced by the message `SharesAmount`
|
||||
- calculate the token worth of the shares remove that amount tokens held within the validator
|
||||
@ -116,22 +100,21 @@ When this message is processed the following actions occur:
|
||||
- if there are no more `Shares` in the delegation, then the delegation object is removed from the store
|
||||
- under this situation if the delegation is the validator's self-delegation then also jail the validator.
|
||||
|
||||
## MsgBeginRedelegate
|
||||
## Msg/BeginRedelegate
|
||||
|
||||
The redelegation command allows delegators to instantly switch validators. Once
|
||||
the unbonding period has passed, the redelegation is automatically completed in
|
||||
the EndBlocker.
|
||||
|
||||
```go
|
||||
type MsgBeginRedelegate struct {
|
||||
DelegatorAddr sdk.AccAddress
|
||||
ValidatorSrcAddr sdk.ValAddress
|
||||
ValidatorDstAddr sdk.ValAddress
|
||||
Amount sdk.Coin
|
||||
}
|
||||
```
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L26-L28
|
||||
|
||||
This message is expected to fail if:
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105
|
||||
|
||||
This service message returns a response containing the completion time of the redelegation:
|
||||
|
||||
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L107-L110
|
||||
|
||||
This service message is expected to fail if:
|
||||
|
||||
- the delegation doesn't exist
|
||||
- the source or destination validators don't exist
|
||||
@ -140,7 +123,7 @@ This message is expected to fail if:
|
||||
- existing `Redelegation` has maximum entries as defined by `params.MaxEntries`
|
||||
- the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom`
|
||||
|
||||
When this message is processed the following actions occur:
|
||||
When this service message is processed the following actions occur:
|
||||
|
||||
- the source validator's `DelegatorShares` and the delegations `Shares` are both reduced by the message `SharesAmount`
|
||||
- calculate the token worth of the shares remove that amount tokens held within the source validator.
|
||||
@ -148,6 +131,6 @@ When this message is processed the following actions occur:
|
||||
- `Bonded` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares (this may be effectively reversed in the next step however).
|
||||
- `Unbonding` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`).
|
||||
- `Unbonded` - no action required in this step
|
||||
- Delegate the token worth to the destination validator, possibly moving tokens back to the bonded state.
|
||||
- Delegate the token worth to the destination validator, possibly moving tokens back to the bonded state.
|
||||
- if there are no more `Shares` in the source delegation, then the source delegation object is removed from the store
|
||||
- under this situation if the delegation is the validator's self-delegation then also jail the validator.
|
||||
|
||||
@ -18,9 +18,9 @@ The staking module emits the following events:
|
||||
| complete_redelegation | destination_validator | {dstValidatorAddress} |
|
||||
| complete_redelegation | delegator | {delegatorAddress} |
|
||||
|
||||
## Handlers
|
||||
## Service Messages
|
||||
|
||||
### MsgCreateValidator
|
||||
### Msg/CreateValidator
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| ---------------- | ------------- | ------------------ |
|
||||
@ -30,7 +30,7 @@ The staking module emits the following events:
|
||||
| message | action | create_validator |
|
||||
| message | sender | {senderAddress} |
|
||||
|
||||
### MsgEditValidator
|
||||
### Msg/EditValidator
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| -------------- | ------------------- | ------------------- |
|
||||
@ -40,7 +40,7 @@ The staking module emits the following events:
|
||||
| message | action | edit_validator |
|
||||
| message | sender | {senderAddress} |
|
||||
|
||||
### MsgDelegate
|
||||
### Msg/Delegate
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| -------- | ------------- | ------------------ |
|
||||
@ -50,7 +50,7 @@ The staking module emits the following events:
|
||||
| message | action | delegate |
|
||||
| message | sender | {senderAddress} |
|
||||
|
||||
### MsgUndelegate
|
||||
### Msg/Undelegate
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| ------- | ------------------- | ------------------ |
|
||||
@ -61,9 +61,9 @@ The staking module emits the following events:
|
||||
| message | action | begin_unbonding |
|
||||
| message | sender | {senderAddress} |
|
||||
|
||||
* [0] Time is formatted in the RFC3339 standard
|
||||
- [0] Time is formatted in the RFC3339 standard
|
||||
|
||||
### MsgBeginRedelegate
|
||||
### Msg/BeginRedelegate
|
||||
|
||||
| Type | Attribute Key | Attribute Value |
|
||||
| ---------- | --------------------- | --------------------- |
|
||||
@ -75,4 +75,4 @@ The staking module emits the following events:
|
||||
| message | action | begin_redelegate |
|
||||
| message | sender | {senderAddress} |
|
||||
|
||||
* [0] Time is formatted in the RFC3339 standard
|
||||
- [0] Time is formatted in the RFC3339 standard
|
||||
|
||||
@ -38,18 +38,18 @@ network.
|
||||
- [Delegations](02_state_transitions.md#delegations)
|
||||
- [Slashing](02_state_transitions.md#slashing)
|
||||
3. **[Messages](03_messages.md)**
|
||||
- [MsgCreateValidator](03_messages.md#msgcreatevalidator)
|
||||
- [MsgEditValidator](03_messages.md#msgeditvalidator)
|
||||
- [MsgDelegate](03_messages.md#msgdelegate)
|
||||
- [MsgBeginUnbonding](03_messages.md#msgbeginunbonding)
|
||||
- [MsgBeginRedelegate](03_messages.md#msgbeginredelegate)
|
||||
- [Msg/CreateValidator](03_messages.md#msgcreatevalidator)
|
||||
- [Msg/EditValidator](03_messages.md#msgeditvalidator)
|
||||
- [Msg/Delegate](03_messages.md#msgdelegate)
|
||||
- [Msg/BeginUnbonding](03_messages.md#msgbeginunbonding)
|
||||
- [Msg/BeginRedelegate](03_messages.md#msgbeginredelegate)
|
||||
4. **[Begin-Block](04_begin_block.md)**
|
||||
- [Historical Info Tracking](04_begin_block.md#historical-info-tracking)
|
||||
4. **[End-Block ](05_end_block.md)**
|
||||
5. **[End-Block ](05_end_block.md)**
|
||||
- [Validator Set Changes](05_end_block.md#validator-set-changes)
|
||||
- [Queues ](05_end_block.md#queues-)
|
||||
5. **[Hooks](06_hooks.md)**
|
||||
6. **[Events](07_events.md)**
|
||||
6. **[Hooks](06_hooks.md)**
|
||||
7. **[Events](07_events.md)**
|
||||
- [EndBlocker](07_events.md#endblocker)
|
||||
- [Handlers](07_events.md#handlers)
|
||||
7. **[Parameters](08_params.md)**
|
||||
8. **[Parameters](08_params.md)**
|
||||
|
||||
@ -135,8 +135,11 @@ func (m *HistoricalInfo) GetValset() []Validator {
|
||||
// CommissionRates defines the initial commission rates to be used for creating
|
||||
// a validator.
|
||||
type CommissionRates struct {
|
||||
Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"`
|
||||
MaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_rate" yaml:"max_rate"`
|
||||
// rate is the commission rate charged to delegators, as a fraction.
|
||||
Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"`
|
||||
// max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
|
||||
MaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_rate" yaml:"max_rate"`
|
||||
// max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
|
||||
MaxChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=max_change_rate,json=maxChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_change_rate" yaml:"max_change_rate"`
|
||||
}
|
||||
|
||||
@ -174,8 +177,10 @@ var xxx_messageInfo_CommissionRates proto.InternalMessageInfo
|
||||
|
||||
// Commission defines commission parameters for a given validator.
|
||||
type Commission struct {
|
||||
// commission_rates defines the initial commission rates to be used for creating a validator.
|
||||
CommissionRates `protobuf:"bytes,1,opt,name=commission_rates,json=commissionRates,proto3,embedded=commission_rates" json:"commission_rates"`
|
||||
UpdateTime time.Time `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3,stdtime" json:"update_time" yaml:"update_time"`
|
||||
// update_time is the last time the commission rate was changed.
|
||||
UpdateTime time.Time `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3,stdtime" json:"update_time" yaml:"update_time"`
|
||||
}
|
||||
|
||||
func (m *Commission) Reset() { *m = Commission{} }
|
||||
@ -219,11 +224,16 @@ func (m *Commission) GetUpdateTime() time.Time {
|
||||
|
||||
// Description defines a validator description.
|
||||
type Description struct {
|
||||
Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
|
||||
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
|
||||
Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"`
|
||||
// moniker defines a human-readable name for the validator.
|
||||
Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
|
||||
// identity defines an optional identity signature (ex. UPort or Keybase).
|
||||
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
|
||||
// website defines an optional website link.
|
||||
Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"`
|
||||
// security_contact defines an optional email for security contact.
|
||||
SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty" yaml:"security_contact"`
|
||||
Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"`
|
||||
// details define other optional details.
|
||||
Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Description) Reset() { *m = Description{} }
|
||||
@ -302,16 +312,27 @@ func (m *Description) GetDetails() string {
|
||||
// exchange rate. Voting power can be calculated as total bonded shares
|
||||
// multiplied by exchange rate.
|
||||
type Validator struct {
|
||||
OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty" yaml:"operator_address"`
|
||||
ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"`
|
||||
Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"`
|
||||
Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"`
|
||||
Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"`
|
||||
DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares" yaml:"delegator_shares"`
|
||||
Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"`
|
||||
UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty" yaml:"unbonding_height"`
|
||||
UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time" yaml:"unbonding_time"`
|
||||
Commission Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"`
|
||||
// operator_address defines the address of the validator's operator; bech encoded in JSON.
|
||||
OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty" yaml:"operator_address"`
|
||||
// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
|
||||
ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"`
|
||||
// jailed defined whether the validator has been jailed from bonded status or not.
|
||||
Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"`
|
||||
// status is the validator status (bonded/unbonding/unbonded).
|
||||
Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"`
|
||||
// tokens define the delegated tokens (incl. self-delegation).
|
||||
Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"`
|
||||
// delegator_shares defines total shares issued to a validator's delegators.
|
||||
DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares" yaml:"delegator_shares"`
|
||||
// description defines the description terms for the validator.
|
||||
Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"`
|
||||
// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
|
||||
UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty" yaml:"unbonding_height"`
|
||||
// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
|
||||
UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time" yaml:"unbonding_time"`
|
||||
// commission defines the commission parameters.
|
||||
Commission Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"`
|
||||
// min_self_delegation is the validator's self declared minimum self delegation.
|
||||
MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation" yaml:"min_self_delegation"`
|
||||
}
|
||||
|
||||
@ -567,9 +588,12 @@ func (m *DVVTriplets) GetTriplets() []DVVTriplet {
|
||||
// owned by one delegator, and is associated with the voting power of one
|
||||
// validator.
|
||||
type Delegation struct {
|
||||
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
|
||||
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
|
||||
Shares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares"`
|
||||
// delegator_address is the bech32-encoded address of the delegator.
|
||||
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
|
||||
// validator_address is the bech32-encoded address of the validator.
|
||||
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
|
||||
// shares define the delegation shares received.
|
||||
Shares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares"`
|
||||
}
|
||||
|
||||
func (m *Delegation) Reset() { *m = Delegation{} }
|
||||
@ -607,9 +631,12 @@ var xxx_messageInfo_Delegation proto.InternalMessageInfo
|
||||
// UnbondingDelegation stores all of a single delegator's unbonding bonds
|
||||
// for a single validator in an time-ordered list.
|
||||
type UnbondingDelegation struct {
|
||||
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
|
||||
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
|
||||
Entries []UnbondingDelegationEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries"`
|
||||
// delegator_address is the bech32-encoded address of the delegator.
|
||||
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
|
||||
// validator_address is the bech32-encoded address of the validator.
|
||||
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"`
|
||||
// entries are the unbonding delegation entries.
|
||||
Entries []UnbondingDelegationEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries"`
|
||||
}
|
||||
|
||||
func (m *UnbondingDelegation) Reset() { *m = UnbondingDelegation{} }
|
||||
@ -646,10 +673,14 @@ var xxx_messageInfo_UnbondingDelegation proto.InternalMessageInfo
|
||||
|
||||
// UnbondingDelegationEntry defines an unbonding object with relevant metadata.
|
||||
type UnbondingDelegationEntry struct {
|
||||
CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"`
|
||||
CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"`
|
||||
// creation_height is the height which the unbonding took place.
|
||||
CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"`
|
||||
// completion_time is the unix time for unbonding completion.
|
||||
CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"`
|
||||
// initial_balance defines the tokens initially scheduled to receive at completion.
|
||||
InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance" yaml:"initial_balance"`
|
||||
Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance"`
|
||||
// balance defines the tokens to receive at completion.
|
||||
Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance"`
|
||||
}
|
||||
|
||||
func (m *UnbondingDelegationEntry) Reset() { *m = UnbondingDelegationEntry{} }
|
||||
@ -700,10 +731,14 @@ func (m *UnbondingDelegationEntry) GetCompletionTime() time.Time {
|
||||
|
||||
// RedelegationEntry defines a redelegation object with relevant metadata.
|
||||
type RedelegationEntry struct {
|
||||
CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"`
|
||||
CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"`
|
||||
// creation_height defines the height which the redelegation took place.
|
||||
CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"`
|
||||
// completion_time defines the unix time for redelegation completion.
|
||||
CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"`
|
||||
// initial_balance defines the initial balance when redelegation started.
|
||||
InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance" yaml:"initial_balance"`
|
||||
SharesDst github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=shares_dst,json=sharesDst,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares_dst"`
|
||||
// shares_dst is the amount of destination-validator shares created by redelegation.
|
||||
SharesDst github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=shares_dst,json=sharesDst,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares_dst"`
|
||||
}
|
||||
|
||||
func (m *RedelegationEntry) Reset() { *m = RedelegationEntry{} }
|
||||
@ -755,10 +790,14 @@ func (m *RedelegationEntry) GetCompletionTime() time.Time {
|
||||
// Redelegation contains the list of a particular delegator's redelegating bonds
|
||||
// from a particular source validator to a particular destination validator.
|
||||
type Redelegation struct {
|
||||
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
|
||||
ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"`
|
||||
ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"`
|
||||
Entries []RedelegationEntry `protobuf:"bytes,4,rep,name=entries,proto3" json:"entries"`
|
||||
// delegator_address is the bech32-encoded address of the delegator.
|
||||
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"`
|
||||
// validator_src_address is the validator redelegation source operator address.
|
||||
ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"`
|
||||
// validator_dst_address is the validator redelegation destination operator address.
|
||||
ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"`
|
||||
// entries are the redelegation entries.
|
||||
Entries []RedelegationEntry `protobuf:"bytes,4,rep,name=entries,proto3" json:"entries"`
|
||||
}
|
||||
|
||||
func (m *Redelegation) Reset() { *m = Redelegation{} }
|
||||
@ -795,11 +834,16 @@ var xxx_messageInfo_Redelegation proto.InternalMessageInfo
|
||||
|
||||
// Params defines the parameters for the staking module.
|
||||
type Params struct {
|
||||
UnbondingTime time.Duration `protobuf:"bytes,1,opt,name=unbonding_time,json=unbondingTime,proto3,stdduration" json:"unbonding_time" yaml:"unbonding_time"`
|
||||
MaxValidators uint32 `protobuf:"varint,2,opt,name=max_validators,json=maxValidators,proto3" json:"max_validators,omitempty" yaml:"max_validators"`
|
||||
MaxEntries uint32 `protobuf:"varint,3,opt,name=max_entries,json=maxEntries,proto3" json:"max_entries,omitempty" yaml:"max_entries"`
|
||||
HistoricalEntries uint32 `protobuf:"varint,4,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty" yaml:"historical_entries"`
|
||||
BondDenom string `protobuf:"bytes,5,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty" yaml:"bond_denom"`
|
||||
// unbonding_time is the time duration of unbonding.
|
||||
UnbondingTime time.Duration `protobuf:"bytes,1,opt,name=unbonding_time,json=unbondingTime,proto3,stdduration" json:"unbonding_time" yaml:"unbonding_time"`
|
||||
// max_validators is the maximum number of validators.
|
||||
MaxValidators uint32 `protobuf:"varint,2,opt,name=max_validators,json=maxValidators,proto3" json:"max_validators,omitempty" yaml:"max_validators"`
|
||||
// max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio).
|
||||
MaxEntries uint32 `protobuf:"varint,3,opt,name=max_entries,json=maxEntries,proto3" json:"max_entries,omitempty" yaml:"max_entries"`
|
||||
// historical_entries is the number of historical entries to persist.
|
||||
HistoricalEntries uint32 `protobuf:"varint,4,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty" yaml:"historical_entries"`
|
||||
// bond_denom defines the bondable coin denomination.
|
||||
BondDenom string `protobuf:"bytes,5,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty" yaml:"bond_denom"`
|
||||
}
|
||||
|
||||
func (m *Params) Reset() { *m = Params{} }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user