-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(taiko-client): add swagger api for preconf server #18274
feat(taiko-client): add swagger api for preconf server #18274
Conversation
} | ||
} | ||
}, | ||
"/preconfBlocks": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preconfTransactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to POST /tentativeBlocks
as suggested below
}, | ||
"/preconfBlocks": { | ||
"post": { | ||
"description": "Insert preconfirmation blocks by the given groups to the backend L2 execution engine, please note that\nthe AVS service should sort the groups and make sure all the groups are valid at first.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Insert preconfirmation blocks by the given groups to the backend L2 execution engine, please note that\nthe AVS service should sort the groups and make sure all the groups are valid at first.", | |
"description": "Insert a group of transactions into a tentative block for preconfirmation. If the group is the first for a block, a new tentative block will be created. Otherwise, the transactions will be appended to the existing tentative block. The API will fail if: 1) the block is not tentative, 2) any transaction in the group is invalid or a duplicate, 3) block-level parameters are invalid or do not match the current tentative block’s parameters, 4) the group ID is not exactly 1 greater than the previous one, or 5) the last group of the block indicates no further transactions are allowed.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
}, | ||
"/preconfHead": { | ||
"put": { | ||
"description": "Resets the backend L2 execution engine preconfirmation head, please note that\nthe AVS service should make sure the new head height is from a valid preconfirmation head.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Resets the backend L2 execution engine preconfirmation head, please note that\nthe AVS service should make sure the new head height is from a valid preconfirmation head.", | |
"description": "Remove all tentative blocks from the blockchain beyond the specified block height, ensuring the latest block ID does not exceed the given height. This method will fail if the block with an ID one greater than the specified height is not a tentative block. If the specified block height is greater than the latest tentative block ID, the method will succeed without modifying the blockchain.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
// @Param body body CreateOrUpdateBlocksFromBatchResponseBodyRequestBody true "preconf blocks creation request body" | ||
// @Accept json | ||
// @Produce json | ||
// @Success 200 {object} CreateOrUpdateBlocksFromBatchResponseBody | ||
// @Router /perconfBlocks [post] | ||
// @Router /preconfBlocks [post] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @Router /preconfBlocks [post] | |
// @Router /preconfTransactions [post] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we use ResetPreconfirmationBlockHeight? If the only parameter is a block ID/height, we should use height, as "head" usually means a structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After another thought: Lets name these two functions:
- build_tentative_blocks (buildTentativeBlocks)
- remove_tentative_blocks (removeTentativeBlocks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After another thought: Lets name these two functions:
- build_tentative_blocks (buildTentativeBlocks)
- remove_tentative_blocks (removeTentativeBlocks)
Updated the method names and the URL path
@@ -75,6 +75,6 @@ func (s *PreconfAPIServer) configureMiddleware(corsOrigins []string) { | |||
func (s *PreconfAPIServer) configureRoutes() { | |||
s.echo.GET("/", s.HealthCheck) | |||
s.echo.GET("/healthz", s.HealthCheck) | |||
s.echo.POST("/perconfTransactions", s.CreateOrUpdateBlocksFromBatch) | |||
s.echo.POST("/preconfTransactions", s.CreateOrUpdateBlocksFromBatch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use "preconfirm_transactions" or "preconfirmTransactions", and "remove_tentative_blocks"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
No description provided.