-
Notifications
You must be signed in to change notification settings - Fork 915
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
reverse rpc fallback order #1010
Conversation
Not sure either, but sharing some thoughts here as well. I think the Sepolia one is the most problematic (noticed this when trying to deploy from hardhat when we had the public RPCs... it was always failing giving weird errors). The problem is that the RPC is not failing (where the fallback would work)... it's just returning incorrect stuff. I guess wevm people noticed it too because they changed it on A couple of solution could be:
|
Love this! Makes sense becoz if people add their API key they would accept more reliable result and SE-2 was still using public RPC URL first (which might give wrong data) Also updated the viem and wagmi so that we the default rpc from viem works nicely out of the box |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great solution. Thanks Shiv!!
Working and looking great to me, thanks! Just added a micro change, moved default alchemy API key to the variable so it could be changed from one place |
Niceee and makes sense tysm!! Merging this 🙌 |
Description
I am not sure what's the best solution for this is, but realized that public RPC URL's are not reliable. Especially recognized this with sepolia public rpc url which wagmi has
https://rpc2.sepolia.org
.It seems to read the wrong state example balance and also not able to fetch read variables.
Demo video:
Screen.Recording.2024-12-08.at.9.41.06.AM.mov
To test the problem:
Switch to main branch.
Copy this inside
externalContracts.ts
externalContracts.ts
Solution:
We use alchmey URL first and then fallback to public RPC. Well I mean this is gonna burst the scaffold alchemy rpc but not sure what's the best solution here is.