From b76a4fa839a0b9898a9693d459711470db12c933 Mon Sep 17 00:00:00 2001 From: alvrs Date: Wed, 2 Oct 2024 20:29:42 +0100 Subject: [PATCH 1/2] remove pino-pretty --- src/utils/logger.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 47dcdaf6..a42a7b22 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -61,12 +61,6 @@ export const customSerializer: SerializerFn = (input: AnyObject): AnyObject => { export const initDebugLogger = (level = "debug"): Logger => { const l = logger({ - transport: { - target: "pino-pretty", - options: { - colorize: true - } - }, formatters: { level: logLevel, log: customSerializer From 981a2f4b8405495420448d52cf8033f014e8a9bb Mon Sep 17 00:00:00 2001 From: alvrs Date: Wed, 16 Oct 2024 13:16:32 +0200 Subject: [PATCH 2/2] immediately return transaction hash and user operation hash --- src/rpc/rpcHandler.ts | 12 +----------- src/types/schemas.ts | 7 ++++++- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/rpc/rpcHandler.ts b/src/rpc/rpcHandler.ts index 2ee90dd7..6633cfdb 100644 --- a/src/rpc/rpcHandler.ts +++ b/src/rpc/rpcHandler.ts @@ -63,7 +63,6 @@ import { isVersion06, isVersion07, maxBigInt, - parseUserOperationReceipt, scaleBigIntByPercent, toUnpackedUserOperation } from "@alto/utils" @@ -1025,16 +1024,7 @@ export class RpcHandler implements IRpcEndpoint { this.executor.markWalletProcessed(res.value.transactionInfo.executor) - // wait for receipt - const receipt = - await this.config.publicClient.waitForTransactionReceipt({ - hash: res.value.transactionInfo.transactionHash, - pollingInterval: 100 - }) - - const userOperationReceipt = parseUserOperationReceipt(opHash, receipt) - - return userOperationReceipt + return { transactionHash: res.value.transactionInfo.transactionHash, userOpHash: opHash }; } async pimlico_sendCompressedUserOperation( diff --git a/src/types/schemas.ts b/src/types/schemas.ts index c8baec47..4af78cb3 100644 --- a/src/types/schemas.ts +++ b/src/types/schemas.ts @@ -578,9 +578,14 @@ const pimlicoSendCompressedUserOperationResponseSchema = z.object({ result: hexData32Schema }) +const userOperationNowResultSchema = z.object({ + transactionHash: hexData32Schema, + userOpHash: hexData32Schema +}) + const pimlicoSendUserOperationNowResponseSchema = z.object({ method: z.literal("pimlico_sendUserOperationNow"), - result: userOperationReceiptSchema + result: userOperationNowResultSchema }) const bundlerResponseSchema = z.discriminatedUnion("method", [