Repository navigation
feat(transaction-pay-controller): add buffer to max gas station cost - #11434
Merged
Merged
Conversation
matthewwalsh0
force-pushed
the
feat/gas-station-buffer
branch
from
November 11, 2026 14:32
da5b2ff to
12ee73e
Compare
matthewwalsh0
marked this pull request as ready for review
November 11, 2026 16:50
2 of 4 tasks
Reserve a configurable buffer (confirmations_pay_extended.gasStationCostBuffer, default 1.0) on top of the probe gas cost, and remove the gas limit checks on the adjusted quote since the affordability check already covers any gas cost change.
matthewwalsh0
force-pushed
the
feat/gas-station-buffer
branch
from
November 11, 2026 18:03
56020f0 to
771a44d
Compare
matthewwalsh0
enabled auto-merge
November 11, 2026 19:06
OGPoyraz
approved these changes
Nov 11, 2026
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.
Explanation
For max-amount quotes where the user can't cover origin gas in native token,
RelayStrategyuses a gas station flow: it prices gas in the source token with a smaller probe quote, then re-quotes with the source amount reduced by that cost. The adjusted quote is only accepted if validation passes, otherwise the original max quote is used.Our gas estimate varies slightly between quotes (e.g. +22 gas out of ~970k), and for multi-item quotes the source-token gas cost is Sentinel's rate × our gas estimate. With nothing reserved beyond the probe's cost, the adjusted quote regularly failed affordability by a handful of raw units. Separately, the adjusted quote was rejected whenever its total gas limit exceeded the phase-1 quote's, even when it was below the probe's.
This change:
confirmations_pay_extended.gasStationCostBuffer(a multiplier, defaults to1.0, i.e. no buffer until configured).References
Checklist
Note
Medium Risk
Changes max-amount quote math and acceptance rules in RelayStrategy; misconfigured buffer could reduce spendable amount or accept quotes that previously fell back to phase 1.
Overview
Relay max-amount gas station now reserves extra headroom on top of the probe quote’s gas cost when computing the phase-2 source amount, and no longer rejects adjusted quotes based on gas-limit shape or totals between phases.
A new feature flag
confirmations_pay_extended.gasStationCostBuffer(multiplier, default1.0) drivesgetGasStationCostBuffer(); values below1fall back to the default. Phase-2 acceptance still requires source gas-fee-token pricing and the existing affordability check.Tests and changelog document the new flag and updated fallback vs phase-2 expectations when gas limits or costs drift slightly.
Reviewed by Cursor Bugbot for commit 771a44d. Bugbot is set up for automated code reviews on this repo. Configure here.