Skip to content

Commit

Permalink
minor fixes for tenderly validation
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilkumar1612 committed Feb 4, 2025
1 parent 977caa5 commit 98bb20d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class GethTracer {
},
"latest",
{
timeout: "10s",
tracer: stringifiedTracer,
},
]);
Expand Down
28 changes: 17 additions & 11 deletions packages/executor/src/services/UserOpValidation/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,28 @@ export class UserOpValidationService {
}
return await this.safeValidationService
.validateSafely(userOp, entryPoint, codehash)
.catch(async (error) => {
this.logger.debug(
`Error occurred during userOp validation on safe mode: ${error}`
);
this.logger.debug("Validating userOp using unsafe mode...");
.catch((error) => {
if (
!(error instanceof RpcError) &&
error.message === "debug_traceCall_failed"
) {
this.logger.debug(
"Error occurred during userOp validation on safe mode"
);
this.logger.debug("Validating userOp using unsafe mode...");

if (this.networkConfig.entryPointForwarder.length > 2) {
return await this.unsafeValidationService.validateUnsafelyWithForwarder(
if (this.networkConfig.entryPointForwarder.length > 2) {
return this.unsafeValidationService.validateUnsafelyWithForwarder(
userOp,
entryPoint
);
}
return this.unsafeValidationService.validateUnsafely(
userOp,
entryPoint
);
}
return await this.unsafeValidationService.validateUnsafely(
userOp,
entryPoint
);
throw error;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ export class SafeValidationService {
...gasPrice,
};

const traceCall: BundlerCollectorReturn =
await this.gethTracer.debug_traceCall(tx);
const traceCall: BundlerCollectorReturn = await this.gethTracer
.debug_traceCall(tx)
.catch((error) => {
this.logger.error(error, "Debug trace call failed");
throw new Error("debug_traceCall_failed");
});
const validationResult = await this.validateOpcodesAndStake(
traceCall,
entryPointContract,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class TenderlyValidationService {
.request(config)
.then((response) => {
const parsed = entryPoint.interface.parseError(
response.data.transaction.transaction_info.call_trace.error_hex_data
response.data.transaction.call_trace[0].output
);
return {
...parsed,
Expand Down

0 comments on commit 98bb20d

Please sign in to comment.