Skip to content

Conversation

@calintat
Copy link
Contributor

@calintat calintat commented Dec 18, 2025

Description

Follow up to #18316

Introduce a new bytecode instruction AbortMsg :

  • Pops two values from the operand stack in the following order:
    1. message: vector<u8> (top of stack)
    2. code: u64
  • Attempts to interpret message as a UTF-8 encoded string. If it is not valid UTF-8, execution terminates with a VM error with status code INVALID_ABORT_MESSAGE.
  • Otherwise, execution terminates with a VM error with status code ABORTED, which is the same as the existing Abort instruction, 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 AbortInfo field of the ExecutionStatus, making it immediately available on-chain without any additional work.

Note that the AbortMsg instruction is feature-gated by the VM_BINARY_FORMAT_V10 flag.

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.masm and abort_msg_invalid.masm.

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 a new VM instruction to abort with a message and upgrades Move bytecode to v10.

  • Adds AbortMsg opcode (0x68): deserialize/serialize, opcode tables, control-flow helpers, and all verifiers (bounds, complexity, stack usage, locals/reference/type safety) updated; compiler generates Abort(attr, code, Some(message))
  • Bumps binary format VERSION_MAX to v10 and updates tests to expect v10
  • Feature-gates via VM_BINARY_FORMAT_V10; release builder maps new flag
  • Gas: new abort_msg.base and abort_msg.per_byte params (since RELEASE_V1_40); implements charge_abort_message in meter/profiler/memory tracker
  • Minor refactor: split vector type helpers (get_vector_element_type / get_vector_ref_element_type) used by type safety

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

@calintat calintat marked this pull request as ready for review December 18, 2025 19:53
@calintat calintat force-pushed the calin/vm-abort-message-2 branch from 82b1db0 to 1af6390 Compare December 19, 2025 12:28
@calintat calintat force-pushed the calin/vm-abort-message-2 branch from b68c512 to 81f8a9f Compare December 19, 2025 13:45
@calintat calintat force-pushed the calin/vm-abort-message-2 branch from 81f8a9f to ad54d9f Compare December 22, 2025 09:42
@calintat calintat force-pushed the calin/vm-abort-message-2 branch from b17021b to 062615e Compare December 22, 2025 09:46
@calintat calintat enabled auto-merge (squash) January 7, 2026 19:22
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@calintat calintat force-pushed the calin/vm-abort-message-2 branch from a008013 to fa4225f Compare January 9, 2026 12:51
@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 ==> fa4225f6ecda597e21c866bb1b474cdca5b4413c

Compatibility test results for 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> fa4225f6ecda597e21c866bb1b474cdca5b4413c (PR)
1. Check liveness of validators at old version: 80b69d0abd53b4ca1b04c5e43732c73fc93b1327
compatibility::simple-validator-upgrade::liveness-check : committed: 12751.51 txn/s, latency: 2736.75 ms, (p50: 2900 ms, p70: 3000, p90: 3300 ms, p99: 3600 ms), latency samples: 418240
2. Upgrading first Validator to new version: fa4225f6ecda597e21c866bb1b474cdca5b4413c
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 5923.57 txn/s, latency: 5760.41 ms, (p50: 6400 ms, p70: 6500, p90: 6600 ms, p99: 6800 ms), latency samples: 202020
3. Upgrading rest of first batch to new version: fa4225f6ecda597e21c866bb1b474cdca5b4413c
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 5958.35 txn/s, latency: 5691.81 ms, (p50: 6400 ms, p70: 6500, p90: 6600 ms, p99: 6600 ms), latency samples: 203360
4. upgrading second batch to new version: fa4225f6ecda597e21c866bb1b474cdca5b4413c
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 10114.37 txn/s, latency: 3228.55 ms, (p50: 3200 ms, p70: 3700, p90: 4500 ms, p99: 5200 ms), latency samples: 333460
5. check swarm health
Compatibility test for 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> fa4225f6ecda597e21c866bb1b474cdca5b4413c passed
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

