-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathquery.proto
381 lines (330 loc) · 14.5 KB
/
query.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
syntax = "proto3";
package interchain_security.ccv.provider.v1;
option go_package = "github.com/cosmos/interchain-security/v5/x/ccv/provider/types";
import "google/api/annotations.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "interchain_security/ccv/provider/v1/provider.proto";
import "interchain_security/ccv/v1/shared_consumer.proto";
import "interchain_security/ccv/v1/wire.proto";
import "tendermint/crypto/keys.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/staking/v1beta1/staking.proto";
service Query {
// ConsumerGenesis queries the genesis state needed to start a consumer chain
// whose proposal has been accepted
rpc QueryConsumerGenesis(QueryConsumerGenesisRequest)
returns (QueryConsumerGenesisResponse) {
option (google.api.http) = {
get: "/interchain_security/ccv/provider/consumer_genesis/{consumer_id}";
};
}
// ConsumerChains queries active consumer chains supported by the provider
// chain
rpc QueryConsumerChains(QueryConsumerChainsRequest)
returns (QueryConsumerChainsResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/consumer_chains/{phase}/{limit}";
}
// QueryValidatorConsumerAddr queries the address
// assigned by a validator for a consumer chain.
rpc QueryValidatorConsumerAddr(QueryValidatorConsumerAddrRequest)
returns (QueryValidatorConsumerAddrResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/validator_consumer_addr";
}
// QueryProviderAddr returns the provider chain validator
// given a consumer chain validator address
rpc QueryValidatorProviderAddr(QueryValidatorProviderAddrRequest)
returns (QueryValidatorProviderAddrResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/validator_provider_addr";
}
// QueryThrottleState returns the main on-chain state relevant to currently
// throttled slash packets
rpc QueryThrottleState(QueryThrottleStateRequest)
returns (QueryThrottleStateResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/throttle_state";
}
// QueryRegisteredConsumerRewardDenoms returns a list of consumer reward
// denoms that are registered
rpc QueryRegisteredConsumerRewardDenoms(
QueryRegisteredConsumerRewardDenomsRequest)
returns (QueryRegisteredConsumerRewardDenomsResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/registered_consumer_reward_denoms";
}
// QueryAllPairsValConAddrByConsumerChainID returns a list of pair valconsensus address
// between provider and consumer chain
rpc QueryAllPairsValConAddrByConsumerChainID (
QueryAllPairsValConAddrByConsumerChainIDRequest)
returns (QueryAllPairsValConAddrByConsumerChainIDResponse) {
option (google.api.http) = {
get: "/interchain_security/ccv/provider/address_pairs/{consumer_id}";
};
}
// QueryParams returns all current values of provider parameters
rpc QueryParams(QueryParamsRequest)
returns (QueryParamsResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/params";
}
// QueryConsumerChainOptedInValidators returns a list of validators consensus addresses
// that opted-in to the given consumer chain
rpc QueryConsumerChainOptedInValidators(
QueryConsumerChainOptedInValidatorsRequest)
returns (QueryConsumerChainOptedInValidatorsResponse) {
option (google.api.http) = {
get: "/interchain_security/ccv/provider/opted_in_validators/{consumer_id}";
};
}
// QueryConsumerChainsValidatorHasToValidate returns a list of consumer chains
// that a given validator must validate
rpc QueryConsumerChainsValidatorHasToValidate(
QueryConsumerChainsValidatorHasToValidateRequest)
returns (QueryConsumerChainsValidatorHasToValidateResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/consumer_chains_per_validator/{provider_address}";
}
// QueryValidatorConsumerCommissionRate returns the commission rate a given
// validator charges on a given consumer chain
rpc QueryValidatorConsumerCommissionRate(
QueryValidatorConsumerCommissionRateRequest)
returns (QueryValidatorConsumerCommissionRateResponse) {
option (google.api.http) = {
get: "/interchain_security/ccv/provider/consumer_commission_rate/{consumer_id}/{provider_address}";
};
}
// QueryConsumerValidators returns the latest set consumer-validator set for a given chainID
// Note that this does not necessarily mean that the consumer chain is using this validator set at this exact moment
// because a VSCPacket could be delayed to be delivered on the consumer chain.
rpc QueryConsumerValidators(QueryConsumerValidatorsRequest)
returns (QueryConsumerValidatorsResponse) {
option (google.api.http) = {
get: "/interchain_security/ccv/provider/consumer_validators/{consumer_id}";
};
}
// QueryBlocksUntilNextEpoch returns the number of blocks until the next epoch
// starts and validator updates are sent to the consumer chains
rpc QueryBlocksUntilNextEpoch(QueryBlocksUntilNextEpochRequest)
returns (QueryBlocksUntilNextEpochResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/blocks_until_next_epoch";
}
// QueryConsumerIdFromClientId returns the consumer id of the chain
// associated with the provided client id
rpc QueryConsumerIdFromClientId(QueryConsumerIdFromClientIdRequest)
returns (QueryConsumerIdFromClientIdResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/consumer_id/{client_id}";
}
// QueryConsumerChain returns the consumer chain
// associated with the provided consumer id
rpc QueryConsumerChain(QueryConsumerChainRequest)
returns (QueryConsumerChainResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/consumer_chain/{consumer_id}";
}
}
message QueryConsumerGenesisRequest {
string consumer_id = 1;
}
message QueryConsumerGenesisResponse {
interchain_security.ccv.v1.ConsumerGenesisState genesis_state = 1
[ (gogoproto.nullable) = false ];
}
message QueryConsumerChainsRequest {
// The phase of the consumer chains returned (optional)
// Registered=1|Initialized=2|Launched=3|Stopped=4
ConsumerPhase phase = 1;
// The limit of consumer chains returned (optional)
// default is 100
int32 limit = 2;
}
message QueryConsumerChainsResponse { repeated Chain chains = 1; }
message Chain {
string chain_id = 1;
string client_id = 2;
// If chain with `chainID` is a Top-N chain, i.e., enforces at least one validator to validate chain `chainID`
uint32 top_N = 3;
// If the chain is a Top-N chain, this is the minimum power required to be in the top N.
// Otherwise, this is -1.
int64 min_power_in_top_N = 4;
// Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain.
uint32 validators_power_cap = 5;
// Corresponds to the maximum number of validators that can validate a consumer chain.
// Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op.
uint32 validator_set_cap = 6;
// Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate
// the consumer chain.
repeated string allowlist = 7;
// Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain.
repeated string denylist = 8;
// The phase the consumer chain (Registered=0|Initialized=1|FailedToLaunch=2|Launched=3|Stopped=4)
ConsumerPhase phase = 9;
// The metadata of the consumer chain
ConsumerMetadata metadata = 10 [(gogoproto.nullable) = false ];
// Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain.
uint64 min_stake = 11;
// Corresponds to whether inactive validators are allowed to validate the consumer chain.
bool allow_inactive_vals = 12;
}
message QueryValidatorConsumerAddrRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// The consensus address of the validator on the provider chain
string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
// The id of the consumer chain
string consumer_id = 2;
}
message QueryValidatorConsumerAddrResponse {
// The address of the validator on the consumer chain
string consumer_address = 1;
}
message QueryValidatorProviderAddrRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// The consensus address of the validator on the consumer chain
string consumer_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
// The id of the consumer chain
string consumer_id = 2;
}
message QueryValidatorProviderAddrResponse {
// The address of the validator on the provider chain
string provider_address = 1;
}
message QueryThrottleStateRequest {}
message QueryThrottleStateResponse {
// current slash_meter state
int64 slash_meter = 1;
// allowance of voting power units (int) that the slash meter is given per
// replenish period this also serves as the max value for the meter.
int64 slash_meter_allowance = 2;
// next time the slash meter could potentially be replenished, iff it's not
// full
google.protobuf.Timestamp next_replenish_candidate = 3
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
}
message QueryRegisteredConsumerRewardDenomsRequest {}
message QueryRegisteredConsumerRewardDenomsResponse {
repeated string denoms = 1;
}
message QueryAllPairsValConAddrByConsumerChainIDRequest {
// The id of the consumer chain
string consumer_id = 1;
}
message QueryAllPairsValConAddrByConsumerChainIDResponse {
repeated PairValConAddrProviderAndConsumer pair_val_con_addr = 1;
}
message PairValConAddrProviderAndConsumer {
// The consensus address of the validator on the provider chain
string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"provider_address\"" ];
// The consensus address of the validator on the consumer chain
string consumer_address = 2 [ (gogoproto.moretags) = "yaml:\"consumer_address\"" ];
tendermint.crypto.PublicKey consumer_key = 3;
}
message QueryParamsRequest {}
message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}
message QueryConsumerChainOptedInValidatorsRequest {
string consumer_id = 1;
}
message QueryConsumerChainOptedInValidatorsResponse {
// The consensus addresses of the validators on the provider chain
repeated string validators_provider_addresses = 1;
}
message QueryConsumerValidatorsRequest {
string consumer_id = 1;
}
message QueryConsumerValidatorsValidator {
// The consensus address of the validator on the provider chain
string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
// The consumer public key of the validator used on the consumer chain
tendermint.crypto.PublicKey consumer_key = 2;
// [DEPRECATED] use `consumer_power` instead
int64 power = 3 [deprecated = true];
// [DEPRECATED] use `consumer_commission_rate` instead
string rate = 4 [ deprecated = true,
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
// The power of the validator used on the consumer chain
int64 consumer_power = 5;
// The rate to charge delegators on the consumer chain, as a fraction
string consumer_commission_rate = 6 [
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
// The rate to charge delegators on the provider chain, as a fraction
string provider_commission_rate = 7 [
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
// description defines the description terms for the validator
cosmos.staking.v1beta1.Description description = 8 [(gogoproto.nullable) = false];
// provider_operator_address defines the address of the validator's operator
string provider_operator_address = 9 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"];
// jailed defined whether the validator has been jailed from bonded status or not.
bool jailed = 10;
// status is the validator status (bonded/unbonding/unbonded).
cosmos.staking.v1beta1.BondStatus status = 11;
// provider_tokens defines the delegated tokens (incl. self-delegation).
string provider_tokens = 12 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
// The power of the validator used on the provider chain
int64 provider_power = 13;
// validates_current_epoch defines whether the validator has to validate for the current epoch or not
bool validates_current_epoch = 14;
}
message QueryConsumerValidatorsResponse {
repeated QueryConsumerValidatorsValidator validators = 1;
}
message QueryConsumerChainsValidatorHasToValidateRequest {
// The consensus address of the validator on the provider chain
string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
}
message QueryConsumerChainsValidatorHasToValidateResponse {
repeated string consumer_chain_ids = 1;
}
message QueryValidatorConsumerCommissionRateRequest {
string consumer_id = 1;
// The consensus address of the validator on the provider chain
string provider_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
}
message QueryValidatorConsumerCommissionRateResponse {
// The rate to charge delegators on the consumer chain, as a fraction
string rate = 1 [
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}
message QueryBlocksUntilNextEpochRequest { }
message QueryBlocksUntilNextEpochResponse {
// The number of blocks until the next epoch starts
uint64 blocks_until_next_epoch = 1;
}
message QueryConsumerIdFromClientIdRequest {
// the client id (on the provider) that is tracking the consumer chain
// the client id can be found from the consumer chain by querying (i.e., `query ccvconsumer provider-info`)
string client_id = 1;
}
message QueryConsumerIdFromClientIdResponse {
// the consumer id of the chain associated with this client id
string consumer_id = 1;
}
message QueryConsumerChainRequest {
string consumer_id = 1;
}
message QueryConsumerChainResponse {
string chain_id = 1;
string owner_address = 2;
string phase = 3;
ConsumerMetadata metadata = 4 [ (gogoproto.nullable) = false ];
ConsumerInitializationParameters init_params = 5;
PowerShapingParameters power_shaping_params = 6;
}