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 more