✅ Forge suite realistic_env_max_load success on fa4225f6ecda597e21c866bb1b474cdca5b4413c

Forge report malformed: Expecting property name enclosed in double quotes: line 14 column 1 (char 267)
'{\n  "metrics": [\n    {\n      "test_name": "two traffics test: inner traffic",\n      "metric": "submitted_txn",\n      "value": 5058320.0\n    },\n    {\n      "test_name": "two traffics test: inner traffic",\n      "metric": "expired_txn",\n      "value": 0.0\n    },\n    {\n[2026-01-09T13:28:34Z INFO  aptos_forge::report] Test Ok\n      "test_name": "two traffics test: inner traffic",\n      "metric": "avg_tps",\n      "value": 13586.077239652277\n    },\n    {\n      "test_name": "two traffics test: inner traffic",\n      "metric": "avg_latency",\n      "value": 2774.1571359660916\n    },\n    {\n      "test_name": "two traffics test: inner traffic",\n      "metric": "p50_latency",\n      "value": 2700.0\n    },\n    {\n      "test_name": "two traffics test: inner traffic",\n      "metric": "p90_latency",\n      "value": 3100.0\n    },\n    {\n      "test_name": "two traffics test: inner traffic",\n      "metric": "p99_latency",\n      "value": 3600.0\n    },\n    {\n      "test_name": "two traffics test",\n      "metric": "submitted_txn",\n      "value": 42680.0\n    },\n    {\n      "test_name": "two traffics test",\n      "metric": "expired_txn",\n      "value": 0.0\n    },\n    {\n      "test_name": "two traffics test",\n      "metric": "avg_tps",\n      "value": 100.0236948746216\n    },\n    {\n      "test_name": "two traffics test",\n      "metric": "avg_latency",\n      "value": 760.2227777777778\n    },\n    {\n      "test_name": "two traffics test",\n      "metric": "p50_latency",\n      "value": 700.0\n    },\n    {\n      "test_name": "two traffics test",\n      "metric": "p90_latency",\n      "value": 900.0\n    },\n    {\n      "test_name": "two traffics test",\n      "metric": "p99_latency",\n      "value": 1700.0\n    }\n  ],\n  "text": "two traffics test: inner traffic : committed: 13586.08 txn/s, latency: 2774.16 ms, (p50: 2700 ms, p70: 2900, p90: 3100 ms, p99: 3600 ms), latency samples: 5058320\\ntwo traffics test : committed: 100.02 txn/s, latency: 760.22 ms, (p50: 700 ms, p70: 800, p90: 900 ms, p99: 1700 ms), latency samples: 1800\\nLatency breakdown for phase 0: [\\"MempoolToBlockCreation: max: 2.290, avg: 2.183\\", \\"ConsensusProposalToOrdered: max: 0.169, avg: 0.166\\", \\"ConsensusOrderedToCommit: max: 0.047, avg: 0.042\\", \\"ConsensusProposalToCommit: max: 0.215, avg: 0.208\\"]\\nMax non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.99s no progress at version 40667 (avg 0.07s) [limit 15].\\nMax epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.30s no progress at version 2328565 (avg 0.30s) [limit 16].\\nTest Ok"\n}'
Trailing Log Lines:
networkchaos.chaos-mesh.org "4-gcp--as-southeast1-to-3-gcp--us-east4-netem" deleted
test CompositeNetworkTest ... ok
Test Statistics: 
two traffics test: inner traffic : committed: 13586.08 txn/s, latency: 2774.16 ms, (p50: 2700 ms, p70: 2900, p90: 3100 ms, p99: 3600 ms), latency samples: 5058320
two traffics test : committed: 100.02 txn/s, latency: 760.22 ms, (p50: 700 ms, p70: 800, p90: 900 ms, p99: 1700 ms), latency samples: 1800
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 2.290, avg: 2.183", "ConsensusProposalToOrdered: max: 0.169, avg: 0.166", "ConsensusOrderedToCommit: max: 0.047, avg: 0.042", "ConsensusProposalToCommit: max: 0.215, avg: 0.208"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.99s no progress at version 40667 (avg 0.07s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.30s no progress at version 2328565 (avg 0.30s) [limit 16].
Test Ok

