Skip to content
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

fix(CacheProvider): Exit early if cacheType based on blockNumber of RPC response is NONE #900

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

nicholaspai
Copy link
Member

This line is triggering and throwing an error when an RPC request for a method like eth_getTransactionReceipt has an initial cache type of DECIDE_TTL_POST_SEND and then the RPC response reveals a blockNumber that is too close to HEAD.

So the cacheTypeForBlock is returning NONE here which then throws an error when we try to set this RPC result in the cache

…PC response is NONE

This [line](https://github.com/across-protocol/sdk/blob/80e2ab26b9dc68265d8d1707a3ee025e03cbc4dc/src/providers/cachedProvider.ts#L77) is triggering and throwing an error when an RPC request for a method like `eth_getTransactionReceipt` has an initial cache type of `DECIDE_TTL_POST_SEND` and then the RPC response reveals a `blockNumber` that is too close to HEAD.

So the `cacheTypeForBlock` is returning `NONE` [here](https://github.com/across-protocol/sdk/blob/80e2ab26b9dc68265d8d1707a3ee025e03cbc4dc/src/providers/cachedProvider.ts#L174) which then throws an error when we try to set this RPC result in the cache
@nicholaspai nicholaspai requested review from bmzig and pxrl February 25, 2025 19:34
@bmzig bmzig merged commit 959b3c3 into master Feb 25, 2025
4 checks passed
@bmzig bmzig deleted the fix-cache-provider branch February 25, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants