0%
SupportWallet Services
How to Fix Precheck failed Errors

How to Fix Precheck failed Errors

Written by Author headshotLiang
Published on August 25, 20242 min read

The following precheck failed errors are typically related to gas and/or fees.

Our Bundler follows the standard ERC 4337 implementation for gas and fee checks to:

  1. Ensure your userOp lands on chain and;

  2. Protect the bundler from potential attacks in order to support scalability

There are many different checks bundlers run before accepting a UO.

For all possible precheck violations see here.

Below are common pre-check errors including gas and fees being too low or too high.

Here are a few example error messages:

  • maxPriorityFeePerGas is X but must be at least XXXX

  • callGasLimit is X but must be at least XXXX

  • preVerificationGas is X but must be at least XXX

  • maxFeePerGas is X but must be at least XXX

Our bundler currently rejects upon sending userOps if they are underpriced compared to the network rate to ensure inclusion in a block. These errors are often related to market movement between the time gas and fees are estimated and the time when userOps are submitted to the bundler. This issue is especially prevalent on testnets.

  • If you are using Alchemy's infra for AA:

    • recommended — use an Alchemy client via any of the create*AlchemyClient (e.g. createLightAccountAlchemyClient)

    • alternative — if for some reason you must use createSmartAccountClient, import the alchemyFeeEstimator middleware from aa-alchemy or account-kit/infra (depending on which version of the SDK you're on), and override the feeEstimator field in your client constructor

  • Implement retries

    • Re-estimate, sign and send the user operation with updated gas and fee fields

  • Add a multiplier

Here are a few example error messages:

  • verificationGasLimit is X but must be at most XXX

  • total gas limit is X but must be at most XXX

Gas limits are based on the max block size and max transaction size per chain. We make sure a single op is not larger than the max bundle gas and also that the combination of user operations being bundled are not larger. Total gas limit is checked against the aggregate between preVerificationGasverificationGasLimit, and callGasLimit.

To reduce the gas needed, try reducing the size of your call data and/or sending your call data in multiple UserOperations rather than one.

Was this article helpful?
Share:
Banner background image

Not finding what you need?