Skip to content

Commit 5feb287

Browse files
committed
fix: rebase
1 parent 7a9b988 commit 5feb287

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+773
-8297
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ build/
1212
# docusaurus versioned docs created during build
1313
docs/versioned_docs
1414
docs/versioned_sidebars
15+
16+
# Go test binaries
17+
*.test

proto/interchain_security/ccv/consumer/v1/consumer.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ message CrossChainValidator {
2828
(gogoproto.moretags) = "yaml:\"consensus_pubkey\""
2929
];
3030

31-
// !!! DEPRECATED !!! opted_out is deprecated because after the introduction
32-
// of Partial Set Security (PSS) we removed the soft opt-out feature.
33-
bool opted_out = 4 [ deprecated = true ];
31+
// Field 4 reserved for previously used opted_out field
32+
reserved 4;
3433
}
3534

3635
// A record storing the state of a slash packet sent to the provider chain

proto/interchain_security/ccv/provider/v1/provider.proto

Lines changed: 29 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import "cosmos/base/v1beta1/coin.proto";
1616
import "cosmos_proto/cosmos.proto";
1717
import "amino/amino.proto";
1818

19+
//
20+
// Note any type defined in this file is ONLY used internally to the provider
21+
// CCV module. These schemas can change with proper consideration of
22+
// compatibility or migration.
1923
//
2024
// Note any type defined in this file is ONLY used internally to the provider
2125
// CCV module. These schemas can change with proper consideration of
@@ -88,32 +92,6 @@ message ConsumerAdditionProposal {
8892
// chain. it is most relevant for chains performing a sovereign to consumer
8993
// changeover in order to maintain the existing ibc transfer channel
9094
string distribution_transmission_channel = 14;
91-
// Corresponds to the percentage of validators that have to validate the chain
92-
// under the Top N case. For example, 53 corresponds to a Top 53% chain,
93-
// meaning that the top 53% provider validators by voting power have to
94-
// validate the proposed consumer chain. top_N can either be 0 or any value in
95-
// [50, 100]. A chain can join with top_N == 0 as an Opt In chain, or with
96-
// top_N ∈ [50, 100] as a Top N chain.
97-
uint32 top_N = 15;
98-
// Corresponds to the maximum power (percentage-wise) a validator can have on
99-
// the consumer chain. For instance, if `validators_power_cap` is set to 32,
100-
// it means that no validator can have more than 32% of the voting power on
101-
// the consumer chain. Note that this might not be feasible. For example,
102-
// think of a consumer chain with only 5 validators and with
103-
// `validators_power_cap` set to 10%. In such a scenario, at least one
104-
// validator would need to have more than 20% of the total voting power.
105-
// Therefore, `validators_power_cap` operates on a best-effort basis.
106-
uint32 validators_power_cap = 16;
107-
// Corresponds to the maximum number of validators that can validate a
108-
// consumer chain. Only applicable to Opt In chains. Setting
109-
// `validator_set_cap` on a Top N chain is a no-op.
110-
uint32 validator_set_cap = 17;
111-
// Corresponds to a list of provider consensus addresses of validators that
112-
// are the ONLY ones that can validate the consumer chain.
113-
repeated string allowlist = 18;
114-
// Corresponds to a list of provider consensus addresses of validators that
115-
// CANNOT validate the consumer chain.
116-
repeated string denylist = 19;
11795
}
11896

11997
// ConsumerRemovalProposal is a governance proposal on the provider chain to
@@ -136,6 +114,9 @@ message ConsumerRemovalProposal {
136114
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
137115
}
138116

117+
// ConsumerModificationProposal is a governance proposal on the provider chain
118+
// to modify parameters of a running consumer chain. If it passes, the consumer
119+
// chain's state is updated to take into account the newest params.
139120
// ConsumerModificationProposal is a governance proposal on the provider chain
140121
// to modify parameters of a running consumer chain. If it passes, the consumer
141122
// chain's state is updated to take into account the newest params.
@@ -146,41 +127,19 @@ message ConsumerModificationProposal {
146127
string description = 2;
147128
// the chain-id of the consumer chain to be modified
148129
string chain_id = 3;
149-
// Corresponds to the percentage of validators that have to validate the chain
150-
// under the Top N case. For example, 53 corresponds to a Top 53% chain,
151-
// meaning that the top 53% provider validators by voting power have to
152-
// validate the proposed consumer chain. top_N can either be 0 or any value in
153-
// [50, 100]. A chain can join with top_N == 0 as an Opt In chain, or with
154-
// top_N ∈ [50, 100] as a Top N chain.
155-
uint32 top_N = 4;
156-
// Corresponds to the maximum power (percentage-wise) a validator can have on
157-
// the consumer chain. For instance, if `validators_power_cap` is set to 32,
158-
// it means that no validator can have more than 32% of the voting power on
159-
// the consumer chain. Note that this might not be feasible. For example,
160-
// think of a consumer chain with only 5 validators and with
161-
// `validators_power_cap` set to 10%. In such a scenario, at least one
162-
// validator would need to have more than 20% of the total voting power.
163-
// Therefore, `validators_power_cap` operates on a best-effort basis.
164-
uint32 validators_power_cap = 5;
165-
// Corresponds to the maximum number of validators that can validate a
166-
// consumer chain. Only applicable to Opt In chains. Setting
167-
// `validator_set_cap` on a Top N chain is a no-op.
168-
uint32 validator_set_cap = 6;
169-
// Corresponds to a list of provider consensus addresses of validators that
170-
// are the ONLY ones that can validate the consumer chain.
171-
repeated string allowlist = 7;
172-
// Corresponds to a list of provider consensus addresses of validators that
173-
// CANNOT validate the consumer chain.
174-
repeated string denylist = 8;
175130
}
176131

