Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logs to check if the second simulation fails #331

Merged
merged 3 commits into from
Oct 18, 2024
Merged
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
11 changes: 6 additions & 5 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,
stateOverrides
deepHexlify({ ...stateOverrides })
)

let { verificationGasLimit, callGasLimit } =
Expand Down Expand Up @@ -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,
Expand All @@ -542,8 +541,10 @@ 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
Loading