Skip to content

Conversation

@DeStefaniAndrei
Copy link

@DeStefaniAndrei DeStefaniAndrei commented Nov 29, 2025

Summary

Adds UserOpEvent types to the audit crate, following the existing BundleEvent pattern. This is the foundation for tracking UserOperation lifecycle events through the audit pipeline.

Changes

  • Add UserOpHash type alias (B256), since in ERC 4337 a UserOpHash is classified as a bytes32 Solidity data type, which translates to B256 in Rust

  • Add UserOpDropReason enum with three basic variants:

    • Invalid(String) - validation failure
    • Expired - TTL exceeded
    • ReplacedByHigherFee - replaced by higher fee
  • Add UserOpEvent enum with three variants (only events that happen after validation to avoid overloading Kafka):

    • AddedToMempool - when a UserOp passes validation and enters the queue
    • Dropped - when a UserOp is removed from mempool
    • Included - when a UserOp is included in a block
  • Add helper methods: user_op_hash() and generate_event_key()

  • Add 6 basic unit tests for serialization and accessors

Testing

  • cargo test -p tips-audit - 12 tests pass
  • cargo clippy -- -D warnings - no warnings
  • cargo fmt --all --check - formatted

Planned follow-up PRs

  • Wire UserOpEvent::AddedToMempool in ingress-rpc
  • Wire UserOpEvent::Included in aa-bundler
  • Update Kafka publisher to handle UserOpEvent
  • Update S3 archiver for UserOp events

Copy link

@chunter-cb chunter-cb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, as long as we can put in the reverted text then that is standard as the way bundler does it when it drops an OP.

This is going to be a big win compared to visibility

@DeStefaniAndrei DeStefaniAndrei force-pushed the feat/userop-audit-events branch from f0fe17d to 4a657a9 Compare December 2, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants