From 84a5e4e276aa6e94b741662282ca3e11c8df721d Mon Sep 17 00:00:00 2001 From: nikurt <86772482+nikurt@users.noreply.github.com> Date: Tue, 15 Feb 2022 00:54:18 +0100 Subject: [PATCH 01/17] chore: Upgrade rust-rocksdb 0.16 to 0.18 (#6289) * chore: Upgrade rust-rocksdb 0.16 to 0.18 * zlib causes a linker failure in librocksdb_sys * . * . * Disable bzip2 feature * fmt --- Cargo.lock | 66 +++++++++++++++++---- chain/indexer/Cargo.toml | 2 +- core/store/Cargo.toml | 2 +- core/store/src/db.rs | 2 +- core/store/src/db/refcount.rs | 2 +- core/store/src/db/v6_to_v7.rs | 2 +- runtime/runtime-params-estimator/Cargo.toml | 2 +- 7 files changed, 60 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57a91bf637a..7c05b33693c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -453,9 +453,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.57.0" +version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263d" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" dependencies = [ "bitflags", "cexpr", @@ -673,6 +673,17 @@ dependencies = [ "bytes", ] +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "c2-chacha" version = "0.3.2" @@ -734,9 +745,9 @@ dependencies = [ [[package]] name = "cexpr" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ "nom", ] @@ -2165,14 +2176,28 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "6.17.3" +version = "0.6.1+6.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da125e1c0f22c7cae785982115523a0738728498547f415c9054cb17c7e89f9" +checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" dependencies = [ "bindgen", + "bzip2-sys", "cc", "glob", "libc", + "libz-sys", + "zstd-sys", +] + +[[package]] +name = "libz-sys" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", ] [[package]] @@ -2359,6 +2384,12 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.4.4" @@ -3301,11 +3332,12 @@ dependencies = [ [[package]] name = "nom" -version = "5.1.2" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" dependencies = [ "memchr", + "minimal-lexical", "version_check", ] @@ -4281,9 +4313,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c749134fda8bfc90d0de643d59bfc841dcb3ac8a1062e12b6754bd60235c48b3" +checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" dependencies = [ "libc", "librocksdb-sys", @@ -4652,9 +4684,9 @@ checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" [[package]] name = "shlex" -version = "0.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook-registry" @@ -6040,3 +6072,13 @@ dependencies = [ "rand 0.8.4", "rustc-hex", ] + +[[package]] +name = "zstd-sys" +version = "1.6.3+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" +dependencies = [ + "cc", + "libc", +] diff --git a/chain/indexer/Cargo.toml b/chain/indexer/Cargo.toml index 9a6a148ee12..195c359b1bf 100644 --- a/chain/indexer/Cargo.toml +++ b/chain/indexer/Cargo.toml @@ -13,7 +13,7 @@ anyhow = "1.0.51" async-recursion = "0.3.2" tracing = "0.1.13" futures = "0.3.5" -rocksdb = "0.16.0" +rocksdb = { version = "0.18.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib"] } serde = { version = "1", features = [ "derive" ] } serde_json = "1.0.55" tokio = { version = "1.1", features = ["time", "sync"] } diff --git a/core/store/Cargo.toml b/core/store/Cargo.toml index 4d6a440b2ab..e29f047a96c 100644 --- a/core/store/Cargo.toml +++ b/core/store/Cargo.toml @@ -13,7 +13,7 @@ byteorder = "1.2" bytesize = "1.1" derive_more = "0.99.3" elastic-array = "0.11" -rocksdb = "0.16.0" +rocksdb = { version = "0.18.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib"] } serde_json = "1" num_cpus = "1.11" rand = "0.7" diff --git a/core/store/src/db.rs b/core/store/src/db.rs index 6eb32d4fc9e..e731840eea5 100644 --- a/core/store/src/db.rs +++ b/core/store/src/db.rs @@ -803,7 +803,7 @@ fn rocksdb_block_based_options(cache_size: usize) -> BlockBasedOptions { block_opts.set_block_cache(&Cache::new_lru_cache(cache_size).unwrap()); block_opts.set_pin_l0_filter_and_index_blocks_in_cache(true); block_opts.set_cache_index_and_filter_blocks(true); - block_opts.set_bloom_filter(10, true); + block_opts.set_bloom_filter(10.0, true); block_opts } diff --git a/core/store/src/db/refcount.rs b/core/store/src/db/refcount.rs index f0320e904e5..433683ede47 100644 --- a/core/store/src/db/refcount.rs +++ b/core/store/src/db/refcount.rs @@ -85,7 +85,7 @@ impl RocksDB { pub(crate) fn refcount_merge( _new_key: &[u8], existing_val: Option<&[u8]>, - operands: &mut MergeOperands, + operands: &MergeOperands, ) -> Option> { let mut result = vec![]; if let Some(val) = existing_val { diff --git a/core/store/src/db/v6_to_v7.rs b/core/store/src/db/v6_to_v7.rs index 1b169e927b1..1763fc08783 100644 --- a/core/store/src/db/v6_to_v7.rs +++ b/core/store/src/db/v6_to_v7.rs @@ -10,7 +10,7 @@ use crate::DBCol; fn refcount_merge_v6( _new_key: &[u8], existing_val: Option<&[u8]>, - operands: &mut MergeOperands, + operands: &MergeOperands, ) -> Option> { let mut result = vec![]; if let Some(val) = existing_val { diff --git a/runtime/runtime-params-estimator/Cargo.toml b/runtime/runtime-params-estimator/Cargo.toml index 91ea12ed3f6..fed0c2c67a6 100644 --- a/runtime/runtime-params-estimator/Cargo.toml +++ b/runtime/runtime-params-estimator/Cargo.toml @@ -37,7 +37,7 @@ near-store = { path = "../../core/store" } near-primitives = { path = "../../core/primitives" } nearcore = { path = "../../nearcore" } -rocksdb = "0.16.0" +rocksdb = { version = "0.18.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib"] } walrus = "0.18.0" hex = "0.4" cfg-if = "1" From e4982a64d51c3ad8e087005768d4df0058c77b79 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Fri, 25 Feb 2022 12:51:17 +0100 Subject: [PATCH 02/17] Enable '-C target-cpu=native' projectwide --- .cargo/config.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000000..ddff4407b90 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["-C", "target-cpu=native"] From d94c54dbd7eed52e4f4cf5cc446b66f1b59e857a Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Fri, 25 Feb 2022 13:10:48 +0100 Subject: [PATCH 03/17] Set '-C target-cpu=native' in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dbcdbad145e..b014a2a0c29 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ export CARGO_PROFILE_RELEASE_CODEGEN_UNITS = 1 export CARGO_PROFILE_RELEASE_LTO = fat export DOCKER_BUILDKIT = 1 -export RUSTFLAGS = -D warnings +export RUSTFLAGS = "-D warnings -C target-cpu=native" export NEAR_RELEASE_BUILD = no export CARGO_TARGET_DIR = target From d1491514a6c668f31c34898e1d8cdc10643d74d7 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Fri, 25 Feb 2022 15:32:52 +0100 Subject: [PATCH 04/17] Enable sse2/sse4.1/sse4.2 instead of using target-cpu=native --- .cargo/config.toml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index ddff4407b90..a4a07f811dc 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [build] -rustflags = ["-C", "target-cpu=native"] +rustflags = ["-C", "target-feature=+sse2", "-C", "target-feature=+sse4.1", "-C", "target-feature=+sse4.2"] diff --git a/Makefile b/Makefile index b014a2a0c29..fac063e3431 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ export CARGO_PROFILE_RELEASE_CODEGEN_UNITS = 1 export CARGO_PROFILE_RELEASE_LTO = fat export DOCKER_BUILDKIT = 1 -export RUSTFLAGS = "-D warnings -C target-cpu=native" +export RUSTFLAGS = "-D warnings -C target-feature=+sse2 -C target-feature=+sse4.1 -C target-feature=+sse4.2" export NEAR_RELEASE_BUILD = no export CARGO_TARGET_DIR = target From 333dd308ac07075d483245cf4903d75bc6b42101 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Fri, 25 Feb 2022 15:51:53 +0100 Subject: [PATCH 05/17] Tiny change --- .cargo/config.toml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index a4a07f811dc..a76873a581f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [build] -rustflags = ["-C", "target-feature=+sse2", "-C", "target-feature=+sse4.1", "-C", "target-feature=+sse4.2"] +rustflags = ["-Ctarget-feature=+sse4.1,+sse4.2"] diff --git a/Makefile b/Makefile index fac063e3431..d366f69cf57 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ export CARGO_PROFILE_RELEASE_CODEGEN_UNITS = 1 export CARGO_PROFILE_RELEASE_LTO = fat export DOCKER_BUILDKIT = 1 -export RUSTFLAGS = "-D warnings -C target-feature=+sse2 -C target-feature=+sse4.1 -C target-feature=+sse4.2" +export RUSTFLAGS = "-D warnings -Ctarget-feature=+sse4.1,+sse4.2" export NEAR_RELEASE_BUILD = no export CARGO_TARGET_DIR = target From b4ef36ce876406760ea4a8eeeee6fc2d3f513bb9 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Fri, 25 Feb 2022 16:31:27 +0100 Subject: [PATCH 06/17] Tiny change --- .cargo/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index a76873a581f..0b49503aebf 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ -[build] +[target.'cfg(target_arch="x86_64")'] rustflags = ["-Ctarget-feature=+sse4.1,+sse4.2"] From a5731496840e2df09cf1e1d9cececfa725c0ca1b Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Fri, 25 Feb 2022 19:10:46 +0100 Subject: [PATCH 07/17] Tiny change --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d366f69cf57..5086763547e 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,17 @@ export CARGO_PROFILE_RELEASE_CODEGEN_UNITS = 1 export CARGO_PROFILE_RELEASE_LTO = fat export DOCKER_BUILDKIT = 1 -export RUSTFLAGS = "-D warnings -Ctarget-feature=+sse4.1,+sse4.2" export NEAR_RELEASE_BUILD = no export CARGO_TARGET_DIR = target +export RUSTFLAGS = -D warnings +ifeq ($(shell uname -m),x86_64) + export RUSTFLAGS := ${RUSTFLAGS} -Ctarget-feature=+sse4.1,+sse4.2 +endif # By default, build a regular release all: release - docker-nearcore: docker build -t nearcore -f Dockerfile --build-arg=make_target=neard-release --progress=plain . From 64a00342e3b9dfc68dbc1a3c841d75685da5dcfa Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Mon, 28 Feb 2022 20:37:49 +0100 Subject: [PATCH 08/17] Tiny fix --- .cargo/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 0b49503aebf..a76873a581f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ -[target.'cfg(target_arch="x86_64")'] +[build] rustflags = ["-Ctarget-feature=+sse4.1,+sse4.2"] From d88e7e80992f45a67892b39a0d9f633321dda2a9 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Tue, 1 Mar 2022 11:35:27 +0100 Subject: [PATCH 09/17] Tiny fix --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5086763547e..d6e06a3c385 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,11 @@ export DOCKER_BUILDKIT = 1 export NEAR_RELEASE_BUILD = no export CARGO_TARGET_DIR = target -export RUSTFLAGS = -D warnings -ifeq ($(shell uname -m),x86_64) - export RUSTFLAGS := ${RUSTFLAGS} -Ctarget-feature=+sse4.1,+sse4.2 -endif # By default, build a regular release all: release + docker-nearcore: docker build -t nearcore -f Dockerfile --build-arg=make_target=neard-release --progress=plain . From 5075acbe77c76f5e523f6284450f24a18b3caab9 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Tue, 1 Mar 2022 11:37:54 +0100 Subject: [PATCH 10/17] Tiny fix --- .cargo/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index a76873a581f..fc73c2f8495 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [build] -rustflags = ["-Ctarget-feature=+sse4.1,+sse4.2"] +rustflags = ["-Dwarnings", "-Ctarget-feature=+sse4.1,+sse4.2"] From 37fe31531ba15a74b21febe72c69dd5daee7385f Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Tue, 1 Mar 2022 13:46:51 +0100 Subject: [PATCH 11/17] . --- .cargo/config.toml | 2 +- Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index fc73c2f8495..a76873a581f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [build] -rustflags = ["-Dwarnings", "-Ctarget-feature=+sse4.1,+sse4.2"] +rustflags = ["-Ctarget-feature=+sse4.1,+sse4.2"] diff --git a/Makefile b/Makefile index d6e06a3c385..cbcbf60abcc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ export CARGO_PROFILE_RELEASE_CODEGEN_UNITS = 1 export CARGO_PROFILE_RELEASE_LTO = fat export DOCKER_BUILDKIT = 1 +export CARGO_BUILD_RUSTFLAGS = -D warnings export NEAR_RELEASE_BUILD = no export CARGO_TARGET_DIR = target From 6a1c7cc0ed0c37dde8b79c984915079982ea7a97 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Tue, 1 Mar 2022 18:40:38 +0100 Subject: [PATCH 12/17] Use LZ4+ZSTD compression --- core/store/src/db.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/store/src/db.rs b/core/store/src/db.rs index 07dfdcb2290..1e2d6212542 100644 --- a/core/store/src/db.rs +++ b/core/store/src/db.rs @@ -759,10 +759,29 @@ impl Database for TestDB { } } +fn set_compression_options(opts: &mut Options) { + opts.set_compression_type(rocksdb::DBCompressionType::Lz4); + opts.set_bottommost_compression_type(rocksdb::DBCompressionType::Zstd); + // RocksDB documenation says that 16KB is a typical dictionary size. + // We've empirically tuned the dicionary size to twice of that 'typical' size. + // Having train data size x100 from dictionary size is a recommendation from RocksDB. + // See: https://rocksdb.org/blog/2021/05/31/dictionary-compression.html?utm_source=dbplatz + let dict_size = 2 * 16384; + let max_train_bytes = dict_size * 100; + // We use default parameters of RocksDB here: + // window_bits is -14 and is unused (Zlib-specific parameter), + // compression_level is 32767 meaning the default compression level for ZSTD, + // compression__strategy is 0 and is unused (Zlib-specific parameter). + // See: https://github.com/facebook/rocksdb/blob/main/include/rocksdb/advanced_options.h#L176: + opts.set_bottommost_compression_options(/*window_bits */-14, /*compression_level */32767, /*compression_strategy */0, dict_size, /*enabled */true); + opts.set_bottommost_zstd_max_train_bytes(max_train_bytes, true); +} + /// DB level options fn rocksdb_options() -> Options { let mut opts = Options::default(); + set_compression_options(&mut opts); opts.create_missing_column_families(true); opts.create_if_missing(true); opts.set_use_fsync(false); @@ -817,6 +836,7 @@ fn choose_cache_size(col: DBCol) -> usize { fn rocksdb_column_options(col: DBCol) -> Options { let mut opts = Options::default(); + set_compression_options(&mut opts); opts.set_level_compaction_dynamic_level_bytes(true); let cache_size = choose_cache_size(col); opts.set_block_based_table_factory(&rocksdb_block_based_options(cache_size)); From f59b329bf9a45731521b1b3711c082c2a4c00c91 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Tue, 1 Mar 2022 18:43:37 +0100 Subject: [PATCH 13/17] Tiny fix --- core/store/src/db.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/store/src/db.rs b/core/store/src/db.rs index 1e2d6212542..a017c83221b 100644 --- a/core/store/src/db.rs +++ b/core/store/src/db.rs @@ -771,7 +771,7 @@ fn set_compression_options(opts: &mut Options) { // We use default parameters of RocksDB here: // window_bits is -14 and is unused (Zlib-specific parameter), // compression_level is 32767 meaning the default compression level for ZSTD, - // compression__strategy is 0 and is unused (Zlib-specific parameter). + // compression_strategy is 0 and is unused (Zlib-specific parameter). // See: https://github.com/facebook/rocksdb/blob/main/include/rocksdb/advanced_options.h#L176: opts.set_bottommost_compression_options(/*window_bits */-14, /*compression_level */32767, /*compression_strategy */0, dict_size, /*enabled */true); opts.set_bottommost_zstd_max_train_bytes(max_train_bytes, true); From 4aeca24df9612f00a1cacc12cc27085669ee9e6c Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Wed, 2 Mar 2022 12:47:48 +0100 Subject: [PATCH 14/17] Remove extra compression setting (no effect) --- core/store/src/db.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/core/store/src/db.rs b/core/store/src/db.rs index a017c83221b..4291ea0f822 100644 --- a/core/store/src/db.rs +++ b/core/store/src/db.rs @@ -842,7 +842,6 @@ fn rocksdb_column_options(col: DBCol) -> Options { opts.set_block_based_table_factory(&rocksdb_block_based_options(cache_size)); opts.optimize_level_style_compaction(128 * bytesize::MIB as usize); opts.set_target_file_size_base(64 * bytesize::MIB); - opts.set_compression_per_level(&[]); if col.is_rc() { opts.set_merge_operator("refcount merge", RocksDB::refcount_merge, RocksDB::refcount_merge); opts.set_compaction_filter("empty value filter", RocksDB::empty_value_compaction_filter); From da35f914228b8fba3791bcc41848bb7910ed4844 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Wed, 2 Mar 2022 12:48:53 +0100 Subject: [PATCH 15/17] Formatting --- core/store/src/db.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/store/src/db.rs b/core/store/src/db.rs index 4291ea0f822..25424d196b1 100644 --- a/core/store/src/db.rs +++ b/core/store/src/db.rs @@ -773,7 +773,10 @@ fn set_compression_options(opts: &mut Options) { // compression_level is 32767 meaning the default compression level for ZSTD, // compression_strategy is 0 and is unused (Zlib-specific parameter). // See: https://github.com/facebook/rocksdb/blob/main/include/rocksdb/advanced_options.h#L176: - opts.set_bottommost_compression_options(/*window_bits */-14, /*compression_level */32767, /*compression_strategy */0, dict_size, /*enabled */true); + opts.set_bottommost_compression_options( + /*window_bits */ -14, /*compression_level */ 32767, + /*compression_strategy */ 0, dict_size, /*enabled */ true, + ); opts.set_bottommost_zstd_max_train_bytes(max_train_bytes, true); } From 387ac1ed354fa35493b9ab942a7d0ea5ca19a2b7 Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Wed, 2 Mar 2022 15:26:25 +0100 Subject: [PATCH 16/17] Update changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e352181f4c6..d4372d487bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ * Enable access key nonce range for implicit accounts to prevent tx hash collisions [#5482](https://github.com/near/nearcore/pull/5482) +### Non-protocol Changes + +* Switch to LZ4+ZSTD compression from Snappy [#6365](https://github.com/near/nearcore/pull/6365) + ## `1.23.0` [13-12-2021] ### Protocol Changes @@ -14,7 +18,7 @@ * Further lower regular_op_cost from 2_207_874 to 822_756. * Limit number of wasm functions in one contract to 10_000. [#4954](https://github.com/near/nearcore/pull/4954) * Add block header v3, required by new validator selection algorithm -* Move to new validator selection and sampling algorithm. Now we would be able to use all available seats. First step to enable chunk only producers. +* Move to new validator selection and sampling algorithm. Now we would be able to use all available seats. First step to enable chunk only producers. ### Non-protocol Changes From 5b4888fdca45f65f3221ee0e984ba4c82997f92a Mon Sep 17 00:00:00 2001 From: Edvard Davtyan Date: Wed, 2 Mar 2022 15:27:21 +0100 Subject: [PATCH 17/17] Tiny change --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4372d487bd..33b859d9a05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ ### Non-protocol Changes -* Switch to LZ4+ZSTD compression from Snappy [#6365](https://github.com/near/nearcore/pull/6365) +* Switch to LZ4+ZSTD compression from Snappy in RocksDB [#6365](https://github.com/near/nearcore/pull/6365) ## `1.23.0` [13-12-2021]