pub enum ShardError {
Show 14 variants
EncodeFailed(String),
DecodeFailed(String),
ShardCodecFailed {
index: u16,
source: Error,
},
ShardHashMismatch {
index: u16,
},
IndexOutOfRange {
index: u16,
total: u32,
},
DuplicateIndex {
index: u16,
},
ManifestShardCountMismatch {
actual: usize,
expected: usize,
},
PackHashMismatch,
InsufficientShards {
provided: usize,
minimum: u16,
},
InvalidManifestPrologue(&'static str),
ManifestUnexpectedEof,
ManifestTrailingBytes,
ManifestZeroShardCount {
minimum: u16,
extra: u16,
},
ManifestTooLarge {
actual: usize,
max: usize,
},
}Expand description
Errors produced by encode_pack_to_shards / decode_pack_from_shards.
Variants§
EncodeFailed(String)
The Reed-Solomon encoder rejected the input. Typically means
the pack is larger than u32::MAX bytes (commonware’s limit).
DecodeFailed(String)
The Reed-Solomon decoder rejected the supplied shards. Usually triggered by too few shards, duplicate indices, or a Merkle proof that no longer matches the commitment.
ShardCodecFailed
The codec layer could not parse a shard’s bytes. Means the
shard envelope is malformed — distinct from a BLAKE3 mismatch.
ShardHashMismatch
A shard’s BLAKE3 hash does not match the manifest entry for its index. The shard is corrupt or maliciously substituted.
IndexOutOfRange
Manifest claims an index outside 0..total_shards.
DuplicateIndex
Duplicate shard index supplied to the decoder.
ManifestShardCountMismatch
Manifest carries the wrong number of shard_hashes for the
declared config.
PackHashMismatch
Reconstruction produced bytes whose BLAKE3 does not match
manifest.pack_hash. Cryptographically the manifest was forged.
InsufficientShards
Caller passed fewer than config.minimum_shards shards.
InvalidManifestPrologue(&'static str)
The manifest wire bytes are shorter than the v0 prologue, do not
begin with MANIFEST_MAGIC, or carry an unrecognised
MANIFEST_VERSION.
ManifestUnexpectedEof
The manifest wire bytes are truncated — a length-prefixed field claims more bytes than remain in the buffer.
ManifestTrailingBytes
The manifest carries trailing bytes after the last expected field. Most likely a producer / consumer version mismatch.
ManifestZeroShardCount
The manifest declares a (minimum_shards, extra_shards) pair
whose components are zero — illegal at the SPEC level.
ManifestTooLarge
The manifest exceeds MANIFEST_MAX_BYTES.
Trait Implementations§
Source§impl Debug for ShardError
impl Debug for ShardError
Source§impl Display for ShardError
impl Display for ShardError
Source§impl Error for ShardError
impl Error for ShardError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for ShardError
impl !UnwindSafe for ShardError
impl Freeze for ShardError
impl Send for ShardError
impl Sync for ShardError
impl Unpin for ShardError
impl UnsafeUnpin for ShardError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more