diff --git a/x/ccv/provider/keeper/consumer_lifecycle.go b/x/ccv/provider/keeper/consumer_lifecycle.go index b292e49ba4..1dc3ef3d95 100644 --- a/x/ccv/provider/keeper/consumer_lifecycle.go +++ b/x/ccv/provider/keeper/consumer_lifecycle.go @@ -513,7 +513,6 @@ func (k Keeper) DeleteConsumerChain(ctx sdk.Context, consumerId string) (err err k.DeleteConsumerValSet(ctx, consumerId) k.DeleteConsumerRewardsAllocation(ctx, consumerId) - k.DeleteConsumerOwnerAddress(ctx, consumerId) k.DeleteConsumerRemovalTime(ctx, consumerId) // TODO (PERMISSIONLESS) add newly-added state to be deleted diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index ee25626169..4d60cf8dc9 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -212,8 +212,6 @@ func (k Keeper) DeleteConsumerIdToChannelId(ctx sdk.Context, consumerId string) } // GetAllConsumersWithIBCClients returns the ids of all consumer chains that with IBC clients created. -// This is equivalent to getting the ids of all launched consumer chains: -// All launched chains have created an IBC client when they launched (see `LaunchConsumer`). func (k Keeper) GetAllConsumersWithIBCClients(ctx sdk.Context) []string { consumerIds := []string{} @@ -224,12 +222,7 @@ func (k Keeper) GetAllConsumersWithIBCClients(ctx sdk.Context) []string { for ; iterator.Valid(); iterator.Next() { // remove 1 byte prefix from key to retrieve consumerId consumerId := string(iterator.Key()[1:]) - - // A chain might have stopped, but we might not yet have its consumer id to client id association deleted. - // To avoid returning stopped chains, we check the phase of the consumer chain and only return launched chains. - if k.GetConsumerPhase(ctx, consumerId) == types.ConsumerPhase_CONSUMER_PHASE_LAUNCHED { - consumerIds = append(consumerIds, consumerId) - } + consumerIds = append(consumerIds, consumerId) } return consumerIds diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 18b292d73e..cfd25babf4 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -143,6 +143,12 @@ func (k Keeper) BlocksUntilNextEpoch(ctx sdk.Context) int64 { // TODO (mpoke): iterate only over consumers with established channel func (k Keeper) SendVSCPackets(ctx sdk.Context) error { for _, consumerId := range k.GetAllConsumersWithIBCClients(ctx) { + + if k.GetConsumerPhase(ctx, consumerId) != providertypes.ConsumerPhase_CONSUMER_PHASE_INITIALIZED { + // only send VSCPackets to launched chains + continue + } + // check if CCV channel is established and send if channelID, found := k.GetConsumerIdToChannelId(ctx, consumerId); found { if err := k.SendVSCPacketsToChain(ctx, consumerId, channelID); err != nil { diff --git a/x/ccv/provider/types/legacy_proposal.go b/x/ccv/provider/types/legacy_proposal.go index b86c409109..9cc6ef2a77 100644 --- a/x/ccv/provider/types/legacy_proposal.go +++ b/x/ccv/provider/types/legacy_proposal.go @@ -136,6 +136,7 @@ func NewConsumerRemovalProposal(title, description, chainID string, stopTime tim Title: title, Description: description, ChainId: chainID, + StopTime: stopTime, } }