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

debug_traceBlockByNumber using flatCallTracer incorrectly returns parentHash instead of blockHash #12415

Closed
1 task done
jamesstanleystewart opened this issue Nov 8, 2024 · 2 comments
Labels
C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled

Comments

@jamesstanleystewart
Copy link

Describe the bug

When running a debug_traceBlockByNumber using flatCallTracer the returned result incorrectly includes each transaction's block's parentHash instead of hash.

I imagine this has something to do with loading the parents state to re-run/trace each transaction.

Steps to reproduce

Eg. Ethereum Mainnet

curl -X POST -H "Content-Type: application/json" -d '{"id": 1, "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": ["0x142A98D",{"tracer": "flatCallTracer"}]}' localhost:8545

returns results with:

"blockHash":"0xf6c28939baac650b17585fd7f151ae9bfbb8987c14d42f503403c719692454b7", <- this is the blocks parentHash
"blockNumber":21145997

where it should return results with:

"blockHash":"0x096604aedd32b33ed533f0e5f4ca528e5aa990f34a96ec8d3698736cf3b9fc1a",
"blockNumber":21145997

Reference: https://etherscan.io/block/21145997

Similarly on Base Mainnet

curl -X POST -H "Content-Type: application/json" -d '{"id": 1, "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": ["0x151F018",{"tracer": "flatCallTracer"}]}' localhost:8545

Traces have

          "blockHash": "0xce271f018751cab1c07fa9ef88cd8e1967d8e3e1329e98a8069ae249f886abf0", <- this is the blocks parentHash
          "blockNumber": 22147096,

the correct trace would have

          "blockHash": "0xa505ff4c3015aff3e04ee9c9fb0d9fe3090e74d67b794d91bbf002a65d3dc726",
          "blockNumber": 22147096,

https://basescan.org/block/22147096

Node logs


Platform(s)

Linux (x86)

What version/commit are you on?

latest docker release:

reth Version: 1.1.1
Commit SHA: 15c230b
Build Timestamp: 2024-11-05T12:39:46.613054379Z
Build Features: asm_keccak,jemalloc
Build Profile: maxperf

What database version are you on?

Current database version: 2
Local database version: 2

Which chain / network are you on?

Tested on Base Mainnet and Ethereum Mainnet using op-reth and reth.

What type of node are you running?

Archive (default)

What prune config do you use, if any?

Archive

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
@jamesstanleystewart jamesstanleystewart added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Nov 8, 2024
@mattsse
Copy link
Collaborator

mattsse commented Nov 9, 2024

thanks, this has been fixed by #12360 as drive by

block_hash: Some(block.hash()),

@mattsse mattsse closed this as completed Nov 9, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Nov 9, 2024
@jamesstanleystewart
Copy link
Author

@mattsse thanks for that, good timing 😁 any idea when the next release will be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled
Projects
Status: Done
Development

No branches or pull requests

2 participants