Skip to content

feat: save custom gas settings#31649

Open
pedronfigueiredo wants to merge 1 commit into
mainfrom
pnf/save-custom-gas-settings
Open

feat: save custom gas settings#31649
pedronfigueiredo wants to merge 1 commit into
mainfrom
pnf/save-custom-gas-settings

Conversation

@pedronfigueiredo

@pedronfigueiredo pedronfigueiredo commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Persist custom gas fee settings from the advanced gas modals.
  • Read saved gas preferences when building fee options for send confirmations.
  • Wire mobile PreferencesController and TransactionController integration for saved gas fee preferences.

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 usePersistGasFeePreference calls PreferencesController.setAdvancedGasFee after gas updates in advanced modals and preset estimate hooks (alongside existing updateTransactionGasFees). Preferences init gains persisted advancedGasFee state and metadata.

Read path: TransactionController is wired with getSavedGasFees, loading preferences by normalized from address and chainId (skipped for MM Pay and unsupported levels like dapp-suggested).

Send flow: EVM submit is awaited; navigation to confirmations only runs after addTransaction succeeds, with an alert on failure. submitEvmTransaction returns transactionMeta.

Engine: ApprovalController is initialized via messenger (approval-controller-init) instead of wallet-only options; transaction init messenger includes GasFeeController:fetchGasFeeEstimates. Gas analytics map UserFeeLevel.DAPP_SUGGESTED to dapp_proposed.

Reviewed by Cursor Bugbot for commit 3cfc658. Bugbot is set up for automated code reviews on this repo. Configure here.

@pedronfigueiredo pedronfigueiredo requested review from a team as code owners June 12, 2026 16:33
@github-actions

Copy link
Copy Markdown
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.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jun 12, 2026
@mm-token-exchange-service mm-token-exchange-service Bot added team-confirmations Push issues to confirmations team INVALID-PR-TEMPLATE PR's body doesn't match template labels Jun 12, 2026
@mm-token-exchange-service

Copy link
Copy Markdown

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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),
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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.

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/save-custom-gas-settings branch from 54d7046 to 3cfc658 Compare June 12, 2026 17:03
@github-actions github-actions Bot added risk:high AI analysis: high risk and removed risk:medium AI analysis: medium risk labels Jun 12, 2026
@matthewwalsh0 matthewwalsh0 requested a review from dan437 June 13, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. risk:high AI analysis: high risk size-L team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant