Skip to content

[compiler] Overload Move abort to support messages#18403

Merged
calintat merged 12 commits intomainfrom
calin/compiler-abort-message
Jan 9, 2026
Merged

[compiler] Overload Move abort to support messages#18403
calintat merged 12 commits intomainfrom
calin/compiler-abort-message

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

Introduces message-carrying aborts and aligns tooling/bytecode defaults accordingly.

  • Adds AbortKind and replaces Operation::Abort/AbortMsg with unified Operation::Abort(AbortKind) across AST, rewriters, visitors, lints, and sourcifier
  • Bytecode gen emits Abort(code, [message]); astifier and analyzers updated to treat Abort(..) as a terminator/control-flow redirect
  • Parser/exp builder overloads abort to accept u64 or vector<u8> (implies UNSPECIFIED_ABORT_CODE), with improved diagnostics for unsupported types; enabled in language version ≥ 2.4
  • Sets VERSION_DEFAULT_LANG_V2_4 to VERSION_10 (bytecode includes ABORT_MSG)
  • Updates tests: new transactional tests for abort with byte string/vector/block/complex/nested and invalid UTF-8; adjusts expected error messages and baselines; adds round-trip decompiled cases
  • Minor: inlining/seqs-in-binop/spec rewrites recognize Operation::Abort(…); tests.rs marks new separate baselines

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

Copy link
Contributor Author

calintat commented Jan 5, 2026

@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 2 times, most recently 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
Copy link
Contributor

@junxzm1990 junxzm1990 left a comment

Choose a reason for hiding this comment

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

Approving with some minor comments, assuming they will be looked at.

Base automatically changed from calin/vm-abort-message-2 to main January 9, 2026 13:35
@calintat calintat force-pushed the calin/compiler-abort-message branch from 7c56a57 to bfd3c95 Compare January 9, 2026 13:45
@calintat calintat enabled auto-merge (squash) January 9, 2026 16:02
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

✅ Forge suite compat success on 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765

Compatibility test results for 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765 (PR)
1. Check liveness of validators at old version: 80b69d0abd53b4ca1b04c5e43732c73fc93b1327
compatibility::simple-validator-upgrade::liveness-check : committed: 13524.28 txn/s, latency: 2566.13 ms, (p50: 2700 ms, p70: 2800, p90: 3100 ms, p99: 3700 ms), latency samples: 445400
2. Upgrading first Validator to new version: bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 5759.47 txn/s, latency: 5846.45 ms, (p50: 6600 ms, p70: 6700, p90: 6700 ms, p99: 6800 ms), latency samples: 199420
3. Upgrading rest of first batch to new version: bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 5803.49 txn/s, latency: 5813.06 ms, (p50: 6400 ms, p70: 6500, p90: 6700 ms, p99: 6800 ms), latency samples: 200260
4. upgrading second batch to new version: bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 9627.69 txn/s, latency: 3502.25 ms, (p50: 3700 ms, p70: 3900, p90: 4000 ms, p99: 4200 ms), latency samples: 315560
5. check swarm health
Compatibility test for 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765 passed
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

✅ Forge suite realistic_env_max_load success on bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765

two traffics test: inner traffic : committed: 13726.27 txn/s, latency: 2748.95 ms, (p50: 2700 ms, p70: 2800, p90: 3000 ms, p99: 3600 ms), latency samples: 5113160
two traffics test : committed: 100.02 txn/s, latency: 738.34 ms, (p50: 700 ms, p70: 800, p90: 900 ms, p99: 1000 ms), latency samples: 1720
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 2.232, avg: 2.152", "ConsensusProposalToOrdered: max: 0.168, avg: 0.166", "ConsensusOrderedToCommit: max: 0.044, avg: 0.041", "ConsensusProposalToCommit: max: 0.212, avg: 0.206"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.55s no progress at version 4896039 (avg 0.07s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.25s no progress at version 2415728 (avg 0.25s) [limit 16].
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

✅ Forge suite framework_upgrade success on 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765

Compatibility test results for 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765 (PR)
Upgrade the nodes to version: bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2169.03 txn/s, submitted: 2179.13 txn/s, failed submission: 10.10 txn/s, expired: 10.10 txn/s, latency: 1313.48 ms, (p50: 1200 ms, p70: 1500, p90: 1700 ms, p99: 2700 ms), latency samples: 197541
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1546.92 txn/s, submitted: 1550.81 txn/s, failed submission: 3.89 txn/s, expired: 3.89 txn/s, latency: 2929.53 ms, (p50: 1400 ms, p70: 1500, p90: 11300 ms, p99: 12100 ms), latency samples: 119281
5. check swarm health
Compatibility test for 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765 passed
Upgrade the remaining nodes to version: bfd3c95e6c697f7a3c87d89166e2d1ebf47ab765
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2327.48 txn/s, submitted: 2334.15 txn/s, failed submission: 6.67 txn/s, expired: 6.67 txn/s, latency: 1273.71 ms, (p50: 1200 ms, p70: 1400, p90: 1700 ms, p99: 2100 ms), latency samples: 209282
Test Ok

@calintat calintat merged commit bb7cb88 into main Jan 9, 2026
102 of 103 checks passed
@calintat calintat deleted the calin/compiler-abort-message branch January 9, 2026 16: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