-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[vm] New bytecode for aborting with message #18347
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82b1db0 to
1af6390
Compare
b68c512 to
81f8a9f
Compare
81f8a9f to
ad54d9f
Compare
b17021b to
062615e
Compare
vgao1996
approved these changes
Jan 7, 2026
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
22 tasks
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a008013 to
fa4225f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
✅ Forge suite
|
Contributor
✅ Forge suite
|
Contributor
✅ Forge suite
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Follow up to #18316
Introduce a new bytecode instruction
AbortMsg:message: vector<u8>(top of stack)code: u64messageas a UTF-8 encoded string. If it is not valid UTF-8, execution terminates with a VM error with status codeINVALID_ABORT_MESSAGE.ABORTED, which is the same as the existingAbortinstruction, carrying the user-provided code and message.The resulting abort status includes both the error code and error message (new). The Move VM has been extended to propagate the message to the
AbortInfofield of theExecutionStatus, making it immediately available on-chain without any additional work.Note that the
AbortMsginstruction is feature-gated by theVM_BINARY_FORMAT_V10flag.Gas semantics
We charge a base fee, which is twice the cost of a regular abort, as well as a per-byte fee for the UTF-8 validation, since it must scan the entire message.
How Has This Been Tested?
Added new tests
abort_msg.masmandabort_msg_invalid.masm.Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist
Note
Introduces a new VM instruction to abort with a message and upgrades Move bytecode to v10.
AbortMsgopcode (0x68): deserialize/serialize, opcode tables, control-flow helpers, and all verifiers (bounds, complexity, stack usage, locals/reference/type safety) updated; compiler generatesAbort(attr, code, Some(message))VERSION_MAXto v10 and updates tests to expect v10VM_BINARY_FORMAT_V10; release builder maps new flagabort_msg.baseandabort_msg.per_byteparams (sinceRELEASE_V1_40); implementscharge_abort_messagein meter/profiler/memory trackerget_vector_element_type/get_vector_ref_element_type) used by type safetyWritten by Cursor Bugbot for commit fa4225f. This will update automatically on new commits. Configure here.