Skip to content

Commit

Permalink
make a should check prefund flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Jan 30, 2025
1 parent 3d7de1f commit b69d5d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cli/config/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export const bundlerArgsSchema = z.object({
)}`
),
"enable-instant-bundling-endpoint": z.boolean(),
"enable-experimental-7702-endpoints": z.boolean()
"enable-experimental-7702-endpoints": z.boolean(),
"should-check-prefund": z.boolean()
})

export const executorArgsSchema = z.object({
Expand Down
6 changes: 6 additions & 0 deletions src/cli/config/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ export const bundlerOptions: CliCommandOptions<IBundlerArgsInput> = {
"Should the bundler enable the pimlico_experimental_sendUserOperation7702 and pimlico_experimental_estimateUserOperationGas7702 endpoint",
type: "boolean",
default: false
},
"should-check-prefund": {
description:
"Should the bundler check userOp's prefund before accepting it",
type: "boolean",
default: true
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/rpc/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,10 @@ export class RpcHandler implements IRpcEndpoint {
})
}

const shouldCheckPrefund =
apiVersion !== "v1" || this.config.shouldCheckPrefund
const validationResult = await this.validator.validateUserOperation({
shouldCheckPrefund: apiVersion !== "v1",
shouldCheckPrefund,
userOperation,
queuedUserOperations,
entryPoint
Expand Down

0 comments on commit b69d5d4

Please sign in to comment.