diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 3d9068f8eb..8e725af983 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -6697,9 +6697,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865edee5b792f537356d9e55cbc138e7f4718dc881a7ea45a18b37bf61c21e3d" +checksum = "3d121a9af17a43efd0a38c6afa508b927ba07785bd4709efb2ac03bf77efef8d" dependencies = [ "blake2-rfc", "crc32fast", diff --git a/substrate/client/db/Cargo.toml b/substrate/client/db/Cargo.toml index 7b1e4da208..105bc43c61 100644 --- a/substrate/client/db/Cargo.toml +++ b/substrate/client/db/Cargo.toml @@ -33,7 +33,7 @@ sc-state-db = { version = "0.10.0-dev", path = "../state-db" } sp-trie = { version = "6.0.0", path = "../../primitives/trie" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } sp-database = { version = "4.0.0-dev", path = "../../primitives/database" } -parity-db = { version = "0.3.8", optional = true } +parity-db = { version = "0.3.9", optional = true } [dev-dependencies] sp-tracing = { version = "5.0.0", path = "../../primitives/tracing" } diff --git a/substrate/client/db/src/parity_db.rs b/substrate/client/db/src/parity_db.rs index c81a346bb0..f88e6f2e91 100644 --- a/substrate/client/db/src/parity_db.rs +++ b/substrate/client/db/src/parity_db.rs @@ -73,7 +73,7 @@ pub fn open>( if upgrade { log::info!("Upgrading database metadata."); if let Some(meta) = parity_db::Options::load_metadata(path)? { - config.write_metadata(path, &meta.salt)?; + config.write_metadata_with_version(path, &meta.salt, Some(meta.version))?; } } diff --git a/substrate/client/db/src/utils.rs b/substrate/client/db/src/utils.rs index 7dcb6676a1..29aa842422 100644 --- a/substrate/client/db/src/utils.rs +++ b/substrate/client/db/src/utils.rs @@ -275,6 +275,7 @@ fn open_parity_db(path: &Path, db_type: DatabaseType, create: boo match crate::parity_db::open(path, db_type, create, false) { Ok(db) => Ok(db), Err(parity_db::Error::InvalidConfiguration(_)) => { + log::warn!("Invalid parity db configuration, attempting database metadata update."); // Try to update the database with the new config Ok(crate::parity_db::open(path, db_type, create, true)?) },