From bc59d22f545bdcc5b13328073d2da55b7f11ec3b Mon Sep 17 00:00:00 2001 From: Garvit Khatri Date: Fri, 18 Oct 2024 14:09:06 +0100 Subject: [PATCH 1/3] Add logs to check if the second simulation fails --- src/rpc/rpcHandler.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rpc/rpcHandler.ts b/src/rpc/rpcHandler.ts index 2ee90dd7..a12a01a6 100644 --- a/src/rpc/rpcHandler.ts +++ b/src/rpc/rpcHandler.ts @@ -527,9 +527,8 @@ export class RpcHandler implements IRpcEndpoint { callGasLimit = 0n } - // If a balance override is provided for the sender, perform an additional simulation - // to verify the userOperation succeeds with the specified balance. - if (stateOverrides?.[userOperation.sender]?.balance) { + // Run second time without state overrides + try { await this.validator.getExecutionResult( { ...userOperation, @@ -544,6 +543,8 @@ export class RpcHandler implements IRpcEndpoint { false, deepHexlify(stateOverrides) ) + } catch (err) { + this.logger.error({ error: err }, "Second simulations fail") } if (isVersion07(userOperation)) { From 19f64ed48bed19e66b9ab3308010a797058b9a49 Mon Sep 17 00:00:00 2001 From: Garvit Khatri Date: Fri, 18 Oct 2024 14:22:58 +0100 Subject: [PATCH 2/3] Make sure we copy the param --- src/rpc/rpcHandler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/rpcHandler.ts b/src/rpc/rpcHandler.ts index a12a01a6..f9797a61 100644 --- a/src/rpc/rpcHandler.ts +++ b/src/rpc/rpcHandler.ts @@ -468,7 +468,7 @@ export class RpcHandler implements IRpcEndpoint { entryPoint, queuedUserOperations, true, - stateOverrides + deepHexlify({ ...stateOverrides }) ) let { verificationGasLimit, callGasLimit } = @@ -541,7 +541,7 @@ export class RpcHandler implements IRpcEndpoint { entryPoint, queuedUserOperations, false, - deepHexlify(stateOverrides) + deepHexlify({ ...stateOverrides }) ) } catch (err) { this.logger.error({ error: err }, "Second simulations fail") From dda919cc2be5368a120f0d9a961b13f83b10136c Mon Sep 17 00:00:00 2001 From: Garvit Khatri Date: Fri, 18 Oct 2024 15:00:41 +0100 Subject: [PATCH 3/3] change log --- src/rpc/rpcHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/rpcHandler.ts b/src/rpc/rpcHandler.ts index f9797a61..37364ff0 100644 --- a/src/rpc/rpcHandler.ts +++ b/src/rpc/rpcHandler.ts @@ -544,7 +544,7 @@ export class RpcHandler implements IRpcEndpoint { deepHexlify({ ...stateOverrides }) ) } catch (err) { - this.logger.error({ error: err }, "Second simulations fail") + this.logger.error(err, "Second simulations fail") } if (isVersion07(userOperation)) {