Skip to content

Commit 1895a7f

Browse files
committed
refactor: comment updates
1 parent fe701a1 commit 1895a7f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

node/grpc/server_v2.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,12 @@ func (s *ServerV2) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (
148148
}
149149
}
150150
if s.blobAuthenticator != nil {
151+
// TODO: check the latency of request validation later; could be parallelized to avoid significant
152+
// impact to the request latency
151153
for _, blob := range batch.BlobCertificates {
152154
_, err = s.validateDispersalRequest(blob)
153155
if err != nil {
156+
// TODO: Blacklist the disperser if there's an invalid dispersal request
154157
return nil, api.NewErrorInvalidArg(fmt.Sprintf("failed to validate blob request: %v", err))
155158
}
156159
}
@@ -387,6 +390,7 @@ func (s *ServerV2) GetChunks(ctx context.Context, in *pb.GetChunksRequest) (*pb.
387390
// - no encoding prover GetCommitmentsForPaddedLength check
388391
// - directly take blob lengths (no blob data yet)
389392
// - doesn't check every 32 bytes is a valid field element
393+
// Node cannot make these checks because the checks require the blob data
390394
func (s *ServerV2) validateDispersalRequest(
391395
blobCert *corev2.BlobCertificate,
392396
) (*corev2.BlobHeader, error) {
@@ -398,7 +402,7 @@ func (s *ServerV2) validateDispersalRequest(
398402
return nil, fmt.Errorf("failed to authenticate blob request: %v", err)
399403
}
400404

401-
//this is the length in SYMBOLS (32 byte field elements) of the blob. it must be a power of 2
405+
// this is the length in SYMBOLS (32 byte field elements) of the blob. it must be a power of 2
402406
commitedBlobLength := blobCert.BlobHeader.BlobCommitments.Length
403407
if commitedBlobLength == 0 {
404408
return nil, errors.New("blob size must be greater than 0")

0 commit comments

Comments
 (0)