Skip to content
Open
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
28 changes: 23 additions & 5 deletions packages/executor/src/services/EntryPointService/versions/0.0.7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ import {
GetContractReturnType,
toHex,
} from "viem";
import { USER_OPERATION_EVENT_HASH, UserOperationEventAbi } from '../../../utils/abi-events'
import { isPrivateEventLogWithArgs, unwrapPrivateEvent } from '../../../utils/unwrapPrivateEvent'


export class EntryPointV7Service implements IEntryPointService {
Expand Down Expand Up @@ -254,18 +256,34 @@ export class EntryPointV7Service implements IEntryPointService {
if (fromBlock < 0) {
fromBlock = BigInt(0);
}
const logs = await this.publicClient.getLogs({

const privateLogs = await this.publicClient.getLogs({
address: this.address,
event: parseAbiItem([
'event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed)'
'event PrivateEvent(address[] allowedViewers, bytes32 indexed eventType, bytes payload)',
]),
fromBlock,
args: {
userOpHash
eventType: USER_OPERATION_EVENT_HASH,
}
});
if(logs[0]) {
return logs[0];

for (const log of privateLogs) {
if (!isPrivateEventLogWithArgs(log)) {
continue;
}

try {
const unwrapped = unwrapPrivateEvent(UserOperationEventAbi, log);

if (unwrapped.args.userOpHash === userOpHash) {
return unwrapped;
}
} catch (error) {
this.logger.error(
`Failed to unwrap PrivateEvent for ${UserOperationEventAbi.name}: ${error instanceof Error ? error.message : JSON.stringify(error)}`
);
}
}
} catch (err) {
this.logger.error(err);
Expand Down