molpha_verifier/error.rs
1//! Error type for DataUpdate verification.
2//!
3//! These are pure verification errors, mapped by downstream programs at the call boundary.
4//! Account-borrow/deserialization errors are produced and handled by the caller (which owns the
5//! framework-specific account I/O) and never cross the crate boundary.
6
7#[derive(Debug, PartialEq, Eq)]
8pub enum DataUpdateError {
9 /// Aggregate Schnorr signature failed verification (recovered address mismatch,
10 /// invalid coalition key, or invalid scalar `s`).
11 InvalidAggregateSignature,
12 /// A signature component was malformed (e.g. non-canonical scalar during the
13 /// Schnorr→ECDSA conversion).
14 InvalidSignature,
15 /// `popcount(signers_bitmap) < signatures_required`.
16 InsufficientSigners,
17 /// `signers_bitmap` is not a subset of the deterministically derived selection bitmap.
18 SignersNotSubsetOfSelection,
19 /// `signers_bitmap` has bits set outside `[0, node_count)`, or is otherwise invalid.
20 InvalidSignersBitmap,
21 /// Selection-group bitmap derivation failed (bad node count / group size, or the
22 /// bounded sampling loop did not converge).
23 GroupBitmapDerivationFailed,
24 /// `ordered_signers.len()` does not equal `popcount(signers_bitmap)`.
25 SignerCountMismatch,
26 /// The requested registry version is neither current nor a live previous version.
27 InvalidRegistryVersion,
28 /// A signer account is missing, extra, or owned by another program.
29 MissingSignerAccount,
30 /// A `Node` account does not match its expected bitmap index.
31 InvalidNodeIndex,
32 /// Previous-version remove remapping was requested without valid transition metadata.
33 InvalidTransitionAccount,
34}