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

JSON-RPC: eth_getBalance Inconsistency #10682

Open
1 task done
ZzPoLariszZ opened this issue Sep 3, 2024 · 4 comments
Open
1 task done

JSON-RPC: eth_getBalance Inconsistency #10682

ZzPoLariszZ opened this issue Sep 3, 2024 · 4 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

@ZzPoLariszZ
Copy link
Contributor

Describe the bug

The balance of the given address requested from Reth is different from QuickNode and Infura

Steps to reproduce

curl http://localhost:8545 \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getBalance","params":["0x0000000000000000000000000000000000000000", "0x1306D3B"],"id":1,"jsonrpc":"2.0"}'

From Reth

The result is 0x2d50d3b2d7840cb6d76 (13374842859180050312566)

From QuickNode and Infura

The result is 0x2d47a18b5b27a27e0ac (13364240691015941873836)

Node logs

No response

Platform(s)

Linux (x86)

What version/commit are you on?

reth Version: 1.0.6

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
@ZzPoLariszZ ZzPoLariszZ added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Sep 3, 2024
@ZzPoLariszZ
Copy link
Contributor Author

ZzPoLariszZ commented Sep 3, 2024

The inconsistency starts from Block 19879895

Reth balance at 19879894: 13361851371947497370023
Geth balance at 19879894: 13361851371947497370023

Reth balance at 19879895: 13371549989026870435183
Geth balance at 19879895: 13361851371947497370024

The related transaction 0x82f5cc4aaf9c6d006c2535be5d95ff387dbd65749763cfbe8d52f595e0fbe666

@emhane emhane added A-rpc Related to the RPC implementation and removed S-needs-triage This issue needs to be labelled labels Sep 23, 2024
Copy link
Contributor

This issue is stale because it has been open for 21 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 Oct 15, 2024
@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 Oct 15, 2024
@jsvisa
Copy link
Contributor

jsvisa commented Oct 18, 2024

reproduced on reth v1.1.0, try to find the causes

@jsvisa
Copy link
Contributor

jsvisa commented Oct 18, 2024

After some digging, in my node, the first discrepancy of the 0x0000000000000000000000000000000000000000's balance occured in block 17455888, diffs as below:

blknum,reth,erigon
...
17455886,11734187543945161994027,11734187543945161994027
17455887,11734187543945161994027,11734187543945161994027
17455888,13397775667035432152370,11734199307305109737224
17455889,13397775667035432152370,11734199307305109737224
...

Then I used prestateTracer to find which tx leads to this discrepancy, but the results of reth and erigon are the same, RPC as below:

{
  "jsonrpc": "2.0",
  "method": "debug_traceBlockByNumber",
  "id": 67,
  "params": [
    "0x10a5b10",
    {
      "tracer": "prestateTracer",
      "tracerConfig": {"diffMode": true}
    }
  ]
}

So seems the pre and the calculated post state are correct, but the post state persisted into disk maybe corrupted?

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
Status: Todo
Development

No branches or pull requests

4 participants