diff --git a/x/fbridge/keeper/grpc_query.go b/x/fbridge/keeper/grpc_query.go index 3f6feb5d06..e2460064c2 100644 --- a/x/fbridge/keeper/grpc_query.go +++ b/x/fbridge/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -32,6 +33,12 @@ func (k Keeper) SeqToBlocknums(goCtx context.Context, req *types.QuerySeqToBlock return nil, status.Error(codes.InvalidArgument, "empty request") } + const lowerBound int = 1 + const upperBound int = 1000 + if len(req.Seqs) < lowerBound || len(req.Seqs) > upperBound { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("The number of seqs requested must be between %d and %d", lowerBound, upperBound)) + } + ctx := sdk.UnwrapSDKContext(goCtx) bhList := make([]uint64, len(req.Seqs)) for i, seq := range req.Seqs {