erigon
erigon copied to clipboard
blockNumber for trace_block is an int rather than hex string
System information
Erigon version: 2022.06.6-alpha-77240899
OS & Version: Linux using Docker
Expected behaviour
The blockNumber property should be consistently formatted as a hex string through the entire RPC API.
Actual behaviour
When doing trace_block
calls it returns blockNumber as an int number
Steps to reproduce the behaviour
Execute:
{"jsonrpc":"2.0","method":"trace_block","params":["latest"],"id":1}
compared to:
{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", false],"id":1}
I agree with this in theory, but my guess is that it works this way because of historical happenstance. One of the goals of the original work to enable the trace_
namespace on Erigon was to duplicate the data produced by Open Ethereum. My guess is that Open Ethereum (which, at the time was the only implementation of the trace_
namespace) used int
, and therefore so does Erigon.
I know there's some sort of command line option (don't remember what it is) that gives full backward compatibility to the Open Ethereum data. I'm not sure if that's on
or off
by default, but perhaps any fix to this issue can preserve the "old" behavior under that flag. Otherwise, the change may break existing code. (Our code, TrueBlocks, won't break, but other code may.)
I understand the history behind that code, however IMHO the aspiration for a next-gen client should be to improve inconsistencies, not preserve them because it might brake some code (with the respect of a transition time when deprecating a format).
I couldn't agree more. Just pointing out a (perhaps obvious) consideration.
This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.