-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
fix: use hardcoded Infura gas API urls #4068
fix: use hardcoded Infura gas API urls #4068
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions as I was passing through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments!
8268471
to
14be4d0
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
## **Description** This PR introduces an updated `GasFeeController` that transitions to the new Infura gas API. Preview `GasFeeController` PR: MetaMask/core#4068 **Important Note**: With the introduction of these changes, developers must complete two critical steps within their Infura project: 1. Activate the Infura gas API in the Expansion APIs section. ![infura all-endpoints ](https://github.com/MetaMask/metamask-extension/assets/7644512/ec976245-cab5-4b8f-b25d-b5a75f5b381b) Access this section via `https://app.infura.io/key/<INFURA_PROJECT_ID>/all-endpoints`. Please replace `<INFURA_PROJECT_ID>` with the project ID found in your `.metamaskrc` file. 2. Ensure that the `REQUIRE API KEY SECRET FOR ALL REQUESTS` option is disabled. ![infura settings](https://github.com/MetaMask/metamask-extension/assets/7644512/de0a3e1a-767b-468c-b0d5-fc7f393e4841) Access this section via `https://app.infura.io/key/<INFURA_PROJECT_ID>/settings`. Again, `<INFURA_PROJECT_ID>` with the project ID found in your `.metamaskrc` file. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/23717?quickstart=1) ## **Related issues** Fixes: MetaMask/MetaMask-planning#2254 ## **Manual testing steps** Although there are no functional changes, the update to the gas API URL warrants manual testing of gas-related components to ensure they remain operational. ## **Screenshots/Recordings** N/A ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [X] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot <[email protected]>
This reverts commit 850461d. merge conflicts: - determineGasFeeCalculations.ts - GasFeeController.ts - GasFeeController.test.ts
This reverts commit 850461d. merge conflicts: - determineGasFeeCalculations.ts - GasFeeController.ts - GasFeeController.test.ts
This reverts commit 850461d. merge conflicts: - determineGasFeeCalculations.ts - GasFeeController.ts - GasFeeController.test.ts
Explanation
legacyAPIEndpoint
andEIP1559APIEndpoint
options are the gas API urls used inGasFeeController
.This PR aims to remove those and put the new Infura URL as hardcoded.
New Infura API also expects an auth header on requests, hence this PR is adding new options
infuraAPIKey
to constructor.References
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2254
Changelog
@metamask/gas-fee-controller
legacyAPIEndpoint
andEIP1559APIEndpoint
. These URLs are now hardcoded within the controller.infuraAPIKey
. This is used to construct and send the Authorization header for Infura gas API requests.Checklist