paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.83k stars 1.08k forks source link

Enhance RPC to account for edge cases #5814

Open liangjh opened 9 months ago

liangjh commented 9 months ago

Describe the feature

I'm a user of the reth node RPC (using via @sslivkoff's cryo), but believe most of the edge cases are likely broadly applicable as well. This centers mostly around the use of debug.tip and the retrieval of data from blocks that have not completed syncing.

Cryo sync utilizes the reth RPC to retrieve data via available block ranges. If cryo (or any client) attempts to retrieve a range that doesn't yet exist, the RPC will return empty. This is particularly acute when the debug.tip is changed (e.g. from a lower block number to a higher block number) and the reth node needs to "catch up" to the higher debug.tip from a lower block number.

Example:

Not sure what is the best way to handle cases like this (exception or error code?). Would assume that an error code would be preferable to elegantly handle on the client rather than silently or loudly fail?

I don't have more detail ATM (ie. specific RPC calls and network traffic etc), just logging the edge case as I'm noticing it; but hopefully the description above is clear enough for those w/ a deeper expertise of the node rpc?

Additional context

Some context in these messages: https://t.me/paradigm_data/2148

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 21 days with no activity.