Return block metadata in debug_traceBlockByNumber in addition to traces
System Information
Geth version: Geth/v1.10.17-stable-25c9b49f/linux-amd64/go1.18
OS & Version: Debian 11.3 Bullseye
Questions
-
With the
debug_traceBlockByNumbermethod, I expected to get not only information about the transactions in the block, but also information about the actual block. This would includeauthor,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 thedebug_traceBlockByHashmethod on geth as well? If not, what method can I use to get the information (especially the mining reward)? -
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.
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.
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.