Skip to content

Commit

Permalink
chore: update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Nov 7, 2024
1 parent f98aa42 commit 87fbe43
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 21 deletions.
15 changes: 10 additions & 5 deletions packages/taiko-client/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const docTemplate = `{
},
"/softBlocks": {
"post": {
"description": "Insert a group of transactions into a soft block for preconfirmation. If the group is the\nfirst for a block, a new soft block will be created. Otherwise, the transactions will\nbe appended to the existing soft block. The API will fail if:\n1) the block is not soft\n2) block-level parameters are invalid or do not match the current soft block’s parameters\n3) the group ID is not exactly 1 greater than the previous one\n4) the last group of the block indicates no further transactions are allowed",
"description": "Insert a batch of transactions into a soft block for preconfirmation. If the batch is the\nfirst for a block, a new soft block will be created. Otherwise, the transactions will\nbe appended to the existing soft block. The API will fail if:\n1) the block is not soft\n2) block-level parameters are invalid or do not match the current soft block’s parameters\n3) the batch ID is not exactly 1 greater than the previous one\n4) the last batch of the block indicates no further transactions are allowed",
"consumes": [
"application/json"
],
Expand Down Expand Up @@ -174,8 +174,11 @@ const docTemplate = `{
}
},
"coinbase": {
"description": "@param coinbase uint64 Coinbase of the soft block",
"type": "string"
"description": "@param coinbase string Coinbase of the soft block",
"type": "array",
"items": {
"type": "integer"
}
},
"timestamp": {
"description": "@param timestamp uint64 Timestamp of the soft block",
Expand Down Expand Up @@ -226,10 +229,12 @@ const docTemplate = `{
"softblocks.TransactionBatchMarker": {
"type": "string",
"enum": [
"end_of_block",
"end_of_preconf"
"",
"endOfBlock",
"endOfPreconf"
],
"x-enum-varnames": [
"BatchMarkerEmpty",
"BatchMarkerEOB",
"BatchMarkerEOP"
]
Expand Down
17 changes: 12 additions & 5 deletions packages/taiko-client/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"/softBlocks": {
"post": {
"description": "Insert a group of transactions into a soft block for preconfirmation. If the group is the\nfirst for a block, a new soft block will be created. Otherwise, the transactions will\nbe appended to the existing soft block. The API will fail if:\n1) the block is not soft\n2) block-level parameters are invalid or do not match the current soft block’s parameters\n3) the group ID is not exactly 1 greater than the previous one\n4) the last group of the block indicates no further transactions are allowed",
"description": "Insert a batch of transactions into a soft block for preconfirmation. If the batch is the\nfirst for a block, a new soft block will be created. Otherwise, the transactions will\nbe appended to the existing soft block. The API will fail if:\n1) the block is not soft\n2) block-level parameters are invalid or do not match the current soft block’s parameters\n3) the batch ID is not exactly 1 greater than the previous one\n4) the last batch of the block indicates no further transactions are allowed",
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
Expand Down Expand Up @@ -153,8 +153,11 @@
}
},
"coinbase": {
"description": "@param coinbase uint64 Coinbase of the soft block",
"type": "string"
"description": "@param coinbase string Coinbase of the soft block",
"type": "array",
"items": {
"type": "integer"
}
},
"timestamp": {
"description": "@param timestamp uint64 Timestamp of the soft block",
Expand Down Expand Up @@ -204,8 +207,12 @@
},
"softblocks.TransactionBatchMarker": {
"type": "string",
"enum": ["end_of_block", "end_of_preconf"],
"x-enum-varnames": ["BatchMarkerEOB", "BatchMarkerEOP"]
"enum": ["", "endOfBlock", "endOfPreconf"],
"x-enum-varnames": [
"BatchMarkerEmpty",
"BatchMarkerEOB",
"BatchMarkerEOP"
]
},
"types.Header": {
"type": "object",
Expand Down
18 changes: 11 additions & 7 deletions packages/taiko-client/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ definitions:
type: integer
type: array
coinbase:
description: "@param coinbase uint64 Coinbase of the soft block"
type: string
description: "@param coinbase string Coinbase of the soft block"
items:
type: integer
type: array
timestamp:
description: "@param timestamp uint64 Timestamp of the soft block"
type: integer
Expand Down Expand Up @@ -95,10 +97,12 @@ definitions:
type: object
softblocks.TransactionBatchMarker:
enum:
- end_of_block
- end_of_preconf
- ""
- endOfBlock
- endOfPreconf
type: string
x-enum-varnames:
- BatchMarkerEmpty
- BatchMarkerEOB
- BatchMarkerEOP
types.Header:
Expand Down Expand Up @@ -238,13 +242,13 @@ paths:
consumes:
- application/json
description: |-
Insert a group of transactions into a soft block for preconfirmation. If the group is the
Insert a batch of transactions into a soft block for preconfirmation. If the batch is the
first for a block, a new soft block will be created. Otherwise, the transactions will
be appended to the existing soft block. The API will fail if:
1) the block is not soft
2) block-level parameters are invalid or do not match the current soft block’s parameters
3) the group ID is not exactly 1 greater than the previous one
4) the last group of the block indicates no further transactions are allowed
3) the batch ID is not exactly 1 greater than the previous one
4) the last batch of the block indicates no further transactions are allowed
parameters:
- description: soft block creation request body
in: body
Expand Down
8 changes: 4 additions & 4 deletions packages/taiko-client/driver/soft_blocks/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ type BuildSoftBlockResponseBody struct {
}

// BuildSoftBlock handles a soft block creation request,
// if the soft block group in request are valid, it will insert the correspoinding new soft
// if the soft block transactions batch in request are valid, it will insert or reorg the correspoinding the soft
// block to the backend L2 execution engine and return a success response.
//
// @Description Insert a group of transactions into a soft block for preconfirmation. If the group is the
// @Description Insert a batch of transactions into a soft block for preconfirmation. If the batch is the
// @Description first for a block, a new soft block will be created. Otherwise, the transactions will
// @Description be appended to the existing soft block. The API will fail if:
// @Description 1) the block is not soft
// @Description 2) block-level parameters are invalid or do not match the current soft block’s parameters
// @Description 3) the group ID is not exactly 1 greater than the previous one
// @Description 4) the last group of the block indicates no further transactions are allowed
// @Description 3) the batch ID is not exactly 1 greater than the previous one
// @Description 4) the last batch of the block indicates no further transactions are allowed
// @Param body body BuildSoftBlockRequestBody true "soft block creation request body"
// @Accept json
// @Produce json
Expand Down

0 comments on commit 87fbe43

Please sign in to comment.