=== BEGIN JUNIT ===
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="forge" tests="1" failures="0" errors="0" uuid="ab1424fc-7f4a-4e0b-8a82-11fb2b33ba3f">
    <testsuite name="local" tests="1" disabled="0" errors="0" failures="0">
        <testcase name="CompositeNetworkTest(network:multi-region-network-emulation(two traffics test)) with ">
        </testcase>
    </testsuite>
</testsuites>
=== END JUNIT ===
[2026-01-09T13:28:34Z INFO  aptos_forge::backend::k8s::cluster_helper] Deleting namespace forge-e2e-pr-18347: Some(NamespaceStatus { conditions: None, phase: Some("Terminating") })
[2026-01-09T13:28:34Z INFO  aptos_forge::backend::k8s::cluster_helper] aptos-node resources for Forge removed in namespace: forge-e2e-pr-18347

test result: ok. 1 passed; 0 soft failed; 0 hard failed; 0 filtered out

Debugging output:
NAME                                         READY   STATUS      RESTARTS   AGE
aptos-node-0-fullnode-eforgedb9a139c-0       1/1     Running     0          12m
aptos-node-0-validator-0                     1/1     Running     0          12m
aptos-node-1-fullnode-eforgedb9a139c-0       1/1     Running     0          12m
aptos-node-1-validator-0                     1/1     Running     0          12m
aptos-node-2-fullnode-eforgedb9a139c-0       1/1     Running     0          12m
aptos-node-2-validator-0                     1/1     Running     0          12m
aptos-node-3-fullnode-eforgedb9a139c-0       1/1     Running     0          12m
aptos-node-3-validator-0                     1/1     Running     0          12m
aptos-node-4-fullnode-eforgedb9a139c-0       1/1     Running     0          12m
aptos-node-4-validator-0                     1/1     Running     0          12m
aptos-node-5-validator-0                     1/1     Running     0          12m
aptos-node-6-validator-0                     1/1     Running     0          12m
forge-testnet-deployer-6r2kk                 0/1     Completed   0          12m
genesis-aptos-genesis-eforgedb9a139c-h4dp4   0/1     Completed   0          12m

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

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

Compatibility test results for 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> fa4225f6ecda597e21c866bb1b474cdca5b4413c (PR)
Upgrade the nodes to version: fa4225f6ecda597e21c866bb1b474cdca5b4413c
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2146.72 txn/s, submitted: 2156.38 txn/s, failed submission: 9.66 txn/s, expired: 9.66 txn/s, latency: 1325.70 ms, (p50: 1200 ms, p70: 1500, p90: 1800 ms, p99: 2400 ms), latency samples: 195521
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2299.31 txn/s, submitted: 2307.97 txn/s, failed submission: 8.66 txn/s, expired: 8.66 txn/s, latency: 1271.48 ms, (p50: 1200 ms, p70: 1500, p90: 1500 ms, p99: 2400 ms), latency samples: 207160
5. check swarm health
Compatibility test for 80b69d0abd53b4ca1b04c5e43732c73fc93b1327 ==> fa4225f6ecda597e21c866bb1b474cdca5b4413c passed
Upgrade the remaining nodes to version: fa4225f6ecda597e21c866bb1b474cdca5b4413c
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2393.09 txn/s, submitted: 2399.11 txn/s, failed submission: 6.01 txn/s, expired: 6.01 txn/s, latency: 1238.83 ms, (p50: 1200 ms, p70: 1400, p90: 1500 ms, p99: 2400 ms), latency samples: 214842
Test Ok

@calintat calintat merged commit 49e73b0 into main Jan 9, 2026
48 checks passed
@calintat calintat deleted the calin/vm-abort-message-2 branch January 9, 2026 13:35
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.

6 participants