-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
When using the libcmt and cartesi-machine low-level APIs, calling cmt_rollup_finish after a rejected request leaves the machine in an undefined state. Attempting to send a subsequent request results in corrupted behavior where the next request is processed with residual data from the previous rejected request.
Expected behavior: Either prevent subsequent requests after rejection, or properly handle the next request.
Current behavior: The API allows subsequent requests but processes them in a corrupted state with undefined behavior.
This creates a fragile testing experience for developers building test frameworks using local machines (no fork support) and libcmt APIs.
Possible solutions
- Modify
cmt_rollup_finishto always populatefinish->next_request_typeandfinish->next_request_payload_lengthfor all request outcomes, including rejections. This enables test frameworks to safely chain requests on local machines. - Have
cmt_rollup_finishenter an infinite rejection loop or halt the machine after a rejected request, making the error state explicit. - Leave the API unchanged but explicitly document the undefined behavior after rejections.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Todo