diff --git a/proxy/grpc/server.go b/proxy/grpc/server.go index 18af360..5f2516e 100644 --- a/proxy/grpc/server.go +++ b/proxy/grpc/server.go @@ -53,19 +53,28 @@ func (s *proxyInputSrv) SubmitRollupTransaction(ctx context.Context, req *pbseq. // GetNextBatch returns the next batch of transactions from sequencer to rollup. func (s *proxyOutputSrv) GetNextBatch(ctx context.Context, req *pbseq.Batch) (*pbseq.Batch, error) { - lastBatch := &sequencing.Batch{} - lastBatch.FromProto(req) + var lastBatch *sequencing.Batch + if req != nil { + lastBatch = &sequencing.Batch{} + lastBatch.FromProto(req) + } batch, err := s.SequencerOutput.GetNextBatch(ctx, lastBatch) if err != nil { return nil, err } + if batch == nil { + return nil, nil + } return batch.ToProto(), nil } // VerifyBatch verifies a batch of transactions received from the sequencer. func (s *proxyVerificationSrv) VerifyBatch(ctx context.Context, req *pbseq.Batch) (*pbseq.VerificationResponse, error) { - batch := &sequencing.Batch{} - batch.FromProto(req) + var batch *sequencing.Batch + if req != nil { + batch = &sequencing.Batch{} + batch.FromProto(req) + } ok, err := s.BatchVerifier.VerifyBatch(ctx, batch) if err != nil { return nil, err