aztec-nr - noir_aztec::messages::processing

Function enqueue_event_for_validation

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,
    recipient: AztecAddress,
)

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) 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.