Skip to content

Commit

Permalink
Fix swagger doc gen to resolve v2.BlobHeader (Layr-Labs#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork authored Feb 3, 2025
1 parent 6fd354c commit 5620ce2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 152 deletions.
4 changes: 2 additions & 2 deletions disperser/common/v2/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

pb "github.com/Layr-Labs/eigenda/api/grpc/disperser/v2"
core "github.com/Layr-Labs/eigenda/core/v2"
corev2 "github.com/Layr-Labs/eigenda/core/v2"
"github.com/Layr-Labs/eigenda/encoding"
)

Expand Down Expand Up @@ -71,7 +71,7 @@ func BlobStatusFromProtobuf(s pb.BlobStatus) (BlobStatus, error) {

// BlobMetadata is an internal representation of a blob's metadata.
type BlobMetadata struct {
BlobHeader *core.BlobHeader
BlobHeader *corev2.BlobHeader
Signature []byte

// BlobStatus indicates the current status of the blob
Expand Down
54 changes: 1 addition & 53 deletions disperser/dataapi/docs/v2/V2_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,58 +603,6 @@ const docTemplateV2 = `{
"big.Int": {
"type": "object"
},
"core.BlobHeader": {
"type": "object",
"properties": {
"accountID": {
"description": "AccountID is the account that is paying for the blob to be stored",
"type": "string"
},
"commitment": {
"$ref": "#/definitions/encoding.G1Commitment"
},
"length": {
"type": "integer"
},
"length_commitment": {
"$ref": "#/definitions/encoding.G2Commitment"
},
"length_proof": {
"$ref": "#/definitions/encoding.LengthProof"
},
"quorumInfos": {
"description": "QuorumInfos contains the quorum specific parameters for the blob",
"type": "array",
"items": {
"$ref": "#/definitions/core.BlobQuorumInfo"
}
}
}
},
"core.BlobQuorumInfo": {
"type": "object",
"properties": {
"adversaryThreshold": {
"description": "AdversaryThreshold is the maximum amount of stake that can be controlled by an adversary in the quorum as a percentage of the total stake in the quorum",
"type": "integer"
},
"chunkLength": {
"description": "ChunkLength is the number of symbols in a chunk",
"type": "integer"
},
"confirmationThreshold": {
"description": "ConfirmationThreshold is the amount of stake that must sign a message for it to be considered valid as a percentage of the total stake in the quorum",
"type": "integer"
},
"quorumID": {
"type": "integer"
},
"quorumRate": {
"description": "Rate Limit. This is a temporary measure until the node can derive rates on its own using rollup authentication. This is used\nfor restricting the rate at which retrievers are able to download data from the DA node to a multiple of the rate at which the\ndata was posted to the DA node.",
"type": "integer"
}
}
},
"core.G1Point": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1110,7 +1058,7 @@ const docTemplateV2 = `{
"type": "object",
"properties": {
"blobHeader": {
"$ref": "#/definitions/core.BlobHeader"
"$ref": "#/definitions/github_com_Layr-Labs_eigenda_core_v2.BlobHeader"
},
"blobSize": {
"description": "BlobSize is the size of the blob in bytes",
Expand Down
54 changes: 1 addition & 53 deletions disperser/dataapi/docs/v2/V2_swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -600,58 +600,6 @@
"big.Int": {
"type": "object"
},
"core.BlobHeader": {
"type": "object",
"properties": {
"accountID": {
"description": "AccountID is the account that is paying for the blob to be stored",
"type": "string"
},
"commitment": {
"$ref": "#/definitions/encoding.G1Commitment"
},
"length": {
"type": "integer"
},
"length_commitment": {
"$ref": "#/definitions/encoding.G2Commitment"
},
"length_proof": {
"$ref": "#/definitions/encoding.LengthProof"
},
"quorumInfos": {
"description": "QuorumInfos contains the quorum specific parameters for the blob",
"type": "array",
"items": {
"$ref": "#/definitions/core.BlobQuorumInfo"
}
}
}
},
"core.BlobQuorumInfo": {
"type": "object",
"properties": {
"adversaryThreshold": {
"description": "AdversaryThreshold is the maximum amount of stake that can be controlled by an adversary in the quorum as a percentage of the total stake in the quorum",
"type": "integer"
},
"chunkLength": {
"description": "ChunkLength is the number of symbols in a chunk",
"type": "integer"
},
"confirmationThreshold": {
"description": "ConfirmationThreshold is the amount of stake that must sign a message for it to be considered valid as a percentage of the total stake in the quorum",
"type": "integer"
},
"quorumID": {
"type": "integer"
},
"quorumRate": {
"description": "Rate Limit. This is a temporary measure until the node can derive rates on its own using rollup authentication. This is used\nfor restricting the rate at which retrievers are able to download data from the DA node to a multiple of the rate at which the\ndata was posted to the DA node.",
"type": "integer"
}
}
},
"core.G1Point": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1107,7 +1055,7 @@
"type": "object",
"properties": {
"blobHeader": {
"$ref": "#/definitions/core.BlobHeader"
"$ref": "#/definitions/github_com_Layr-Labs_eigenda_core_v2.BlobHeader"
},
"blobSize": {
"description": "BlobSize is the size of the blob in bytes",
Expand Down
45 changes: 1 addition & 44 deletions disperser/dataapi/docs/v2/V2_swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,6 @@ basePath: /api/v2
definitions:
big.Int:
type: object
core.BlobHeader:
properties:
accountID:
description: AccountID is the account that is paying for the blob to be stored
type: string
commitment:
$ref: '#/definitions/encoding.G1Commitment'
length:
type: integer
length_commitment:
$ref: '#/definitions/encoding.G2Commitment'
length_proof:
$ref: '#/definitions/encoding.LengthProof'
quorumInfos:
description: QuorumInfos contains the quorum specific parameters for the blob
items:
$ref: '#/definitions/core.BlobQuorumInfo'
type: array
type: object
core.BlobQuorumInfo:
properties:
adversaryThreshold:
description: AdversaryThreshold is the maximum amount of stake that can be
controlled by an adversary in the quorum as a percentage of the total stake
in the quorum
type: integer
chunkLength:
description: ChunkLength is the number of symbols in a chunk
type: integer
confirmationThreshold:
description: ConfirmationThreshold is the amount of stake that must sign a
message for it to be considered valid as a percentage of the total stake
in the quorum
type: integer
quorumID:
type: integer
quorumRate:
description: |-
Rate Limit. This is a temporary measure until the node can derive rates on its own using rollup authentication. This is used
for restricting the rate at which retrievers are able to download data from the DA node to a multiple of the rate at which the
data was posted to the DA node.
type: integer
type: object
core.G1Point:
properties:
x:
Expand Down Expand Up @@ -358,7 +315,7 @@ definitions:
v2.BlobMetadata:
properties:
blobHeader:
$ref: '#/definitions/core.BlobHeader'
$ref: '#/definitions/github_com_Layr-Labs_eigenda_core_v2.BlobHeader'
blobSize:
description: BlobSize is the size of the blob in bytes
type: integer
Expand Down

0 comments on commit 5620ce2

Please sign in to comment.