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

reth's callTracer output is different from erigon/geth's traces when a tx executes the SELFDESTRUCT opcode #3863

Closed
1 task done
pnnkr opened this issue Jul 21, 2023 · 3 comments
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity

Comments

@pnnkr
Copy link

pnnkr commented Jul 21, 2023

Describe the bug

See relevant geth issue there: ethereum/go-ethereum#16459 - I think it's important for reth to return outputs as identical as possible to 90% of the other nodes out there.

Steps to reproduce

Consider the following TX on Goerli testnet: 0x389fed47c06d9e9c15e075339a2c820f009ba130165e58b95c757b51e25e5597. 0.01ETH is transferred by this TX via the SELFDESTRUCT opcode.

If you run debug_traceTransaction in erigon and geth, you get from both nodes:

$ curl -H "Content-Type: application/json"  --data '{"jsonrpc":"2.0", "method": "debug_traceTransaction", "params": ["0x389fed47c06d9e9c15e075339a2c820f009ba130165e58b95c757b51e25e5597",  {"tracer": "callTracer"}],"id":1}'  127.0.0.1:8545
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "from": "0x208c016d29599bbb836e02f30798578e75bb62a0",
    "gas": "0x54a1",
    "gasUsed": "0x6f46",
    "to": "0x6c3782df9e7e0b6e723e7debbc1c690afb258009",
    "input": "0x43d726d6",
    "calls": [
      {
        "from": "0x6c3782df9e7e0b6e723e7debbc1c690afb258009",
        "gas": "0x0",
        "gasUsed": "0x0",
        "to": "0x208c016d29599bbb836e02f30798578e75bb62a0",
        "input": "0x",
        "value": "0x2386f26fc10000",
        "type": "SELFDESTRUCT"
      }
    ],
    "value": "0x0",
    "type": "CALL"
  }
}

If you run it from reth, you are missing the call with the value 0x2386f26fc10000 making it impossible to know that 0.01ETH was transferred:

$ curl -H "Content-Type: application/json"  --data '{"jsonrpc":"2.0", "method": "debug_traceTransaction", "params": ["0x389fed47c06d9e9c15e075339a2c820f009ba130165e58b95c757b51e25e5597",  {"tracer": "callTracer"}],"id":1}'  127.0.0.1:8545
{                                                                                                                                                                                                                                                                                           
  "jsonrpc": "2.0",                                                                                                                                                                                                                                                                         
  "result": {                                                                                                                                                                                                                                                                               
    "from": "0x208c016d29599bbb836e02f30798578e75bb62a0",                                                                                                                                                                                                                                   
    "gas": "0xa6e9",                                                                                                                                                                                                                                                                        
    "gasUsed": "0x1cfe",                                                                                                                                                                                                                                                                    
    "to": "0x6c3782df9e7e0b6e723e7debbc1c690afb258009",                                                                                                                                                                                                                                     
    "input": "0x43d726d6",                                                                                                                                                                                                                                                                  
    "output": "0x",                                                                                                                                                                                                                                                                         
    "value": "0x0",                                                                                                                                                                                                                                                                         
    "type": "CALL"                                                                                                                                                                                                                                                                          
  },                                                                                                                                                                                                                                                                                        
  "id": 1                                                                                                                                                                                                                                                                                   
}

Node logs

N/A

Platform(s)

Linux (x86)

What version/commit are you on?

v0.1.0-alpha.4

What database version are you on?

v0.1.0-alpha.4

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

cargo build --profile maxperf --features jemalloc

Code of Conduct

  • I agree to follow the Code of Conduct
@pnnkr pnnkr added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Jul 21, 2023
@pnnkr pnnkr changed the title reth's callTracer output is different from erigon/geth's traces when a tx includes the SELFDESTRUCT opcode reth's callTracer output is different from erigon/geth's traces when a tx executes the SELFDESTRUCT opcode Jul 21, 2023
@onbjerg onbjerg added A-rpc Related to the RPC implementation and removed S-needs-triage This issue needs to be labelled labels Jul 26, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Aug 10, 2023
@mattsse mattsse added M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity and removed S-stale This issue/PR is stale and will close with no further activity labels Aug 10, 2023
@mattsse
Copy link
Collaborator

mattsse commented Oct 2, 2023

this should be fixed now

@mattsse mattsse closed this as completed Oct 2, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Oct 2, 2023
@pnnkr
Copy link
Author

pnnkr commented Dec 7, 2023

Amazing thanks!

I don't have time to test but you guys should check there's no similar issues with failed optimism l1 -> l2 TXs too (type 126).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity
Projects
Archived in project
Development

No branches or pull requests

3 participants