-
Notifications
You must be signed in to change notification settings - Fork 141
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
context.client.readContract occasionally returns 0x
#1477
Comments
Hi, thanks for opening! Questions:
My gut says this has nothing to do with the chain being an L2, I think this problem can happen on any chain depending on the node software being used to serve the RPC request. It's very difficult for the framework itself to know that a |
Hi, thanks for your reply!
I understand that this might not be specifically related to the chain being an L2, but rather to the node software serving the RPC request. However, I’ve already implemented a retry mechanism where the request is retried 5 times with a 1-second delay between attempts, yet I still frequently get 0x responses. Would you recommend any additional strategies to ensure reliable state reads in this scenario? |
+1, bumping this issue up. Creating your own client works but using the one from context is returning 0x. I tried adding a timeout if the response is 0x and then calling again, issue persists. |
Hi @kanvgupta and @donguks - we're not able to reproduce this despite several attempts. Can you please include a minimal reproduction with real a contract address, ABI, and |
Hi @typedarray, thanks for looking into this. After further investigation, we found that the issue was related to the RPC provider. Specifically, it occurred frequently with Ankr but not with Alchemy. Switching to Alchemy consistently resolved the problem, so we’ve opted to use Alchemy exclusively. Let us know if you need any further details! |
Version
latest
Current behavior
Expected behavior
Steps to reproduce
Link to repository
No response
Anything else?
Possible Causes
Questions
The text was updated successfully, but these errors were encountered: