mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 13:24:44 +00:00
Add database schema versioning (#1688)
## Issue Addressed Closes #673 ## Proposed Changes Store a schema version in the database so that future releases can check they're running against a compatible database version. This would also enable automatic migration on breaking database changes, but that's left as future work. The database config is also stored in the database so that the `slots_per_restore_point` value can be checked for consistency, which closes #673
This commit is contained in:
committed by
Paul Hauner
parent
cdec3cec18
commit
22aedda1be
@@ -1,4 +1,5 @@
|
||||
use crate::chunked_vector::ChunkError;
|
||||
use crate::config::StoreConfigError;
|
||||
use crate::hot_cold_store::HotColdDBError;
|
||||
use ssz::DecodeError;
|
||||
use types::{BeaconStateError, Hash256, Slot};
|
||||
@@ -17,6 +18,7 @@ pub enum Error {
|
||||
BlockNotFound(Hash256),
|
||||
NoContinuationData,
|
||||
SplitPointModified(Slot, Slot),
|
||||
ConfigError(StoreConfigError),
|
||||
}
|
||||
|
||||
impl From<DecodeError> for Error {
|
||||
@@ -49,6 +51,12 @@ impl From<DBError> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<StoreConfigError> for Error {
|
||||
fn from(e: StoreConfigError) -> Error {
|
||||
Error::ConfigError(e)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct DBError {
|
||||
pub message: String,
|
||||
|
||||
Reference in New Issue
Block a user