erigon icon indicating copy to clipboard operation
erigon copied to clipboard

blockNumber for trace_block is an int rather than hex string

Open jondoe1337 opened this issue 1 year ago • 3 comments

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}

jondoe1337 avatar Aug 16 '22 19:08 jondoe1337

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.)

tjayrush avatar Aug 16 '22 22:08 tjayrush

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).

jondoe1337 avatar Aug 17 '22 07:08 jondoe1337

I couldn't agree more. Just pointing out a (perhaps obvious) consideration.

tjayrush avatar Aug 18 '22 20:08 tjayrush

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.

github-actions[bot] avatar Sep 28 '22 04:09 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Oct 06 '22 03:10 github-actions[bot]