From 8d310ac19f54a860d1f955435ecb70f00876bc2c Mon Sep 17 00:00:00 2001 From: Nikita Melnikov Date: Thu, 10 Oct 2024 14:39:10 +0100 Subject: [PATCH 1/3] reduce receipt logs --- src/rpc/server.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rpc/server.ts b/src/rpc/server.ts index a13d78a2..3ab0b3c9 100644 --- a/src/rpc/server.ts +++ b/src/rpc/server.ts @@ -337,7 +337,12 @@ export class Server { reply.rpcStatus = "success" this.fastify.log.info( { - data: JSON.stringify(jsonRpcResponse), + data: + bundlerRequest.method === + "eth_getUserOperationReceipt" && + jsonRpcResponse.result + ? "reduced" + : jsonRpcResponse, // do not log the full result for eth_getUserOperationReceipt to reduce log size method: bundlerRequest.method }, "sent reply" From fbfb75caf61cc69cdf8609bde8be37301b3b110f Mon Sep 17 00:00:00 2001 From: Nikita Melnikov Date: Thu, 10 Oct 2024 15:36:29 +0100 Subject: [PATCH 2/3] keep original log struct --- src/rpc/server.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rpc/server.ts b/src/rpc/server.ts index 3ab0b3c9..b058c120 100644 --- a/src/rpc/server.ts +++ b/src/rpc/server.ts @@ -341,7 +341,10 @@ export class Server { bundlerRequest.method === "eth_getUserOperationReceipt" && jsonRpcResponse.result - ? "reduced" + ? { + ...jsonRpcResponse, + result: "reduced" + } : jsonRpcResponse, // do not log the full result for eth_getUserOperationReceipt to reduce log size method: bundlerRequest.method }, From 6e56a635a66beeefe9b49ace71935691e398798a Mon Sep 17 00:00:00 2001 From: Nikita Melnikov Date: Thu, 10 Oct 2024 15:41:55 +0100 Subject: [PATCH 3/3] use arrow brackets --- src/rpc/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/server.ts b/src/rpc/server.ts index b058c120..bf329c64 100644 --- a/src/rpc/server.ts +++ b/src/rpc/server.ts @@ -343,7 +343,7 @@ export class Server { jsonRpcResponse.result ? { ...jsonRpcResponse, - result: "reduced" + result: "" } : jsonRpcResponse, // do not log the full result for eth_getUserOperationReceipt to reduce log size method: bundlerRequest.method