Skip to content

fix: patch transaction controller in mobile to add fallback gas estimation#8707

Merged
dbrans merged 1 commit into
mainfrom
dbrans/patch-txctl
Feb 26, 2024
Merged

fix: patch transaction controller in mobile to add fallback gas estimation#8707
dbrans merged 1 commit into
mainfrom
dbrans/patch-txctl

Conversation

@dbrans

@dbrans dbrans commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

Description

Diff in core repo corresponding to this patch: MetaMask/core@0c09517

This patches transaction-controller 6.1.0, introducing a fallback for gas estimations. In cases of failed gas estimation, the transaction will default to using 95% of the latest block gas limit. This ensures that transactions have viable gas.

Previously, if gas estimation for a transaction failed (for example, due to the transaction being reverted), the gasHex value would remain undefined. This issue led to the transaction being assigned zero gas, causing it to be submitted to the mempool where it would get "stuck".

This change is specific to version 6.1.0 of the transaction-controller. Later versions of the TransactionController include this fix.

Related issues

Fixes: #8533

Manual testing steps

  1. Go to https://mmsdk-polygon-swap.vercel.app/
  2. Add Polygon chain and switch to network
  3. Click "Send Transaction"
  4. Try again if you get a JSON-RPC error (unrelated issue)

Transaction should submit and fail... but not get stuck in "submitted" state as in #8533.

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@dbrans dbrans added the team-confirmations-system-deprecated DEPRECATED: please use "team-confirmations" instead label Feb 23, 2024
Comment thread patches/@metamask+transaction-controller+6.1.0.patch
Comment thread patches/@metamask+transaction-controller+6.1.0.patch
@codecov-commenter

codecov-commenter commented Feb 23, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.47%. Comparing base (667d8c8) to head (9129af9).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8707      +/-   ##
==========================================
- Coverage   41.47%   41.47%   -0.01%     
==========================================
  Files        1263     1263              
  Lines       30605    30610       +5     
  Branches     3008     3008              
==========================================
  Hits        12694    12694              
- Misses      17157    17162       +5     
  Partials      754      754              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbrans dbrans force-pushed the dbrans/patch-txctl branch from 2a1497e to 9129af9 Compare February 26, 2024 15:42
@dbrans dbrans marked this pull request as ready for review February 26, 2024 15:44
@dbrans dbrans requested a review from a team as a code owner February 26, 2024 15:44
@github-actions

Copy link
Copy Markdown
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/b78aac18-4200-43ae-8910-1df7228a47bc
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@dbrans dbrans merged commit 4869690 into main Feb 26, 2024
@dbrans dbrans deleted the dbrans/patch-txctl branch February 26, 2024 16:43
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 26, 2024
@metamaskbot metamaskbot added the release-7.18.0 Issue or pull request that will be included in release 7.18.0 label Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.18.0 Issue or pull request that will be included in release 7.18.0 team-confirmations-system-deprecated DEPRECATED: please use "team-confirmations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Stuck pending transactions

4 participants