Skip to content

Commit

Permalink
Log request protobuf msg size (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored and pschork committed May 25, 2024
1 parent d4405ee commit 52510fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion disperser/batcher/grpc/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/protobuf/proto"
)

type Config struct {
Expand Down Expand Up @@ -130,7 +131,7 @@ func (c *dispatcher) sendChunks(ctx context.Context, blobs []*core.BlobMessage,
}

opt := grpc.MaxCallSendMsgSize(60 * 1024 * 1024 * 1024)
c.logger.Debug("sending chunks to operator", "operator", op.Socket, "size", totalSize)
c.logger.Debug("sending chunks to operator", "operator", op.Socket, "size", totalSize, "request message size", proto.Size(request))
reply, err := gc.StoreChunks(ctx, request, opt)

if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions node/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ func (s *Server) validateStoreChunkRequest(in *pb.StoreChunksRequest) error {
func (s *Server) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (*pb.StoreChunksReply, error) {
start := time.Now()

s.node.Logger.Info("StoreChunks RPC request recieved", "request message size", proto.Size(in))

// Validate the request.
if err := s.validateStoreChunkRequest(in); err != nil {
return nil, err
Expand Down

0 comments on commit 52510fb

Please sign in to comment.