From ed4bcb6216c5c71af1f75e84b234c76bfae0f37d Mon Sep 17 00:00:00 2001 From: Slava Date: Tue, 9 Apr 2024 10:34:39 +0300 Subject: [PATCH 1/2] Several fixes for configs --- CHANGELOG.md | 11 +++++++++- Cargo.toml | 20 +++++++++---------- catchain/Cargo.toml | 6 +++--- configs/default_config.json | 2 +- ...fig.json => ton-global.config-sample.json} | 0 src/config.rs | 5 ----- src/engine.rs | 7 ------- src/engine_operations.rs | 2 +- src/shard_states_keeper.rs | 17 ++++++---------- src/tests/test_control.rs | 2 +- src/validating_utils.rs | 4 ++-- storage/Cargo.toml | 8 ++++---- validator-session/Cargo.toml | 8 ++++---- 13 files changed, 42 insertions(+), 50 deletions(-) rename configs/{ton-global.config.json => ton-global.config-sample.json} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9457514..838b59f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. +## Version 0.56.8 + +- `./configs/ton-global.config.json` renamed to `./configs/ton-global-config-sample.json` because + it is not an actual mainnet config. You can get the actual mainnet config here: + https://github.com/tonlabs/main.ton.dev/blob/master/configs/ton-global.config.json. +- Removed `low_memory_mode` flag from node's config.json. It is always enabled now. + The false value of this flag is not actual anymore because the size of the shard states + has become too big to process it in memory. + ## Version 0.56.7 - Logging was a bit refactored. Added neighbor's stat to telemetry. @@ -22,7 +31,7 @@ All notable changes to this project will be documented in this file. ## Version 0.56.3 -- Fixed UNREGISTERED_CHAIN_MAX_LEN const for Venom blockchain. +- Fixed UNREGISTERED_CHAIN_MAX_LEN const for Venom blockchain ## Version 0.56.2 diff --git a/Cargo.toml b/Cargo.toml index 26cf087e..a8716526 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ build = 'common/build/build.rs' edition = '2021' name = 'ton_node' -version = '0.56.7' +version = '0.56.8' [workspace] members = [ 'storage' ] @@ -84,17 +84,17 @@ stream-cancel = '0.8.0' string-builder = '^0.2.0' tokio = { features = [ 'rt-multi-thread' ], version = '1.5' } tokio-util = '0.7' -adnl = { features = [ 'client', 'node', 'server' ], git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.10.12' } +adnl = { features = [ 'client', 'node', 'server' ], git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.10.15' } catchain = { path = 'catchain' } lockfree = { git = 'https://github.com/tonlabs/lockfree.git' } storage = { path = 'storage' } -ton_abi = { git = 'https://github.com/tonlabs/ever-abi.git', optional = true, tag = '2.4.23' } -ton_api = { git = 'https://github.com/tonlabs/ever-tl.git', package = 'ton_api', tag = '0.3.69' } -ton_block = { git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.139' } -ton_block_json = { git = 'https://github.com/tonlabs/ever-block-json.git', tag = '0.7.228' } -ton_executor = { git = 'https://github.com/tonlabs/ever-executor.git', tag = '1.16.119' } -ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.38' } -ton_vm = { git = 'https://github.com/tonlabs/ever-vm.git', tag = '1.9.20' } +ton_abi = { git = 'https://github.com/tonlabs/ever-abi.git', optional = true, tag = '2.4.25' } +ton_api = { git = 'https://github.com/tonlabs/ever-tl.git', package = 'ton_api', tag = '0.3.72' } +ton_block = { git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.141' } +ton_block_json = { git = 'https://github.com/tonlabs/ever-block-json.git', tag = '0.7.231' } +ton_executor = { git = 'https://github.com/tonlabs/ever-executor.git', tag = '1.16.122' } +ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.39' } +ton_vm = { git = 'https://github.com/tonlabs/ever-vm.git', tag = '1.9.22' } validator_session = { path = 'validator-session' } [dev-dependencies] @@ -109,6 +109,7 @@ tokio = { features = [ 'macros' ], version = '1.5' } default = [ 'telemetry' ] export_key = [ 'catchain/export_key', 'ton_types/export_key' ] external_db = [ 'rdkafka' ] +fast_finality_extra = [ ] gosh = [ 'ton_block/gosh', 'ton_vm/gosh' ] log_metrics = [ ] prometheus = [ 'metrics-exporter-prometheus', 'log_metrics' ] @@ -118,7 +119,6 @@ statsd = [ 'metrics-exporter-statsd', 'log_metrics', 'dep:statsd' ] telemetry = [ 'adnl/telemetry', 'storage/telemetry' ] trace_alloc = [ ] trace_alloc_detail = [ 'trace_alloc' ] -fast_finality_extra = [ ] [profile] diff --git a/catchain/Cargo.toml b/catchain/Cargo.toml index 8c4f7d5a..644cd5ad 100644 --- a/catchain/Cargo.toml +++ b/catchain/Cargo.toml @@ -19,10 +19,10 @@ quanta = '0.11.1' rand = '0.8' regex = '1.3.1' tokio = { features = [ 'rt-multi-thread' ], version = '1.5' } -adnl = { features = [ 'node' ], git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.10.12' } +adnl = { features = [ 'node' ], git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.10.15' } storage = { path = '../storage' } -ton_api = { git = 'https://github.com/tonlabs/ever-tl.git', package = 'ton_api', tag = '0.3.69' } -ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.38' } +ton_api = { git = 'https://github.com/tonlabs/ever-tl.git', package = 'ton_api', tag = '0.3.72' } +ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.39' } [dev-dependencies] chrono = '0.4.10' diff --git a/configs/default_config.json b/configs/default_config.json index 9be6afd8..1942cbf2 100644 --- a/configs/default_config.json +++ b/configs/default_config.json @@ -1,6 +1,6 @@ { "log_config_name": "log_cfg.yml", - "ton_global_config_name": "ton-global.config.json", + "ton_global_config_name": "ton-global.config-sample.json", "internal_db_path": "node_db", "ip_address": "0.0.0.0:30303", "control_server_port": 3031, diff --git a/configs/ton-global.config.json b/configs/ton-global.config-sample.json similarity index 100% rename from configs/ton-global.config.json rename to configs/ton-global.config-sample.json diff --git a/src/config.rs b/src/config.rs index ccf3f4f0..4cae53c2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -169,8 +169,6 @@ pub struct TonNodeConfig { #[serde(default)] restore_db: bool, #[serde(default)] - low_memory_mode: bool, - #[serde(default)] cells_db_config: CellsDbConfig, #[serde(default)] collator_config: CollatorConfig, @@ -598,9 +596,6 @@ impl TonNodeConfig { pub fn restore_db(&self) -> bool { self.restore_db } - pub fn low_memory_mode(&self) -> bool { - self.low_memory_mode - } pub fn skip_saving_persistent_states(&self) -> bool { self.skip_saving_persistent_states } diff --git a/src/engine.rs b/src/engine.rs index f186277f..adf0c5e5 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -136,7 +136,6 @@ pub struct Engine { last_known_keyblock_seqno: AtomicU32, will_validate: AtomicBool, sync_status: AtomicU32, - low_memory_mode: bool, remp_capability: AtomicBool, test_bundles_config: CollatorTestBundlesGeneralConfig, @@ -614,7 +613,6 @@ impl Engine { }; let control_config = general_config.control_server()?; let collator_config = general_config.collator_config().clone(); - let low_memory_mode = general_config.low_memory_mode(); let boot_from_zerostate = general_config.boot_from_zerostate(); let global_config = general_config.load_global_config()?; let test_bundles_config = general_config.test_bundles_config().clone(); @@ -809,7 +807,6 @@ impl Engine { last_known_keyblock_seqno: AtomicU32::new(0), will_validate: AtomicBool::new(false), sync_status: AtomicU32::new(0), - low_memory_mode, remp_capability: AtomicBool::new(false), test_bundles_config, collator_config, @@ -1088,10 +1085,6 @@ impl Engine { &self.tps_counter } - pub fn low_memory_mode(&self) -> bool { - self.low_memory_mode - } - pub fn remp_service(&self) -> Option<&RempService> { self.remp_service.as_ref().map(|arc| arc.deref()) } diff --git a/src/engine_operations.rs b/src/engine_operations.rs index 197eff59..b13f2a29 100644 --- a/src/engine_operations.rs +++ b/src/engine_operations.rs @@ -451,7 +451,7 @@ impl EngineOperations for Engine { ).await?; let state = self.shard_states_keeper().check_and_store_state( - handle, root_hash, data, self.low_memory_mode()).await?; + handle, root_hash, data).await?; Ok(state) } diff --git a/src/shard_states_keeper.rs b/src/shard_states_keeper.rs index ab2c299c..2cc62f73 100644 --- a/src/shard_states_keeper.rs +++ b/src/shard_states_keeper.rs @@ -286,24 +286,19 @@ impl ShardStatesKeeper { handle: &Arc, root_hash: &UInt256, data: Arc>, - low_memory_mode: bool, ) -> Result> { // deserialise cells (and save it by the way - in case of low memory mode) let now = std::time::Instant::now(); log::info!( - "check_and_store_state: deserialize (low_memory_mode: {}) length: {}, {}...", - low_memory_mode, data.len(), handle.id() + "check_and_store_state: deserialize, length: {}, {}...", + data.len(), handle.id() ); let state_root = { - let mut boc_reader = BocReader::new(); - if low_memory_mode { - let done_cells_storage = self.db.create_done_cells_storage(root_hash)?; - boc_reader = boc_reader.set_done_cells_storage(done_cells_storage); - } - boc_reader + BocReader::new() + .set_done_cells_storage(self.db.create_done_cells_storage(root_hash)?) .set_abort(&|| self.stopper.check_stop()) .read_inmem(data.clone())? .withdraw_single_root()? @@ -314,8 +309,8 @@ impl ShardStatesKeeper { } log::info!( - "check_and_store_state: deserialized (low_memory_mode: {}) {} TIME {} ms", - low_memory_mode, handle.id(), now.elapsed().as_millis() + "check_and_store_state: deserialized {} TIME {} ms", + handle.id(), now.elapsed().as_millis() ); let state = self.build_state_object(state_root, handle.id(), handle.is_queue_update_for())?; diff --git a/src/tests/test_control.rs b/src/tests/test_control.rs index 9638fd11..4b9d8bca 100644 --- a/src/tests/test_control.rs +++ b/src/tests/test_control.rs @@ -135,10 +135,10 @@ async fn start_control_with_options( config: Option, server_only: bool ) -> Result<(ControlServer, Option, Arc)> { + fs::copy("./configs/ton-global.config-sample.json", "./target/ton-global.config-sample.json")?; let config = if let Some(config) = config { config } else { - fs::copy("./configs/ton-global.config.json", "./target/ton-global.config.json")?; crate::test_helper::get_config(IP_NODE, Some("./target"), DEFAULT_CONFIG).await? }; let network = NodeNetwork::new( diff --git a/src/validating_utils.rs b/src/validating_utils.rs index 2898f585..c9447f6a 100644 --- a/src/validating_utils.rs +++ b/src/validating_utils.rs @@ -19,9 +19,9 @@ use ton_block::{ use ton_types::{fail, error, Result, Sha256, UInt256}; use std::{collections::HashSet, cmp::max, iter::Iterator}; -#[cfg(not(feature = "fast_finality_extra"))] +#[cfg(not(feature = "fast_finality_extra"))] pub const UNREGISTERED_CHAIN_MAX_LEN: u32 = 8; -#[cfg(feature = "fast_finality_extra")] +#[cfg(feature = "fast_finality_extra")] pub const UNREGISTERED_CHAIN_MAX_LEN: u32 = 32; pub fn supported_capabilities() -> u64 { diff --git a/storage/Cargo.toml b/storage/Cargo.toml index 176f3dfa..234cc66f 100644 --- a/storage/Cargo.toml +++ b/storage/Cargo.toml @@ -26,11 +26,11 @@ serde_derive = '1.0.114' strum = '0.18.0' strum_macros = '0.18.0' tokio = { features = [ 'fs', 'rt-multi-thread' ], version = '1.5' } -adnl = { git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.10.12' } +adnl = { git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.10.15' } lockfree = { git = 'https://github.com/tonlabs/lockfree.git' } -ton_api = { git = 'https://github.com/tonlabs/ever-tl.git', package = 'ton_api', tag = '0.3.69' } -ton_block = { git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.139' } -ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.38' } +ton_api = { git = 'https://github.com/tonlabs/ever-tl.git', package = 'ton_api', tag = '0.3.72' } +ton_block = { git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.141' } +ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.39' } [build-dependencies] cc = { features = [ 'parallel' ], version = '1.0.61' } diff --git a/validator-session/Cargo.toml b/validator-session/Cargo.toml index 1fe098f3..71dec32c 100644 --- a/validator-session/Cargo.toml +++ b/validator-session/Cargo.toml @@ -15,12 +15,12 @@ log = '0.4' metrics = '0.21.0' metrics-core = '0.5' rand = '0.8' -adnl = { git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.10.12' } +adnl = { git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.10.15' } catchain = { path = '../catchain' } storage = { path = '../storage' } -ton_api = { git = 'https://github.com/tonlabs/ever-tl.git', package = 'ton_api', tag = '0.3.69' } -ton_block = { git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.139' } -ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.38' } +ton_api = { git = 'https://github.com/tonlabs/ever-tl.git', package = 'ton_api', tag = '0.3.72' } +ton_block = { git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.141' } +ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.39' } [dev-dependencies] chrono = '0.4' From 9c35c275e3d426d7dec960aa77b9950d63801d7f Mon Sep 17 00:00:00 2001 From: Sumrachek Date: Tue, 9 Apr 2024 20:06:26 +0400 Subject: [PATCH 2/2] Added description for `sync_by_archives` config parameter --- config.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config.md b/config.md index d070ef67..82c5de59 100644 --- a/config.md +++ b/config.md @@ -1,3 +1,11 @@ +Root section +------------ + +* `sync_by_archives`: possible values `true` and `false`. Default value `false`. If set `true` + allows to synchronize node by archives instead of single blocks. It may be useful in some + conditions, for example, long ping to other nodes. + + `remp` section ------------