Skip to main content

ValidationError

Enum ValidationError 

Source
#[non_exhaustive]
pub enum ValidationError {
Show 28 variants InvalidSaid { expected: Said, actual: Said, }, BrokenChain { sequence: u128, referenced: Said, actual: Said, }, InvalidSequence { expected: u128, actual: u128, }, CommitmentMismatch { sequence: u128, }, SignatureFailed { sequence: u128, }, ThresholdNotSatisfiable { sequence: u128, reason: String, }, InvalidBackerDelta { sequence: u128, reason: String, }, BackerRoleFlip { sequence: u128, reason: String, }, AsymmetricKeyRotation { sequence: u128, prior_next_count: usize, new_key_count: usize, }, DelegatorSealNotFound { sequence: u128, delegator_aid: String, }, DelegateSourceSealMissing { sequence: u128, }, SealBackRefMismatch { sequence: u128, }, DelegatorLookupMissing { sequence: u128, }, NotInception, EmptyKel, MultipleInceptions, Serialization(String), MalformedSequence { raw: String, }, InvalidKey(String), AbandonedIdentity { sequence: u128, }, EstablishmentOnly { sequence: u128, }, NonTransferable, DuplicateBacker { aid: String, }, InvalidBackerThreshold { bt: u64, backer_count: usize, }, MissingTimestamp { sequence: u128, }, NonMonotonicTimestamp { sequence: u128, prev: String, curr: String, }, RotationCooldown { sequence: u128, interval_secs: i64, min_secs: i64, }, ClockSkew { sequence: u128, skew_secs: i64, tolerance_secs: i64, },
}
Expand description

Errors specific to KEL validation.

These errors represent protocol invariant violations. They indicate structural corruption or attack, not recoverable conditions.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InvalidSaid

SAID (Self-Addressing Identifier) doesn’t match content hash.

Fields

§expected: Said

The SAID that was expected from the content hash.

§actual: Said

The SAID that was actually found in the event.

§

BrokenChain

Event references wrong previous event.

Fields

§sequence: u128

Zero-based position of the event in the KEL.

§referenced: Said

The previous SAID referenced by this event.

§actual: Said

The actual SAID of the previous event.

§

InvalidSequence

Sequence number is not monotonically increasing.

Fields

§expected: u128

The sequence number that was expected.

§actual: u128

The sequence number that was found.

§

CommitmentMismatch

Pre-rotation commitment doesn’t match the new current key.

Fields

§sequence: u128

Zero-based position of the rotation event that failed.

§

SignatureFailed

Cryptographic signature verification failed for an event.

Fields

§sequence: u128

Zero-based position of the event whose signature failed.

§

ThresholdNotSatisfiable

A threshold (kt, nt, or bt) is structurally unsatisfiable against the list it governs — e.g. kt=5 over a single key, or a weighted clause whose length differs from the key-list length.

Fields

§sequence: u128

Zero-based position of the offending event.

§reason: String

Which threshold and why it cannot be met.

§

InvalidBackerDelta

A rotation’s backer delta is invalid: a br (cut) entry isn’t in the prior backer set, or a ba (add) entry duplicates a surviving backer.

Fields

§sequence: u128

Zero-based position of the offending rotation.

§reason: String

What was wrong with the delta.

§

BackerRoleFlip

A rotation flips the registrar-backer role (RB <-> NRB) while retaining prior backers via a partial br/ba delta. RB and NRB carry different backer-list semantics, so a surviving backer would be governed by semantics it was never admitted under. A role flip must rebuild b[] — every prior backer cut (F-23).

Fields

§sequence: u128

Zero-based position of the offending rotation.

§reason: String

Which roles flipped and how many backers survived.

§

AsymmetricKeyRotation

Rotation event’s key-list size differs from the prior next-commitment list. Properly expressing this case requires CESR indexed-signature type codes so verified indices can be mapped distinctly against prior and current key lists. Until that lands, such rotations are rejected.

