@@ -60,7 +60,7 @@ func (k Keeper) InitializeConsumer(ctx sdk.Context, consumerId string) (time.Tim
60
60
return initializationParameters .SpawnTime , true
61
61
}
62
62
63
- // BeginBlockLaunchConsumers launches initialized consumers that are ready to launch
63
+ // BeginBlockLaunchConsumers launches initialized consumers chains for which the spawn time has passed
64
64
func (k Keeper ) BeginBlockLaunchConsumers (ctx sdk.Context ) error {
65
65
consumerIds , err := k .ConsumeIdsFromTimeQueue (
66
66
ctx ,
@@ -204,10 +204,10 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error {
204
204
// Set minimum height for equivocation evidence from this consumer chain
205
205
k .SetEquivocationEvidenceMinHeight (ctx , consumerId , initializationRecord .InitialHeight .RevisionHeight )
206
206
207
- // Consumers start out with the unbonding period from the consumer addition prop
207
+ // Consumers start out with the unbonding period from the initialization parameters
208
208
consumerUnbondingPeriod := initializationRecord .UnbondingPeriod
209
209
210
- // Create client state by getting template client from parameters and filling in zeroed fields from proposal.
210
+ // Create client state by getting template client from initialization parameters
211
211
clientState := k .GetTemplateClient (ctx )
212
212
clientState .ChainId = chainId
213
213
clientState .LatestHeight = initializationRecord .InitialHeight
@@ -351,6 +351,8 @@ func (k Keeper) MakeConsumerGenesis(
351
351
}
352
352
hash := tmtypes .NewValidatorSet (updatesAsValSet ).Hash ()
353
353
354
+ // note that providerFeePoolAddrStr is sent to the consumer during the IBC Channel handshake;
355
+ // see HandshakeMetadata in OnChanOpenTry on the provider-side, and OnChanOpenAck on the consumer-side
354
356
consumerGenesisParams := ccv .NewParams (
355
357
true ,
356
358
initializationRecord .BlocksPerDistributionTransmission ,
@@ -399,7 +401,7 @@ func (k Keeper) StopAndPrepareForConsumerRemoval(ctx sdk.Context, consumerId str
399
401
return nil
400
402
}
401
403
402
- // BeginBlockRemoveConsumers iterates over the pending consumer proposals and stop/removes the chain if the removal time has passed
404
+ // BeginBlockRemoveConsumers removes stopped consumer chain for which the removal time has passed
403
405
func (k Keeper ) BeginBlockRemoveConsumers (ctx sdk.Context ) error {
404
406
consumerIds , err := k .ConsumeIdsFromTimeQueue (
405
407
ctx ,
@@ -483,8 +485,11 @@ func (k Keeper) DeleteConsumerChain(ctx sdk.Context, consumerId string) (err err
483
485
k .DeleteConsumerRemovalTime (ctx , consumerId )
484
486
485
487
// TODO (PERMISSIONLESS) add newly-added state to be deleted
488
+
486
489
// Note that we do not delete ConsumerIdToChainIdKey and ConsumerIdToPhase, as well
487
490
// as consumer metadata, initialization and power-shaping parameters.
491
+ // This is to enable block explorers and front ends to show information of
492
+ // consumer chains that were removed without needing an archive node.
488
493
489
494
k .SetConsumerPhase (ctx , consumerId , types .CONSUMER_PHASE_DELETED )
490
495
k .Logger (ctx ).Info ("consumer chain deleted from provider" , "consumerId" , consumerId )
0 commit comments