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

[Spike] Reduce eth daemon calls #6193

Closed
0xean opened this issue Feb 13, 2024 · 3 comments
Closed

[Spike] Reduce eth daemon calls #6193

0xean opened this issue Feb 13, 2024 · 3 comments
Assignees
Labels

Comments

@0xean
Copy link
Contributor

0xean commented Feb 13, 2024

  1. open the app, with network tab filter on daemon.ethereum
  2. connect demo wallet
  3. notice the large amount of calls

We should take a look at why the app is so chatty here, work has been done to work on the approval calls, but we should understand this behavior and perhaps look to reduce this traffic if reasonably possible.

@0xean
Copy link
Contributor Author

0xean commented Feb 14, 2024

Some of the eth_calls seem related to Foxy

@0xean 0xean moved this from To schedule to Up next in ShapeShift Dashboard Feb 15, 2024
@gomesalexandre gomesalexandre self-assigned this Feb 15, 2024
@gomesalexandre
Copy link
Contributor

  • There are two calls on splash screen, which should really not happen as we didn't connect a wallet. One is the UNI-V2 resolver of opportunitiesSlice, the other is the ethereum plugin. We should ensure things are lazy-loaded in both these cases.
  • From there on, once a wallet is connected, there is a bunch of network request for opportunities meta/user-data. Work has already been done here to batch things - indeed @0xean many of these are related to FOXy, and removing support for it eventually will make things some better

@gomesalexandre
Copy link
Contributor

gomesalexandre commented Feb 15, 2024

Also related: ethers-io/ethers.js#3462 we're using JsonRpcBatchProvider for its caching capabilities but ironically, it doesn't have the chainId caching improvements of StaticJsonRpcProvider. See e.g Uniswap/routing-api#404.
While this indeed seems to reduce the number of calls (#6223), it looks like our issue is having multiple instances of providers for a given ChainId. Will use this PR to instantiate them only once, across web and packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

3 participants