Skip to content

[AIP-138][Discussion] Move abort with message #649

@calintat

Description

@calintat

AIP Discussion

This AIP extends the Move abort mechanism to support optional, user-facing abort messages. These messages are persisted as part of the transaction execution and surfaced through APIs and developer tooling.

The proposal introduces:

  1. A new bytecode instruction AbortMsg that aborts with:

    • an error code (u64), and
    • an error message (vector<u8>) interpreted as an UTF-8 string,

    taken from the operand stack.

  2. An extension to the Move language abort syntax to accept an error message instead of an error code.

  3. An extension to the assert! macro to accept formatted messages.

  4. New assert_eq! and assert_ne! macros with Rust-like semantics, i.e., evaluate each argument exactly once and, on failure, abort with a descriptive message that identifies the values involved.

All changes are backward compatible. Abort messages are optional and do not replace abort codes.

Read more about it here: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-138.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions