-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
How often is eth_chainId called? #1253
Comments
Realized this is a dupe. Sorry! |
We should be friends! This is what the staticjsonrpcprovider call is for. othewise it checks to make sure the user hasnt changed the network in metamask or whatever let us know if you figure out a solution for the changes to fallbackproviders that have increased your call load by 4-8x. it seems like our project set ups are similar. |
@mrwillis Can you link to the dupe? The base provider will check the chain is on every operation via It should only double the traffic and not for any of the third-party providers; not sure why it would be 4x to 8x higher. Unless you mean across all backends (not just to one)? In v5 multiple backends are queries simultaneously to make sure the others are not lying. You could increase the stall timeout (how long a backend takes to reply before trying the next) or reduce the quorum to 1. It still should only be a bit higher though... 4x-8x is way took much... |
Basically seemed like the recommendation was to use InfuraProvider for Infura. We are actually on matic (sidechain) and use a service called matic-vigil which is basically a matic version of Infura. If we wanted to copy what you did with InfuraProvider to save on # of requests, is StaticJsonRpcProvider the answer here? |
That’s correct. The StaticJsonRpcProvider will make the assumption the underlying network cannot change. Which is the case when the network is baked into the URLs. :) |
@ricmoo appreciate the continued support. Cannot thank you enough. Will close this for now as the linked issue is effectively this question. |
Hi Richard,
We have a bunch of event listeners (v5) and we see this request fairly often. Wondering why it's called so frequently.
{method: "eth_chainId", params: [], id: 5267, jsonrpc: "2.0"}
id: 5267
jsonrpc: "2.0"
method: "eth_chainId"
params: []
Thanks!
The text was updated successfully, but these errors were encountered: