Introducing User Operation Overrides
Account Abstraction lets users use smart contract accounts as wallets instead of traditional Externally Owned Accounts (EOAs). When initiating transactions from a smart contract account, User Operations (UserOps or UOs) contain the transaction details similar to regular transactions: sender
, to
, calldata
, maxFeePerGas
, maxPriorityFee
, signature
, and nonce
.
Because smart contract accounts rely on Bundlers to execute transactions on their behalf, user operations also contain a new set of fields for estimating gas and sponsoring gas with paymasters including: callGasLimit
, verificationGasLimit
, preVerificationGas
, and paymasterAndData
.
Today, we’re launching User Operation Overrides to give developers fine grain control over gas fees. Gas fee markets move fast on L2s, and when that happens pending UOs might fail.
UO Overrides enable you to override gas estimates to get stronger guarantees that UserOps are mined, regardless of gas estimates that are misaligned with actual gas costs.
What User Operation Overrides Do:
By overriding a gas fee estimate, which incorporates a lot of complex inputs and therefore can be hard to estimate accurately, you can get stronger guarantees that your UserOp will successfully be mined regardless of gas fluctuations by setting absolute or multiplier-based override values.
What are the benefits of User Operation Overrides?
The two main developer benefits of UO Overrides are streamlining the complexity of estimating gas and paymaster values, and increasing the likelihood of UOs getting mined during periods of fee market volatility.
1. Streamline complexity
Today, estimating the right gas fee means incorporating six different gas types, making it hard to get a gas estimate “right”. With Fee Overrides, devs set the parameter to override gas estimates at a certain threshold, so UserOps are mined, regardless of how accurate your estimate was.
2. Own your outcomes
One pain point of using the aa-sdk to date has been that when the network got busy, teams would ask Alchemy engineers to take care of gas estimation and UserOp success for them.
With User Operation Overrides, teams can now choose what UserOps are most important, and set custom override values with greater control to increase the likelihood that their UOs are mined successfully.
What are the features of User Operation Overrides?
User Operation Overrides allow the specification of override values for:
maxFeePerGas
maxPriorityFeePerGas
callGasLimit
preVerificationGas
verificationGasLimit
paymasterAndData
Developers building with Alchemy's AA SDK can use User Operation Overrides with any Bundler or Paymaster!
How do User Operation Overrides work?
Override values are available from each middleware of the SmartAccountProvider
. For example, the default middlewares
such as gasEstimator
or feeDataGetter
apply the overrides values to the estimated values if the override values are provided.
Other than the paymasterAndData
field, the override fields could be either the absolute value or the multiplier value. In the default middlewares, if the override value is an absolute value, it simply overrides the estimated value.
If the override value is a multiplier value, the estimated value is bumped with the indicated multiplier value. For example, if the override value is { multiplier: 1.1 }
for the maxPriorityFeePerGas
field, then a 1.1 multiplier, or a 10% increase, is applied to the estimated maxPriorityFeePerGas
of the user operation.
To get started, explore the User Operation Override docs!
Related articles
The Graph's Hosted Service is Shutting Down - Migrate Now
Migrate your hosted subgraph from The Graph to Alchemy by June 12th and get personalized migration assistance.
Polygon Mumbai Support Ending April 13th - Migrate to Amoy
Polygon will deprecate the Mumbai testnet on April 13th, 2024. We encourage developers to migrate to Polygon Amoy immediately.
Polygon zkEVM Testnet Support Ends April 6 - Migrate to Sepolia
Polygon zkEVM Cardona is now supported on Alchemy! Support for the Polygon zkEVM Goerli testnet ends April 6th. Migrate today.