bundlerClient.sendUserOperation
pays way too much for gas
#3431
johanneskares
started this conversation in
General
Replies: 2 comments 7 replies
-
This is because 4337 bundlers are unfortunately very brittle and some break when a fee is set below a price of 3 gwei 😅 |
Beta Was this translation helpful? Give feedback.
6 replies
-
There should be a fat warning somewhere, I spent over 100 USD on gas today since it way overspent on gas 😬 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Check existing issues
Viem Version
2.23.6
Current Behavior
When sending a transaction using
bundlerClient.sendUserOperation
the gas price is way to high.Here's a AA transaction, that was created using
sendUserOperation
on Base. Gas Price was over 1 Gwei.https://basescan.org/tx/0xe1c9399343ea62ebf247492d6c8efc1c3e16ac38118b78cdeda1887333d8cc3b
The corresponding Bundler TX has only a gas price of 0.003 Gwei, so a 300x difference, so I massively overpaid the bundler.
https://basescan.org/tx/0x607f66017375f1eb655f931fdffb39e9ab6d349a9c60a1544d1869c979e9f01d
I tried it with both Pimlico Bundler and Coinbase Bundler, same result.
My quick fix was to do this
Is it possible that this should be Math.min? :
viem/src/account-abstraction/actions/bundler/prepareUserOperation.ts
Line 442 in c52c8ed
Currently,
prepareUserOperation
returns at least 3 Gwei for maxFeePerGas, doesn't really make sense.Expected Behavior
Gas Price for sendUserOperation should be close to current gas price.
Steps To Reproduce
Use bundlerClient.sendUserOperation and send a transaction.
Link to Minimal Reproducible Example
No response
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions