fix: ignore underpriced saved gas fee preferences - #9705
Merged
cloudonshore merged 2 commits intoJul 30, 2026
Conversation
cloudonshore
merged commit Jul 30, 2026
63124d2
into
fix/underpriced-dapp-gas-fees
105 of 122 checks passed
Contributor
Author
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.
Note
Draft — there is a product decision to make here (see "The product decision" below). The mechanics are ready for review; the behavior on gate-fire (silently replace vs. replace + alert vs. warn-only) needs a product call before this leaves draft.
Explanation
Companion to #9704, which replaces underpriced dapp-suggested fees. This PR applies the same staleness gate to the other unguarded fee source: saved (advanced) gas fee preferences.
A saved custom preference is a static
maxBaseFeecaptured at some point in the past. Network conditions move; the preference doesn't. Once the base fee rises past the saved value, every transaction priced from it is unlikely to be included before fee conditions change further, and typically ends up stuck as pending until timeout mechanisms mark it failed — with no actionable feedback. Unlike the dapp case, nothing else guards this source: #9704 deliberately excludessavedGasFees, andhasInitialGasFeeParamsonly protects transactions that carry explicit fee params (saved fees apply precisely when they don't).This is increasingly relevant: clients are expanding saved-preference usage (e.g. per-account custom gas settings persisted from the confirmation flow, and #9682 extending saved fees to wallet-initiated transfers), which grows the surface a stale value can underprice.
Behavior (flag-gated, disabled by default):
maxBaseFeebelow the current low estimate, the saved preference is ignored for this transaction and the suggested (medium) values are used instead.low/medium/high) are never touched — they track current estimates by construction and are the recommended shape for persistent preferences.userFeeLevelbecomesmediuminstead ofcustom, which also opts the transaction intoGasFeePollerrefresh while unapproved.The product decision
Overriding a value the user saved is a stronger intervention than overriding a dapp's computed value, and there are three defensible behaviors when the gate fires:
An argument that we should intervene (option 1 or 2) rather than defer entirely to the saved value: saved preferences already do not grant full autonomy. The controller already ignores them for swaps and bridges (
SAVED_GAS_FEES_IGNORED_TRANSACTION_TYPES, #9401/#9682) — explicitly because a saved fee could underprice aggregator-priced transactions — and already yields them to explicit fee params (hasInitialGasFeeParams, #8993). The established principle is that saved preferences apply where they can work and yield where they would predictably break the transaction. A custommaxBaseFeebelow the current low estimate is the clearest possible instance of "would predictably break the transaction" — extending the same principle to it is consistent, not a new precedent.The same known edge case as #9704 applies (fee bump vs. max-spend arithmetic); see the balance-clamp proposal there — it covers both gates.
References
Checklist