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

feat: retrieve layer 1 gas fee from transaction controller #23521

Merged
merged 40 commits into from
Apr 15, 2024

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Mar 15, 2024

Description

This PR is aiming to implement OptimismLayer1GasFeeFlow as a first use of transactionMeta.layer1GasFee. Hence it contains removal of fetchEstimatedL1Fee function and it's helper functions.

New transaction-controller version also includes a getLayer1GasFee function which could be used to obtain layer1GasFeeValue for un-existing transactions. This is being used in swaps controller.

Optimism Layer 1 Gas Fee Flow PR in core: MetaMask/core#4055

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1945

Manual testing steps

This PR should not affect existing gas component that shows Layer1GasFee amount which appear on send flow, confirmation page & swaps. Hence manually testing any transaction on Optimism will work fine.

Screenshots/Recordings

Before

N/A

After

N/A

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.

@OGPoyraz OGPoyraz changed the title Use transaction meta layer1GasFee feat: Use transaction meta layer1GasFee Mar 19, 2024
@OGPoyraz OGPoyraz changed the title feat: Use transaction meta layer1GasFee feat: use transaction meta layer1GasFee Mar 19, 2024
@OGPoyraz OGPoyraz added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Mar 19, 2024
@OGPoyraz OGPoyraz marked this pull request as ready for review March 19, 2024 10:14
@OGPoyraz OGPoyraz requested review from kumavis and a team as code owners March 19, 2024 10:14
@OGPoyraz OGPoyraz marked this pull request as draft March 19, 2024 10:35
@OGPoyraz
Copy link
Member Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

@sleepytanya
Copy link
Contributor

Dev build git id, Chrome, Firefox - Optimism Layer1 Gas fees displayed in the Send flow:
Screenshot 2024-03-19 at 12 56 53 PM
Screenshot 2024-03-19 at 12 55 51 PM

Update calls to getLayer1GasFee to use request object.
Remove unnecessary simulation logic.
@matthewwalsh0 matthewwalsh0 changed the title feat: use transaction meta layer1GasFee feat: retrieve layer 1 gas fee from transaction controller Apr 11, 2024
@matthewwalsh0
Copy link
Member

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

matthewwalsh0
matthewwalsh0 previously approved these changes Apr 12, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [449f256]
Page Load Metrics (1319 ± 529 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint743271465928
domContentLoaded167434188
load65246413191101529
domInteractive167434188
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 113.69 KiB (3.32%)
  • ui: -1.99 KiB (-0.03%)
  • common: -691 Bytes (-0.01%)

cryptotavares
cryptotavares previously approved these changes Apr 12, 2024
@cryptotavares
Copy link
Contributor

why do we still need the getIsMultiLayerFeeNetwork selector? Couldn't we just tell if the layer1GasFee is not undefined? 🤔

@matthewwalsh0
Copy link
Member

matthewwalsh0 commented Apr 12, 2024

why do we still need the getIsMultiLayerFeeNetwork selector? Couldn't we just tell if the layer1GasFee is not undefined? 🤔

That's exactly the plan in a pending branch as it requires alot of additional changes also and test updates etc.

@sleepytanya
Copy link
Contributor

Latest build - Optimism Layer1 fees displayed on confirmations screen:

Screenshot 2024-04-12 at 12 11 51 PM Screenshot 2024-04-12 at 12 22 49 PM

@matthewwalsh0 matthewwalsh0 dismissed stale reviews from cryptotavares and themself via 50e0dcc April 15, 2024 12:04
@matthewwalsh0
Copy link
Member

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

@metamaskbot
Copy link
Collaborator

Builds ready [27b8937]
Page Load Metrics (1131 ± 690 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint634271598842
domContentLoaded1081372211
load50390311311437690
domInteractive1080372211
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 11.35 KiB (0.33%)
  • ui: -1.99 KiB (-0.03%)
  • common: 9.59 KiB (0.16%)

@matthewwalsh0 matthewwalsh0 merged commit f8b92ab into develop Apr 15, 2024
67 of 68 checks passed
@matthewwalsh0 matthewwalsh0 deleted the use-layer1gasfeeflow branch April 15, 2024 12:52
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2024
@metamaskbot metamaskbot added the release-11.16.0 Issue or pull request that will be included in release 11.16.0 label Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed release-11.16.0 Issue or pull request that will be included in release 11.16.0 team-confirmations-system DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants