fix/mantle lack operator fee#8837
Merged
Merged
Conversation
d661f99 to
08620b9
Compare
Julink-eth
previously approved these changes
May 19, 2026
5b00cd4 to
f7003fe
Compare
Julink-eth
previously approved these changes
May 20, 2026
…d` is missing `OracleLayer1GasFeeFlow` skipped the operator-fee oracle call whenever `transactionMeta.gasUsed` was unset. Mantle has no value for `gasUsed` during the pre-confirmation lifecycle, so the operator fee silently collapsed to zero and the displayed L1 fee under-reported the actual on-chain cost. Expose a `protected getOperatorFeeGas` hook on the base flow so subclasses can supply a fallback value, and override it in `MantleLayer1GasFeeFlow` to fall back to `txParams.gas` (or `txParams.gasLimit`) when `gasUsed` is not available. Gas limit is an upper bound on actual gas used, so the resulting operator fee over-estimates rather than under-reports.
OGPoyraz
previously approved these changes
May 27, 2026
f7003fe to
7a0ebd5
Compare
OGPoyraz
approved these changes
May 28, 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
We observed the confirmation screen showing
0.10 MNTfor a transaction that ended up costing0.12 MNT— the ~0.02 MNT delta is the operator-fee component of Mantle's Arsia gas model, which never reached the displayed total.Root cause is in
OracleLayer1GasFeeFlow.#getOperatorLayer1GasFee: the method skips the operator-fee oracle call whenevertransactionMeta.gasUsedis unset. That field is populated by the transaction simulation backend, and Mantle is not in its supported-networks list —getBalanceChangesthrowsSimulationChainNotSupportedError, the catch returnsgasUsed: undefined, and the operator-fee path silently collapses to zero for the entire pre-confirmation lifecycle (initial render, gas-fee poller re-poll, edit-gas). The UI sumslayer1GasFeestraight into the displayed total inuseFeeCalculations.ts, so the dropped operator fee flows directly to the user.The fix introduces a
protected getOperatorFeeGashook onOracleLayer1GasFeeFlow. The base default returnstransactionMeta.gasUsed, soOptimismLayer1GasFeeFlow,ScrollLayer1GasFeeFlow, and any other current or future subclass keep their existing behaviour.MantleLayer1GasFeeFlowoverrides the hook to fall back totxParams.gas ?? txParams.gasLimitwhengasUsedis unavailable.The transaction's gas limit is an upper bound on actual gas used (it carries the
updateGasbuffer when populated by the controller, and is the caller-supplied value otherwise). Mantle's operator-fee oracle is strictly linear in its input gas (verified on-chain at0x420000000000000000000000000000000000000F—getOperatorFee(21000) = 2.1e14,getOperatorFee(500000) = 5e15, same per-gas rate), so the operator fee returned for a gas-limit input is an upper bound on the realised operator fee. The displayed total will be a hair above the actual on-chain cost rather than under-reporting it. This matches the over-estimate direction already used for the Optimism L1 data fee.Caller coverage with the override in place:
addTransactionflow):updateGaspopulatestxParams.gasin#updateGasPropertiesbeforeupdateTransactionLayer1GasFeeruns in the same method.GasFeePoller10s re-poll: reads the sametxParams.gasfrom state.updateEditableParams(user edits gas): uses the newtxParams.gasafter the edit.bridge-controller'sappendL1GasFeesis allowlisted to Optimism + Base only today, so Mantle quotes don't reach this code. The?? gasLimitarm future-proofs the bridgegetLayer1GasFeecall shape if Mantle is added later.References
Fixes the operator-fee under-reporting flagged by the Mantle team following the Arsia gas model rollout.
Checklist
Note
Low Risk
Localized gas-estimation change with default behavior unchanged for other chains; Mantle may show slightly high fees when using gas limit fallback.
Overview
Fixes Mantle confirmation totals omitting the Arsia operator fee when
transactionMeta.gasUsedis missing (e.g. Mantle unsupported by simulation), which previously skippedgetOperatorFeeand under-reportedlayer1GasFee.OracleLayer1GasFeeFlownow routes operator-fee oracle input through aprotected getOperatorFeeGashook (default stillgasUsed).MantleLayer1GasFeeFlowoverrides it withgasUsed ?? txParams.gas ?? txParams.gasLimitso pre-confirmation estimates still call the oracle; using gas limit slightly over-estimates rather than under-shows the fee. Tests and changelog updated accordingly.Reviewed by Cursor Bugbot for commit 7a0ebd5. Bugbot is set up for automated code reviews on this repo. Configure here.