From 87fbe4382e20d3093ff93fbd8dbbed6d74b045b3 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 7 Nov 2024 14:51:41 +0800 Subject: [PATCH] chore: update some comments --- packages/taiko-client/docs/docs.go | 15 ++++++++++----- packages/taiko-client/docs/swagger.json | 17 ++++++++++++----- packages/taiko-client/docs/swagger.yaml | 18 +++++++++++------- .../taiko-client/driver/soft_blocks/api.go | 8 ++++---- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/packages/taiko-client/docs/docs.go b/packages/taiko-client/docs/docs.go index 716fc382652..f82f6be1ce0 100644 --- a/packages/taiko-client/docs/docs.go +++ b/packages/taiko-client/docs/docs.go @@ -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" ], @@ -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", @@ -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" ] diff --git a/packages/taiko-client/docs/swagger.json b/packages/taiko-client/docs/swagger.json index 078524beb0b..85f3a08f1f4 100644 --- a/packages/taiko-client/docs/swagger.json +++ b/packages/taiko-client/docs/swagger.json @@ -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": [ @@ -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", @@ -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", diff --git a/packages/taiko-client/docs/swagger.yaml b/packages/taiko-client/docs/swagger.yaml index fa62613b65a..fa7adf15247 100644 --- a/packages/taiko-client/docs/swagger.yaml +++ b/packages/taiko-client/docs/swagger.yaml @@ -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 @@ -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: @@ -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 diff --git a/packages/taiko-client/driver/soft_blocks/api.go b/packages/taiko-client/driver/soft_blocks/api.go index 1f818e7ce36..551e50a608e 100644 --- a/packages/taiko-client/driver/soft_blocks/api.go +++ b/packages/taiko-client/driver/soft_blocks/api.go @@ -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