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

Incorrect traces order for suicide call, and gas and value for create call #9142

Closed
1 task done
nateless opened this issue Jun 27, 2024 · 0 comments · Fixed by paradigmxyz/revm-inspectors#171 or #9761
Closed
1 task done
Assignees
Labels
C-bug An unexpected or incorrect behavior

Comments

@nateless
Copy link

nateless commented Jun 27, 2024

Describe the bug

In this transaction:

https://etherscan.io/tx/0xc683815f97c3de4972442448b5fa17aff31ec8f0d9e939f82234884ff989ac9e

if we query reth:

curl -X POST http://IP:8545/ -H "content-type: application/json" --data '{"id":0,"params":["0x210E96",["trace"]],"method":"trace_replayBlockTransactions","jsonrpc":"2.0"}' | jq

we get:

    {
      "output": "0x",
      "stateDiff": null,
      "trace": [
        {
          "type": "create",
          "action": {
            "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
            "gas": "0x7a120",
            "init": "0x60606040525b60006000731db3439a222c519ab44bb1144fc28167b4fa6ee6915073d8da6bf26964af9d7eed9e03e53415d37aa9604590508173ffffffffffffffffffffffffffffffffffffffff16600060023404604051809050600060405180830381858888f19350505050508073ffffffffffffffffffffffffffffffffffffffff16600060023404604051809050600060405180830381858888f19350505050503073ffffffffffffffffffffffffffffffffffffffff16ff5b5050600a8060ca6000396000f360606040526008565b00",
            "value": "0x0"
          },
          "result": {
            "address": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "code": "0x",
            "gasUsed": "0xdccf"
          },
          "subtraces": 3,
          "traceAddress": []
        },
        {
          "type": "suicide",
          "action": {
            "address": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "balance": "0x0",
            "refundAddress": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515"
          },
          "result": null,
          "subtraces": 0,
          "traceAddress": [
            2
          ]
        },
        {
          "type": "call",
          "action": {
            "from": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "callType": "call",
            "gas": "0x8fc",
            "input": "0x",
            "to": "0x1db3439a222c519ab44bb1144fc28167b4fa6ee6",
            "value": "0x58d15e17628000"
          },
          "result": {
            "gasUsed": "0x0",
            "output": "0x"
          },
          "subtraces": 0,
          "traceAddress": [
            0
          ]
        },
        {
          "type": "call",
          "action": {
            "from": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "callType": "call",
            "gas": "0x8fc",
            "input": "0x",
            "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
            "value": "0x58d15e17628000"
          },
          "result": {
            "gasUsed": "0x0",
            "output": "0x"
          },
          "subtraces": 0,
          "traceAddress": [
            1
          ]
        }
      ],
      "vmTrace": null,
      "transactionHash": "0xc683815f97c3de4972442448b5fa17aff31ec8f0d9e939f82234884ff989ac9e"
    },

suicide call comes second when it should be last, and first call has incorrect gas. Reth says first call gas is 0x7a120, when etherscan and erigon 0x69c08

Also value for create call is incorrect as well, reth says its 0x0 and erigon/etherscan 0xb1a2bc2ec50000.

https://etherscan.io/vmtrace?txhash=0xc683815f97c3de4972442448b5fa17aff31ec8f0d9e939f82234884ff989ac9e&type=parity#raw

Erigon data:

 {
      "output": "0x",
      "stateDiff": null,
      "trace": [
        {
          "action": {
            "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
            "gas": "0x69c08",
            "init": "0x60606040525b60006000731db3439a222c519ab44bb1144fc28167b4fa6ee6915073d8da6bf26964af9d7eed9e03e53415d37aa9604590508173ffffffffffffffffffffffffffffffffffffffff16600060023404604051809050600060405180830381858888f19350505050508073ffffffffffffffffffffffffffffffffffffffff16600060023404604051809050600060405180830381858888f19350505050503073ffffffffffffffffffffffffffffffffffffffff16ff5b5050600a8060ca6000396000f360606040526008565b00",
            "value": "0xb1a2bc2ec50000"
          },
          "result": {
            "address": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "code": "0x",
            "gasUsed": "0x3577"
          },
          "subtraces": 3,
          "traceAddress": [],
          "type": "create"
        },
        {
          "action": {
            "from": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "callType": "call",
            "gas": "0x8fc",
            "input": "0x",
            "to": "0x1db3439a222c519ab44bb1144fc28167b4fa6ee6",
            "value": "0x58d15e17628000"
          },
          "result": {
            "gasUsed": "0x0",
            "output": "0x"
          },
          "subtraces": 0,
          "traceAddress": [
            0
          ],
          "type": "call"
        },
        {
          "action": {
            "from": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "callType": "call",
            "gas": "0x8fc",
            "input": "0x",
            "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
            "value": "0x58d15e17628000"
          },
          "result": {
            "gasUsed": "0x0",
            "output": "0x"
          },
          "subtraces": 0,
          "traceAddress": [
            1
          ],
          "type": "call"
        },
        {
          "action": {
            "address": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "refundAddress": "0xce77a9f979e700b13b8e27dd4dd9f38d383a7515",
            "balance": "0x0"
          },
          "result": null,
          "subtraces": 0,
          "traceAddress": [
            2
          ],
          "type": "suicide"
        }
      ],
      "vmTrace": null
    },

Steps to reproduce

curl -X POST http://ip:8545/ -H "content-type: application/json" --data '{"id":0,"params":["0x210E96",["trace"]],"method":"trace_replayBlockTransactions","jsonrpc":"2.0"}' | jq

Node logs

No response

Platform(s)

Linux (x86)

What version/commit are you on?

reth Version: 1.0.0-rc.2

What database version are you on?

Current database version: 2
Local database version: 2

Which chain / network are you on?

mainnet

What type of node are you running?

Archive (default)

What prune config do you use, if any?

No response

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct
@nateless nateless added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Jun 27, 2024
@nateless nateless changed the title Incorrect calls order and gas with suicide transaction Incorrect traces order and gas with suicide transaction Jun 27, 2024
@nateless nateless changed the title Incorrect traces order and gas with suicide transaction Incorrect traces order and gas and value with suicide transaction Jun 27, 2024
@nateless nateless changed the title Incorrect traces order and gas and value with suicide transaction Incorrect traces order for suicide call, and gas and value for create call Jun 27, 2024
@mattsse mattsse self-assigned this Jun 27, 2024
@mattsse mattsse removed the S-needs-triage This issue needs to be labelled label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug An unexpected or incorrect behavior
Projects
Archived in project
2 participants