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

Stop using ethers default api keys #356

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

apbendi
Copy link
Member

@apbendi apbendi commented Jun 30, 2022

Switch to static provider with our infura id env var injected to avoid rate limiting associated with the default provider.

@netlify
Copy link

netlify bot commented Jun 30, 2022

Deploy Preview for jolly-shaw-20fe62 ready!

Name Link
🔨 Latest commit fa9f231
🔍 Latest deploy log https://app.netlify.com/sites/jolly-shaw-20fe62/deploys/62c9d6f172a56d0008ee4c66
😎 Deploy Preview https://deploy-preview-356--jolly-shaw-20fe62.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@mds1
Copy link
Collaborator

mds1 commented Jun 30, 2022

We're using getDefaultProvider, which "connects to multiple backends and verifies their results internally, making it simple to have a high level of trust in third-party services". So even though we added an Infura key, this message shows up for other providers.

Switching from getDefaultProvider to any of JsonRpcProvider, StaticJsonRpcProvider, or InfuraProvider should all fix this. The latter two reduce the number of RPC requests because you know the provider won't suddenly change chain ID on you (I'm going to have a PR later to use StaticJsonRpcProvider elsewhere in the app to reduce the number of requests)

Edit: See #357 where we switch to StaticJsonRpcProvider

@apbendi apbendi force-pushed the stop-using-ethers-default-api-keys branch from 35aa25e to fa9f231 Compare July 9, 2022 19:28
@apbendi apbendi marked this pull request as ready for review July 9, 2022 19:29
@apbendi apbendi requested a review from mds1 July 9, 2022 19:29
@apbendi
Copy link
Member Author

apbendi commented Jul 9, 2022

Updated to use StaticJsonRpcProvider, ready for review @mds1

Copy link
Collaborator

@mds1 mds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@apbendi apbendi merged commit fa9f231 into master Jul 11, 2022
@apbendi apbendi deleted the stop-using-ethers-default-api-keys branch July 11, 2022 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants