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: Use gasLimitNoBuffer on network fee estimation #29502

Merged
merged 21 commits into from
Jan 20, 2025

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Jan 8, 2025

Description

While estimating gas for the transaction we add 50% gas limit buffer. With this PR we want to show network fee without gas limit buffer using gasLimitNoBuffer property on transactionMeta.

Open in GitHub Codespaces

Related issues

Fixes: /~https://github.com/MetaMask/MetaMask-planning/issues/3773

Manual testing steps

N/A

Screenshots/Recordings

In the recording you will see that gasLimitNoBuffer used over txParams.gas. Please see that txParams.gas is greater than gasLimitNoBuffer. This calculation leads lower value in the UI.

Screen.Recording.2025-01-08.at.13.12.30.mov

Before

After

Pre-merge author checklist

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 requested a review from a team as a code owner January 8, 2025 12:04
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jan 8, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [d96d86b]
Page Load Metrics (1734 ± 47 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30719131610420202
domContentLoaded1508188617059746
load1519190317349847
domInteractive279435157
backgroundConnect783312210
firstReactRender1673392311
getState56016168
initialActions00000
loadScripts1114142712779546
setupStore65713157
uiStartup17992369200213163

@metamaskbot
Copy link
Collaborator

Builds ready [44608df]
Page Load Metrics (1756 ± 63 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26120381597455219
domContentLoaded15371958172512761
load15741988175613163
domInteractive25134472914
backgroundConnect7147313216
firstReactRender17107513115
getState596272814
initialActions01000
loadScripts10991506129111756
setupStore65411105
uiStartup181327562118290139

matthewwalsh0
matthewwalsh0 previously approved these changes Jan 8, 2025
gasPrice,
maxPriorityFeePerGas,
maxFeePerGas,
baseFeePerGas,
} = {}) {
const minimumGasLimit = gasLimitNoBuffer ?? gasLimit;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant to my comment in the core PR, we wouldn't need the fallback here if we always populated gasLimitNoBuffer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link

socket-security bot commented Jan 20, 2025

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/transaction-controller@43.0.0 🔁 npm/@metamask/transaction-controller@42.1.0 None 0 2.18 MB metamaskbot

View full report↗︎

@metamaskbot
Copy link
Collaborator

Builds ready [60b0af0]
Page Load Metrics (1793 ± 99 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint25122321643470226
domContentLoaded13812226177320398
load13982232179320599
domInteractive23103432010
backgroundConnect55918178
firstReactRender1795392713
getState55219189
initialActions01000
loadScripts9681739130917886
setupStore65817189
uiStartup163825152070237114
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 84 Bytes (0.00%)
  • common: 118 Bytes (0.00%)

@OGPoyraz OGPoyraz added this pull request to the merge queue Jan 20, 2025
Merged via the queue into main with commit 5887e05 Jan 20, 2025
72 checks passed
@OGPoyraz OGPoyraz deleted the feat/use-gasLimitNoBuffer-on-estimations branch January 20, 2025 11:34
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2025
@metamaskbot metamaskbot added the release-12.12.0 Issue or pull request that will be included in release 12.12.0 label Jan 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.12.0 Issue or pull request that will be included in release 12.12.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants