Skip to main content

Bundler Error Codes

If a UserOperation is valid, the bundler return the calculated userOpHash for it. In case of failure, the bundler return an error result object, with code and message.

Here are the common error codes as defined by the protocol. These error codes supplement the standard JSON-RPC error codes that are typically returned in response to an incorrect method call.

Additionally, many of these errors will be accompanied by an extra error message provided by the Entrypoint.

Invalid UserOp Error Codes​

CodeDescription
-32500Transaction rejected by entryPoint’s simulateValidation, during wallet creation or validation. The message field is set the FailedOp’s “AAxx” error message from the EntryPoint.
-32501Transaction rejected by paymaster’s validatePaymasterUserOp
-32502Transaction rejected because of opcode validation
-32503UserOperation out of time-range: either wallet or paymaster returned a time-range, and it is already expired (or will expire soon)
-32504Transaction rejected because paymaster (or signature aggregator) is throttled or banned
-32505Transaction rejected because paymaster (or signature aggregator) stake or unstake-delay is too low
-32506Transaction rejected because wallet specified unsupported signature aggregator
-32507Transaction rejected because of wallet signature check failed (or paymaster signature, if the paymaster uses its data as signature)
-32508Transaction rejected because paymaster balance cannot cover all pending UserOperations
-32521Transaction was reverted during the execution phase
-32602Invalid UserOperation struct/fields

Standard JSON-RPC Error Codes​

CodeDescription
-32700Parse error: the request body is not valid JSON
-32600Invalid request, or the method is not supported by this endpoint
-32601Method not found
-32602Invalid params, including an invalid UserOperation struct or fields
-32603Internal error. Retry the request, and contact us if it persists

Handling Bundler Errors in AbstractionKit​

AbstractionKit throws bundler failures as an AbstractionKitError with code: "BUNDLER_ERROR". The numeric code is on errno, and cause is a nested AbstractionKitError whose code names the specific error:

Bundler codeerror.cause.code
-32500SIMULATE_VALIDATION
-32501SIMULATE_PAYMASTER_VALIDATION
-32502OPCODE_VALIDATION
-32503EXPIRE_SHORTLY
-32504REPUTATION
-32505INSUFFICIENT_STAKE
-32506UNSUPPORTED_SIGNATURE_AGGREGATOR
-32507INVALID_SIGNATURE
-32508PAYMASTER_DEPOSIT_TOO_LOW
-32521EXECUTION_REVERTED
-32602INVALID_FIELDS
-32601METHOD_NOT_FOUND
-32603INTERNAL_ERROR
Any otherUNKNOWN_ERROR

When the message carries an EntryPoint revert code, it is also exposed on error.aaCode (for example "AA21").

The JSON-RPC error the bundler returned is one level further down, on error.cause.cause. Its code is the numeric bundler code, and its data holds the error's data field when the bundler sends one.

The paymaster clients report a paymaster rejection during gas estimation as PAYMASTER_ERROR instead, with the bundler error as its cause. See paymaster error handling.

import { AbstractionKitError } from "abstractionkit";

try {
await bundler.sendUserOperation(userOperation, entrypointAddress);
} catch (error) {
if (error instanceof AbstractionKitError && error.code === "BUNDLER_ERROR") {
const cause = error.cause as AbstractionKitError | undefined;
if (cause?.code === "PAYMASTER_DEPOSIT_TOO_LOW") {
// retry later or contact the paymaster provider
}
}
}