Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions scripts/localDeployer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ const verifyDeployed = async (addresses: Address[]) => {
})

if (bytecode === undefined) {
// biome-ignore lint/suspicious/noConsoleLog: it is oke
console.log(`CONTRACT ${address} NOT DEPLOYED!!!`)
process.exit(1)
}
}
}

const main = async () => {
// biome-ignore lint/suspicious/noConsoleLog: []
console.log("========== DEPLOYING V0.7 CORE CONTRACTS ==========")

const txs: Hex[] = []
Expand Down Expand Up @@ -103,7 +101,6 @@ const main = async () => {
)
console.log("Deployed EntryPointSimulations")

// biome-ignore lint/suspicious/noConsoleLog: []
console.log("========== DEPLOYING V0.6 CORE CONTRACTS ==========")

txs.push(
Expand All @@ -124,7 +121,6 @@ const main = async () => {
)
console.log("Deployed SimpleAccountFactory v0.6")

// biome-ignore lint/suspicious/noConsoleLog: []
console.log("========== DEPLOYING SAFE CONTRACTS ==========")

txs.push(
Expand Down Expand Up @@ -205,7 +201,6 @@ const main = async () => {
)
console.log("Deployed Safe Multi Send Call Only")

// biome-ignore lint/suspicious/noConsoleLog: []
console.log("========== DEPLOYING BICONOMY CONTRACTS ==========")

await anvilClient.setCode({
Expand Down Expand Up @@ -250,7 +245,6 @@ const main = async () => {
)
console.log("Deployed Biconomy Default Fallback Handler")

// biome-ignore lint/suspicious/noConsoleLog: []
console.log("========== DEPLOYING KERNEL CONTRACTS ==========")

txs.push(
Expand Down Expand Up @@ -280,7 +274,6 @@ const main = async () => {
)
console.log("Deployed Kernel Factory")

// biome-ignore lint/suspicious/noConsoleLog: []
console.log("========== MISC ==========")

await anvilClient.setCode({
Expand Down
2 changes: 1 addition & 1 deletion src/cli/alto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
import * as sentry from "@sentry/node"
import dotenv from "dotenv"
import { HttpRequestError, InternalRpcError, TimeoutError } from "viem"
import yargs from "yargs"
import { hideBin } from "yargs/helpers"
import {
Expand All @@ -16,7 +17,6 @@ import {
serverOptions
} from "./config"
import { registerCommandToYargs } from "./util"
import { TimeoutError, HttpRequestError, InternalRpcError } from "viem"

// Load environment variables from .env file
if (process.env.DOTENV_CONFIG_PATH) {
Expand Down
16 changes: 12 additions & 4 deletions src/cli/config/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import type {
IExecutorArgsInput,
IGasEstimationArgsInput,
ILogArgsInput,
IMempoolArgsInput,
IOptionsInput,
IRpcArgsInput,
IServerArgsInput,
IMempoolArgsInput
IServerArgsInput
} from "./bundler"

export const bundlerOptions: CliCommandOptions<IBundlerArgsInput> = {
Expand Down Expand Up @@ -100,7 +100,8 @@ export const bundlerOptions: CliCommandOptions<IBundlerArgsInput> = {
default: "20000000"
},
"max-bundle-count": {
description: "Maximum number of UserOperations to include in a bundle. If not set, no limit is applied.",
description:
"Maximum number of UserOperations to include in a bundle. If not set, no limit is applied.",
type: "number",
require: false
},
Expand Down Expand Up @@ -407,7 +408,14 @@ export const compatibilityOptions: CliCommandOptions<ICompatibilityArgsInput> =
description:
"Indicates what type of chain the bundler is running on",
type: "string",
choices: ["default", "op-stack", "arbitrum", "hedera", "mantle", "abstract"],
choices: [
"default",
"op-stack",
"arbitrum",
"hedera",
"mantle",
"abstract"
],
default: "default"
},
"legacy-transactions": {
Expand Down
4 changes: 2 additions & 2 deletions src/cli/customTransport.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { Logger } from "@alto/utils"
import {
type Hex,
type HttpTransport,
type HttpTransportConfig,
RpcRequestError,
UrlRequiredError,
createTransport,
toFunctionSelector,
getAbiItem,
isHex,
slice,
Hex
toFunctionSelector
} from "viem"
import { formatAbiItem, rpc } from "viem/utils"
import {
Expand Down
14 changes: 7 additions & 7 deletions src/cli/deploySimulationsContract.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import type { IOptions } from "@alto/cli"
import {
DETERMINISTIC_DEPLOYER_TRANSACTION,
pimlicoEntrypointSimulationsV7DeployBytecode,
pimlicoEntrypointSimulationsSalt,
pimlicoEntrypointSimulationsV7DeployBytecode,
pimlicoEntrypointSimulationsV8DeployBytecode
} from "@alto/types"
import type { Logger } from "pino"
import {
http,
type Chain,
createWalletClient,
getContractAddress,
type Hex,
http,
type PublicClient,
type Transport,
concat
concat,
createWalletClient,
getContractAddress
} from "viem"
import type { CamelCasedProperties } from "./parseArgs"
import type { IOptions } from "@alto/cli"
import type { Logger } from "pino"

const isContractDeployed = async ({
publicClient,
Expand Down
14 changes: 7 additions & 7 deletions src/cli/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import {
} from "@alto/utils"
import { Registry } from "prom-client"
import {
type CallParameters,
type Chain,
createPublicClient,
createWalletClient,
formatEther,
fallback,
type CallParameters,
formatEther,
publicActions
} from "viem"
import type { IOptionsInput } from "./config"
import { customTransport } from "./customTransport"
import { setupServer } from "./setupServer"
import { type AltoConfig, createConfig } from "../createConfig"
import { parseArgs } from "./parseArgs"
import { deploySimulationsContract } from "./deploySimulationsContract"
import { getSenderManager } from "../executor/senderManager/index"
import { UtilityWalletMonitor } from "../executor/utilityWalletMonitor"
import type { IOptionsInput } from "./config"
import { customTransport } from "./customTransport"
import { deploySimulationsContract } from "./deploySimulationsContract"
import { parseArgs } from "./parseArgs"
import { setupServer } from "./setupServer"

const preFlightChecks = async (config: AltoConfig): Promise<void> => {
for (const entrypoint of config.entrypoints) {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { FastifyInstrumentation } from "@opentelemetry/instrumentation-fastify"
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http"
import { PinoInstrumentation } from "@opentelemetry/instrumentation-pino"
import { UndiciInstrumentation } from "@opentelemetry/instrumentation-undici"
import { ViemInstrumentation } from "@pimlico/opentelemetry-instrumentation-viem"
import { NodeSDK } from "@opentelemetry/sdk-node"
import {
ParentBasedSampler,
type Sampler,
SamplingDecision
} from "@opentelemetry/sdk-trace-base"
import { SemanticAttributes } from "@opentelemetry/semantic-conventions"
import { ViemInstrumentation } from "@pimlico/opentelemetry-instrumentation-viem"

class CustomSampler implements Sampler {
shouldSample(
Expand Down
2 changes: 1 addition & 1 deletion src/cli/parseArgs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IOptions, optionArgsSchema, type IOptionsInput } from "@alto/cli"
import { type IOptions, type IOptionsInput, optionArgsSchema } from "@alto/cli"
import { fromZodError } from "zod-validation-error"

type CamelCase<S extends string> =
Expand Down
2 changes: 1 addition & 1 deletion src/cli/setupServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import type { InterfaceValidator } from "@alto/types"
import type { Metrics } from "@alto/utils"
import type { Registry } from "prom-client"
import type { AltoConfig } from "../createConfig"
import { validateAndRefillWallets } from "../executor/senderManager/validateAndRefill"
import { flushOnStartUp } from "../executor/senderManager/flushOnStartUp"
import { validateAndRefillWallets } from "../executor/senderManager/validateAndRefill"
import { createMempoolStore } from "../store/createMempoolStore"

const getReputationManager = (
Expand Down
2 changes: 1 addition & 1 deletion src/createConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IOptions } from "@alto/cli"
import type { CamelCasedProperties } from "./cli/parseArgs"
import type { Bindings, ChildLoggerOptions, Logger } from "pino"
import type { Chain, PublicClient, Transport, WalletClient } from "viem"
import type { CamelCasedProperties } from "./cli/parseArgs"

export type AltoConfig = Readonly<CamelCasedProperties<IOptions>> & {
getLogger: <ChildCustomLevels extends string = never>(
Expand Down
26 changes: 13 additions & 13 deletions src/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ import type { InterfaceReputationManager, Mempool } from "@alto/mempool"
import type {
Address,
BundleResult,
GasPriceParameters,
HexData32,
UserOpInfo,
UserOperation,
GasPriceParameters,
UserOperationBundle,
UserOpInfo
UserOperationBundle
} from "@alto/types"
import type { Logger, Metrics } from "@alto/utils"
import { maxBigInt, parseViemError, scaleBigIntByPercent } from "@alto/utils"
import * as sentry from "@sentry/node"
import {
IntrinsicGasTooLowError,
NonceTooLowError,
TransactionExecutionError,
type Account,
BaseError,
type Hex,
IntrinsicGasTooLowError,
NonceTooHighError,
BaseError
NonceTooLowError,
TransactionExecutionError
} from "viem"
import type { SendTransactionErrorType } from "viem"
import type { SignedAuthorizationList } from "viem"
import type { AltoConfig } from "../createConfig"
import { sendPflConditional } from "./fastlane"
import { filterOpsAndEstimateGas } from "./filterOpsAndEStimateGas"
import {
calculateAA95GasFloor,
encodeHandleOpsCalldata,
getAuthorizationList,
getUserOpHashes,
isTransactionUnderpricedError
} from "./utils"
import type { SendTransactionErrorType } from "viem"
import type { AltoConfig } from "../createConfig"
import { sendPflConditional } from "./fastlane"
import type { SignedAuthorizationList } from "viem"
import { filterOpsAndEstimateGas } from "./filterOpsAndEStimateGas"

type HandleOpsTxParams = {
gas: bigint
Expand Down Expand Up @@ -274,7 +274,7 @@ export class Executor {
entryPoint
})

let estimateResult = await filterOpsAndEstimateGas({
const estimateResult = await filterOpsAndEstimateGas({
userOpBundle,
executor,
nonce,
Expand Down
26 changes: 14 additions & 12 deletions src/executor/executorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
type BundlingMode,
EntryPointV06Abi,
type HexData32,
type RejectedUserOp,
type SubmittedUserOp,
type TransactionInfo,
RejectedUserOp,
UserOperationBundle,
UserOpInfo
type UserOpInfo,
type UserOperationBundle
} from "@alto/types"
import type { BundlingStatus, Logger, Metrics } from "@alto/utils"
import {
Expand All @@ -22,23 +22,23 @@ import {
parseUserOperationReceipt,
scaleBigIntByPercent
} from "@alto/utils"
import { BaseError } from "abitype"
import {
type Address,
type Block,
type Hash,
type Hex,
InsufficientFundsError,
NonceTooLowError,
type TransactionReceipt,
TransactionReceiptNotFoundError,
type WatchBlocksReturnType,
formatEther,
getAbiItem,
Hex,
InsufficientFundsError,
NonceTooLowError
getAbiItem
} from "viem"
import type { Executor } from "./executor"
import type { AltoConfig } from "../createConfig"
import { SenderManager } from "./senderManager"
import { BaseError } from "abitype"
import type { Executor } from "./executor"
import type { SenderManager } from "./senderManager"
import { getUserOpHashes } from "./utils"

function getTransactionsFromUserOperationEntries(
Expand Down Expand Up @@ -137,7 +137,9 @@ export class ExecutorManager {
(timestamp) => now - timestamp < RPM_WINDOW
)

const bundles = await this.mempool.getBundles(this.config.maxBundleCount)
const bundles = await this.mempool.getBundles(
this.config.maxBundleCount
)

if (bundles.length > 0) {
const opsCount: number = bundles
Expand Down Expand Up @@ -434,7 +436,7 @@ export class ExecutorManager {
blockNumber: bigint // block number is undefined only if transaction is not found
transactionHash: `0x${string}`
}

// Track transaction costs for both included and reverted transactions
if (
bundlingStatus.status === "included" ||
Expand Down
18 changes: 9 additions & 9 deletions src/executor/fastlane.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Logger } from "@alto/utils"
import type { Logger } from "@alto/utils"
import {
Hex,
createClient,
http,
SendRawTransactionReturnType,
Hash,
WalletClient,
PublicClient,
toHex,
BaseError
BaseError,
type Hash,
type Hex,
type PublicClient,
type SendRawTransactionReturnType,
type WalletClient,
createClient,
toHex
} from "viem"

const pflClient = createClient({
Expand Down
Loading