Skip to main content

WireError

Enum WireError 

Source
pub enum WireError {
    Decode(Error),
    BadSignatureLength(usize),
    PlaceholderSignature,
    InvalidSignature,
    InvalidPublicKey,
    NodeIdMismatch {
        claimed: NodeId,
        publisher: NodeId,
    },
    KindMismatch {
        got: u16,
        expected: u16,
    },
    Apply(FoldError),
}
Expand description

Errors the wire codec surfaces. The dispatch layer routes them to logs + metrics; the caller of SignedAnnouncement::decode sees them via Result.

Variants§

§

Decode(Error)

Postcard refused to decode the byte buffer (truncated, schema-incompatible, etc.).

§

BadSignatureLength(usize)

The signature on a decoded envelope has the wrong length. Production signatures are exactly SIGNATURE_LEN bytes (Ed25519); anything else is malformed by construction.

§

PlaceholderSignature

Decoded envelope carries the placeholder_signature sentinel. Dispatch rejects this — the envelope was constructed without signing, so verification would be vacuous and the node_id claim is unauthenticated.

§

InvalidSignature

Underlying Ed25519 verifier rejected the signature: the envelope was tampered with, or claims a publisher whose public key doesn’t match the signing key.

§

InvalidPublicKey

The publisher’s EntityId bytes aren’t a valid Ed25519 public key (not on-curve / malformed encoding). Returned when the dispatch layer is handed an EntityId that didn’t round-trip through a known publisher.

§

NodeIdMismatch

The envelope’s node_id claim doesn’t match the node id derived from the signature-verified publisher. A valid signature only proves the publisher signed these bytes — without this check a peer could sign an envelope claiming any other node’s id, and Fold::apply keys all state on node_id, so the forged entry would land in the victim’s capability/reservation state (cross-node injection). The publisher is the node; the two must agree.

Fields

§claimed: NodeId

node_id field decoded from the envelope.

§publisher: NodeId

Node id derived from the verified publisher EntityId.

§

KindMismatch

The decoded envelope’s kind field doesn’t match the fold it was dispatched into. The dispatch layer catches this BEFORE handing the envelope to Fold::apply so a crossed-channel publish doesn’t pollute the wrong fold.

Fields

§got: u16

Kind field decoded from the envelope.

§expected: u16

Kind the dispatch path was expecting.

§

Apply(FoldError)

An FoldError surfaced during the post-verify apply. Wraps the underlying error so callers can pattern-match on the apply-side failure modes.

Trait Implementations§

Source§

impl Debug for WireError

Source§

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

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

impl Display for WireError

Source§

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

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

impl Error for WireError

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 From<Error> for WireError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FoldError> for WireError

Source§

fn from(source: FoldError) -> Self

Converts to this type from the input type.
Source§

impl From<WireError> for DispatchError

Source§

fn from(source: WireError) -> Self

Converts to this type from the input type.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more