update kvdb & co (#12312)

* upgrade kvdb & co

* remove patch

* update Cargo.lock

* upgrade impl-serde

* fix parsing test

* actually fix it

* FFS
This commit is contained in:
Andronik
2022-10-05 23:07:15 +02:00
committed by GitHub
parent 93e8ffed55
commit 9e423925f6
24 changed files with 73 additions and 103 deletions
+4 -4
View File
@@ -17,9 +17,9 @@ codec = { package = "parity-scale-codec", version = "3.0.0", features = [
"derive",
] }
hash-db = "0.15.2"
kvdb = "0.11.0"
kvdb-memorydb = "0.11.0"
kvdb-rocksdb = { version = "0.15.2", optional = true }
kvdb = "0.12.0"
kvdb-memorydb = "0.12.0"
kvdb-rocksdb = { version = "0.16.0", optional = true }
linked-hash-map = "0.5.4"
log = "0.4.17"
parity-db = "0.3.16"
@@ -36,7 +36,7 @@ sp-trie = { version = "6.0.0", path = "../../primitives/trie" }
[dev-dependencies]
criterion = "0.3.3"
kvdb-rocksdb = "0.15.1"
kvdb-rocksdb = "0.16.0"
rand = "0.8.4"
tempfile = "3.1.0"
quickcheck = { version = "1.0.3", default-features = false }
+6 -3
View File
@@ -115,7 +115,7 @@ pub fn upgrade_db<Block: BlockT>(db_path: &Path, db_type: DatabaseType) -> Upgra
/// 2) transactions column is added;
fn migrate_1_to_2<Block: BlockT>(db_path: &Path, _db_type: DatabaseType) -> UpgradeResult<()> {
let db_cfg = DatabaseConfig::with_columns(V1_NUM_COLUMNS);
let db = Database::open(&db_cfg, db_path)?;
let mut db = Database::open(&db_cfg, db_path)?;
db.add_column().map_err(Into::into)
}
@@ -126,7 +126,10 @@ fn migrate_2_to_3<Block: BlockT>(db_path: &Path, _db_type: DatabaseType) -> Upgr
let db = Database::open(&db_cfg, db_path)?;
// Get all the keys we need to update
let keys: Vec<_> = db.iter(columns::JUSTIFICATIONS).map(|entry| entry.0).collect();
let keys: Vec<_> = db
.iter(columns::JUSTIFICATIONS)
.map(|r| r.map(|e| e.0))
.collect::<Result<_, _>>()?;
// Read and update each entry
let mut transaction = db.transaction();
@@ -152,7 +155,7 @@ fn migrate_2_to_3<Block: BlockT>(db_path: &Path, _db_type: DatabaseType) -> Upgr
/// 2) BODY_INDEX column is added;
fn migrate_3_to_4<Block: BlockT>(db_path: &Path, _db_type: DatabaseType) -> UpgradeResult<()> {
let db_cfg = DatabaseConfig::with_columns(V3_NUM_COLUMNS);
let db = Database::open(&db_cfg, db_path)?;
let mut db = Database::open(&db_cfg, db_path)?;
db.add_column().map_err(Into::into)
}