Remove mem_info and references to parity-util-mem (#12795)

* Remove mem_info and some references to parity-util-mem

* [Draft] Finish removing references to `parity-util-mem`

* Upgrade dependencies

* Update scripts/ci/deny.toml

Co-authored-by: ordian <write@reusable.software>

* Fix Cargo.lock (remove unwanted dependency changes)

* Removed unused argument

* Run cargo fmt (didn't have pre-commit set up)

* Fix some CI errors

* Fix another CI error

* Remove unused dependency

Co-authored-by: ordian <write@reusable.software>
This commit is contained in:
Marcin S
2022-12-06 09:55:10 -05:00
committed by GitHub
parent 07117e7913
commit aa21e56744
46 changed files with 70 additions and 426 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.12.0"
kvdb-memorydb = "0.12.0"
kvdb-rocksdb = { version = "0.16.0", optional = true }
kvdb = "0.13.0"
kvdb-memorydb = "0.13.0"
kvdb-rocksdb = { version = "0.17.0", optional = true }
linked-hash-map = "0.5.4"
log = "0.4.17"
parity-db = "0.4.2"
@@ -36,7 +36,7 @@ sp-trie = { version = "7.0.0", path = "../../primitives/trie" }
[dev-dependencies]
criterion = "0.3.3"
kvdb-rocksdb = "0.16.0"
kvdb-rocksdb = "0.17.0"
rand = "0.8.4"
tempfile = "3.1.0"
quickcheck = { version = "1.0.3", default-features = false }
+1 -2
View File
@@ -2086,10 +2086,9 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
let state_cache = MemorySize::from_bytes(
self.shared_trie_cache.as_ref().map_or(0, |c| c.used_memory_size()),
);
let state_db = self.storage.state_db.memory_info();
Some(UsageInfo {
memory: MemoryInfo { state_cache, database_cache, state_db },
memory: MemoryInfo { state_cache, database_cache },
io: IoInfo {
transactions: io_stats.transactions,
bytes_read: io_stats.bytes_read,
+3 -7
View File
@@ -59,15 +59,11 @@ pub struct Cache<B: BlockT> {
struct LRUMap<K, V>(LinkedHashMap<K, V>, usize, usize);
/// Internal trait similar to `heapsize` but using
/// a simply estimation.
/// Internal trait similar to `heapsize` but using a simple estimation.
///
/// This should not be made public, it is implementation
/// detail trait. If it need to become public please
/// consider using `malloc_size_of`.
/// This should not be made public, it is an implementation detail trait.
trait EstimateSize {
/// Return a size estimation of additional size needed
/// to cache this struct (in bytes).
/// Return a size estimation of the additional size needed to cache this struct (in bytes).
fn estimate_size(&self) -> usize;
}