From 491a454160f0af9030b312e3df56ba8ead7eb428 Mon Sep 17 00:00:00 2001 From: mouseless <97399882+mouseless-eth@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:47:49 +0000 Subject: [PATCH] remove signedAuthorization from v0.6 --- src/executor/utils.ts | 3 ++- src/rpc/estimation/gasEstimationsV06.ts | 10 ---------- src/rpc/validation/UnsafeValidator.ts | 1 - src/types/interfaces.ts | 1 - src/types/schemas.ts | 7 ++----- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/executor/utils.ts b/src/executor/utils.ts index 7ffc6325..51353995 100644 --- a/src/executor/utils.ts +++ b/src/executor/utils.ts @@ -17,6 +17,7 @@ import type { Logger } from "@alto/utils" import { getRevertErrorData, isVersion06, + isVersion07, parseViemError, scaleBigIntByPercent, toPackedUserOperation @@ -51,7 +52,7 @@ export const getAuthorizationList = ( ): SignedAuthorizationList | undefined => { const authorizationList = mempoolUserOperations .map((op) => { - if (op.eip7702Auth) { + if (isVersion07(op) && op.eip7702Auth) { return op.eip7702Auth } return undefined diff --git a/src/rpc/estimation/gasEstimationsV06.ts b/src/rpc/estimation/gasEstimationsV06.ts index 43d498ed..19b87262 100644 --- a/src/rpc/estimation/gasEstimationsV06.ts +++ b/src/rpc/estimation/gasEstimationsV06.ts @@ -21,8 +21,6 @@ import type { SimulateHandleOpResult } from "./types" import type { AltoConfig } from "../../createConfig" import { deepHexlify } from "../../utils/userop" import { parseFailedOpWithRevert } from "./gasEstimationsV07" -import { SignedAuthorizationList } from "viem/experimental" -import { addAuthorizationStateOverrides } from "@alto/utils" export class GasEstimatorV06 { private config: AltoConfig @@ -144,14 +142,6 @@ export class GasEstimatorV06 { } } - if (userOperation.eip7702Auth) { - stateOverrides = await addAuthorizationStateOverrides({ - stateOverrides, - authorizationList: [userOperation.eip7702Auth], - publicClient - }) - } - // Remove state override if not supported by network. if (!this.config.balanceOverride) { stateOverrides = undefined diff --git a/src/rpc/validation/UnsafeValidator.ts b/src/rpc/validation/UnsafeValidator.ts index 355f8e91..6cf883c6 100644 --- a/src/rpc/validation/UnsafeValidator.ts +++ b/src/rpc/validation/UnsafeValidator.ts @@ -46,7 +46,6 @@ import { fromZodError } from "zod-validation-error" import { GasEstimationHandler } from "../estimation/gasEstimationHandler" import type { SimulateHandleOpResult } from "../estimation/types" import type { AltoConfig } from "../../createConfig" -import { SignedAuthorizationList } from "viem/experimental" export class UnsafeValidator implements InterfaceValidator { config: AltoConfig diff --git a/src/types/interfaces.ts b/src/types/interfaces.ts index f36120da..c604094e 100644 --- a/src/types/interfaces.ts +++ b/src/types/interfaces.ts @@ -8,7 +8,6 @@ import type { UserOperationV07 } from "./schemas" import type * as validation from "./validation" -import { SignedAuthorizationList } from "viem/experimental" export interface InterfaceValidator { getExecutionResult(args: { diff --git a/src/types/schemas.ts b/src/types/schemas.ts index 6b95881e..66afeb4a 100644 --- a/src/types/schemas.ts +++ b/src/types/schemas.ts @@ -1,7 +1,6 @@ import { type Hash, type Hex, getAddress, maxUint256 } from "viem" import { z } from "zod" import type { MempoolUserOperation } from "./mempool" -import { SignedAuthorization } from "viem/experimental" const hexDataPattern = /^0x[0-9A-Fa-f]*$/ const addressPattern = /^0x[0-9,a-f,A-F]{40}$/ @@ -58,8 +57,7 @@ const userOperationV06Schema = z maxPriorityFeePerGas: hexNumberSchema, maxFeePerGas: hexNumberSchema, paymasterAndData: hexDataSchema, - signature: hexDataSchema, - eip7702Auth: signedAuthorizationSchema.optional() + signature: hexDataSchema }) .strict() .transform((val) => { @@ -118,8 +116,7 @@ const partialUserOperationV06Schema = z maxPriorityFeePerGas: hexNumberSchema.default(1n), maxFeePerGas: hexNumberSchema.default(1n), paymasterAndData: hexDataSchema, - signature: hexDataSchema, - eip7702Auth: signedAuthorizationSchema.optional() + signature: hexDataSchema }) .strict() .transform((val) => {