Skip to content

Commit

Permalink
remove signedAuthorization from v0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Jan 23, 2025
1 parent 69176a0 commit 491a454
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
3 changes: 2 additions & 1 deletion src/executor/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type { Logger } from "@alto/utils"
import {
getRevertErrorData,
isVersion06,
isVersion07,
parseViemError,
scaleBigIntByPercent,
toPackedUserOperation
Expand Down Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/rpc/estimation/gasEstimationsV06.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/rpc/validation/UnsafeValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/types/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
7 changes: 2 additions & 5 deletions src/types/schemas.ts
Original file line number Diff line number Diff line change
@@ -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}$/
Expand Down Expand Up @@ -58,8 +57,7 @@ const userOperationV06Schema = z
maxPriorityFeePerGas: hexNumberSchema,
maxFeePerGas: hexNumberSchema,
paymasterAndData: hexDataSchema,
signature: hexDataSchema,
eip7702Auth: signedAuthorizationSchema.optional()
signature: hexDataSchema
})
.strict()
.transform((val) => {
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 491a454

Please sign in to comment.