#[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
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
impl Debug for ProofError
Source§impl Display for ProofError
impl Display for ProofError
Source§impl Error for ProofError
impl Error for ProofError
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
Source§impl From<FileIoError> for ProofError
impl From<FileIoError> for ProofError
Source§impl From<ProofError> for Error
impl From<ProofError> for Error
Source§fn from(source: ProofError) -> Self
fn from(source: ProofError) -> Self
Auto Trait Implementations§
impl Freeze for ProofError
impl !RefUnwindSafe for ProofError
impl Send for ProofError
impl Sync for ProofError
impl Unpin for ProofError
impl !UnwindSafe for ProofError
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> 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