Skip to content

Commit

Permalink
prune unused flags (#428)
Browse files Browse the repository at this point in the history
Co-authored-by: mouseless <[email protected]>
  • Loading branch information
mouseless0x and mouseless0x authored Feb 5, 2025
1 parent 9a2bb13 commit 8a4e8f8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 53 deletions.
7 changes: 1 addition & 6 deletions src/cli/config/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ export const bundlerArgsSchema = z.object({
"min-entity-stake": z.number().int().min(0),
"min-entity-unstake-delay": z.number().int().min(0),

"max-bundle-wait": z.number().int().min(0),
"max-bundle-size": z.number().int().min(0),

"gas-price-bump": z
.string()
.transform((val) => BigInt(val))
.default("100"),
"gas-price-floor-percent": z.number().int().min(0),
"gas-price-expiry": z.number().int().min(0),
"gas-price-multipliers": z
.string()
Expand Down Expand Up @@ -193,8 +189,7 @@ export const debugArgsSchema = z.object({
"enable-debug-endpoints": z.boolean(),
"expiration-check": z.boolean(),
"dangerous-skip-user-operation-validation": z.boolean(),
"deploy-simulations-contract": z.boolean(),
tenderly: z.boolean()
"deploy-simulations-contract": z.boolean()
})

export const gasEstimationArgsSchema = z.object({
Expand Down
27 changes: 1 addition & 26 deletions src/cli/config/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,6 @@ export const bundlerOptions: CliCommandOptions<IBundlerArgsInput> = {
require: true,
default: 1
},
"max-bundle-wait": {
description: "Maximum time to wait for a bundle to be submitted (ms)",
type: "number",
require: true,
default: 1000
},
"max-bundle-size": {
description:
"Maximum number of operations allowed in the mempool before a bundle is submitted",
type: "number",
require: true,
default: 10
},
"safe-mode": {
description: "Enable safe mode (enforcing all ERC-4337 rules)",
type: "boolean",
Expand All @@ -63,13 +50,6 @@ export const bundlerOptions: CliCommandOptions<IBundlerArgsInput> = {
require: false,
default: "100"
},
"gas-price-floor-percent": {
description:
"The minimum percentage of incoming user operation gas prices compared to the gas price used by the bundler to submit bundles",
type: "number",
require: true,
default: 101
},
"gas-price-expiry": {
description:
"Maximum that the gas prices fetched using pimlico_getUserOperationGasPrice will be accepted for (seconds)",
Expand Down Expand Up @@ -417,6 +397,7 @@ export const rpcOptions: CliCommandOptions<IRpcArgsInput> = {
"max-block-range": {
description: "Max block range for getLogs calls",
type: "number",
default: 2000,
require: false
},
"block-tag-support": {
Expand Down Expand Up @@ -536,12 +517,6 @@ export const debugOptions: CliCommandOptions<IDebugArgsInput> = {
type: "boolean",
require: true,
default: true
},
tenderly: {
description: "RPC url follows the tenderly format",
type: "boolean",
require: true,
default: false
}
}

Expand Down
13 changes: 0 additions & 13 deletions src/rpc/validation/SafeValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ export class SafeValidator

async getValidationResultV07({
userOperation,
queuedUserOperations,
entryPoint,
preCodeHashes
}: {
Expand All @@ -203,14 +202,6 @@ export class SafeValidator
referencedContracts?: ReferencedCodeHashes
}
> {
if (this.config.tenderly) {
return super.getValidationResultV07({
userOperation,
queuedUserOperations,
entryPoint
})
}

if (preCodeHashes && preCodeHashes.addresses.length > 0) {
const { hash } = await this.getCodeHashes(preCodeHashes.addresses)
if (hash !== preCodeHashes.hash) {
Expand Down Expand Up @@ -278,10 +269,6 @@ export class SafeValidator
storageMap: StorageMap
}
> {
if (this.config.tenderly) {
return super.getValidationResultV06({ userOperation, entryPoint })
}

if (preCodeHashes && preCodeHashes.addresses.length > 0) {
const { hash } = await this.getCodeHashes(preCodeHashes.addresses)
if (hash !== preCodeHashes.hash) {
Expand Down
12 changes: 4 additions & 8 deletions src/rpc/validation/UnsafeValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
type UserOperation,
ValidationErrors,
type ValidationResultWithAggregation,
entryPointErrorsSchema,
entryPointExecutionErrorSchemaV06,
entryPointExecutionErrorSchemaV07
} from "@alto/types"
Expand Down Expand Up @@ -79,18 +78,16 @@ export class UnsafeValidator implements InterfaceValidator {
isVersion06: boolean,
errorResult: unknown,
logger: Logger,
simulationType: "validation" | "execution",
usingTenderly = false
simulationType: "validation" | "execution"
): Promise<
ValidationResult | ValidationResultWithAggregation | ExecutionResult
> {
const entryPointExecutionErrorSchema = isVersion06
? entryPointExecutionErrorSchemaV06
: entryPointExecutionErrorSchemaV07

const entryPointErrorSchemaParsing = usingTenderly
? entryPointErrorsSchema.safeParse(errorResult)
: entryPointExecutionErrorSchema.safeParse(errorResult)
const entryPointErrorSchemaParsing =
entryPointExecutionErrorSchema.safeParse(errorResult)

if (!entryPointErrorSchemaParsing.success) {
try {
Expand Down Expand Up @@ -236,8 +233,7 @@ export class UnsafeValidator implements InterfaceValidator {
isVersion06(userOperation),
simulateValidationResult,
this.logger,
"validation",
this.config.tenderly
"validation"
)) as ValidationResultV06 | ValidationResultWithAggregationV06),
storageMap: {}
}
Expand Down

0 comments on commit 8a4e8f8

Please sign in to comment.