Check existing issues
Viem Version
2.48.4
Current Behavior
When using smartAccountClient with EntryPoint 0.7, the internal estimateUserOperationGas action explicitly ignores/strips maxFeePerGas and maxPriorityFeePerGas before calling the JSON-RPC method eth_estimateUserOperationGas. Strict bundlers (like Pimlico v2 endpoints) reject this payload with validation errors because they expect these string/hex properties to be defined in the user operation object for EP 0.7.
Root Cause Analysis
Looking at viem/account-abstraction/actions/bundler/estimateUserOperationGas.ts:
const request = account ? await getAction(client, prepareUserOperation, 'prepareUserOperation')({ ...parameters, parameters: [ 'authorization', 'factory', 'nonce', 'paymaster', 'signature', ], }) : parameters;
The parameters array explicitly passes only specific keys to prepareUserOperation. Because gas prices (maxFeePerGas, maxPriorityFeePerGas) are omitted here, the subsequent formatUserOperationRequest(request) outputs an operation object completely stripped of gas price fields.
While some bundlers fall back gracefully, strict RPC nodes enforce the presence of these fields in EntryPoint 0.7 schema validation, causing transaction flows to break entirely.
Expected Behavior
estimateUserOperationGas should retain maxFeePerGas and maxPriorityFeePerGas if they are already resolved or provided by the gasPrice middleware/arguments, instead of filtering them out before hitting client.request.
Steps To Reproduce
- Set up a smartAccountClient using custom middleware hooks.
- In the gasPrice middleware, return calculated maxFeePerGas and maxPriorityFeePerGas.
- Trigger an action that invokes estimateUserOperationGas.
- The bundler returns: Invalid input: expected string, received undefined at "params[0].userOp.maxFeePerGas".
Link to Minimal Reproducible Example
No response
Anything else?
Environment:
Viem Version: 2.48.4 (and newer v2 releases)
Bundler: Pimlico (v2 RPC endpoint)
EntryPoint: 0.7
Check existing issues
Viem Version
2.48.4
Current Behavior
When using smartAccountClient with EntryPoint 0.7, the internal estimateUserOperationGas action explicitly ignores/strips maxFeePerGas and maxPriorityFeePerGas before calling the JSON-RPC method eth_estimateUserOperationGas. Strict bundlers (like Pimlico v2 endpoints) reject this payload with validation errors because they expect these string/hex properties to be defined in the user operation object for EP 0.7.
Root Cause Analysis
Looking at viem/account-abstraction/actions/bundler/estimateUserOperationGas.ts:
const request = account ? await getAction(client, prepareUserOperation, 'prepareUserOperation')({ ...parameters, parameters: [ 'authorization', 'factory', 'nonce', 'paymaster', 'signature', ], }) : parameters;The parameters array explicitly passes only specific keys to prepareUserOperation. Because gas prices (maxFeePerGas, maxPriorityFeePerGas) are omitted here, the subsequent formatUserOperationRequest(request) outputs an operation object completely stripped of gas price fields.
While some bundlers fall back gracefully, strict RPC nodes enforce the presence of these fields in EntryPoint 0.7 schema validation, causing transaction flows to break entirely.
Expected Behavior
estimateUserOperationGasshould retainmaxFeePerGasandmaxPriorityFeePerGasif they are already resolved or provided by thegasPricemiddleware/arguments, instead of filtering them out before hittingclient.request.Steps To Reproduce
Link to Minimal Reproducible Example
No response
Anything else?
Environment:
Viem Version: 2.48.4 (and newer v2 releases)
Bundler: Pimlico (v2 RPC endpoint)
EntryPoint: 0.7