Fields

§sequence: u128

Zero-based position of the rotation event.

§prior_next_count: usize

Number of entries in the prior event’s next-commitment list.

§new_key_count: usize

Number of entries in this rotation’s key list.

§

DelegatorSealNotFound

A delegated event (dip / drt) references a delegator but no matching seal could be found in the delegator’s KEL.

Fields

§sequence: u128

Zero-based position of the delegated event.

§delegator_aid: String

Delegator AID the event referenced (dip.di / drt.di).

§

DelegateSourceSealMissing

A delegated event (dip / drt) has no delegate-side source seal (-G couple). The delegator anchored it, but the event itself doesn’t point back at that anchoring event — a one-directional (and therefore non-keripy-interoperable, weakly-bound) delegation. Bilateral required.

Fields

§sequence: u128

Zero-based position of the delegated event.

§

SealBackRefMismatch

A delegated event’s source seal (-G couple) points at a different delegator event than the one that actually anchored it. The bilateral binding is broken: the delegate claims anchoring location L while the delegator’s Seal::KeyEvent lives at L′ ≠ L.

Fields

§sequence: u128

Zero-based position of the delegated event.

§

DelegatorLookupMissing

A delegated event was submitted but no DelegatorKelLookup was provided. Use validate_kel_with_lookup when processing KELs that contain dip or drt events.

Fields

§sequence: u128

Zero-based position of the delegated event.

§

NotInception

The first event in a KEL must be an Inception event.

§

EmptyKel

The KEL contains no events.

§

MultipleInceptions

More than one Inception event was found in the KEL.

§

Serialization(String)

JSON serialization or deserialization failed.

§

MalformedSequence

A sequence field could not be parsed as a valid hex number.

Fields

§raw: String

The raw string that could not be parsed.

§

InvalidKey(String)

The key encoding prefix is unsupported or malformed.

§

AbandonedIdentity

The identity has been abandoned (empty next commitment) and no more events are allowed.

Fields

§sequence: u128

The sequence number of the rejected event.

§

EstablishmentOnly

An interaction event was found in an establishment-only KEL.

Fields

§sequence: u128

The sequence number of the rejected event.

§

NonTransferable

The identity is non-transferable (inception had empty next commitments).

§

DuplicateBacker

A backer AID appears more than once in the backer list.

Fields

§aid: String

The duplicated AID.

§

InvalidBackerThreshold

The backer threshold is inconsistent with the backer list size.

Fields

§bt: u64

The backer threshold value.

§backer_count: usize

The number of backers.

§

MissingTimestamp

A policy-only variant: an establishment event is missing the dt field, so the cooldown cannot be enforced. Structural validation (validate_kel) permits missing dt; the policy validator (validate_kel_with_policy) does not.

Fields

§sequence: u128

Zero-based position of the event in the KEL.

§

NonMonotonicTimestamp

Two consecutive events have non-monotonic dt.

Fields

§sequence: u128

Zero-based position of the offending event.

§prev: String

Previous event’s dt.

§curr: String

Current event’s dt.

§

RotationCooldown

Two rotations happened closer together than the configured cooldown allows (and the event is not an emergency override).

Fields

§sequence: u128

Zero-based position of the offending rotation.

§interval_secs: i64

Observed inter-rotation interval (seconds).

§min_secs: i64

Configured minimum interval (seconds).

§

ClockSkew

An event’s dt is beyond the configured clock-skew tolerance.

Fields

§sequence: u128

Zero-based position of the event.

§skew_secs: i64

Observed skew vs server clock (seconds, signed).

§tolerance_secs: i64

Configured tolerance (seconds).

Trait Implementations§

Source§

impl Clone for ValidationError

Source§

fn clone(&self) -> ValidationError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ValidationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for ValidationError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for ValidationError

Source§

impl Error for ValidationError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for ValidationError

Source§

fn eq(&self, other: &ValidationError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ValidationError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.