a16z / helios

A fast, secure, and portable light client for Ethereum
MIT License
1.79k stars 271 forks source link

feat: Standardization of responses according to eth_rpc specs for eth_ methods related to byNumber and byHash #234

Open phklive opened 1 year ago

phklive commented 1 year ago

The methods: eth_getBlockByNumber eth_getBlockTransactionCountByNumber eth_getBlockByHash eth_getBlockTransactionCountByHash

Some respond with null and some respond with an error if passed a block that has not been synced by helios.

But in the eth_specs we can see that the normal behavior in that case should always be returning null.

The idea is to standardize the responses of these methods to make them always repsond with null in case an unsynced block is passed.

It could also be a good idea to add a print / log "block has not been synced by helios client" or something following those lines.

giovannivignone commented 1 year ago

@phklive Thanks for calling this out. I will get this implemented