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

fix: legacy gas miss match and not preserved after change #7305

Merged
merged 11 commits into from
Oct 4, 2023

Conversation

blackdevelopa
Copy link
Contributor

@blackdevelopa blackdevelopa commented Sep 22, 2023

Description

Whenever I trigger a legacy transaction from a dapp, I can see how the Estimated gas fees does not match the gas details (if I open the Edit gas). Furthermore if I change the suggested gas, I can see how the value is not changed and tx is submitted with the suggested gas value instead of the one I set. See here

Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions:
1. What is the reason for the change?
2. What is the improvement/solution?

Manual testing steps

Test for both 1559 supported network and legacy network. For legacy network, use ganache and check that --hardfork berlin or use Palm. For 1559, a testnet like Georli should suffice

Setup legacy network using
1. Step1: Setup wallet and import the right key and account
3. Step3: Check that transactions are submitted as expected.

Screenshots/Recordings

Before

gas_mis_match.mp4
legacy.mp4

After

Send token: https://recordit.co/KCujgfnwOO
Send legacy: http://recordit.co/QOSHpcmrMS
Create a token: http://recordit.co/ygpx2T3Wsw
Token approve: http://recordit.co/C4ItxYxWCB
Send legacy txn from Georli: http://recordit.co/TUmaOp9vHl

Related issues

_Fixes #7290

Bitrise build: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/35e839a1-6d20-491d-bfea-6956c207776a

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • 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
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.

@blackdevelopa blackdevelopa added the team-confirmations-secure-ux-PR PR from the confirmations team label Sep 25, 2023
@blackdevelopa blackdevelopa self-assigned this Sep 25, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (0afaaa8) 34.60% compared to head (9e02c47) 34.59%.
Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7305      +/-   ##
==========================================
- Coverage   34.60%   34.59%   -0.02%     
==========================================
  Files        1016     1017       +1     
  Lines       27107    27165      +58     
  Branches     2198     2215      +17     
==========================================
+ Hits         9381     9397      +16     
- Misses      17237    17278      +41     
- Partials      489      490       +1     
Files Coverage Δ
...pp/components/UI/ApproveTransactionReview/index.js 3.88% <ø> (ø)
app/components/UI/EditGasFeeLegacyUpdate/index.tsx 57.83% <100.00%> (+0.51%) ⬆️
...actionReview/TransactionReviewInformation/index.js 37.50% <100.00%> (ø)
app/core/GasPolling/GasPolling.ts 90.90% <66.66%> (-6.46%) ⬇️
app/components/UI/TransactionEditor/index.js 2.73% <0.00%> (-0.11%) ⬇️

... and 35 files with indirect coverage changes

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

@blackdevelopa blackdevelopa marked this pull request as ready for review September 26, 2023 10:01
@blackdevelopa blackdevelopa requested a review from a team as a code owner September 26, 2023 10:01
@blackdevelopa blackdevelopa added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Sep 26, 2023
@jpuri
Copy link
Contributor

jpuri commented Sep 28, 2023

@blackdevelopa : code changes look good, I left some small queries can you plz check.

jpuri
jpuri previously approved these changes Sep 28, 2023
@seaona
Copy link
Contributor

seaona commented Sep 29, 2023

For some reason, Sepolia is still showing the gas missmatch. It's interesting because it's indeed fixed in Goerli, so we should wonder why both networks behave differently, since in theory , they should be the same 🤔

sepolia-legacy-missmatch.mp4

@blackdevelopa
Copy link
Contributor Author

Hey @seaona thanks for the QA feedback. Here's an update

Screen.Recording.2023-10-03.at.17.14.46.mov

@seaona
Copy link
Contributor

seaona commented Oct 4, 2023

thank you @blackdevelopa I also see the issue fixed

sepolia-gas.mp4

@seaona seaona added the QA Passed A successful QA run through has been done label Oct 4, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

@blackdevelopa blackdevelopa merged commit d25c011 into main Oct 4, 2023
26 checks passed
@blackdevelopa blackdevelopa deleted the 7290/legacy_gas_mismatch branch October 4, 2023 12:52
@github-actions github-actions bot locked and limited conversation to collaborators Oct 4, 2023
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Oct 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done release-7.10.0 team-confirmations-secure-ux-PR PR from the confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants