-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some Infura RPC methods should be cached but are not #143
Comments
Look into |
I did some research and it looks like when a block is attested to be a part of the canonical chain, if there are any other competing blocks that should be marked as uncles, those are associated with the canonical block. For instance, see this block which became an uncle after this block became the canonical (the uncle is listed on the block page). Interestingly, according to the Ethereum docs, uncles (ommers) are not possible in Ethereum 2.0. In fact, according to Etherscan, the last uncle was 18 days ago. So caching uncle-related RPC methods isn't going to be as important in the future as it is now. In any case, in terms of whether these methods are safe to cache in the first place, my thought is that the possibility that a block that was once canonical then can be an uncle now if the network says so is a consequence of the overall ephemeralness of Ethereum that affects all kinds of blocks, not just uncle blocks. In other words, if we think that Or, we ignore these methods and only cache Thoughts? |
Interesting; I hadn't realized this changed post-merge. I guess it's still an issue for PoW chains though. Ideally we would detect chain reorganizations and refresh any affected caches, across the board. Until then, chain reorganizations might be very confusing. In the meantime, I'm unsure whether caching these would make these situations more confusing or not. Maybe better to err on the side of caution and leave them uncached for now. |
Okay, so I'll just focus on caching |
The following RPC methods take block parameters and yet are not covered in
blockTagParamIndex
and so are not being cached the same as other RPC methods which take block parameters:eth_getBlockTransactionCountByNumber
eth_getTransactionByBlockNumberAndIndex
eth_getUncleByBlockNumberAndIndex
eth_getUncleCountByBlockNumber
The text was updated successfully, but these errors were encountered: