Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: migrations for permissionless #2174

Merged
merged 9 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions proto/interchain_security/ccv/provider/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
import "interchain_security/ccv/provider/v1/provider.proto";

// GenesisState defines the CCV provider chain genesis state
message GenesisState {

Check failure on line 13 in proto/interchain_security/ccv/provider/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "6" with name "consumer_addition_proposals" on message "GenesisState" was deleted.

Check failure on line 13 in proto/interchain_security/ccv/provider/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "7" with name "consumer_removal_proposals" on message "GenesisState" was deleted.
// Reserve 3rd slot for removed unbonding_ops field
reserved 3;

// Reserve 4th slot for removed mature_unbonding_ops field
reserved 4;

// Reserve 6th slot for removed consumer_addition_proposals field
reserved 6;

// Reserve 7th slot for removed consumer_removal_proposals field
reserved 7;

// Reserve 11th slot for consumer_addrs_to_prune field
reserved 11;

Expand All @@ -36,12 +42,6 @@
// empty for a new chain
repeated ValsetUpdateIdToHeight valset_update_id_to_height = 5
[ (gogoproto.nullable) = false ];
// empty for a new chain
repeated ConsumerAdditionProposal consumer_addition_proposals = 6
[ (gogoproto.nullable) = false ];
// empty for a new chain
repeated ConsumerRemovalProposal consumer_removal_proposals = 7
[ (gogoproto.nullable) = false ];
Params params = 8 [ (gogoproto.nullable) = false ];
// empty for a new chain
repeated ValidatorConsumerPubKey validator_consumer_pubkeys = 9
Expand Down
49 changes: 0 additions & 49 deletions proto/interchain_security/ccv/provider/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
syntax = "proto3";

Check failure on line 1 in proto/interchain_security/ccv/provider/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "ProposedChain" was deleted from file.

Check failure on line 1 in proto/interchain_security/ccv/provider/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "QueryConsumerChainStartProposalsRequest" was deleted from file.

Check failure on line 1 in proto/interchain_security/ccv/provider/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "QueryConsumerChainStartProposalsResponse" was deleted from file.

Check failure on line 1 in proto/interchain_security/ccv/provider/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "QueryConsumerChainStopProposalsRequest" was deleted from file.

Check failure on line 1 in proto/interchain_security/ccv/provider/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "QueryConsumerChainStopProposalsResponse" was deleted from file.

Check failure on line 1 in proto/interchain_security/ccv/provider/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "QueryProposedChainIDsRequest" was deleted from file.

Check failure on line 1 in proto/interchain_security/ccv/provider/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "QueryProposedChainIDsResponse" was deleted from file.
package interchain_security.ccv.provider.v1;

option go_package = "github.com/cosmos/interchain-security/v5/x/ccv/provider/types";
Expand All @@ -13,7 +13,7 @@
import "cosmos_proto/cosmos.proto";
import "cosmos/staking/v1beta1/staking.proto";

service Query {

Check failure on line 16 in proto/interchain_security/ccv/provider/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present RPC "QueryConsumerChainStarts" on service "Query" was deleted.
// ConsumerGenesis queries the genesis state needed to start a consumer chain
// whose proposal has been accepted
rpc QueryConsumerGenesis(QueryConsumerGenesisRequest)
Expand All @@ -35,20 +35,6 @@
"/interchain_security/ccv/provider/consumer_chains";
}

// QueryConsumerChainStarts queries consumer chain start proposals.
rpc QueryConsumerChainStarts(QueryConsumerChainStartProposalsRequest)
returns (QueryConsumerChainStartProposalsResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/consumer_chain_start_proposals";
}

// QueryConsumerChainStops queries consumer chain stop proposals.
rpc QueryConsumerChainStops(QueryConsumerChainStopProposalsRequest)
returns (QueryConsumerChainStopProposalsResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/consumer_chain_stop_proposals";
}

// QueryValidatorConsumerAddr queries the address
// assigned by a validator for a consumer chain.
rpc QueryValidatorConsumerAddr(QueryValidatorConsumerAddrRequest)
Expand Down Expand Up @@ -82,15 +68,6 @@
"/interchain_security/ccv/provider/registered_consumer_reward_denoms";
}

// QueryProposedConsumerChainIDs returns the chain IDs of the proposed consumer chain addition proposals
// that are still in the voting period
rpc QueryProposedConsumerChainIDs(
QueryProposedChainIDsRequest)
returns (QueryProposedChainIDsResponse) {
option (google.api.http).get =
"/interchain_security/ccv/provider/proposed_consumer_chains";
}

