Companion for paritytech/substrate#12795 (#6374)

* Begin removing `parity-util-mem`; remove `collect_memory_stats`

* Update some dependencies that were using `parity-util-mem`

* Remove `trie-memory-tracker` feature

* Update Cargo.lock

* Update `kvdb-shared-tests`

* Add back jemalloc

* Add missing license header

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
Co-authored-by: Andronik <write@reusable.software>
This commit is contained in:
Marcin S
2022-12-06 11:41:00 -05:00
committed by GitHub
parent 800a928ab0
commit 3f951cce16
22 changed files with 291 additions and 395 deletions
+3 -4
View File
@@ -32,8 +32,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
kvdb = "0.12.0"
parity-util-mem = { version = "0.12.0", default-features = false }
kvdb = "0.13.0"
parity-db = { version = "0.4.2"}
[dev-dependencies]
@@ -44,6 +43,6 @@ log = "0.4.17"
polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" }
lazy_static = "1.4.0"
polkadot-primitives-test-helpers = { path = "../../primitives/test-helpers" }
kvdb-shared-tests = "0.10.0"
kvdb-shared-tests = "0.11.0"
tempfile = "3.1.0"
kvdb-memorydb = "0.12.0"
kvdb-memorydb = "0.13.0"
@@ -29,7 +29,6 @@ pub trait Database: KeyValueDB {
pub mod kvdb_impl {
use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB};
use kvdb::{DBOp, IoStats, IoStatsKind};
use parity_util_mem::{MallocSizeOf, MallocSizeOfOps};
use std::{collections::BTreeSet, io::Result};
/// Adapter implementing subsystem database
@@ -123,13 +122,6 @@ pub mod kvdb_impl {
self.db.has_prefix(col, prefix)
}
}
impl<D: KeyValueDB> MallocSizeOf for DbAdapter<D> {
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
// ignore filter set
self.db.size_of(ops)
}
}
}
/// Utilities for using parity-db database.
@@ -160,12 +152,6 @@ pub mod paritydb_impl {
write_lock: Arc<Mutex<()>>,
}
impl parity_util_mem::MallocSizeOf for DbAdapter {
fn size_of(&self, _ops: &mut parity_util_mem::MallocSizeOfOps) -> usize {
unimplemented!("size_of is not supported for parity_db")
}
}
impl KeyValueDB for DbAdapter {
fn transaction(&self) -> DBTransaction {
DBTransaction::new()