pub enum StorageError {
StorageInternalError,
MissingTrieValue(MissingTrieValue),
UnexpectedTrieValue,
StorageInconsistentState(String),
FlatStorageBlockNotSupported(String),
MemTrieLoadingError(String),
}Expand description
Errors which may occur during working with trie storages, storing trie values (trie nodes and state values) by their hashes.
JSON schema
{
"description": "Errors which may occur during working with trie storages, storing\ntrie values (trie nodes and state values) by their hashes.",
"oneOf": [
{
"description": "Key-value db internal failure",
"type": "string",
"enum": [
"StorageInternalError"
]
},
{
"description": "Requested trie value by its hash which is missing in storage.",
"type": "object",
"required": [
"MissingTrieValue"
],
"properties": {
"MissingTrieValue": {
"$ref": "#/components/schemas/MissingTrieValue"
}
},
"additionalProperties": false
},
{
"description": "Found trie node which shouldn't be part of state. Raised during\nvalidation of state sync parts where incorrect node was passed.\nTODO (#8997): consider including hash of trie node.",
"type": "string",
"enum": [
"UnexpectedTrieValue"
]
},
{
"description": "Either invalid state or key-value db is corrupted.\nFor PartialStorage it cannot be corrupted.\nError message is unreliable and for debugging purposes only. It's also probably ok to\npanic in every place that produces this error.\nWe can check if db is corrupted by verifying everything in the state trie.",
"type": "object",
"required": [
"StorageInconsistentState"
],
"properties": {
"StorageInconsistentState": {
"type": "string"
}
},
"additionalProperties": false
},
{
"description": "Flat storage error, meaning that it doesn't support some block anymore.\nWe guarantee that such block cannot become final, thus block processing\nmust resume normally.",
"type": "object",
"required": [
"FlatStorageBlockNotSupported"
],
"properties": {
"FlatStorageBlockNotSupported": {
"type": "string"
}
},
"additionalProperties": false
},
{
"description": "In-memory trie could not be loaded for some reason.",
"type": "object",
"required": [
"MemTrieLoadingError"
],
"properties": {
"MemTrieLoadingError": {
"type": "string"
}
},
"additionalProperties": false
}
]
}Variants§
StorageInternalError
Key-value db internal failure
MissingTrieValue(MissingTrieValue)
Requested trie value by its hash which is missing in storage.
UnexpectedTrieValue
Found trie node which shouldn’t be part of state. Raised during validation of state sync parts where incorrect node was passed. TODO (#8997): consider including hash of trie node.
StorageInconsistentState(String)
Either invalid state or key-value db is corrupted. For PartialStorage it cannot be corrupted. Error message is unreliable and for debugging purposes only. It’s also probably ok to panic in every place that produces this error. We can check if db is corrupted by verifying everything in the state trie.
FlatStorageBlockNotSupported(String)
Flat storage error, meaning that it doesn’t support some block anymore. We guarantee that such block cannot become final, thus block processing must resume normally.
MemTrieLoadingError(String)
In-memory trie could not be loaded for some reason.
Trait Implementations§
Source§impl Clone for StorageError
impl Clone for StorageError
Source§fn clone(&self) -> StorageError
fn clone(&self) -> StorageError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StorageError
impl Debug for StorageError
Source§impl<'de> Deserialize<'de> for StorageError
impl<'de> Deserialize<'de> for StorageError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for StorageError
impl Display for StorageError
Source§impl Error for StorageError
impl Error for StorageError
1.30.0 · 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<&StorageError> for StorageError
impl From<&StorageError> for StorageError
Source§fn from(value: &StorageError) -> Self
fn from(value: &StorageError) -> Self
Source§impl From<MissingTrieValue> for StorageError
impl From<MissingTrieValue> for StorageError
Source§fn from(value: MissingTrieValue) -> Self
fn from(value: MissingTrieValue) -> Self
Source§impl From<StorageError> for InvalidTxError
impl From<StorageError> for InvalidTxError
Source§fn from(value: StorageError) -> Self
fn from(value: StorageError) -> Self
Auto Trait Implementations§
impl Freeze for StorageError
impl RefUnwindSafe for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl UnwindSafe for StorageError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.