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

fix blob size displayed at sendchunks #452

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
2 changes: 1 addition & 1 deletion disperser/batcher/grpc/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func GetStoreChunksRequest(blobMessages []*core.BlobMessage, batchHeader *core.B
if err != nil {
return nil, 0, err
}
totalSize += blob.BlobHeader.EncodedSizeAllQuorums()
totalSize += int64(blob.Bundles.Size())
Copy link
Contributor

Choose a reason for hiding this comment

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

did you want to update the logging in L122 too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is more useful to get workload per node, it is currently printing total blob size.

}

request := &node.StoreChunksRequest{
Expand Down
14 changes: 10 additions & 4 deletions node/grpc/server_load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package grpc_test
import (
"context"
"crypto/rand"
"fmt"
"testing"
"time"

"github.com/Layr-Labs/eigenda/core"
"github.com/Layr-Labs/eigenda/disperser/batcher"
dispatcher "github.com/Layr-Labs/eigenda/disperser/batcher/grpc"
"github.com/Layr-Labs/eigenda/encoding"
"github.com/Layr-Labs/eigenda/encoding/utils/codec"
"github.com/stretchr/testify/assert"
)

Expand All @@ -23,10 +25,13 @@ func makeBatch(t *testing.T, blobSize int, numBlobs int, advThreshold, quorumThr
blobMessagesByOp := make(map[core.OperatorID][]*core.BlobMessage)
for i := 0; i < numBlobs; i++ {
// create data
data := make([]byte, blobSize)
_, err := rand.Read(data)
ranData := make([]byte, blobSize)
_, err := rand.Read(ranData)
assert.NoError(t, err)

data := codec.ConvertByPaddingEmptyByte(ranData)
data = data[:blobSize]

operatorState, err := chainState.GetOperatorState(context.Background(), 0, []core.QuorumID{0})
assert.NoError(t, err)

Expand Down Expand Up @@ -92,15 +97,16 @@ func TestStoreChunks(t *testing.T) {

server := newTestServer(t, false)
// 50 X 200 KiB blobs
batchHeader, blobMessagesByOp := makeBatch(t, 200*1024, 50, 80, 100, 0)
batchHeader, blobMessagesByOp := makeBatch(t, 200*1024, 50, 80, 100, 1)
numTotalChunks := 0
for i := range blobMessagesByOp[opID] {
numTotalChunks += len(blobMessagesByOp[opID][i].Bundles[0])
}
t.Logf("Batch numTotalChunks: %d", numTotalChunks)
req, totalSize, err := dispatcher.GetStoreChunksRequest(blobMessagesByOp[opID], batchHeader)
fmt.Println("totalSize", totalSize)
assert.NoError(t, err)
assert.Equal(t, 50790400, totalSize)
assert.Equal(t, int64(26214400), totalSize)

timer := time.Now()
reply, err := server.StoreChunks(context.Background(), req)
Expand Down
Loading