rooch icon indicating copy to clipboard operation
rooch copied to clipboard

proposal: push error map onchain and show abort reason when txn failed.

Open pause125 opened this issue 1 year ago • 1 comments

Proposal Details

Fow now, if a txn fails, the output message is like:

    "status": {
      "type": "moveabort",
      "location": "0x2::module_store",
      "abort_code": "2"
    }

or

    "vm_error_info": {
      "error_message": "VMError with status ABORTED with sub status 2 at location Module ModuleId { address: 0000000000000000000000000000000000000000000000000000000000000002, name: Identifier(\"module_store\") } and message 0x0000000000000000000000000000000000000000000000000000000000000002::module_store::publish_package_entry at offset 62 at code offset 62 in function definition 25",
      "execution_state": []
    }

The developer need to check the source file for the reason or use rooch move explain to expain framework's abort reason. And what's more to auto explain the reason to end user.

Proposal Can we store error map onchain when publishing modules, and then add an abort reason field in the transation output?

pause125 avatar Sep 23 '24 15:09 pause125

We can explain the error code in the vm_error_info

jolestar avatar Sep 24 '24 01:09 jolestar