runtime-api subsystem lru cache (#2309)

* Add memory-lru cache to runtime-api

* Add cache.rs

* Adds MallocSizeOf

* Review nits

* Add a cached requests metric

* More review nits

* Some more review nits
This commit is contained in:
Fedor Sakharov
2021-01-26 18:51:10 +03:00
committed by GitHub
parent f3adf8b864
commit 5634d289ee
11 changed files with 525 additions and 39 deletions
+63
View File
@@ -1317,6 +1317,33 @@ dependencies = [
"libc",
]
[[package]]
name = "ethbloom"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22a621dcebea74f2a6f2002d0a885c81ccf6cbdf86760183316a7722b5707ca4"
dependencies = [
"crunchy",
"fixed-hash",
"impl-rlp",
"impl-serde",
"tiny-keccak",
]
[[package]]
name = "ethereum-types"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05dc5f0df4915fa6dff7f975a8366ecfaaa8959c74235469495153e7bb1b280e"
dependencies = [
"ethbloom",
"fixed-hash",
"impl-rlp",
"impl-serde",
"primitive-types",
"uint",
]
[[package]]
name = "event-listener"
version = "2.5.1"
@@ -2350,6 +2377,15 @@ dependencies = [
"parity-scale-codec",
]
[[package]]
name = "impl-rlp"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808"
dependencies = [
"rlp",
]
[[package]]
name = "impl-serde"
version = "0.3.1"
@@ -3438,6 +3474,15 @@ dependencies = [
"parity-util-mem",
]
[[package]]
name = "memory-lru"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a"
dependencies = [
"lru",
]
[[package]]
name = "memory_units"
version = "0.3.0"
@@ -4548,9 +4593,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f17f15cb05897127bf36a240085a1f0bbef7bce3024849eccf7f93f6171bc27"
dependencies = [
"cfg-if 1.0.0",
"ethereum-types",
"hashbrown",
"impl-trait-for-tuples 0.2.0",
"jemallocator",
"lru",
"parity-util-mem-derive",
"parking_lot 0.11.1",
"primitive-types",
@@ -5028,6 +5075,7 @@ name = "polkadot-core-primitives"
version = "0.7.30"
dependencies = [
"parity-scale-codec",
"parity-util-mem",
"sp-core",
"sp-runtime",
"sp-std",
@@ -5263,6 +5311,8 @@ name = "polkadot-node-core-runtime-api"
version = "0.1.0"
dependencies = [
"futures 0.3.12",
"memory-lru",
"parity-util-mem",
"polkadot-node-subsystem",
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
@@ -5429,6 +5479,7 @@ dependencies = [
"futures 0.3.12",
"log",
"parity-scale-codec",
"parity-util-mem",
"parking_lot 0.11.1",
"polkadot-core-primitives",
"sc-executor",
@@ -5471,6 +5522,7 @@ dependencies = [
"frame-system",
"hex-literal",
"parity-scale-codec",
"parity-util-mem",
"polkadot-core-primitives",
"polkadot-parachain",
"pretty_assertions",
@@ -6029,6 +6081,7 @@ checksum = "b3824ae2c5e27160113b9e029a10ec9e3f0237bad8029f69c7724393c9fdefd8"
dependencies = [
"fixed-hash",
"impl-codec",
"impl-rlp",
"impl-serde",
"uint",
]
@@ -6567,6 +6620,16 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "rlp"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e54369147e3e7796c9b885c7304db87ca3d09a0a98f72843d532868675bbfba8"
dependencies = [
"bytes 1.0.1",
"rustc-hex",
]
[[package]]
name = "rocksdb"
version = "0.15.0"