fix(transaction-controller): use node-authoritative gas estimation - #10245
Open
pedronfigueiredo wants to merge 3 commits into
Open
pedronfigueiredo wants to merge 3 commits into
pedronfigueiredo wants to merge 3 commits into
Conversation
pedronfigueiredo
marked this pull request as ready for review
September 15, 2026 13:56
matthewwalsh0
self-requested a review
September 15, 2026 14:04
matthewwalsh0
previously approved these changes
Sep 15, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 15, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 15, 2026
pedronfigueiredo
force-pushed
the
pnf/node-estimation-conf-1995
branch
from
September 15, 2026 16:15
b07b5d7 to
4f787cc
Compare
pedronfigueiredo
enabled auto-merge
September 15, 2026 16:15
…onf-1995 # Conflicts: # packages/transaction-controller/CHANGELOG.md
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
Transaction Controller currently skips
eth_estimateGasfor ordinary no-data transfers to recipients without code and assigns a fixed 21,000 gas limit. That assumption is not valid across transaction shapes and active fork rules, including EIP-2780 networks, and cannot account for node state such as account creation or delegation resolution.This change removes the fixed-gas shortcut so transactions without caller-provided gas use the selected network client's existing node/simulation estimation path. Caller-provided gas remains authoritative, and existing percentage/fixed-feature fallbacks plus
simulationFailsreporting are preserved when estimation fails.Specifically, this changes gas-limit estimation, not gas-price estimation. For an ordinary transaction without caller-provided
gas, Transaction Controller callseth_estimateGason the node selected bynetworkClientIdand may apply the existing gas buffer.gasPrice,maxFeePerGas, andmaxPriorityFeePerGascontinue to come from the existing gas-fee estimation flows; the eventual transaction fee combines those prices with the node-estimated gas limit.The focused test matrix covers legacy and upgraded node responses for self-transfers, zero-value transfers, existing and new recipients, contract creation, and delegated sender/recipient cases. It also verifies complete transaction-shape forwarding and estimation failure behavior. Existing type-4 composition remains unchanged because it is owned by CONF-1997.
Validation
yarn workspace @metamask/transaction-controller run testyarn buildyarn workspace @metamask/transaction-controller run buildyarn workspace @metamask/transaction-controller run changelog:validateReferences
Checklist
Note
Medium Risk
Changes default gas limits for many wallet-initiated sends, which affects fees and inclusion; wrong estimates could cause reverts, though fallbacks and explicit
gasremain.Overview
Gas limit estimation no longer short-circuits plain no-data transfers to empty recipients with a hard-coded
0x5208(21,000) limit. The removedrequiresFixedGas/eth_getCodepath andFIXED_GASexport are gone; when the caller does not setgas,updateGasalways goes throughestimateGason thenetworkClientIdclient (simulation when enabled, otherwiseeth_estimateGas), with existing buffers and failure fallbacks unchanged.Caller-provided
gasis still used as-is. Gas price flows are untouched. Tests and integration mocks now expecteth_estimateGasfor simple sends and cover varied shapes (self-transfer, new accounts, contract creation, EIP-7702 delegation). The changelog documents the behavior change.Reviewed by Cursor Bugbot for commit ab91ca6. Bugbot is set up for automated code reviews on this repo. Configure here.