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
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
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 Error for WireError
impl Error for WireError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()