question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Try Erigon (TurboGeth) as a Tracing Node

See original GitHub issue

Problem Statement:

Details: I don’t think we can trust TurboGeth (turbo-geth/v2021.04.3/linux-amd64/go1.16.3 ) for tracing…

In [12]: ethereum_client.parity.trace_transaction('0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63')
Out[12]: []

Block of that transaction is 7941777

In [13]: [internal_tx for internal_tx in ethereum_client.parity.trace_block(7941777) if internal_tx['transactionHash'] == '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63']
Out[13]: 
[{'action': {'from': '0xed2Fb810E69bf37802eC356e4D30f1C4A1A8d216',
   'gas': 380626,
   'value': 0,
   'callType': 'call',
   'input': HexBytes('0x1688f0b900000000000000000000000034cfac646f301356faa8b21e94227e3583fe3f5f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000001772c39fa1b0000000000000000000000000000000000000000000000000000000000000164b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ed2fb810e69bf37802ec356e4d30f1c4a1a8d216000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'),
   'to': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B'},
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',
  'blockNumber': 7941777,
  'error': 'Reverted',
  'subtraces': 0,
  'traceAddress': [],
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,
  'type': 'call'}]

Transaction was not reverted at all: https://rinkeby.etherscan.io/tx/0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63

With regular not tracing rpc calls it returns the expected results:

In [4]: ethereum_client.get_transaction_receipt('0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63')
Out[4]:
AttributeDict({'blockHash': HexBytes('0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11'),
 'blockNumber': 7941777,
 'contractAddress': None,
 'cumulativeGasUsed': 837377,
 'from': '0xed2Fb810E69bf37802eC356e4D30f1C4A1A8d216',
 'gasUsed': 266231,
 'logs': [AttributeDict({'address': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B',
   'topics': [HexBytes('0xa38789425dbeee0239e16ff2d2567e31720127fbc6430758c1a4efc6aef29f80')],
   'data': '0x000000000000000000000000333367d9a5b1782270193ed1d0c7669d90aa560a',
   'blockNumber': 7941777,
   'transactionHash': HexBytes('0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63'),
   'transactionIndex': 3,
   'blockHash': HexBytes('0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11'),
   'logIndex': 3,
   'removed': False})],
 'logsBloom': HexBytes('0x00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000004000000000000000000000000000000000'),
 'status': 1,
 'to': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B',
 'transactionHash': HexBytes('0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63'),
 'transactionIndex': 3})

Using OpenEthereum:

In [2]: ethereum_client.parity.trace_transaction('0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63')                                                                
Out[2]:                              
[{'action': {'from': '0xed2Fb810E69bf37802eC356e4D30f1C4A1A8d216',
   'gas': 380626,                               
   'value': 0,                                                                             
   'callType': 'call',                       
   'input': HexBytes('0x1688f0b900000000000000000000000034cfac646f301356faa8b21e94227e3583fe3f5f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000001772c39fa1b0000000000000000000000000000000000000000000000000000000000000164b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ed2fb810e69bf37802ec356e4d30f1c4a1a8d216000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'),                                 
   'to': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B'},
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',
  'blockNumber': 7941777,     
  'result': {'gasUsed': 242183,      
   'output': HexBytes('0x000000000000000000000000333367d9a5b1782270193ed1d0c7669d90aa560a')},                                                                                         
  'subtraces': 2,                       
  'traceAddress': [],                                      
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,                                             
  'type': 'call'},                               
 {'action': {'from': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B',
   'gas': 340263,                                                                          
   'value': 0,                               
   'init': HexBytes('0x608060405234801561001057600080fd5b506040516101e73803806101e78339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806101c36024913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060aa806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea265627a7a72315820d8a00dc4fe6bf675a9d7416fc2d00bb3433362aa8186b750f76c4027269667ff64736f6c634300050e0032496e76616c6964206d617374657220636f707920616464726573732070726f766964656400000000000000000000000034cfac646f301356faa8b21e94227e3583fe3f5f')},                           
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',
  'blockNumber': 7941777,                                             
  'result': {'gasUsed': 55109,                                
   'code': HexBytes('0x608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea265627a7a72315820d8a00dc4fe6bf675a9d7416fc2d00bb3433362aa8186b750f76c4027269667ff64736f6c634300050e0032'),                                                                                    
   'address': '0x333367d9A5b1782270193Ed1D0C7669d90aA560A'},
  'subtraces': 0,                                      
  'traceAddress': [0],                     
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,
  'type': 'create'},                                                   
 {'action': {'from': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B',
   'gas': 285195,
   'value': 0,
   'callType': 'call',                                                    
   'input': HexBytes('0xb63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ed2fb810e69bf37802ec356e4d30f1c4a1a8d2160000000000000000000000000000000000000000000000000000000000000000'),                                                       
   'to': '0x333367d9A5b1782270193Ed1D0C7669d90aA560A'},
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',
  'blockNumber': 7941777,                                            
  'result': {'gasUsed': 150098, 'output': HexBytes('0x')},
  'subtraces': 1,                                          
  'traceAddress': [1],                                       
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,                    
  'type': 'call'},                                                                         
 {'action': {'from': '0x333367d9A5b1782270193Ed1D0C7669d90aA560A',
   'gas': 279119,      
   'value': 0, 
   'callType': 'delegatecall',                                                             
   'input': HexBytes('0xb63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ed2fb810e69bf37802ec356e4d30f1c4a1a8d2160000000000000000000000000000000000000000000000000000000000000000'),                                               
   'to': '0x34CfAC646f301356fAa8B21e94227e3583Fe3F5F'},
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',       
  'blockNumber': 7941777,                         
  'result': {'gasUsed': 148410, 'output': HexBytes('0x')},
  'subtraces': 0,             
  'traceAddress': [1, 0],            
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,           
  'type': 'call'}]                                          

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
ziogaschrcommented, Apr 29, 2021

At core-geth we’ve also been working on Trace features with regard to achieving parity with the OpenEthereum API (no pun intended), and have learned a lot from talking with and referencing turbo-geth too. We think we’re getting close to a nearly complete congruence, and have added a few performance optimizations along the way.

Here, you can find a list of stuff that we decided to handle differently.

Turbo-geth will probably shine at the trace-filter performance.

1reaction
Uxio0commented, Apr 29, 2021

Looks like with the last commit everything is working as expected: https://github.com/ledgerwatch/turbo-geth/commit/711f157cf592539e10d6e08ce879e759b1f9c691

In [2]: ethereum_client.parity.trace_transaction('0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63')
Out[2]:
[{'action': {'from': '0xed2Fb810E69bf37802eC356e4D30f1C4A1A8d216',
   'gas': 380626,
   'value': 0,
   'callType': 'call',
   'input': HexBytes('0x1688f0b900000000000000000000000034cfac646f301356faa8b21e94227e3583fe3f5f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000001772c39fa1b0000000000000000000000000000000000000000000000000000000000000164b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ed2fb810e69bf37802ec356e4d30f1c4a1a8d216000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'),
   'to': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B'},
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',
  'blockNumber': 7941777,
  'result': {'gasUsed': 242183,
   'output': HexBytes('0x000000000000000000000000333367d9a5b1782270193ed1d0c7669d90aa560a')},
  'subtraces': 2,
  'traceAddress': [],
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,
  'type': 'call'},
 {'action': {'from': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B',
   'gas': 340263,
   'value': 0,
   'init': HexBytes('0x608060405234801561001057600080fd5b506040516101e73803806101e78339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806101c36024913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060aa806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea265627a7a72315820d8a00dc4fe6bf675a9d7416fc2d00bb3433362aa8186b750f76c4027269667ff64736f6c634300050e0032496e76616c6964206d617374657220636f707920616464726573732070726f766964656400000000000000000000000034cfac646f301356faa8b21e94227e3583fe3f5f')},
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',
  'blockNumber': 7941777,
  'result': {'gasUsed': 55109,
   'code': HexBytes('0x608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea265627a7a72315820d8a00dc4fe6bf675a9d7416fc2d00bb3433362aa8186b750f76c4027269667ff64736f6c634300050e0032'),
   'address': '0x333367d9A5b1782270193Ed1D0C7669d90aA560A'},
  'subtraces': 0,
  'traceAddress': [0],
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,
  'type': 'create'},
 {'action': {'from': '0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B',
   'gas': 285195,
   'value': 0,
   'callType': 'call',
   'input': HexBytes('0xb63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ed2fb810e69bf37802ec356e4d30f1c4a1a8d2160000000000000000000000000000000000000000000000000000000000000000'),
   'to': '0x333367d9A5b1782270193Ed1D0C7669d90aA560A'},
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',
  'blockNumber': 7941777,
  'result': {'gasUsed': 150098, 'output': HexBytes('0x')},
  'subtraces': 1,
  'traceAddress': [1],
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,
  'type': 'call'},
 {'action': {'from': '0x333367d9A5b1782270193Ed1D0C7669d90aA560A',
   'gas': 279119,
   'value': 0,
   'callType': 'delegatecall',
   'input': HexBytes('0xb63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000d5d82b6addc9027b22dca772aa68d5d74cdbdf440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ed2fb810e69bf37802ec356e4d30f1c4a1a8d2160000000000000000000000000000000000000000000000000000000000000000'),
   'to': '0x34CfAC646f301356fAa8B21e94227e3583Fe3F5F'},
  'blockHash': '0x9f4f103d4d9214edbabddd3b44d94df6852f78f2b222b17370427ccd7efb6c11',
  'blockNumber': 7941777,
  'result': {'gasUsed': 148410, 'output': HexBytes('0x')},
  'subtraces': 0,
  'traceAddress': [1, 0],
  'transactionHash': '0xa9dc6069cdd0acd1033ad02257c380074fa6dd7d3a4e2c17dd676c5ffc40eb63',
  'transactionPosition': 3,
  'type': 'call'}]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Try Erigon (TurboGeth) as a Tracing Node · Issue #246
Problem Statement: safe-global/safe-pm#87 Details: I don't think we can trust TurboGeth (turbo-geth/v2021.04.3/linux-amd64/go1.16.3 ) for tracing.
Read more >
Getting Started with Erigon (and Lighthouse) on Ubuntu
Erigon is an Ethereum Execution Layer (EL) client that was originally a fork of the popular Go-Ethereum (Geth) client. It has since seen ......
Read more >
Learn About Ethereum Clients Geth and Erigon
Try debug and trace on Chainstack's web app. The app allows you to input the endpoints of two nodes, an Erigon node and...
Read more >
Running an Erigon Archive Node - Magnus Hansson
Erigon syncs mainnet by default and is an archive node by default. Erigon has a pruning option if you do not want to...
Read more >
Tweets with replies by Turbogeth ( ...
#Erigon 2021.05.04-alpha! New default DB format (requires resyncing, see release notes); `trace_filter` is on for newly synced nodes; first draft of node ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found