ProofError

Enum ProofError 

Source
#[non_exhaustive]
pub enum ProofError {
Show 41 variants NonMonotonicIncreaseRange, UnexpectedHash, UnexpectedValue, ValueMismatch, ExpectedValue, Empty, ShouldBePrefixOfProvenKey, ShouldBePrefixOfNextKey, ChildIndexOutOfBounds, ValueAtOddNibbleLength, NodeNotInTrie, IO(FileIoError), Deserialization(ReadError), EmptyRange, Unverified, InvalidValueFormat, ProofIsLargerThanMaxLength, ChangeProofKeysNotSorted, StartKeyLargerThanFirstKey, EndKeyLessThanLastKey, RangeProofStartBeyondFirstKey, RangeProofEndBeforeLastKey, ProofIsNone, KeyOutsideRange, NoEndProof, UnexpectedStartProof, ConflictingProofNodes, StartAfterEnd, ProofNodeHasUnincludedValue, ProposalIsNone, EndRootMismatch, EndProofOperationMismatch, StartProofOperationMismatch, DeleteRangeFoundInChangeProof, MissingBoundaryProof, ProofNodeValueMismatch, BoundaryProofsDivergeAtRoot, UnexpectedEndProof, InRangeChildMismatch, MissingEndProof, ProofNodeUnreachable,
}
Expand description

Reasons why a proof is invalid

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

NonMonotonicIncreaseRange

Non-monotonic range decrease

§

UnexpectedHash

Unexpected hash

§

UnexpectedValue

Unexpected value

§

ValueMismatch

Value mismatch

§

ExpectedValue

Expected value but got None

§

Empty

Proof is empty

§

ShouldBePrefixOfProvenKey

Each proof node key should be a prefix of the proven key

§

ShouldBePrefixOfNextKey

Each proof node key should be a prefix of the next key

§

ChildIndexOutOfBounds

Child index is out of bounds

§

ValueAtOddNibbleLength

Only nodes with even length key can have values

§

NodeNotInTrie

Node not in trie

§

IO(FileIoError)

Error from the merkle package

§

Deserialization(ReadError)

Error deserializing a proof

§

EmptyRange

Empty range

§

Unverified

The proof has not yet been verified.

§

InvalidValueFormat

Invalid value format

§

ProofIsLargerThanMaxLength

§

ChangeProofKeysNotSorted

Change proof keys are not sorted

§

StartKeyLargerThanFirstKey

Start key is larger than first key

§

EndKeyLessThanLastKey

End key is smaller than last key

§

RangeProofStartBeyondFirstKey

Range proof: requested start key is greater than the first key in the proof

§

RangeProofEndBeforeLastKey

Range proof: requested end key is less than the last key in the proof

§

ProofIsNone

§

KeyOutsideRange

Key-value pair is outside the requested range

§

NoEndProof

End proof is required when key-value pairs are present or end key is specified

§

UnexpectedStartProof

Start proof should be empty when no start key is specified

§

ConflictingProofNodes

Start and end proofs contain conflicting nodes at the same key path

§

StartAfterEnd

Start key is after end key

§

ProofNodeHasUnincludedValue

A proof node within the range has a value not present in the key-value pairs

§

ProposalIsNone

§

EndRootMismatch

Computed root hash after applying batch_ops doesn’t match expected end root

§

EndProofOperationMismatch

The end proof’s inclusion/exclusion result doesn’t match the last batch op’s type when batch_ops is non-empty. A Put expects the key to exist in end_root (inclusion); a Delete expects it to be absent (exclusion). A mismatch indicates the attacker tampered with batch_ops — for example, appending a spurious key changes last_op_key, shifting the end proof’s derived key.

§

StartProofOperationMismatch

The start proof’s inclusion/exclusion result doesn’t match the first batch op’s type when first_op_key == start_key. A Put expects the key to exist in end_root (inclusion); a Delete expects it to be absent (exclusion). A mismatch indicates the attacker tampered with batch_ops by adding a spurious key at start_key.

§

DeleteRangeFoundInChangeProof

A DeleteRange operation was found in a change proof’s batch ops. DeleteRange is not supported in change proofs — honest generators only produce Put and Delete operations.

§

MissingBoundaryProof

Bounded change proof with non-empty batch operations requires at least one boundary proof for verification. Unbounded proofs (start_key and end_key both None) use direct root hash comparison and do not require boundary proofs.

§

ProofNodeValueMismatch

A proof node’s value differs from the expected value

§

BoundaryProofsDivergeAtRoot

Start and end boundary proofs share no common prefix — they disagree on the very first node. Since both proofs have already passed hash chain verification against the same end_root, their first nodes must be identical. This is unreachable without a hash collision.

§

UnexpectedEndProof

Non-empty end proof when no end key is set and no batch operations.

§

InRangeChildMismatch

In-range child hash mismatch between proof and proposal.

§

MissingEndProof

Empty end proof when end_key is set or batch_ops is non-empty.

§

ProofNodeUnreachable

Proof node is unreachable in the proving trie during collapse

Trait Implementations§

Source§

impl Debug for ProofError

Source§

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

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

impl Display for ProofError

Source§

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

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

impl Error for ProofError

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<FileIoError> for ProofError

Source§

fn from(source: FileIoError) -> Self

Converts to this type from the input type.
Source§

impl From<ProofError> for Error

Source§

fn from(source: ProofError) -> 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, 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ValueSize for T

§

fn value_size(&self) -> usize

The size of this value in bytes, excluding allocated data. Read more
§

fn value_size_sum_iter<'item>(iterator: impl Iterator<Item = &'item T>) -> usize
where T: 'item,

The total sum of the sizes of all values in the given iterator, in bytes. This is default-implemented by computing [ValueSize::value_size] on every element and summing them. For Sized types, a more potentially efficient implementation using Iterator::count is provided. If you are implementing this trait manually, it is unlikely to be more efficient to provide a manual implementation here. Read more
§

fn value_size_sum_exact_size_iter<'item>( iterator: impl ExactSizeIterator<Item = &'item T>, ) -> usize
where T: 'item,

The total sum of the sizes of all values in the given exact-size-iterator, in bytes. This is default-implemented by using [ValueSize::value_size_sum_iter]. For Sized types, a usually more efficient implementation using ExactSizeIterator::len is provided. If you are implementing this trait manually, it is unlikely to be more efficient to provide a manual implementation here. Read more