> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Function enqueue_event_for_validation

Module: `noir_aztec::messages::processing`

```rust
pub unconstrained fn enqueue_event_for_validation(
    contract_address: AztecAddress,
    event_type_id: EventSelector,
    randomness: Field,
    serialized_event: BoundedVec<Field, 10>,
    event_commitment: Field,
    tx_hash: Field,
)
```

Enqueues an event for validation and storage by PXE.

This is the primary way for custom message handlers (registered via [`crate::macros::AztecConfig::custom_message_handler`](/aztec-nr-api/v6.0.0/noir_aztec/macros/struct.AztecConfig.md#custom_message_handler)) to deliver reassembled events back to PXE after processing application-specific message formats.

In order for the event validation and insertion to occur, `validate_and_store_enqueued_notes_and_events` must be later called. For optimal performance, accumulate as many event validation requests as possible and then validate them all at the end (which results in PXE minimizing the number of network round-trips).

Note that `validate_and_store_enqueued_notes_and_events` is called by Aztec.nr after processing messages, so custom message processors do not need to be concerned with this.
