alchemix-finance / alchemix-v2-frontend

Repository for v2 UI
https://alchemix.fi
ISC License
12 stars 22 forks source link

[BUG] OP web3 connection not working #432

Open thewilder opened 2 years ago

thewilder commented 2 years ago

Contact Details

peter.szilagyi01@gmail.com

What happened?

OP vault won't show up, only shows "Fetching Data". Win 11, Chrome browser.

Steps to reproduce

  1. Open the site on Chrome.
  2. Select OP network.
  3. Click on "Vaults". ...

Expected behavior

Vaults to show up.

What browser were you using?

Chrome

If you selected "Other" above, fill in the browser you used here.

No response

n4n0GH commented 2 years ago

Note to self: due to our walletManager.js using ethers.providers.Web3Provider() at one point, ethers' calls to the different RPC providers is always done using the default connection data (including the api keys) which means we're running into massive rate limit issues.

Fix: refactor codebase to get rid of Web3Provider types.

n4n0GH commented 2 years ago

Aside from the archaic implementation, when using Metamask or other wallets that provide their own RPC it is worth pointing out that using the default mainnet.optimism.io url to connect might get rate limited as explained here https://changelog.optimism.io/2022/03/15/mainnet-system-addresses.html

Users can circumvent this issue by using an alternative RPC url (i.e. public nodes like rpc.ankr.com/optimism or paid nodes).

n4n0GH commented 2 years ago

revert changes as they broke certain contract calls without bigger refactoring

n4n0GH commented 2 years ago