Skip to content

Commit

Permalink
docs: clearer MaxRetrieveBlobSizeBytes docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Oct 30, 2024
1 parent b301232 commit a07336c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions api/clients/disperser_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ type Config struct {
// but all other methods use the default 4MiB max message size, whereas RetrieveBlob
// potentially needs a larger size.
//
// If not set, the default value is 100MiB, to be backward compatible.
// If not set, default value is 100MiB for forward compatibility.
// Check official documentation for current max blob size on mainnet.
MaxRetrieveBlobSizeBytes int
}

Expand Down Expand Up @@ -293,16 +294,16 @@ func (c *DisperserClient) RetrieveBlob(ctx context.Context, batchHeaderHash []by
ctxTimeout, cancel := context.WithTimeout(ctx, time.Second*60)
defer cancel()
if c.config.MaxRetrieveBlobSizeBytes == 0 {
// max blob size on mainnet is currently 16MiB but we set this to 100MiB for backward compatibility
// to what it originally was before this config was added
// Set to 100MiB for forward compatibility.
// Check official documentation for current max blob size on mainnet.
c.config.MaxRetrieveBlobSizeBytes = 100 * 1024 * 1024
}
reply, err := c.client.RetrieveBlob(ctxTimeout,
&disperser_rpc.RetrieveBlobRequest{
BatchHeaderHash: batchHeaderHash,
BlobIndex: blobIndex,
},
grpc.MaxCallRecvMsgSize(c.config.MaxRetrieveBlobSizeBytes))
grpc.MaxCallRecvMsgSize(c.config.MaxRetrieveBlobSizeBytes)) // for client
if err != nil {
return nil, err
}
Expand Down

0 comments on commit a07336c

Please sign in to comment.