reth icon indicating copy to clipboard operation
reth copied to clipboard

Some RPC method fields have bad output

Open sslivkoff opened this issue 1 year ago • 8 comments

Describe the bug

I tested some of the more common RPC methods over the HTTP interface

Found issues with

  • eth_getLogs
  • eth_getTransactionByHash
  • eth_getTransactionReceipt

Also tested a few call for each of these methods, but did not find issues

  • eth_call
  • eth_gasPrice
  • eth_getBalance
  • eth_getBlockByHash
  • eth_getBlockByNumber
  • eth_getChainId
  • eth_getCode
  • eth_getStorageAt
  • eth_getTransactionCount

Additionally, I was not able to get any trace_ methods to respond, they give method-not-found errors

Steps to reproduce

┌──────────────────────────────┐
│ Discrepancies in eth_getLogs │
└──────────────────────────────┘

args:
    address: 0x6b175474e89094c44da98b954eedeac495271d0f
    start_block: 14000000
    end_block: 14000100


different number of results
- erigon: 85 results
- reth:   0 results

┌───────────────────────────────────────────┐
│ Discrepancies in eth_getTransactionByHash │
└───────────────────────────────────────────┘

args:
    0xd01212e8ab48d2fd2ea9c4f33f8670fd1cf0cfb09d2e3c6ceddfaf54152386e5


different fields in results
- present only in erigon: gas_price


differences in values
            field                             reth                           erigon
───────────────────────────────────────────────────────────────────────────────────
                v                               38                                1
transaction_index       18,446,744,073,709,551,612                              207
       block_hash   0xc2beedf91127b83563d2b1a44...   0x3dc4ef568ae2635db1419c5fe...
     block_number                       16,000,001                       16,000,000

┌────────────────────────────────────────────┐
│ Discrepancies in eth_getTransactionReceipt │
└────────────────────────────────────────────┘

args:
    0xd01212e8ab48d2fd2ea9c4f33f8670fd1cf0cfb09d2e3c6ceddfaf54152386e5


differences in values
              field                             reth                           erigon
