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

Some RPC method fields have bad output #2457

Closed
1 task done
sslivkoff opened this issue Apr 28, 2023 · 9 comments
Closed
1 task done

Some RPC method fields have bad output #2457

sslivkoff opened this issue Apr 28, 2023 · 9 comments
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior
Milestone

Comments

@sslivkoff
Copy link
Member

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

  • I agree to follow the Code of Conduct
@sslivkoff sslivkoff added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Apr 28, 2023
@rkrasiuk rkrasiuk added A-rpc Related to the RPC implementation and removed S-needs-triage This issue needs to be labelled labels Apr 30, 2023
@sslivkoff
Copy link
Member Author

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

@mattsse
Copy link
Collaborator

mattsse commented May 4, 2023

log range fix: #2460

gasPrice issue tracked here #2545

@gakonst
Copy link
Member

gakonst commented May 5, 2023

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

@sslivkoff
Copy link
Member Author

all of these discrepancies have been patched

@sslivkoff
Copy link
Member Author

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 sslivkoff reopened this May 24, 2023
@sslivkoff
Copy link
Member Author

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
Copy link
Member Author

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

trace calls still not working

@sslivkoff
Copy link
Member Author

need error messages for when valid data is not available

@gakonst
Copy link
Member

gakonst commented Jul 3, 2023

@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.

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
Projects
Archived in project
Development

No branches or pull requests

5 participants