fix: use hardcoded Infura gas API urls#4068
Merged
Conversation
mcmire
reviewed
Mar 18, 2024
Contributor
mcmire
left a comment
There was a problem hiding this comment.
Left some suggestions as I was passing through.
mcmire
previously approved these changes
Mar 20, 2024
Contributor
mcmire
left a comment
There was a problem hiding this comment.
Thanks for addressing my comments!
8268471 to
14be4d0
Compare
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
7 tasks
matthewwalsh0
approved these changes
Mar 26, 2024
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
OGPoyraz
added a commit
to MetaMask/metamask-extension
that referenced
this pull request
Apr 23, 2024
## **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.  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.  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. [](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 <metamaskbot@users.noreply.github.com>
dbrans
added a commit
that referenced
this pull request
Jun 10, 2024
This reverts commit 850461d. merge conflicts: - determineGasFeeCalculations.ts - GasFeeController.ts - GasFeeController.test.ts
5 tasks
dbrans
added a commit
that referenced
this pull request
Jun 11, 2024
This reverts commit 850461d. merge conflicts: - determineGasFeeCalculations.ts - GasFeeController.ts - GasFeeController.test.ts
3 tasks
dbrans
added a commit
that referenced
this pull request
Jun 26, 2024
This reverts commit 850461d. merge conflicts: - determineGasFeeCalculations.ts - GasFeeController.ts - GasFeeController.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
legacyAPIEndpointandEIP1559APIEndpointoptions 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
infuraAPIKeyto constructor.References
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2254
Changelog
@metamask/gas-fee-controllerlegacyAPIEndpointandEIP1559APIEndpoint. 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