Skip to main content

alea_verifier/
events.rs

1use anchor_lang::prelude::*;
2
3/// Emitted on every successful `verify`.
4///
5/// `payer` is the tx signer that funded the verify call (RENAMED from
6/// `verifier` per T2.27 — the program is the verifier). In user-pays
7/// flows this exposes the end-user wallet in program logs; consumer
8/// programs that need privacy sign via a PDA-derived signer instead.
9///
10/// Schema frozen per ADR 0028.
11#[event]
12pub struct BeaconVerified {
13    pub round: u64,
14    pub randomness: [u8; 32],
15    pub payer: Pubkey,
16}
17
18/// Emitted on every successful `update_config`.
19///
20/// `pubkey_g2_hash` is the sha256 digest of `config.pubkey_g2` — NOT
21/// the raw 128-byte pubkey (T3.m). Raw pubkey would bloat the event
22/// log; subscribers who need the full bytes can decode the Config PDA
23/// at the slot the event fired.
24#[event]
25pub struct ConfigUpdated {
26    pub authority: Pubkey,
27    pub chain_hash: [u8; 32],
28    pub pubkey_g2_hash: [u8; 32],
29}