Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][compiler-v2] Inconsistent VM status reported for transaction errors in Move-2 modules #15666

Open
0xAnto opened this issue Jan 3, 2025 · 4 comments
Labels
bug Something isn't working compiler-v2

Comments

@0xAnto
Copy link

0xAnto commented Jan 3, 2025

🐛 Bug

Inconsistent VM status reported for testnet transaction errors in Move-2 modules.

To reproduce

Transaction ID: 6583611373 shows incorrect VM status in multiple interfaces:

  1. Explorer shows incorrect error message Aptos Explorer
  2. Transaction details fetched via TypeScript SDK return incorrect VM status
  3. Transaction replay shows the correct error (see below)

Reported VM Status: (in explorer)

Execution failed in 0x1ce63c441256263ea2f45dd2d3a1e68e5843107c65c10b79c7a2d5aa2b7a4e3e::perp_market::get_tier_activation_fee at code offset 202

Actual Error (from transaction replay):

aptos move replay --network testnet --txn-id 6583611373 --profile-gas
Got 1/1 txns from RestApi.
Profiling transaction...
Gas report saved to gas-profiling/txn-e9ddf53d-0x1ce6-perp_market-place_limit_order.
{
  "Result": {
    "transaction_hash": "0xe9ddf53d53be45b5b0ccc043e902cf9a396540adbe8f25fc703bef493ee1b583",
    "gas_used": 30,
    "gas_unit_price": 100,
    "sender": "f3ee57f6d382f8477dc5c5e38b485f973d422b9bf539cd5473135b046d1c5561",
    "sequence_number": 61,
    "success": false,
    "version": 6583611373,
    "vm_status": "status ARITHMETIC_ERROR of type Execution with message Subtraction overflow"
  }
}

Expected Behavior

VM status should correctly reflect the arithmetic error (subtraction overflow) instead of showing an irrelevant failure message.

System information

Please complete the following information:

  • CLI version: 5.1.0
  • MacOS
@0xAnto 0xAnto added the bug Something isn't working label Jan 3, 2025
@rahxephon89 rahxephon89 changed the title [Bug] Inconsistent VM status reported for transaction errors in Move-2 modules [Bug][compiler-v2] Inconsistent VM status reported for transaction errors in Move-2 modules Jan 7, 2025
@vineethk
Copy link
Contributor

vineethk commented Jan 8, 2025

@0xAnto Was the contract compiled using compiler v1 during the execution of the transaction, and later upgraded (by compiling the contract with v2 or making modifications to the contract and republishing it)?

@0xAnto
Copy link
Author

0xAnto commented Jan 8, 2025

@0xAnto Was the contract compiled using compiler v1 during the execution of the transaction, and later upgraded (by compiling the contract with v2 or making modifications to the contract and republishing it)?

It was deployed using move-2 from the start.

@vineethk
Copy link
Contributor

vineethk commented Jan 9, 2025

@0xAnto Thank you.

Was this possibly the sequence of operations that occurred:

  1. Contract was deployed by compiling with move-2.
  2. Transaction was executed.
  3. Contract was upgraded (e.g., by adding or removing a function in the contract) and redeployed (using move-2 or otherwise).

And we are talking about the transaction executed in step 2 in the above described bug.

@0xAnto
Copy link
Author

0xAnto commented Jan 9, 2025

@vineethk Yeah, I might have added new functions to that contract, but it happened again with a new contract.

I haven’t changed anything since the initial code was published with --move-2. Please check the transaction below: https://explorer.aptoslabs.com/txn/6589661797?network=testnet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler-v2
Projects
Status: 🆕 New
Development

No branches or pull requests

4 participants
@vineethk @rahxephon89 @0xAnto and others