Skip to content

Commit

Permalink
change traffic gen and synthetic client
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Apr 2, 2024
1 parent d80082a commit ca825a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/synthetic-test/synthetic_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ func TestDisperseBlobEndToEnd(t *testing.T) {
data := make([]byte, dataSize[rand.Intn(len(dataSize))])
_, err := rand.Read(data)
assert.NoError(t, err)

data = codec.ConvertByPaddingEmptyByte(data)

disperseBlobStartTime := time.Now()
ctx := context.Background()

Expand Down
6 changes: 5 additions & 1 deletion tools/traffic/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/Layr-Labs/eigenda/clients"
"github.com/Layr-Labs/eigenda/common"
"github.com/Layr-Labs/eigenda/encoding/utils/codec"
"github.com/Layr-Labs/eigensdk-go/logging"
)

Expand Down Expand Up @@ -62,6 +63,8 @@ func (g *TrafficGenerator) StartTraffic(ctx context.Context) error {
return err
}

data = codec.ConvertByPaddingEmptyByte(data)

ticker := time.NewTicker(g.Config.RequestInterval)
for {
select {
Expand All @@ -73,8 +76,9 @@ func (g *TrafficGenerator) StartTraffic(ctx context.Context) error {
if err != nil {
return err
}
data = codec.ConvertByPaddingEmptyByte(data)
}
err := g.sendRequest(ctx, data)
err := g.sendRequest(ctx, data[:g.Config.DataSize])
if err != nil {
g.Logger.Error("failed to send blob request", "err:", err)
}
Expand Down

0 comments on commit ca825a6

Please sign in to comment.