Repository navigation
fix(bundler): make default maxFeePerGas floor chain-aware - #19
Open
Alicepoltora wants to merge 1 commit into
Open
Alicepoltora wants to merge 1 commit into
Alicepoltora wants to merge 1 commit into
Conversation
Fixes circlefin#15 prepareUserOperation used a hardcoded 3 gwei maxFeePerGas floor when neither the caller-supplied partialUserOp fields nor a custom estimateFeesPerGas callback provided fees. On L2s where base fees sit well below 1 gwei this inflates the worst-case spend (gasLimit x maxFeePerGas) that Gas Station policies check by 100-500x, rejecting otherwise-trivial UserOperations with a budget of ~0.01 USDC. Add defaultMaxFeePerGasFor(chainId) applying a 0.05 gwei floor on L2 chains where sub-gwei base fees are routine (Base, Base Sepolia, Arbitrum One and Sepolia, Optimism and OP Sepolia, Polygon and Amoy) and keep the conservative L1-tuned 3 gwei default for Ethereum mainnet and unknown chains. The max(estimated x 2) clamp is unchanged, so when the node estimates non-trivial fees they still win. The custom estimateFeesPerGas override path is untouched.
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.
Summary
Fixes #15
prepareUserOperationused a hardcoded 3 gweimaxFeePerGasfloor when neither the caller-suppliedpartialUserOpfields nor a customestimateFeesPerGascallback provided fees. On L2s where base fees sit well below 1 gwei (Base, Arbitrum, Optimism regularly see 0.001–0.1 gwei) this inflates the worst-case spend (gasLimit × maxFeePerGas) that Gas Station policies check by 100–500×, rejecting otherwise-trivial UserOperations with a typical ~0.01 USDC budget.Changes
defaultMaxFeePerGasFor(chainId): 0.05 gwei floor on L2s with routine sub-gwei base fees (Base / Base Sepolia, Arbitrum One / Sepolia, Optimism / OP Sepolia, Polygon / Amoy); keep the 3 gwei L1-tuned default for Ethereum mainnet and unknown chainsmax(estimated × 2)clamp is unchanged — when the node estimates non-trivial fees they still winestimateFeesPerGasoverride path untouchedNotes
0.05 gweiis chosen as a floor that clears current L2 minimum base fees while being ~60× smaller than the old 3 gwei constant; on these chains a typical UserOp uses < 300k gas, so the checked worst-case spend drops from ~0.0009 ETH to ~0.000015 ETH — comfortably inside Gas Station budgets.