fix: bump gas price multiplier and make it configurable #23
Open
livingrockrises wants to merge 4 commits into
Open
fix: bump gas price multiplier and make it configurable #23livingrockrises wants to merge 4 commits into
livingrockrises wants to merge 4 commits into
Conversation
…ndler fee rejections
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.
to prevent bundler fee rejections
Problem
Bundlers enforce a minimum maxFeePerGas at submission time based on current network conditions. Because base fee can tick up between when estimateFeesPerGas runs (inside prepareUserOperation) and when eth_sendUserOperation is actually called, a hardcoded low multiplier leaves no room for that drift — producing rejections.
Changes
Usage
gasPriceMultipliers is set once at client creation — every sendUserOperation / sendTransaction that flows through that client automatically gets buffered fees with no per-call changes needed.
// defaults (1.5× / 1.1×) apply automatically — no change needed
const client = createSmartAccountClient({ ... })
// custom — tighten or loosen per deployment
// call sites are unchanged
const hash = await smartAccountClient.sendUserOperation({ calls: [...] })
If maxFeePerGas and maxPriorityFeePerGas are both supplied explicitly on the sendUserOperation call, viem short-circuits fee estimation entirely and the multiplier is not applied — the provided values are used verbatim:
// multiplier is bypassed — values go through as-is