Skip to content

Commit

Permalink
switched GetStatus to only return empty ticks for current epoch inste…
Browse files Browse the repository at this point in the history
…ad of all epochs; part of the optimisation process
  • Loading branch information
0xluk committed Dec 23, 2024
1 parent 3e3560b commit 36d5326
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions rpc/rpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,22 +370,17 @@ func (s *Server) GetStatus(ctx context.Context, _ *emptypb.Empty) (*protobuff.Ge
return nil, status.Errorf(codes.Internal, "getting processed tick intervals")
}

var epochs []uint32
for epoch, _ := range lastProcessedTicksPerEpoch {
epochs = append(epochs, epoch)
}

emptyTicksForAllEpochs, err := s.store.GetEmptyTicksForEpochs(epochs)
emptyTickForCurrentEpoch, err := s.store.GetEmptyTicksForEpoch(lastProcessedTick.Epoch)
if err != nil {
return nil, status.Errorf(codes.Internal, "getting empty ticks for all epochs: %v", err)
return nil, status.Errorf(codes.Internal, "getting empty ticks for current epoch: %v", err)
}

return &protobuff.GetStatusResponse{
LastProcessedTick: lastProcessedTick,
LastProcessedTicksPerEpoch: lastProcessedTicksPerEpoch,
SkippedTicks: skippedTicks.SkippedTicks,
ProcessedTickIntervalsPerEpoch: ptie,
EmptyTicksPerEpoch: emptyTicksForAllEpochs,
EmptyTicksPerEpoch: map[uint32]uint32{lastProcessedTick.Epoch: emptyTickForCurrentEpoch},
}, nil
}

Expand Down

0 comments on commit 36d5326

Please sign in to comment.