Skip to content

Conversation

@zeluisping
Copy link

@zeluisping zeluisping commented Oct 21, 2025

Description

This PR integrates private event support into the EventsService, enabling it to watch and process private EntryPoint events.

Key Changes:

  • Use Common Event ABIs: Refactored EventsService to use the centralised event ABI definitions from utils/abi-events instead of local duplicates
  • Private Event Watching: Added watchContractEvent subscription for PrivateEvent emissions, filtering by event type for UserOperationEvent and AccountDeployed
  • Event Unwrapping Logic: Implemented handlePrivateEventUnwrap() method that decodes and reconstructs private events into standard event logs
  • Unified Event Handling: Modified handleEvent() to transparently unwrap private events before processing, maintaining the same flow for both public and private events
  • Error Handling: Added validation and error logging for malformed private events and unwrapping failures

Implementation Details:

  • The unwrapper maps eventType hashes to their corresponding ABIs (UserOperationEventAbi, AccountDeployedAbi) for proper decoding
  • Events that cannot be unwrapped are logged and gracefully skipped
  • Type safety is maintained with proper TypeScript typing using EventLog<ABI> helper type
  • Removed support for the public versions of the privatised events

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • Removes support for public events: UserOperationEvent, and AccountDeployed
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Further comments (optional)

  • The service now watches for PrivateEvent with specific eventType filters to only process relevant events (UserOperationEvent and AccountDeployed)
  • The unwrapping happens before event processing; downstream handlers don't need to know if the event was private or public
    • We can attach the original private event data to the unwrapped event if needed (say, with a symbol)
  • Removed support for the public events that were privatised; these are now handled solely as PrivateEvents

@zeluisping zeluisping requested a review from seromenho October 21, 2025 11:38
@zeluisping zeluisping self-assigned this Oct 21, 2025
@zeluisping zeluisping added the enhancement New feature or request label Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant