Conversation
8478d3c to
7126883
Compare
|
@metamaskbot update-policies |
|
No policy changes |
Builds ready [7126883]
Page Load Metrics (1750 ± 70 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
Codecov Report
@@ Coverage Diff @@
## develop #19746 +/- ##
===========================================
+ Coverage 69.85% 69.86% +0.01%
===========================================
Files 980 980
Lines 36911 36913 +2
Branches 9909 9909
===========================================
+ Hits 25782 25786 +4
+ Misses 11129 11127 -2
|
569c56b to
962fec1
Compare
Builds ready [962fec1]
Page Load Metrics (1435 ± 27 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
962fec1 to
142f264
Compare
Our fallback gas estimation was failing due to a bug in the `@metamask/controller-utils` package. This was causing gas estimation to fail completely on certain networks (those not supported by our gas estimation APIs and non EIP-1559 compatibile), and it was causing the fallback gas estimation operation (in case our API was down) to fail across all networks. Fixes #19735
E2E tests have been added to capture gas estimation. Cases are added for our API, for the fallback estimate, and for non-EIP-1559 estimates. As part of this work, the legacy gas API had to be disabled. This was being used in e2e tests but was dead code in production. It needed to be disabled to ensure the code under test was reachable.
142f264 to
cde2190
Compare
| }); | ||
|
|
||
| describe('Send on a network that is not EIP-1559 compatible', function () { | ||
| it('show expected gas defaults', async function () { |
There was a problem hiding this comment.
This test was failing prior to this PR
| hardfork: 'london', | ||
| }; | ||
|
|
||
| describe('Send on a network that is EIP-1559 compatible', function () { |
There was a problem hiding this comment.
These tests were already passing (both before and after this PR), but I included them here just to have all four code paths covered in the same file.
|
This has been updated with e2e tests |
Builds ready [faa1753]
Page Load Metrics (1675 ± 64 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
danjm
left a comment
There was a problem hiding this comment.
LGTM, nice work on the e2e tests
| EIP1559APIEndpoint: `${gasApiBaseUrl}/networks/<chain_id>/suggestedGasFees`, | ||
| getCurrentNetworkLegacyGasAPICompatibility: () => { | ||
| const { chainId } = this.networkController.state.providerConfig; | ||
| return process.env.IN_TEST || chainId === CHAIN_IDS.MAINNET; |
There was a problem hiding this comment.
I've since discovered that this legacy gas endpoint remains useful for non-EIP1559 chains that our APIs support (e.g. BSC and Polygon). But we can restore this for those chains in a later PR, they weren't using it yet anyway.
Explanation
Our fallback gas estimation was failing due to a bug in the
@metamask/controller-utilspackage. This was causing gas estimation to fail completely on certain networks (those not supported by our gas estimation APIs and non EIP-1559 compatibile), and it was causing the fallback gas estimation operation (in case our API was down) to fail across all networks.Additionally, the legacy gas API has been disabled as part of this PR. This was required in order to cover this functionality with e2e tests (if the legacy gas API was enabled, that would take precedence over the code this PR is fixing).
I tried removing the legacy gas API in a separate PR, but that depends upon this bug fix, so they need to be changed together.
A few test IDs were added for the purpose of helping with writing the e2e tests.
Fixes #19735
Manual Testing Steps
Switch to the BNB network, and start the send or swaps flow. You should see an error like the one shown in the referenced issue if you're testing with
developor the v10.33.0 release candidate. With this PR, the error no longer appears.Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Boardlabel.In this case, a QA Engineer approval will be be required.