Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Feature request : Display error message for Revert opcode in transaction traces #8068

Closed
cleanunicorn opened this issue Mar 7, 2018 · 1 comment
Labels
A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. F8-enhancement 🎊 An additional feature request. M6-rpcapi 📣 RPC API. P5-sometimesoon 🌲 Issue is worth doing soon.
Milestone

Comments

@cleanunicorn
Copy link

I'm running:

  • Which Parity version?: 1.10.0-nightly
  • Which operating system?: Linux
  • How installed?: from source
  • Are you fully synchronized?: yes
  • Which network are you connected to?: ethereum
  • Did you try to restart the node?: yes

When a contract message uses the REVERT opcode with a message is this message available in the traces?
I know it's not part of the receipt and I understood it could be part of the traces (either trace_block or trace_transactionReplay) ethereum/solidity#1686 (comment)

trace_block only contains this about the transaction

{
    "action": {
        "callType": "call", 
        "from": "0xe8fdfdcc8e5b438e3faeb17cc8599078380680a7", 
        "gas": "0x90c8", 
        "input": "0xa9059cbb000000000000000000000000a97f7dd4adbbe6159da8b1250098309ca31bf5f9000000000000000000000000000000000000000000000000000000001dcd6500", 
        "to": "0x0b76544f6c413a555f309bf76260d1e02377c02a", 
        "value": "0x0"
    }, 
    "blockHash": "0xb1ea4f564e6cbc4be5d8d33cd741e4fe435048939eedc7f33a48fb44a9272deb", 
    "blockNumber": 4719805, 
    "error": "Reverted", 
    "subtraces": 0, 
    "traceAddress": [], 
    "transactionHash": "0x1a0d9182048a3a4ac159364d9087cd942ff45c16c8cfe1c37335500fc6bb87b4", 
    "transactionPosition": 62, 
    "type": "call"
}

Other transactions contain a result section that could include that message.

"result": {
    "gasUsed": "0x0", 
    "output": "0x"
}, 

I'm not sure if trace_replayTransaction will include this message in the output section

{
    "output": "0x", 
    "stateDiff": {
        "0xe8fdfdcc8e5b438e3faeb17cc8599078380680a7": {
            "balance": {
                "*": {
                    "from": "0x25e206dba1d4c0", 
                    "to": "0x23c131a92df0c0"
                }
            }, 
            "code": "=", 
            "nonce": {
                "*": {
                    "from": "0x25", 
                    "to": "0x26"
                }
            }, 
            "storage": {}
        }, 
        "0xf3b9d2c81f2b24b0fa0acaaa865b7d9ced5fc2fb": {
            "balance": {
                "*": {
                    "from": "0xf0027c6c2716273d4c9", 
                    "to": "0xf0027c8e34694e7b8c9"
                }
            }, 
            "code": "=", 
            "nonce": "=", 
            "storage": {}
        }
    }, 
    "trace": [
        {
            "action": {
                "callType": "call", 
                "from": "0xe8fdfdcc8e5b438e3faeb17cc8599078380680a7", 
                "gas": "0x90c8", 
                "input": "0xa9059cbb000000000000000000000000a97f7dd4adbbe6159da8b1250098309ca31bf5f9000000000000000000000000000000000000000000000000000000001dcd6500", 
                "to": "0x0b76544f6c413a555f309bf76260d1e02377c02a", 
                "value": "0x0"
            }, 
            "error": "Reverted", 
            "subtraces": 0, 
            "traceAddress": [], 
            "type": "call"
        }
    ], 
    "vmTrace": {
        ...
    }
}

Is the error message going to be included in the trace?
Or is it already trying to include it but because solidity does not support a message yet there was nothing to include as a message?

@Tbaut Tbaut added Z1-question 🙋‍♀️ Issue is a question. Closer should answer. F5-documentation 📑 Documentation needs fixing, improving or augmenting. M6-rpcapi 📣 RPC API. F8-enhancement 🎊 An additional feature request. P5-sometimesoon 🌲 Issue is worth doing soon. and removed F5-documentation 📑 Documentation needs fixing, improving or augmenting. Z1-question 🙋‍♀️ Issue is a question. Closer should answer. labels Apr 3, 2018
@Tbaut Tbaut added this to the 1.11 milestone Apr 3, 2018
@Tbaut Tbaut changed the title Revert opcode with error message Feature request : Display error message for Revert opcode in transaction traces Apr 3, 2018
@Tbaut
Copy link
Contributor

Tbaut commented Apr 3, 2018

Is the error message going to be included in the trace?

Parity does not support it yet, I edited your title it to make it a feature request.

@5chdn 5chdn modified the milestones: 1.11, 1.12 Apr 24, 2018
@5chdn 5chdn modified the milestones: 2.0, 2.1 Jul 17, 2018
@5chdn 5chdn modified the milestones: 2.1, 2.2 Sep 11, 2018
@5chdn 5chdn modified the milestones: 2.2, 2.3 Oct 29, 2018
@5chdn 5chdn modified the milestones: 2.3, 2.4 Jan 10, 2019
@5chdn 5chdn modified the milestones: 2.4, 2.5 Feb 21, 2019
@soc1c soc1c modified the milestones: 2.5, 2.6 Apr 2, 2019
@ordian ordian modified the milestones: 2.6, 2.7 Jul 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. F8-enhancement 🎊 An additional feature request. M6-rpcapi 📣 RPC API. P5-sometimesoon 🌲 Issue is worth doing soon.
Projects
None yet
Development

No branches or pull requests

6 participants