Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log for chunk encoding format #696

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions disperser/batcher/grpc/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (c *dispatcher) sendChunks(ctx context.Context, blobs []*core.BlobMessage,
if err != nil {
return nil, err
}
c.logger.Debug("sending chunks to operator", "operator", op.Socket, "num blobs", len(blobs), "size", totalSize, "request message size", proto.Size(request), "request serialization time", time.Since(start))
c.logger.Debug("sending chunks to operator", "operator", op.Socket, "num blobs", len(blobs), "size", totalSize, "request message size", proto.Size(request), "request serialization time", time.Since(start), "use Gnark chunk encoding", c.EnableGnarkBundleEncoding)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It would be nicer to keep the labels one word without spaces (numBlobs, requestMessageSize, etc), to support label filter queries. I think LogQL queries bork if labels contain spaces

opt := grpc.MaxCallSendMsgSize(60 * 1024 * 1024 * 1024)
reply, err := gc.StoreChunks(ctx, request, opt)

Expand Down Expand Up @@ -173,7 +173,7 @@ func (c *dispatcher) SendBlobsToOperator(ctx context.Context, blobs []*core.Blob
if err != nil {
return nil, err
}
c.logger.Debug("sending chunks to operator", "operator", op.Socket, "num blobs", len(blobs), "size", totalSize, "request message size", proto.Size(request), "request serialization time", time.Since(start))
c.logger.Debug("sending chunks to operator", "operator", op.Socket, "num blobs", len(blobs), "size", totalSize, "request message size", proto.Size(request), "request serialization time", time.Since(start), "use Gnark chunk encoding", c.EnableGnarkBundleEncoding)
opt := grpc.MaxCallSendMsgSize(60 * 1024 * 1024 * 1024)
reply, err := gc.StoreBlobs(ctx, request, opt)

Expand Down
1 change: 1 addition & 0 deletions node/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ func (s *Server) RetrieveChunks(ctx context.Context, in *pb.RetrieveChunksReques
return nil, fmt.Errorf("could not find chunks for batchHeaderHash %v, blob index: %v, quorumID: %v", hex.EncodeToString(batchHeaderHash[:]), in.GetBlobIndex(), in.GetQuorumId())
}
if !s.config.EnableGnarkBundleEncoding && format == pb.ChunkEncodingFormat_GNARK {
s.node.Logger.Info("Converting chunks from Gnark back to Gob", "batchHeaderHash", hex.EncodeToString(batchHeaderHash[:]), "blobIndex", in.GetBlobIndex(), "quorumId", in.GetQuorumId())
format = pb.ChunkEncodingFormat_GOB
gobChunks := make([][]byte, 0, len(chunks))
for _, c := range chunks {
Expand Down
2 changes: 1 addition & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func NewNode(reg *prometheus.Registry, config *Config, pubIPProvider pubip.Provi
nodeLogger.Info("Creating node", "chainID", chainID.String(), "operatorID", config.ID.Hex(),
"dispersalPort", config.DispersalPort, "retrievalPort", config.RetrievalPort, "churnerUrl", config.ChurnerUrl,
"quorumIDs", fmt.Sprint(config.QuorumIDList), "registerNodeAtStart", config.RegisterNodeAtStart, "pubIPCheckInterval", config.PubIPCheckInterval,
"eigenDAServiceManagerAddr", config.EigenDAServiceManagerAddr, "blockStaleMeasure", blockStaleMeasure, "storeDurationBlocks", storeDurationBlocks)
"eigenDAServiceManagerAddr", config.EigenDAServiceManagerAddr, "blockStaleMeasure", blockStaleMeasure, "storeDurationBlocks", storeDurationBlocks, "enableGnarkBundleEncoding", config.EnableGnarkBundleEncoding)

return &Node{
Config: config,
Expand Down
3 changes: 2 additions & 1 deletion node/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,12 +594,13 @@ func (s *Store) GetChunks(ctx context.Context, batchHeaderHash [32]byte, blobInd
if err != nil {
return nil, node.ChunkEncodingFormat_UNKNOWN, err
}
log.Debug("Retrieved chunk", "blobKey", hexutil.Encode(blobKey), "length", len(data))

chunks, format, err := DecodeChunks(data)
if err != nil {
return nil, format, err
}
log.Debug("Retrieved chunk", "blobKey", hexutil.Encode(blobKey), "length", len(data), "chunk encoding format", format)

return chunks, format, nil
}

Expand Down
Loading