Skip to main content

BlobError

Enum BlobError 

Source
#[non_exhaustive]
pub enum BlobError { HashMismatch { expected: [u8; 32], actual: [u8; 32], }, UnsupportedScheme(String), NotFound(String), Backend(String), Cancelled, UnsupportedVersion(u8), Decode(String), AdapterNotConfigured, AdapterNotRegistered(String), Unauthorized(String), ShortChunk { hash: [u8; 32], requested_start: u64, requested_end: u64, actual_len: u64, }, }
Expand description

Errors surfaced by super::BlobAdapter implementations and the substrate’s blob-fetch path. Variants stay byte-stable across bindings because they appear in error-routing logic on the JS / Python / Go sides.

#[non_exhaustive] so binding-side FFI sites that match exhaustively get a compile-time nudge when new variants land, rather than silently routing unknown errors to a default arm.

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.
§

HashMismatch

Adapter returned bytes whose BLAKE3 hash did not match the expected hash carried in the super::BlobRef. The substrate enforces verification so an adversarial adapter cannot fake-verify. expected / actual are 32-byte BLAKE3 outputs.

Fields

§expected: [u8; 32]

Hash recorded on the BlobRef.

§actual: [u8; 32]

Hash computed over the fetched bytes.

§

UnsupportedScheme(String)

BlobRef::uri carries a scheme this adapter does not recognise (s3://, ipfs://, file://, etc.). The substrate routes per scheme; surface from the routing layer when no registered adapter claims the scheme.

§

NotFound(String)

Object did not exist at the adapter’s backend.

§

Backend(String)

Adapter-side I/O / network / auth failure. The string is the adapter’s best-effort message; downstream telemetry consumes the whole BlobError Display.

§

Cancelled

Caller cancelled the fetch (e.g. context dropped, future aborted).

§

UnsupportedVersion(u8)

BlobRef encoded with a version byte this build does not understand. Reserved for migration headroom; current encoder only emits super::blob_ref::BLOB_REF_VERSION_V1.

§

Decode(String)

BlobRef encoded form failed to decode (truncated / corrupted bytes, bad postcard frame, etc.).

§

AdapterNotConfigured

Channel’s RedexFileConfig did not specify a blob_adapter_id — substrate can’t route the BlobRef resolve. Operator misconfiguration (vs AdapterNotRegistered which is a deploy-ordering issue).

§

AdapterNotRegistered(String)

Channel’s configured blob_adapter_id is not present in the registry — either an adapter that hasn’t been registered yet (deploy-ordering race) or one that was unregistered. Distinct from AdapterNotConfigured so operators can tell apart “you forgot to set it” from “you didn’t register the named adapter yet.”

§

Unauthorized(String)

Caller failed an authorization check on the blob op: AuthGuard rejected the (origin_hash, ChannelName) ACL lookup, or no guard was configured for an op that requires one. Distinct from Backend so callers (and metrics) can tell apart a 401-style security boundary hit from a 500-style adapter failure. The string is the authorization-side context; do not leak channel names or principal identifiers if they’re sensitive.

§

ShortChunk

Backend returned a chunk whose length is shorter than the manifest’s recorded chunk size — distinct from Self::HashMismatch so retry logic can tell a truncated tail (where the content may still hash correctly over its visible prefix) from a fundamental content disagreement. Pre-fix, an over-short chunk surfaced as HashMismatch { expected, actual: blake3(short_bytes) }, where actual could even equal expected for a truncated tail aligned to a block boundary, confusing retry / divergence-detection callers.

Fields

§hash: [u8; 32]

Hash recorded on the BlobRef::Manifest chunk entry.

§requested_start: u64

Bytes the request asked the chunk to span past (req.start_in_chunk).

§requested_end: u64

Bytes the request asked the chunk to span up to (req.end_in_chunk).

§actual_len: u64

Bytes the backend actually delivered for this chunk.

Trait Implementations§

Source§

impl Clone for BlobError

Source§

fn clone(&self) -> BlobError

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 BlobError

Source§

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

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

impl Display for BlobError

Source§

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

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

impl Error for BlobError

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 BlobError

Source§

fn eq(&self, other: &BlobError) -> 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 Eq for BlobError

Source§

impl StructuralPartialEq for BlobError

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> 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> 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.
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