feat: save custom gas settings#31649
Conversation
|
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 586023b. Configure here.
| from: from as Hex, | ||
| to: toAddress as Hex, | ||
| value: normalizeAmount(value), | ||
| }); |
There was a problem hiding this comment.
Awaiting EVM submit blocks loader
High Severity
The EVM send path now awaits submitEvmTransaction before navigating to redesigned confirmations. That keeps the user on the send screen until addTransaction finishes and delays mounting the transfer confirmation skeleton loader, which is meant to show while submission runs in the background.
Triggered by learned rule: Do not await submitEvmTransaction in send/confirm action hooks — blocks skeleton loader
Reviewed by Cursor Bugbot for commit 586023b. Configure here.
586023b to
54d7046
Compare
54d7046 to
3cfc658
Compare


Summary
Related PRs
Testing
yarn jest app/components/Views/confirmations/components/modals/advanced-eip1559-modal/advanced-eip1559-modal.test.tsx app/components/Views/confirmations/components/modals/advanced-gas-price-modal/advanced-gas-price-modal.test.tsx app/components/Views/confirmations/hooks/gas/useGasFeeEstimateLevelOptions.test.ts app/components/Views/confirmations/hooks/gas/useGasPriceEstimateOption.test.ts app/components/Views/confirmations/hooks/gas/usePersistGasFeePreference.test.ts app/core/Engine/controllers/preferences-controller-init.test.ts app/core/Engine/controllers/transaction-controller/metrics_properties/gas.test.ts app/core/Engine/controllers/transaction-controller/transaction-controller-init.test.ts(8 suites, 78 tests).Note
Medium Risk
Changes transaction gas defaults and persisted wallet state for all EVM sends; send navigation now depends on async addTransaction success, so regressions could affect fees or confirmation entry.
Overview
Adds per-account, per-chain persistence for gas choices so confirmations can reuse saved fee levels and custom EIP-1559 / legacy values on later sends.
Write path: New
usePersistGasFeePreferencecallsPreferencesController.setAdvancedGasFeeafter gas updates in advanced modals and preset estimate hooks (alongside existingupdateTransactionGasFees). Preferences init gains persistedadvancedGasFeestate and metadata.Read path:
TransactionControlleris wired withgetSavedGasFees, loading preferences by normalizedfromaddress andchainId(skipped for MM Pay and unsupported levels like dapp-suggested).Send flow: EVM submit is
awaited; navigation to confirmations only runs afteraddTransactionsucceeds, with an alert on failure.submitEvmTransactionreturnstransactionMeta.Engine:
ApprovalControlleris initialized via messenger (approval-controller-init) instead of wallet-only options; transaction init messenger includesGasFeeController:fetchGasFeeEstimates. Gas analytics mapUserFeeLevel.DAPP_SUGGESTEDtodapp_proposed.Reviewed by Cursor Bugbot for commit 3cfc658. Bugbot is set up for automated code reviews on this repo. Configure here.