From bde19a7ea291d1804c750c98196ed392bfc0051b Mon Sep 17 00:00:00 2001 From: Green Baneling Date: Wed, 14 Feb 2024 14:54:23 -0500 Subject: [PATCH] Duplication of the `0.22.1` release (#1665) It is a duplication of the https://github.com/FuelLabs/fuel-core/pull/1664 for the `master`. --- CHANGELOG.md | 6 ++++ Cargo.lock | 49 +++++++++++++------------- Cargo.toml | 48 ++++++++++++------------- crates/fuel-core/Cargo.toml | 3 +- crates/fuel-core/src/state/rocks_db.rs | 6 ++++ deployment/charts/Chart.yaml | 2 +- 6 files changed, 64 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efed5753783..d9747caeecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -150,6 +150,12 @@ Description of the upcoming release here. - [#1573](https://github.com/FuelLabs/fuel-core/pull/1573): Remove nested p2p request/response encoding. Only breaks p2p networking compatibility with older fuel-core versions, but is otherwise fully internal. +## [Version 0.22.1] + +### Fixed +- [#1664](https://github.com/FuelLabs/fuel-core/pull/1664): Fixed long database initialization after restart of the node by setting limit to the WAL file. + + ## [Version 0.22.0] ### Added diff --git a/Cargo.lock b/Cargo.lock index 15f6afb0177..03b4d99fb47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2623,7 +2623,7 @@ dependencies = [ [[package]] name = "fuel-core" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "assert_matches", @@ -2654,6 +2654,7 @@ dependencies = [ "hyper", "itertools 0.10.5", "mockall", + "num_cpus", "proptest", "rand", "rocksdb", @@ -2705,11 +2706,11 @@ dependencies = [ [[package]] name = "fuel-core-bft" -version = "0.22.0" +version = "0.22.1" [[package]] name = "fuel-core-bin" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "clap 4.5.0", @@ -2735,7 +2736,7 @@ dependencies = [ [[package]] name = "fuel-core-chain-config" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "bech32", @@ -2754,7 +2755,7 @@ dependencies = [ [[package]] name = "fuel-core-client" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "cynic", @@ -2777,7 +2778,7 @@ dependencies = [ [[package]] name = "fuel-core-client-bin" -version = "0.22.0" +version = "0.22.1" dependencies = [ "clap 4.5.0", "fuel-core-client", @@ -2788,7 +2789,7 @@ dependencies = [ [[package]] name = "fuel-core-consensus-module" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "fuel-core-chain-config", @@ -2800,7 +2801,7 @@ dependencies = [ [[package]] name = "fuel-core-database" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "derive_more", @@ -2811,7 +2812,7 @@ dependencies = [ [[package]] name = "fuel-core-e2e-client" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "assert_cmd", @@ -2836,7 +2837,7 @@ dependencies = [ [[package]] name = "fuel-core-executor" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "fuel-core-chain-config", @@ -2850,7 +2851,7 @@ dependencies = [ [[package]] name = "fuel-core-importer" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "derive_more", @@ -2868,7 +2869,7 @@ dependencies = [ [[package]] name = "fuel-core-keygen" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "clap 4.5.0", @@ -2879,7 +2880,7 @@ dependencies = [ [[package]] name = "fuel-core-keygen-bin" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "atty", @@ -2892,7 +2893,7 @@ dependencies = [ [[package]] name = "fuel-core-metrics" -version = "0.22.0" +version = "0.22.1" dependencies = [ "axum", "once_cell", @@ -2905,7 +2906,7 @@ dependencies = [ [[package]] name = "fuel-core-p2p" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "async-trait", @@ -2941,7 +2942,7 @@ dependencies = [ [[package]] name = "fuel-core-poa" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "async-trait", @@ -2959,7 +2960,7 @@ dependencies = [ [[package]] name = "fuel-core-producer" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "async-trait", @@ -2976,7 +2977,7 @@ dependencies = [ [[package]] name = "fuel-core-relayer" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "async-trait", @@ -3008,7 +3009,7 @@ dependencies = [ [[package]] name = "fuel-core-services" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "async-trait", @@ -3022,7 +3023,7 @@ dependencies = [ [[package]] name = "fuel-core-storage" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "derive_more", @@ -3044,7 +3045,7 @@ dependencies = [ [[package]] name = "fuel-core-sync" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "async-trait", @@ -3096,7 +3097,7 @@ dependencies = [ [[package]] name = "fuel-core-trace" -version = "0.22.0" +version = "0.22.1" dependencies = [ "ctor", "tracing", @@ -3106,7 +3107,7 @@ dependencies = [ [[package]] name = "fuel-core-txpool" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "async-trait", @@ -3132,7 +3133,7 @@ dependencies = [ [[package]] name = "fuel-core-types" -version = "0.22.0" +version = "0.22.1" dependencies = [ "anyhow", "bs58", diff --git a/Cargo.toml b/Cargo.toml index 2db2dcc899a..4d232af4cad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,33 +46,33 @@ homepage = "https://fuel.network/" keywords = ["blockchain", "cryptocurrencies", "fuel-vm", "vm"] license = "BUSL-1.1" repository = "https://github.com/FuelLabs/fuel-core" -version = "0.22.0" +version = "0.22.1" [workspace.dependencies] # Workspace members -fuel-core = { version = "0.22.0", path = "./crates/fuel-core", default-features = false } -fuel-core-client-bin = { version = "0.22.0", path = "./bin/client" } -fuel-core-bin = { version = "0.22.0", path = "./bin/fuel-core" } -fuel-core-keygen = { version = "0.22.0", path = "./crates/keygen" } -fuel-core-keygen-bin = { version = "0.22.0", path = "./bin/keygen" } -fuel-core-chain-config = { version = "0.22.0", path = "./crates/chain-config", default-features = false } -fuel-core-client = { version = "0.22.0", path = "./crates/client" } -fuel-core-database = { version = "0.22.0", path = "./crates/database" } -fuel-core-metrics = { version = "0.22.0", path = "./crates/metrics" } -fuel-core-services = { version = "0.22.0", path = "./crates/services" } -fuel-core-consensus-module = { version = "0.22.0", path = "./crates/services/consensus_module" } -fuel-core-bft = { version = "0.22.0", path = "./crates/services/consensus_module/bft" } -fuel-core-poa = { version = "0.22.0", path = "./crates/services/consensus_module/poa" } -fuel-core-executor = { version = "0.22.0", path = "./crates/services/executor" } -fuel-core-importer = { version = "0.22.0", path = "./crates/services/importer" } -fuel-core-p2p = { version = "0.22.0", path = "./crates/services/p2p" } -fuel-core-producer = { version = "0.22.0", path = "./crates/services/producer" } -fuel-core-relayer = { version = "0.22.0", path = "./crates/services/relayer" } -fuel-core-sync = { version = "0.22.0", path = "./crates/services/sync" } -fuel-core-txpool = { version = "0.22.0", path = "./crates/services/txpool" } -fuel-core-storage = { version = "0.22.0", path = "./crates/storage" } -fuel-core-trace = { version = "0.22.0", path = "./crates/trace" } -fuel-core-types = { version = "0.22.0", path = "./crates/types", default-features = false } +fuel-core = { version = "0.22.1", path = "./crates/fuel-core", default-features = false } +fuel-core-client-bin = { version = "0.22.1", path = "./bin/client" } +fuel-core-bin = { version = "0.22.1", path = "./bin/fuel-core" } +fuel-core-keygen = { version = "0.22.1", path = "./crates/keygen" } +fuel-core-keygen-bin = { version = "0.22.1", path = "./bin/keygen" } +fuel-core-chain-config = { version = "0.22.1", path = "./crates/chain-config", default-features = false } +fuel-core-client = { version = "0.22.1", path = "./crates/client" } +fuel-core-database = { version = "0.22.1", path = "./crates/database" } +fuel-core-metrics = { version = "0.22.1", path = "./crates/metrics" } +fuel-core-services = { version = "0.22.1", path = "./crates/services" } +fuel-core-consensus-module = { version = "0.22.1", path = "./crates/services/consensus_module" } +fuel-core-bft = { version = "0.22.1", path = "./crates/services/consensus_module/bft" } +fuel-core-poa = { version = "0.22.1", path = "./crates/services/consensus_module/poa" } +fuel-core-executor = { version = "0.22.1", path = "./crates/services/executor" } +fuel-core-importer = { version = "0.22.1", path = "./crates/services/importer" } +fuel-core-p2p = { version = "0.22.1", path = "./crates/services/p2p" } +fuel-core-producer = { version = "0.22.1", path = "./crates/services/producer" } +fuel-core-relayer = { version = "0.22.1", path = "./crates/services/relayer" } +fuel-core-sync = { version = "0.22.1", path = "./crates/services/sync" } +fuel-core-txpool = { version = "0.22.1", path = "./crates/services/txpool" } +fuel-core-storage = { version = "0.22.1", path = "./crates/storage" } +fuel-core-trace = { version = "0.22.1", path = "./crates/trace" } +fuel-core-types = { version = "0.22.1", path = "./crates/types", default-features = false } fuel-core-tests = { version = "0.0.0", path = "./tests" } fuel-core-xtask = { version = "0.0.0", path = "./xtask" } diff --git a/crates/fuel-core/Cargo.toml b/crates/fuel-core/Cargo.toml index 56d4db0d6ac..2fcbb29594a 100644 --- a/crates/fuel-core/Cargo.toml +++ b/crates/fuel-core/Cargo.toml @@ -41,6 +41,7 @@ futures = { workspace = true } hex = { version = "0.4", features = ["serde"] } hyper = { workspace = true } itertools = { workspace = true } +num_cpus = { version = "1.16.0", optional = true } rand = { workspace = true } rocksdb = { version = "0.21", default-features = false, features = [ "lz4", @@ -74,7 +75,7 @@ test-strategy = { workspace = true } default = ["rocksdb"] p2p = ["dep:fuel-core-p2p", "dep:fuel-core-sync"] relayer = ["dep:fuel-core-relayer"] -rocksdb = ["dep:rocksdb", "dep:tempfile"] +rocksdb = ["dep:rocksdb", "dep:tempfile", "dep:num_cpus"] test-helpers = ["fuel-core-p2p?/test-helpers"] # features to enable in production, but increase build times rocksdb-production = ["rocksdb", "rocksdb/jemalloc"] diff --git a/crates/fuel-core/src/state/rocks_db.rs b/crates/fuel-core/src/state/rocks_db.rs index 748305974a9..2b18f7bda94 100644 --- a/crates/fuel-core/src/state/rocks_db.rs +++ b/crates/fuel-core/src/state/rocks_db.rs @@ -43,6 +43,7 @@ use rocksdb::{ WriteBatch, }; use std::{ + cmp, env, fmt::Debug, iter, @@ -144,6 +145,11 @@ where let mut opts = Options::default(); opts.create_if_missing(true); opts.set_compression_type(DBCompressionType::Lz4); + // TODO: Make it customizable https://github.com/FuelLabs/fuel-core/issues/1666 + opts.set_max_total_wal_size(64 * 1024 * 1024); + let cpu_number = + i32::try_from(num_cpus::get()).expect("The number of CPU can't exceed `i32`"); + opts.increase_parallelism(cmp::max(1, cpu_number / 2)); if let Some(capacity) = capacity { // Set cache size 1/3 of the capacity. Another 1/3 is // used by block cache and the last 1 / 3 remains for other purposes: diff --git a/deployment/charts/Chart.yaml b/deployment/charts/Chart.yaml index f6f5c86765b..725c763d1aa 100644 --- a/deployment/charts/Chart.yaml +++ b/deployment/charts/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: ${fuel_core_service_name} description: ${fuel_core_service_name} Helm Chart type: application -appVersion: "0.22.0" +appVersion: "0.22.1" version: 0.1.0