Skip to content

Commit

Permalink
Fix: add blobkey in blob response (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Jan 10, 2025
1 parent b09cdc3 commit 2699b91
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions disperser/dataapi/docs/v2/V2_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,9 @@ const docTemplateV2 = `{
"blob_header": {
"$ref": "#/definitions/github_com_Layr-Labs_eigenda_core_v2.BlobHeader"
},
"blob_key": {
"type": "string"
},
"blob_size_bytes": {
"type": "integer"
},
Expand Down
3 changes: 3 additions & 0 deletions disperser/dataapi/docs/v2/V2_swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,9 @@
"blob_header": {
"$ref": "#/definitions/github_com_Layr-Labs_eigenda_core_v2.BlobHeader"
},
"blob_key": {
"type": "string"
},
"blob_size_bytes": {
"type": "integer"
},
Expand Down
2 changes: 2 additions & 0 deletions disperser/dataapi/docs/v2/V2_swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ definitions:
properties:
blob_header:
$ref: '#/definitions/github_com_Layr-Labs_eigenda_core_v2.BlobHeader'
blob_key:
type: string
blob_size_bytes:
type: integer
dispersed_at:
Expand Down
8 changes: 8 additions & 0 deletions disperser/dataapi/v2/server_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type (
}

BlobResponse struct {
BlobKey string `json:"blob_key"`
BlobHeader *corev2.BlobHeader `json:"blob_header"`
Status string `json:"status"`
DispersedAt uint64 `json:"dispersed_at"`
Expand Down Expand Up @@ -321,7 +322,14 @@ func (s *ServerV2) FetchBlobHandler(c *gin.Context) {
errorResponse(c, err)
return
}
bk, err := metadata.BlobHeader.BlobKey()
if err != nil || bk != blobKey {
s.metrics.IncrementFailedRequestNum("FetchBlob")
errorResponse(c, err)
return
}
response := &BlobResponse{
BlobKey: bk.Hex(),
BlobHeader: metadata.BlobHeader,
Status: metadata.BlobStatus.String(),
DispersedAt: metadata.RequestedAt,
Expand Down

0 comments on commit 2699b91

Please sign in to comment.