diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index af979ff07e..7353b13f86 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -680,8 +680,7 @@ func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) (time.Time, bool) return time.Time{}, false } - // a chain can only launch if the spawn time is in the future - spawnTimeInTheFuture := initializationParameters.SpawnTime.After(ctx.BlockTime()) + spawnTimeIsNotZero := !initializationParameters.SpawnTime.Equal(time.Time{}) genesisHashSet := initializationParameters.GenesisHash != nil binaryHashSet := initializationParameters.BinaryHash != nil @@ -690,7 +689,7 @@ func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) (time.Time, bool) blocksPerDistributionTransmissionSet := initializationParameters.BlocksPerDistributionTransmission > 0 historicalEntriesSet := initializationParameters.HistoricalEntries > 0 - return initializationParameters.SpawnTime, spawnTimeInTheFuture && genesisHashSet && binaryHashSet && consumerRedistributionFractionSet && + return initializationParameters.SpawnTime, spawnTimeIsNotZero && genesisHashSet && binaryHashSet && consumerRedistributionFractionSet && blocksPerDistributionTransmissionSet && historicalEntriesSet } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index ebd02e61d4..a18fe738cc 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -704,16 +704,6 @@ func TestCanLaunch(t *testing.T) { _, canLaunch = providerKeeper.CanLaunch(ctx, "consumerId") require.True(t, canLaunch) - // initialized chain that has spawn time in the past cannot launch - ctx = ctx.WithBlockTime(initializationParameters.SpawnTime.Add(time.Second)) - _, canLaunch = providerKeeper.CanLaunch(ctx, "consumerId") - require.False(t, canLaunch) - - // reset block time so the chain can launch - ctx = ctx.WithBlockTime(initializationParameters.SpawnTime.Add(-time.Second)) - _, canLaunch = providerKeeper.CanLaunch(ctx, "consumerId") - require.True(t, canLaunch) - // chain cannot launch without a genesis hash initializationParameters.GenesisHash = nil err = providerKeeper.SetConsumerInitializationParameters(ctx, "consumerId", initializationParameters)