177132
// EquivocationProposal is a governance proposal on the provider chain to
178133
// punish a validator for equivocation on a consumer chain.
179134
//
180135
// This type is only used internally to the consumer CCV module.
136+
//
137+
// This type is only used internally to the consumer CCV module.
181138
// WARNING: This message is deprecated now that equivocations can be submitted
182139
// and verified automatically on the provider. (see SubmitConsumerDoubleVoting
183140
// in proto/interchain-security/ccv/provider/v1/tx.proto).
141+
// and verified automatically on the provider. (see SubmitConsumerDoubleVoting
142+
// in proto/interchain-security/ccv/provider/v1/tx.proto).
184143
message EquivocationProposal {
185144
option deprecated = true;
186145
// the title of the proposal
@@ -268,13 +227,16 @@ message Params {
268227
// The number of blocks that comprise an epoch.
269228
int64 blocks_per_epoch = 10;
270229

230+
// The number of epochs a validator has to validate a consumer chain in order
231+
// to start receiving rewards from that chain.
271232
// The number of epochs a validator has to validate a consumer chain in order
272233
// to start receiving rewards from that chain.
273234
int64 number_of_epochs_to_start_receiving_rewards = 11;
274235
}
275236

276237
// SlashAcks contains cons addresses of consumer chain validators
277238
// successfully slashed on the provider chain.
239+
// successfully slashed on the provider chain.
278240
message SlashAcks { repeated string addresses = 1; }
279241

280242
// ConsumerAdditionProposals holds pending governance proposals on the provider
@@ -336,12 +298,15 @@ message ValidatorSetChangePackets {
336298
// unbonding operations.
337299
message MaturedUnbondingOps { repeated uint64 ids = 1; }
338300

301+
// ExportedVscSendTimestamps is VscSendTimestamp with chainID info for exporting
302+
// to genesis
339303
// ExportedVscSendTimestamps is VscSendTimestamp with chainID info for exporting
340304
// to genesis
341305
message ExportedVscSendTimestamp {
342306
string chain_id = 1;
343307
repeated VscSendTimestamp vsc_send_timestamps = 2
344308
[ (gogoproto.nullable) = false ];
309+
[ (gogoproto.nullable) = false ];
345310
}
346311

347312
//
@@ -380,6 +345,9 @@ message ConsumerAddrsToPrune {
380345
AddressList consumer_addrs = 3;
381346
}
382347

348+
// ConsumerValidator is used to facilitate epoch-based transitions. It contains
349+
// relevant info for a validator that is expected to validate on a consumer
350+
// chain during an epoch.
383351
// ConsumerValidator is used to facilitate epoch-based transitions. It contains
384352
// relevant info for a validator that is expected to validate on a consumer
385353
// chain during an epoch.
@@ -396,13 +364,22 @@ message ConsumerValidator {
396364
// height of the validator SHOULD remain `H`. This height only resets to a
397365
// different height if a validator stops being a consumer validator during an
398366
// epoch and later becomes again a consumer validator.
367+
// If a validator becomes a consumer validator at height `H` and is
368+
// continuously a consumer validator for all the upcoming epochs, then the
369+
// height of the validator SHOULD remain `H`. This height only resets to a
370+
// different height if a validator stops being a consumer validator during an
371+
// epoch and later becomes again a consumer validator.
399372
int64 join_height = 4;
400373
}
401374
// ConsumerRewardsAllocation stores the rewards allocated by a consumer chain
402375
// to the consumer rewards pool. It is used to allocate the tokens to the
403376
// consumer opted-in validators and the community pool during BeginBlock.
377+
// to the consumer rewards pool. It is used to allocate the tokens to the
378+
// consumer opted-in validators and the community pool during BeginBlock.
404379
message ConsumerRewardsAllocation {
405380
repeated cosmos.base.v1beta1.DecCoin rewards = 1 [
381+
(gogoproto.nullable) = false,
382+
(amino.dont_omitempty) = true,
406383
(gogoproto.nullable) = false,
407384
(amino.dont_omitempty) = true,
408385
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"

proto/interchain_security/ccv/provider/v1/query.proto

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -98,35 +98,6 @@ service Query {
9898
option (google.api.http).get = "/interchain_security/ccv/provider/params";
9999
}
100100

101-
// QueryConsumerChainOptedInValidators returns a list of validators consensus
102-
// addresses that opted-in to the given consumer chain
103-
rpc QueryConsumerChainOptedInValidators(
104-
QueryConsumerChainOptedInValidatorsRequest)
105-
returns (QueryConsumerChainOptedInValidatorsResponse) {
106-
option (google.api.http).get =
107-
"/interchain_security/ccv/provider/opted_in_validators/{chain_id}";
108-
}
109-
110-
// QueryConsumerChainsValidatorHasToValidate returns a list of consumer chains
111-
// that a given validator must validate
112-
rpc QueryConsumerChainsValidatorHasToValidate(
113-
QueryConsumerChainsValidatorHasToValidateRequest)
114-
returns (QueryConsumerChainsValidatorHasToValidateResponse) {
115-
option (google.api.http).get =
116-
"/interchain_security/ccv/provider/consumer_chains_per_validator/"
117-
"{provider_address}";
118-
}
119-
120-
// QueryValidatorConsumerCommissionRate returns the commission rate a given
121-
// validator charges on a given consumer chain
122-
rpc QueryValidatorConsumerCommissionRate(
123-
QueryValidatorConsumerCommissionRateRequest)
124-
returns (QueryValidatorConsumerCommissionRateResponse) {
125-
option (google.api.http).get =
126-
"/interchain_security/ccv/provider/consumer_commission_rate/{chain_id}/"
127-
"{provider_address}";
128-
}
129-
130101
// QueryOldestUnconfirmedVsc returns the send timestamp of the oldest
131102
// unconfirmed VSCPacket for a given chainID
132103
rpc QueryOldestUnconfirmedVsc(QueryOldestUnconfirmedVscRequest)
@@ -172,25 +143,6 @@ message QueryConsumerChainStopProposalsResponse {
172143
message Chain {
173144
string chain_id = 1;
174145
string client_id = 2;
175-
// If chain with `chainID` is a Top-N chain, i.e., enforces at least one
176-
// validator to validate chain `chainID`
177-
uint32 top_N = 3;
178-
// If the chain is a Top-N chain, this is the minimum power required to be in
179-
// the top N. Otherwise, this is -1.
180-
int64 min_power_in_top_N = 4;
181-
// Corresponds to the maximum power (percentage-wise) a validator can have on
182-
// the consumer chain.
183-
uint32 validators_power_cap = 5;
184-
// Corresponds to the maximum number of validators that can validate a
185-
// consumer chain. Only applicable to Opt In chains. Setting
186-
// `validator_set_cap` on a Top N chain is a no-op.
187-
uint32 validator_set_cap = 6;
188-
// Corresponds to a list of provider consensus addresses of validators that
189-
// are the ONLY ones that can validate the consumer chain.
190-
repeated string allowlist = 7;
191-
// Corresponds to a list of provider consensus addresses of validators that
192-
// CANNOT validate the consumer chain.
193-
repeated string denylist = 8;
194146
}
195147

196148
message QueryValidatorConsumerAddrRequest {
@@ -277,13 +229,6 @@ message QueryParamsResponse {
277229
Params params = 1 [ (gogoproto.nullable) = false ];
278230
}
279231

280-
message QueryConsumerChainOptedInValidatorsRequest { string chain_id = 1; }
281-
282-
message QueryConsumerChainOptedInValidatorsResponse {
283-
// The consensus addresses of the validators on the provider chain
284-
repeated string validators_provider_addresses = 1;
285-
}
286-
287232
message QueryConsumerValidatorsRequest { string chain_id = 1; }
288233

289234
message QueryConsumerValidatorsValidator {
@@ -299,29 +244,6 @@ message QueryConsumerValidatorsResponse {
299244
repeated QueryConsumerValidatorsValidator validators = 1;
300245
}
301246

302-
message QueryConsumerChainsValidatorHasToValidateRequest {
303-
// The consensus address of the validator on the provider chain
304-
string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
305-
}
306-
307-
message QueryConsumerChainsValidatorHasToValidateResponse {
308-
repeated string consumer_chain_ids = 1;
309-
}
310-
311-
message QueryValidatorConsumerCommissionRateRequest {
312-
string chain_id = 1;
313-
// The consensus address of the validator on the provider chain
314-
string provider_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
315-
}
316-
317-
message QueryValidatorConsumerCommissionRateResponse {
318-
// The rate to charge delegators on the consumer chain, as a fraction
319-
string rate = 1 [
320-
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
321-
(gogoproto.nullable) = false
322-
];
323-
}
324-
325247
message QueryOldestUnconfirmedVscRequest { string chain_id = 1; }
326248

327249
message QueryOldestUnconfirmedVscResponse {

0 commit comments

Comments
 (0)