Skip to content

Commit

Permalink
Add headers for routing on encoding streamer (Layr-Labs#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmanc authored Sep 20, 2024
1 parent 70ab0f2 commit 09c300e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions disperser/batcher/encoding_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/Layr-Labs/eigenda/encoding"
"github.com/Layr-Labs/eigensdk-go/logging"
"github.com/wealdtech/go-merkletree/v2"
grpc_metadata "google.golang.org/grpc/metadata"
)

const encodingInterval = 2 * time.Second
Expand Down Expand Up @@ -377,6 +378,14 @@ func (e *EncodingStreamer) RequestEncodingForBlob(ctx context.Context, metadata
e.mu.Lock()
e.encodingCtxCancelFuncs = append(e.encodingCtxCancelFuncs, cancel)
e.mu.Unlock()

// Add headers for routing
md := grpc_metadata.New(map[string]string{
"content-type": "application/grpc",
"x-payload-size": fmt.Sprintf("%d", len(blob.Data)),
})
encodingCtx = grpc_metadata.NewOutgoingContext(encodingCtx, md)

e.Pool.Submit(func() {
defer cancel()
start := time.Now()
Expand Down

0 comments on commit 09c300e

Please sign in to comment.