Skip to content

Commit 896eee2

Browse files
amaury1093anilcsemergify[bot]
authored
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 <[email protected]> * progo-gen * Update Msg with slash * Rerun proto docs Co-authored-by: Anil Kumar Kammari <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 8128357 commit 896eee2

File tree

8 files changed

+4338
-4352
lines changed

8 files changed

+4338
-4352
lines changed

docs/core/proto-docs.md

+4,112-4,108
Large diffs are not rendered by default.

proto/cosmos/staking/v1beta1/staking.proto

+44
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@ message CommissionRates {
2727
option (gogoproto.equal) = true;
2828
option (gogoproto.goproto_stringer) = false;
2929

30+
// rate is the commission rate charged to delegators, as a fraction.
3031
string rate = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
32+
// max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
3133
string max_rate = 2 [
3234
(gogoproto.moretags) = "yaml:\"max_rate\"",
3335
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
3436
(gogoproto.nullable) = false
3537
];
38+
// max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
3639
string max_change_rate = 3 [
3740
(gogoproto.moretags) = "yaml:\"max_change_rate\"",
3841
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
@@ -45,7 +48,9 @@ message Commission {
4548
option (gogoproto.equal) = true;
4649
option (gogoproto.goproto_stringer) = false;
4750

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

63+
// moniker defines a human-readable name for the validator.
5864
string moniker = 1;
65+
// identity defines an optional identity signature (ex. UPort or Keybase).
5966
string identity = 2;
67+
// website defines an optional website link.
6068
string website = 3;
69+
// security_contact defines an optional email for security contact.
6170
string security_contact = 4 [(gogoproto.moretags) = "yaml:\"security_contact\""];
71+
// details define other optional details.
6272
string details = 5;
6373
}
6474

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

88+
// operator_address defines the address of the validator's operator; bech encoded in JSON.
7889
string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""];
90+
// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
7991
google.protobuf.Any consensus_pubkey = 2
8092
[(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", (gogoproto.moretags) = "yaml:\"consensus_pubkey\""];
93+
// jailed defined whether the validator has been jailed from bonded status or not.
8194
bool jailed = 3;
95+
// status is the validator status (bonded/unbonding/unbonded).
8296
BondStatus status = 4;
97+
// tokens define the delegated tokens (incl. self-delegation).
8398
string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
99+
// delegator_shares defines total shares issued to a validator's delegators.
84100
string delegator_shares = 6 [
85101
(gogoproto.moretags) = "yaml:\"delegator_shares\"",
86102
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
87103
(gogoproto.nullable) = false
88104
];
105+
// description defines the description terms for the validator.
89106
Description description = 7 [(gogoproto.nullable) = false];
107+
// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
90108
int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""];
109+
// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
91110
google.protobuf.Timestamp unbonding_time = 9
92111
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""];
112+
// commission defines the commission parameters.
93113
Commission commission = 10 [(gogoproto.nullable) = false];
114+
// min_self_delegation is the validator's self declared minimum self delegation.
94115
string min_self_delegation = 11 [
95116
(gogoproto.moretags) = "yaml:\"min_self_delegation\"",
96117
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
@@ -164,8 +185,11 @@ message Delegation {
164185
option (gogoproto.goproto_getters) = false;
165186
option (gogoproto.goproto_stringer) = false;
166187

188+
// delegator_address is the bech32-encoded address of the delegator.
167189
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
190+
// validator_address is the bech32-encoded address of the validator.
168191
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
192+
// shares define the delegation shares received.
169193
string shares = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
170194
}
171195

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

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

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

216+
// creation_height is the height which the unbonding took place.
189217
int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""];
218+
// completion_time is the unix time for unbonding completion.
190219
google.protobuf.Timestamp completion_time = 2
191220
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""];
221+
// initial_balance defines the tokens initially scheduled to receive at completion.
192222
string initial_balance = 3 [
193223
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
194224
(gogoproto.nullable) = false,
195225
(gogoproto.moretags) = "yaml:\"initial_balance\""
196226
];
227+
// balance defines the tokens to receive at completion.
197228
string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
198229
}
199230

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

236+
// creation_height defines the height which the redelegation took place.
205237
int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""];
238+
// completion_time defines the unix time for redelegation completion.
206239
google.protobuf.Timestamp completion_time = 2
207240
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""];
241+
// initial_balance defines the initial balance when redelegation started.
208242
string initial_balance = 3 [
209243
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
210244
(gogoproto.nullable) = false,
211245
(gogoproto.moretags) = "yaml:\"initial_balance\""
212246
];
247+
// shares_dst is the amount of destination-validator shares created by redelegation.
213248
string shares_dst = 4
214249
[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
215250
}
@@ -221,9 +256,13 @@ message Redelegation {
221256
option (gogoproto.goproto_getters) = false;
222257
option (gogoproto.goproto_stringer) = false;
223258

259+
// delegator_address is the bech32-encoded address of the delegator.
224260
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
261+
// validator_src_address is the validator redelegation source operator address.
225262
string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
263+
// validator_dst_address is the validator redelegation destination operator address.
226264
string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
265+
// entries are the redelegation entries.
227266
repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries
228267
}
229268

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

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

0 commit comments

Comments
 (0)