Skip to content

Commit

Permalink
Merge pull request #332 from pimlicolabs/revert-331-add-second-simula…
Browse files Browse the repository at this point in the history
…tion-logs

Revert "Add logs to check if the second simulation fails"
  • Loading branch information
plusminushalf authored Oct 19, 2024
2 parents 8b04215 + 3a947aa commit e6d99a0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/rpc/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export class RpcHandler implements IRpcEndpoint {
entryPoint,
queuedUserOperations,
true,
deepHexlify({ ...stateOverrides })
stateOverrides
)

let { verificationGasLimit, callGasLimit } =
Expand Down Expand Up @@ -527,8 +527,9 @@ export class RpcHandler implements IRpcEndpoint {
callGasLimit = 0n
}

// Run second time without state overrides
try {
// 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) {
await this.validator.getExecutionResult(
{
...userOperation,
Expand All @@ -541,10 +542,8 @@ export class RpcHandler implements IRpcEndpoint {
entryPoint,
queuedUserOperations,
false,
deepHexlify({ ...stateOverrides })
deepHexlify(stateOverrides)
)
} catch (err) {
this.logger.error(err, "Second simulations fail")
}

if (isVersion07(userOperation)) {
Expand Down

0 comments on commit e6d99a0

Please sign in to comment.