diff --git a/x/subscription/keeper/subscription.go b/x/subscription/keeper/subscription.go index 29ddca3388..6758c64111 100644 --- a/x/subscription/keeper/subscription.go +++ b/x/subscription/keeper/subscription.go @@ -599,6 +599,14 @@ func (k Keeper) CreateFutureSubscription(ctx sdk.Context, return err } + if duration > types.MAX_SUBSCRIPTION_DURATION { + str := strconv.FormatInt(types.MAX_SUBSCRIPTION_DURATION, 10) + return utils.LavaFormatWarning("duration cannot exceed limit ("+str+" months)", + fmt.Errorf("future subscription failed"), + utils.Attribute{Key: "duration", Value: duration}, + ) + } + var sub types.Subscription nextEpoch, err := k.epochstorageKeeper.GetNextEpoch(ctx, block) if err != nil {