Skip to content

Commit

Permalink
Merge pull request #233 from tonlabs/fix-configs
Browse files Browse the repository at this point in the history
Several fixes for configs
  • Loading branch information
bvscd committed Apr 10, 2024
2 parents 722e1f8 + 9c35c27 commit ac41562
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 50 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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' ]
Expand Down Expand Up @@ -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]
Expand All @@ -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' ]
Expand All @@ -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]

Expand Down
6 changes: 3 additions & 3 deletions catchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 8 additions & 0 deletions config.md
Original file line number Diff line number Diff line change
@@ -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
------------

Expand Down
2 changes: 1 addition & 1 deletion configs/default_config.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down
7 changes: 0 additions & 7 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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())
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
17 changes: 6 additions & 11 deletions src/shard_states_keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,24 +286,19 @@ impl ShardStatesKeeper {
handle: &Arc<BlockHandle>,
root_hash: &UInt256,
data: Arc<Vec<u8>>,
low_memory_mode: bool,
) -> Result<Arc<ShardStateStuff>> {

// 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()?
Expand All @@ -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())?;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ async fn start_control_with_options(
config: Option<TonNodeConfig>,
server_only: bool
) -> Result<(ControlServer, Option<AdnlClient>, Arc<KeyId>)> {
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(
Expand Down
4 changes: 2 additions & 2 deletions src/validating_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down
8 changes: 4 additions & 4 deletions validator-session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ac41562

Please sign in to comment.