─────────────────────────────────────────────────────────────────────────────────────
effective_gas_price                   22,928,138,288                   11,288,650,858
               logs   [{'address': '0x6dc6001535e...   [{'address': '0x6dc6001535e...
       block_number                       16,000,001                       16,000,000
         block_hash   0xc2beedf91127b83563d2b1a44...   0x3dc4ef568ae2635db1419c5fe...
  transaction_index       18,446,744,073,709,551,612                              207
           gas_used                                0                           46,107

Node logs

No response

Platform(s)

Linux (x86)

What version/commit are you on?

607186

Code of Conduct

  • [X] I agree to follow the Code of Conduct

sslivkoff avatar Apr 28 '23 18:04 sslivkoff

reran on commit 0xb4fcb1518fdafb0710daff1cb2c0c6116552d39c. a few remaining discrepancies

┌──────────────────────────────┐
│ Discrepancies in eth_getLogs │
└──────────────────────────────┘

args:
    address: 0x6b175474e89094c44da98b954eedeac495271d0f
    start_block: 14000000
    end_block: 14000100


different number of results
- erigon: 85 results
- reth:   0 results

┌───────────────────────────────────────────┐
│ Discrepancies in eth_getTransactionByHash │
└───────────────────────────────────────────┘

args:
    0xd01212e8ab48d2fd2ea9c4f33f8670fd1cf0cfb09d2e3c6ceddfaf54152386e5


different fields in results
- present only in erigon: gas_price

┌────────────────────────────────────────────┐
│ Discrepancies in eth_getTransactionReceipt │
└────────────────────────────────────────────┘

args:
    0xd01212e8ab48d2fd2ea9c4f33f8670fd1cf0cfb09d2e3c6ceddfaf54152386e5


differences in values
              field                             reth                           erigon
─────────────────────────────────────────────────────────────────────────────────────
               logs   [{'address': '0x6dc6001535e...   [{'address': '0x6dc6001535e...
effective_gas_price                   22,928,138,288                   11,288,650,858
fetching ethereum abi from etherscan: 0x6b175474e89094c44da98b954eedeac495271d0f

┌─────────────────────────┐
│ No differences detected │
└─────────────────────────┘
- eth_call
- eth_gasPrice
- eth_getBalance
- eth_getBlockByHash
- eth_getBlockByNumber
- eth_getChainId
- eth_getCode
- eth_getStorageAt
- eth_getTransactionCount

in eth_getTransactionReceipt the only difference in logs is that reth is including a transactionLogIndex field whereas erigon is not

@gakonst mentioned the eth_getLogs might have been resolved in a later commit

sslivkoff avatar May 04 '23 00:05 sslivkoff

log range fix: https://github.com/paradigmxyz/reth/pull/2460

gasPrice issue tracked here #2545

mattsse avatar May 04 '23 13:05 mattsse

in eth_getTransactionReceipt the only difference in logs is that reth is including a transactionLogIndex field whereas erigon is not

We don't seem to be tracking this right?

Also, what about our receipt having a huge effective gas price?

effective_gas_price 22,928,138,288 11,288,650,858

gakonst avatar May 05 '23 02:05 gakonst

all of these discrepancies have been patched

sslivkoff avatar May 10 '23 22:05 sslivkoff

noticed some regressions

┌──────────────────────────────┐
│ Discrepancies in eth_getLogs │
└──────────────────────────────┘

args:
    address: 0x6b175474e89094c44da98b954eedeac495271d0f
    start_block: 14000000
    end_block: 14000100


different number of results
- erigon: 85 results
- reth:   0 results

┌─────────────────────────────────┐
│ Discrepancies in eth_getBalance │
└─────────────────────────────────┘

args:
    0xeb27d00030033c29307daa483171d22eb0c93342
    block_number: 16000000
differences in values
- erigon: 13252579385760232
- reth:   0

┌──────────────────────────────────────────┐
│ Discrepancies in eth_getTransactionCount │
└──────────────────────────────────────────┘

args:
    0xeb27d00030033c29307daa483171d22eb0c93342
    block_number: 16000000
differences in values
- erigon: 48
- reth:   144
fetching ethereum abi from etherscan: 0x6b175474e89094c44da98b954eedeac495271d0f

┌─────────────────────────┐
│ No differences detected │
└─────────────────────────┘
- eth_call
- eth_gasPrice
- eth_getBlockByHash
- eth_getBlockByNumber
- eth_getChainId
- eth_getCode
- eth_getStorageAt
- eth_getTransactionByHash
- eth_getTransactionReceipt

sslivkoff avatar May 24 '23 21:05 sslivkoff

also having trouble getting successful responses from trace methods

┌──────────────────────────────┐
│ Discrepancies in trace_block │
└──────────────────────────────┘

args:
    block_number: 16000000

reth failed

┌─────────────────────────────┐
│ Discrepancies in trace_call │
└─────────────────────────────┘

args:
    to_address: 0x6b175474e89094c44da98b954eedeac495271d0f
    trace_type: ['trace']
    function_abi: {'constant': True, 'inputs': [{'internalType': 'address', 'name': '', 'type': 'address'}], 'name': 'balanceOf', 'outputs': [{'internalType': 'uint256', 'name': '', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}
    function_parameters: ['0x5d3a536e4d6dbd6114cc1ead35777bab948e3643']
    block_number: 16000000


differences in values
field                             reth                           erigon
───────────────────────────────────────────────────────────────────────
trace   [{'trace_address': [], 'sub...   [{'action': {'from': '0x000...

┌──────────────────────────────────┐
│ Discrepancies in trace_call_many │
└──────────────────────────────────┘

args:
    calls: [{'to_address': '0x6b175474e89094c44da98b954eedeac495271d0f', 'function_abi': {'constant': True, 'inputs': [{'internalType': 'address', 'name': '', 'type': 'address'}], 'name': 'balanceOf', 'outputs': [{'internalType': 'uint256', 'name': '', 'type': 'uint256'}], 'payable': False, 'stateMutability': 'view', 'type': 'function'}, 'function_parameters': ['0x5d3a536e4d6dbd6114cc1ead35777bab948e3643'], 'trace_type': ['trace']}]
    trace_type: ['trace']

reth failed

┌──────────────────────────────────────────────────┐
│ Discrepancies in trace_replay_block_transactions │
└──────────────────────────────────────────────────┘

args:
    block_number: 16000000
    trace_type: ['trace']

reth failed

┌───────────────────────────────────────────┐
│ Discrepancies in trace_replay_transaction │
└───────────────────────────────────────────┘

args:
    0xd01212e8ab48d2fd2ea9c4f33f8670fd1cf0cfb09d2e3c6ceddfaf54152386e5
    trace_type: ['trace']

reth failed

┌────────────────────────────────────┐
│ Discrepancies in trace_transaction │
└────────────────────────────────────┘

args:
    0xd01212e8ab48d2fd2ea9c4f33f8670fd1cf0cfb09d2e3c6ceddfaf54152386e5

reth failed

┌─────────────────────────┐
│ No differences detected │
└─────────────────────────┘
no successful calls

sslivkoff avatar May 24 '23 21:05 sslivkoff

once node is sync'd vanilla calls are working with no discrepancies

trace calls still not working

sslivkoff avatar May 25 '23 00:05 sslivkoff

need error messages for when valid data is not available

sslivkoff avatar May 25 '23 00:05 sslivkoff

@sslivkoff closing this - we should create new issues for specific methods as they come from users. pls run the same commands again and let's open a separate issue for any discrepancies you see.

gakonst avatar Jul 03 '23 13:07 gakonst