wagmi
wagmi copied to clipboard
bug: lots of requests on arbitrum
Is there an existing issue for this?
- [X] I have searched the existing issues
Package Version
0.5.12
Current Behavior
If your wallet is connected to arbitrum and you connect on the app using the InjectedConnector, I see a lot of network requests being fired by useContractReads whereas if im connected to Ethereum but pass chainId: 42161, theres only a couple.
Expected Behavior
I would expect the same amount of requests being fired
Steps To Reproduce
On the sandbox press connect and use the console network inspector to see the requests being fired.
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
https://codesandbox.io/s/quizzical-goldwasser-6lwu14?file=/src/App.js
Anything else?
No response
More minimal example here:
https://codesandbox.io/s/nervous-ben-i3fhfn?file=/src/App.js
You have to connect wallet and make sure you're on Arbitrum.
A single balanceOf call proxied via useContractReads results in 16 requests,
1 eth_blockNumber and 15 duplicate eth_calls. I'd expect in this case to only see a maximum of 2 requests?
This gets out of hand quickly when you have large multicall requests, or multiple useContractReads on a single page.
Fixed in 0.6.7
.
This issue has been locked since it has been closed for more than 14 days.
If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.