Skip to content

Conversation

@calintat
Copy link
Contributor

@calintat calintat commented Jan 5, 2026

Description

This extends the Move abort syntax by overloading it to accept either a u64 or a vector<u8>, e.g.

abort 0
abort b"Hello, world"

The latter form emits a AbortMsg instruction with UNSPECIFIED_ABORT_CODE and the provided message.

How Has This Been Tested?

Added several tests in move-compiler-v2-transactional-tests, such as:

  • abort with byte string literal (abort b"Hello, world!")
  • abort with vector literal (abort vector[..])
  • abort with block
  • abort with complex expression
  • nested aborts
  • abort with message that is not valid UTF-8

Key Areas to Review

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Note

Adds message-capable abort and propagates it across the toolchain.

  • Introduces AbortKind and changes Operation::Abort to carry kind; bytecode gen emits Bytecode::Abort(code, [msg]); updates visitors/rewriters/checkers (inlining_optimization, seqs_in_binop_checker, spec rewriter, astifier, exp_builder, sourcifier, prover translator, linters) to new shape
  • abort vector<u8> translated to message abort with UNSPECIFIED_ABORT_CODE (gated on language v2.4); printing/decompile elides unspecified code and shows abort <bytes>
  • Bumps VERSION_DEFAULT_LANG_V2_4 to VERSION_10; retains ABORT_MSG opcode mapping
  • Adds transactional tests covering abort with byte strings, vectors, blocks, nesting, invalid UTF-8, and round-trip decompilation; updates separate baselines where offsets differ

Written by Cursor Bugbot for commit d74255a. This will update automatically on new commits. Configure here.

Copy link
Contributor Author

calintat commented Jan 5, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@calintat calintat marked this pull request as ready for review January 5, 2026 16:35
@calintat calintat force-pushed the calin/compiler-abort-message branch from e16c548 to 9d97287 Compare January 6, 2026 11:49
Copy link
Contributor

@vineethk vineethk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some higher level syntax questions in slack. Leaving some comments here too.

@calintat calintat marked this pull request as draft January 6, 2026 22:10
@calintat calintat force-pushed the calin/compiler-abort-message branch from 9d97287 to 8e1d7bf Compare January 6, 2026 23:16
@calintat calintat force-pushed the calin/compiler-abort-message branch from 8e1d7bf to aec15df Compare January 7, 2026 17:55
@calintat calintat marked this pull request as ready for review January 7, 2026 20:16
@calintat calintat requested a review from vineethk January 7, 2026 20:17
Copy link
Contributor

@vineethk vineethk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving assuming comments are addressed. Looks good!

@calintat calintat changed the title [compiler] Move abort with optional message [compiler] Overload Move abort to support messages Jan 7, 2026
@calintat calintat requested a review from junxzm1990 January 8, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants