fix(confirmations): stabilize cancel/speed-up gas estimates#41437
Open
vinistevam wants to merge 1 commit intomainfrom
Open
fix(confirmations): stabilize cancel/speed-up gas estimates#41437vinistevam wants to merge 1 commit intomainfrom
vinistevam wants to merge 1 commit intomainfrom
Conversation
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. |
Contributor
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (5 files, +157 -229)
|
|
Contributor
Builds ready [2d50909]
⚡ Performance Benchmarks (Total: 🟢 18 pass · 🟡 0 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Cancel and speed-up use network gas estimates to choose between the medium fee level and a +10% bump. That path must only consume estimates in the shape returned by the gas fee layer (decimal GWEI fields such as
suggestedMaxFeePerGas). A separate shape on transaction metadata (hex WEImaxFeePerGasper level) is not interchangeable.Problem
gasEstimateGreaterThanGasUsedPlusTenPercentcould be wrong or misleading.networkClientIdwas derived from network configuration even though it is already present on transaction metadata.useSupportsEIP1559).Solution
networkClientIdfrom the effective transaction (store or prop) and pass it intouseGasFeeEstimates.isGasEstimatesLoadingfrom cancel/speed-up gas state and skip initial gas application until loading finishes (alongside existing app loading guard).useSupportsEIP1559.Changelog
CHANGELOG entry: Fixed reliability of gas handling when canceling or speeding up a pending transaction
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1007
Manual testing steps
gasPricetransaction.Screenshots/Recordings
fix_ethe_mainnet_cancel.webm
fix_base_cancel.webm
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches cancel/speed-up fee selection and legacy/EIP-1559 branching, which can affect replacement transaction fees and user ability to unstick transactions. Changes are localized and covered by updated tests, but regressions could impact transaction confirmation behavior.
Overview
Cancel/Speed-up now waits for valid network gas estimates before applying the initial fee rule. The cancel/speed-up modal wires through
isGasEstimatesLoadingfromuseGasFeeEstimatesanduseCancelSpeedupGasState, anduseCancelSpeedupInitialGasskips applying medium-vs-+10% logic while estimates are still loading.Gas estimate sourcing and flow selection were tightened.
useCancelSpeedupGasStatenow takesnetworkClientIddirectly from the effective transaction when callinguseGasFeeEstimates(removing network config derivation/fallback), and legacy vs EIP-1559 routing is based onuseSupportsEIP1559rather than checking formaxFeePerGas. Tests were updated/added to cover the new loading guard and EIP-1559 support branching.Written by Cursor Bugbot for commit 2d50909. This will update automatically on new commits. Configure here.