// QueryAllPairsValConAddrByConsumerChainID returns a list of pair valconsensus address
// between provider and consumer chain
rpc QueryAllPairsValConAddrByConsumerChainID (
Expand Down Expand Up @@ -195,18 +172,6 @@

message QueryConsumerChainsResponse { repeated Chain chains = 1; }

message QueryConsumerChainStartProposalsRequest {}

message QueryConsumerChainStartProposalsResponse {
ConsumerAdditionProposals proposals = 1;
}

message QueryConsumerChainStopProposalsRequest {}

message QueryConsumerChainStopProposalsResponse {
ConsumerRemovalProposals proposals = 1;
}

message Chain {
string chain_id = 1;
string client_id = 2;
Expand Down Expand Up @@ -284,20 +249,6 @@
repeated string denoms = 1;
}

message QueryProposedChainIDsRequest {}

message QueryProposedChainIDsResponse {
repeated ProposedChain proposedChains = 1
[ (gogoproto.nullable) = false ];
}

message ProposedChain {
// [DEPRECATED] use `consumer_id` instead
string chainID = 1 [deprecated = true];
uint64 proposalID = 2;
string consumer_id = 3;
}

message QueryAllPairsValConAddrByConsumerChainIDRequest {
// [DEPRECATED] use `consumer_id` instead
string chain_id = 1 [deprecated = true];
Expand Down
178 changes: 0 additions & 178 deletions tests/integration/provider_gov_hooks.go

This file was deleted.

92 changes: 0 additions & 92 deletions x/ccv/provider/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ func NewQueryCmd() *cobra.Command {

cmd.AddCommand(CmdConsumerGenesis())
cmd.AddCommand(CmdConsumerChains())
cmd.AddCommand(CmdConsumerStartProposals())
cmd.AddCommand(CmdConsumerStopProposals())
cmd.AddCommand(CmdConsumerValidatorKeyAssignment())
cmd.AddCommand(CmdProviderValidatorKey())
cmd.AddCommand(CmdThrottleState())
cmd.AddCommand(CmdRegisteredConsumerRewardDenoms())
cmd.AddCommand(CmdProposedConsumerChains())
cmd.AddCommand(CmdAllPairsValConAddrByConsumerChainID())
cmd.AddCommand(CmdProviderParameters())
cmd.AddCommand(CmdConsumerChainOptedInValidators())
Expand Down Expand Up @@ -100,95 +97,6 @@ func CmdConsumerChains() *cobra.Command {
return cmd
}

func CmdProposedConsumerChains() *cobra.Command {
cmd := &cobra.Command{
Use: "list-proposed-consumer-chains",
Short: "Query chainIDs in consumer addition proposal before voting finishes",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)

req := &types.QueryProposedChainIDsRequest{}
res, err := queryClient.QueryProposedConsumerChainIDs(cmd.Context(), req)
if err != nil {
return err
}

return clientCtx.PrintProto(res)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

func CmdConsumerStartProposals() *cobra.Command {
cmd := &cobra.Command{
Use: "list-start-proposals",
Short: "Query consumer chains start proposals on provider chain.",
Long: `Query mature and pending consumer chains start proposals on provider chain.
Matured proposals will be executed on the next block - their spawn_time has passed
Pending proposals are waiting for their spawn_time to pass.
`,
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)

req := &types.QueryConsumerChainStartProposalsRequest{}
res, err := queryClient.QueryConsumerChainStarts(cmd.Context(), req)
if err != nil {
return err
}

return clientCtx.PrintProto(res)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

func CmdConsumerStopProposals() *cobra.Command {
cmd := &cobra.Command{
Use: "list-stop-proposals",
Short: "Query consumer chains stop proposals on provider chain.",
Long: `Query mature and pending consumer chains stop proposals on provider chain.
Matured proposals will be executed on the next block - their stop_time has passed
Pending proposals are waiting for their stop_time to pass.
`,
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)

req := &types.QueryConsumerChainStopProposalsRequest{}
res, err := queryClient.QueryConsumerChainStops(cmd.Context(), req)
if err != nil {
return err
}

return clientCtx.PrintProto(res)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

// TODO: fix naming
func CmdConsumerValidatorKeyAssignment() *cobra.Command {
bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix()
Expand Down
Loading
Loading