go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

Return block metadata in debug_traceBlockByNumber in addition to traces

Open kash1988 opened this issue 3 years ago • 2 comments

System Information

Geth version: Geth/v1.10.17-stable-25c9b49f/linux-amd64/go1.18 OS & Version: Debian 11.3 Bullseye

Questions

  1. With the debug_traceBlockByNumber method, I expected to get not only information about the transactions in the block, but also information about the actual block. This would include author, reward, value, blockHash, etc. I found an example of this on ethereum.stackexchange at the following link. In the example they use an Erigon RPC node, so the results differ. Can this information be obtained via the debug_traceBlockByHash method on geth as well? If not, what method can I use to get the information (especially the mining reward)?

  2. Where can I find a list of all secondary optional arguments (e.g. disableStorage, tracer, etc.) and their function in the documentation? Also, I can't find a list for the individual tracers (e.g. callTracer, evmdisTracer, etc.) and their function in the documentation.

kash1988 avatar May 14 '22 14:05 kash1988

Hello. As you noticed debug_traceBlockBy* don't return information about the block itself. Those can be queried via eth_getBlockByNumber or eth_getBlockByHash. To see what exactly is returned you can check the spec.

I'm not aware of any way to query the mining reward from RPC. I'm not sure adding that right now is a good idea either since after the merge mining reward will be the responsibility of the consensus client and not geth.

You can find the optional arguments documented here. But the individual tracers are not documented yet unfortunately. I added an item to the docs TODO list here https://github.com/ethereum/go-ethereum/issues/20260 for tracking this.

s1na avatar May 17 '22 12:05 s1na

There's now a page on the built-in tracers: https://geth.ethereum.org/docs/dapp/builtin-tracers

Keeping this issue re point 1., i.e. adding some block metadata to the traceBlock result.

s1na avatar Jul 26 '22 12:07 s1na