From cfd990d9e47e4e2a4e0e459bb491b1602001515a Mon Sep 17 00:00:00 2001 From: steviez Date: Thu, 11 Aug 2022 09:41:01 -0500 Subject: [PATCH] Bump rust-rocksdb to 0.19.0 tag (#26949) (cherry picked from commit 14d9922105f78b2d3ab6ed82e5e38db27dedb76b) --- Cargo.lock | 76 +++++++------------------------------ ledger/Cargo.toml | 2 +- ledger/src/blockstore_db.rs | 14 +++++-- programs/bpf/Cargo.lock | 12 +++--- 4 files changed, 31 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d247d8a12855c7..4103785d580482 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,7 +143,7 @@ dependencies = [ "asn1-rs-derive", "asn1-rs-impl", "displaydoc", - "nom 7.0.0", + "nom", "num-traits", "rusticata-macros", "thiserror", @@ -360,9 +360,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.1" +version = "0.60.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453c49e5950bb0eb63bb3df640e31618846c89d5b7faa54040d76e98e0134375" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" dependencies = [ "bitflags", "cexpr", @@ -407,18 +407,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "bitvec" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "blake3" version = "1.3.1" @@ -721,11 +709,11 @@ dependencies = [ [[package]] name = "cexpr" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db507a7679252d2276ed0dd8113c6875ec56d3089f9225b2b42c30cc1f8e5c89" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 6.1.2", + "nom", ] [[package]] @@ -1142,7 +1130,7 @@ checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" dependencies = [ "asn1-rs", "displaydoc", - "nom 7.0.0", + "nom", "num-bigint 0.4.3", "num-traits", "rusticata-macros", @@ -1580,12 +1568,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - [[package]] name = "futures" version = "0.1.31" @@ -2427,9 +2409,9 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "librocksdb-sys" -version = "0.6.1+6.28.2" +version = "0.8.0+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" +checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" dependencies = [ "bindgen", "bzip2-sys", @@ -2728,18 +2710,6 @@ dependencies = [ "memoffset", ] -[[package]] -name = "nom" -version = "6.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" -dependencies = [ - "bitvec", - "funty", - "memchr", - "version_check", -] - [[package]] name = "nom" version = "7.0.0" @@ -3635,12 +3605,6 @@ dependencies = [ "proc-macro2 1.0.41", ] -[[package]] -name = "radium" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" - [[package]] name = "rand" version = "0.4.6" @@ -3949,9 +3913,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" +checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" dependencies = [ "libc", "librocksdb-sys", @@ -4005,7 +3969,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "nom 7.0.0", + "nom", ] [[package]] @@ -6865,16 +6829,10 @@ dependencies = [ "chrono", "lazy_static", "libc", - "nom 7.0.0", + "nom", "winapi 0.3.9", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "tar" version = "0.4.38" @@ -7987,12 +7945,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - [[package]] name = "x509-parser" version = "0.14.0" @@ -8004,7 +7956,7 @@ dependencies = [ "data-encoding", "der-parser", "lazy_static", - "nom 7.0.0", + "nom", "oid-registry", "rusticata-macros", "thiserror", diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index c2d18be9451ef7..867752a3083232 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -63,7 +63,7 @@ trees = "0.4.2" [dependencies.rocksdb] # Avoid the vendored bzip2 within rocksdb-sys that can cause linker conflicts # when also using the bzip2 crate -version = "0.18.0" +version = "0.19.0" default-features = false features = ["lz4"] diff --git a/ledger/src/blockstore_db.rs b/ledger/src/blockstore_db.rs index 94064df7a179cd..2e3ec3ba944cc5 100644 --- a/ledger/src/blockstore_db.rs +++ b/ledger/src/blockstore_db.rs @@ -509,7 +509,7 @@ impl Rocks { /// /// Full list of properties that return int values could be found /// [here](https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L654-L689). - fn get_int_property_cf(&self, cf: &ColumnFamily, name: &str) -> Result { + fn get_int_property_cf(&self, cf: &ColumnFamily, name: &'static std::ffi::CStr) -> Result { match self.db.property_int_value_cf(cf, name) { Ok(Some(value)) => Ok(value.try_into().unwrap()), Ok(None) => Ok(0), @@ -1059,7 +1059,10 @@ impl Database { { let cf = self.cf_handle::(); let iter = self.backend.iterator_cf::(cf, iterator_mode); - Ok(iter.map(|(key, value)| (C::index(&key), value))) + Ok(iter.map(|pair| { + let (key, value) = pair.unwrap(); + (C::index(&key), value) + })) } #[inline] @@ -1153,7 +1156,10 @@ where ) -> Result)> + '_> { let cf = self.handle(); let iter = self.backend.iterator_cf::(cf, iterator_mode); - Ok(iter.map(|(key, value)| (C::index(&key), value))) + Ok(iter.map(|pair| { + let (key, value) = pair.unwrap(); + (C::index(&key), value) + })) } pub fn delete_slot( @@ -1235,7 +1241,7 @@ where /// /// Full list of properties that return int values could be found /// [here](https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L654-L689). - pub fn get_int_property(&self, name: &str) -> Result { + pub fn get_int_property(&self, name: &'static std::ffi::CStr) -> Result { self.backend.get_int_property_cf(self.handle(), name) } } diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index 39130a758ca812..c62387093e884f 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -346,9 +346,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.2" +version = "0.60.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" dependencies = [ "bitflags", "cexpr", @@ -2168,9 +2168,9 @@ checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" [[package]] name = "librocksdb-sys" -version = "0.6.1+6.28.2" +version = "0.8.0+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" +checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" dependencies = [ "bindgen", "bzip2-sys", @@ -3578,9 +3578,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" +checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" dependencies = [ "libc", "librocksdb-sys",