neo-project / neo-modules

MIT License
60 stars 100 forks source link

Tx showed HALT in ApplicationLogs but has exception returned #854

Closed superboyiii closed 9 months ago

superboyiii commented 9 months ago

Describe the bug 0x0819175f7cd906f2eee8fbc825496acd11f0f0afcfcaec32bfbb71a7a52b6f48 on testnet have such an applicationlog below:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "txid": "0x0819175f7cd906f2eee8fbc825496acd11f0f0afcfcaec32bfbb71a7a52b6f48",
        "executions": [
            {
                "trigger": "Application",
                "vmstate": "HALT",
                "exception": "Operation is not valid due to the current state of the object.",
                "gasconsumed": "6312969",
                "notifications": []
            }
        ]
    }
}

The vmstate is HALT, but the exception is not null. This can make people confusing.

To Reproduce Steps to reproduce the behavior: 1701312079559

Expected behavior exception is not null even vmstate is null.

Screenshots Showed above

Platform:

roman-khimov commented 9 months ago
$ curl -sd '{ "jsonrpc": "2.0", "id": 1, "method": "getapplicationlog", "params": ["0x0819175f7cd906f2eee8fbc825496acd11f0f0afcfcaec32bfbb71a7a52b6f48"] }' https://rpc.t5.n3.nspcc.ru:20331 | json_pp
{
   "id" : 1,
   "result" : {
      "txid" : "0x0819175f7cd906f2eee8fbc825496acd11f0f0afcfcaec32bfbb71a7a52b6f48",
      "executions" : [
         {
            "gasconsumed" : "6312969",
            "vmstate" : "HALT",
            "stack" : [
               "error: unserializable: nil",
               "error: unserializable: nil"
            ],
            "notifications" : [],
            "exception" : null,
            "trigger" : "Application"
         }
      ]
   },
   "jsonrpc" : "2.0"
}
cschuchardt88 commented 9 months ago

This is normal expected behavior. The reason why this exception is happening is because the Stackitem is an InteropInterface, that can't be serialized. Which indicates that VM is not crashing or having problems. I found some of these in my working of the new storage system. I just ignore the ones that cant be serialized. problem solved.