Skip to content

Commit

Permalink
0.47.93 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
AtomXY authored Nov 8, 2021
1 parent c0fbed5 commit 653d06d
Show file tree
Hide file tree
Showing 32 changed files with 961 additions and 542 deletions.
159 changes: 85 additions & 74 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,92 +1,103 @@

#
# Copyright 2018-2019 TON DEV SOLUTIONS LTD.
#
# Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at:
#
# https://www.ton.dev/licenses
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific TON DEV software governing permissions and limitations
# under the License.
#
[package]

name = 'ton_node'
version = '0.47.83'
edition = '2018'
name = "ton_node"
version = "0.47.93"
edition = "2018"

[workspace]

members = [
'storage',
"storage"
]

[dependencies]
async-trait = "0.1.22"
base64 = "0.13"
bincode = "1.2.1"
bitflags = "1.2.1"
crossbeam-channel = "0.4.2"
clap = "2.33.1"
chrono = "0.4.10"
colored = "1.9.3"
dirs = "2.0.2"
env_logger = "0.7.1"
failure = "0.1"
futures = "0.3.1"
futures-timer = "3.0.1"
hex = "0.4"
lazy_static = "1.4.0"
log = "0.4"
log4rs = "1"
log4rs-rolling-file = "0.2.0"
num-bigint = "0.2.2"
openssl = "0.10.35"
pretty_assertions = "0.6.1"
rand = "0.7"
regex = "^1.3.0"
rocksdb = "0.15.0"
rustracing = { version = "0.4.0", optional = true }
rustracing_jaeger = { version = "0.4.1", optional = true }
serde = "1.0.105"
serde_derive = "1.0.105"
serde_json = "1.0.64"
sha2 = "0.9"
spin = "0.7.1"
statsd = { version = "0.14.0", optional = true }
stream-cancel = "0.8.0"
string-builder = "^0.2.0"
tokio = { version = "1.5", features = ["rt-multi-thread"] }

async-trait = '0.1.22'
base64 = '0.11.0'
bincode = '1.2.1'
bitflags = '1.2.1'
crossbeam-channel = '0.4.2'
clap = '2.33.1'
chrono = '0.4.10'
colored = '1.9.3'
dirs = '2.0.2'
env_logger = '0.7.1'
failure = '0.1.6'
futures = '0.3.1'
futures-timer = '3.0.1'
hex = '0.4.1'
lazy_static = '1.4.0'
log = '0.4'
log4rs = '1'
log4rs-rolling-file = '0.2.0'
num-bigint = '0.2.2'
openssl = '0.10.35'
pretty_assertions = '0.6.1'
rand = '0.7.3'
regex = '^1.3.0'
rocksdb = '0.15.0'
rustracing = { version = '0.4.0', optional = true }
rustracing_jaeger = { version = '0.4.1', optional = true }
serde = '1.0.105'
serde_derive = '1.0.105'
serde_json = '1.0.64'
sha2 = '^0.8'
spin = '0.7.1'
statsd = { version = '0.14.0', optional = true }
stream-cancel = '0.8.0'
string-builder = '^0.2.0'
tokio = { version = '1.5.0', features = [ 'rt-multi-thread' ] }
adnl = { git = 'https://github.com/tonlabs/ton-labs-adnl', features = [ 'client', 'node', 'server' ], tag = '0.7.53' }
catchain = { path = 'catchain' }
dht = { git = 'https://github.com/tonlabs/ton-labs-dht', tag = '0.5.47' }
lockfree = { git = 'https://github.com/tonlabs/lockfree.git' }
overlay = { git = 'https://github.com/tonlabs/ton-labs-overlay', tag = '0.6.34' }
rldp = { git = 'https://github.com/tonlabs/ton-labs-rldp', tag = '0.7.49' }
storage = { path = 'storage' }
ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.1.1' }
ton_api = { git = 'https://github.com/tonlabs/ton-labs-tl', package = 'ton_api', tag = '0.2.110' }
ton_block = { git = 'https://github.com/tonlabs/ton-labs-block', tag = '1.7.27' }
ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git', tag = '0.6.24' }
ton_executor = { git = 'https://github.com/tonlabs/ton-labs-executor', tag = '1.15.31' }
ton_types = { git = 'https://github.com/tonlabs/ton-labs-types', tag = '1.10.10' }
ton_vm = { git = 'https://github.com/tonlabs/ton-labs-vm', tag = '1.8.19' }
validator_session = { path = 'validator-session' }
adnl = { git = 'https://github.com/tonlabs/ton-labs-adnl', features = [ 'client', 'node', 'server' ], tag = '0.7.55' }
catchain = { path = "catchain" }
dht = { git = 'https://github.com/tonlabs/ton-labs-dht', tag = '0.5.48' }
lockfree = { git = "https://github.com/tonlabs/lockfree.git" }
overlay = { git = 'https://github.com/tonlabs/ton-labs-overlay', tag = '0.6.35' }
rldp = { git = 'https://github.com/tonlabs/ton-labs-rldp', tag = '0.7.50' }
storage = { path = "storage" }
ton_abi = { git = "https://github.com/tonlabs/ton-labs-abi.git", tag = '2.1.5' }
ton_api = { git = 'https://github.com/tonlabs/ton-labs-tl', package = 'ton_api', tag = '0.2.111' }
ton_block = { git = 'https://github.com/tonlabs/ton-labs-block', tag = '1.7.29' }
ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git', tag = '0.6.26' }
ton_executor = { git = 'https://github.com/tonlabs/ton-labs-executor', tag = '1.15.34' }
ton_types = { git = 'https://github.com/tonlabs/ton-labs-types', tag = '1.10.11' }
ton_vm = { git = 'https://github.com/tonlabs/ton-labs-vm', tag = '1.8.20' }
validator_session = { path = "validator-session" }

[target.'cfg(windows)'.dependencies.rdkafka]

version = '0.26.0'
features = [ 'cmake_build' ]
version = "0.26.0"
features = ["cmake_build"]
optional = true

[target.'cfg(unix)'.dependencies.rdkafka]

version = '0.26.0'
version = "0.26.0"
optional = true

[dev-dependencies]

[features]

default = [ 'telemetry' ]
validator = [ 'async_collator', 'async_validator', 'slashing' ]
external_db = [ 'rdkafka' ]
async_collator = [ ]
async_validator = [ ]
ci_run = [ ]
compression = [ 'overlay/compression', 'rldp/compression' ]
metrics = [ 'statsd' ]
read_old_db = [ ]
slashing = [ ]
telemetry = [ 'adnl/telemetry', 'dht/telemetry', 'rldp/telemetry', 'overlay/telemetry', 'storage/telemetry' ]
default = ["telemetry"]
validator = ["async_collator", "async_validator", "slashing"]
external_db = ["rdkafka"]
async_collator = []
async_validator = []
ci_run = []
compression = ["overlay/compression", "rldp/compression"]
metrics = ["statsd"]
read_old_db = []
slashing = []
telemetry = ["adnl/telemetry", "dht/telemetry", "rldp/telemetry", "overlay/telemetry", "storage/telemetry"]
trace_alloc_detail = ["trace_alloc"]
trace_alloc = []
58 changes: 28 additions & 30 deletions catchain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@

[package]

edition = '2018'
build = '../common/build/build.rs'
name = 'catchain'
version = '0.1.0'
edition = "2018"
build = "../common/build/build.rs"
name = "catchain"
version = "0.1.0"

[dependencies]
# external
base64 = "0.13"
chrono = "0.4.10"
crossbeam = "0.7.3"
ed25519-dalek = "1.0"
failure = "0.1"
futures = "0.3.4"
hex = "0.4"
lazy_static = "1.4.0"
log = "0.4"
metrics-core = "0.5.2"
metrics-runtime = "0.13.0"
rand = "0.8"
regex = "1.3.1"
sha2 = "0.9"
tokio = { version = "1.5", features = ["rt-multi-thread"] }

sha2 = '^0.8'
base64 = '0.11.0'
log = '0.4.8'
hex = '0.3.1'
adnl = { git = 'https://github.com/tonlabs/ton-labs-adnl', features = [ 'node' ], tag = '0.7.53' }
overlay = { git = 'https://github.com/tonlabs/ton-labs-overlay', tag = '0.6.34' }
rldp = { git = 'https://github.com/tonlabs/ton-labs-rldp', tag = '0.7.49' }
storage = { path = '../storage' }
ton_types = { git = 'https://github.com/tonlabs/ton-labs-types', tag = '1.10.10' }
ton_api = { git = 'https://github.com/tonlabs/ton-labs-tl', package = 'ton_api', tag = '0.2.110' }
tokio = { version = '1.3.0', features = [ 'rt-multi-thread' ] }
futures = '0.3.4'
crossbeam = '0.7.3'
rand = '0.7.3'
failure = '0.1.1'
regex = '1.3.1'
chrono = '0.4.10'
metrics-core = '0.5.2'
metrics-runtime = '0.13.0'
ed25519-dalek = '1.0.0-pre.4'
lazy_static = '1.4.0'
adnl = { git = 'https://github.com/tonlabs/ton-labs-adnl', features = [ 'node' ], tag = '0.7.55' }
overlay = { git = 'https://github.com/tonlabs/ton-labs-overlay', tag = '0.6.35' }
rldp = { git = 'https://github.com/tonlabs/ton-labs-rldp', tag = '0.7.50' }
storage = { path = "../storage" }
ton_types = { git = 'https://github.com/tonlabs/ton-labs-types', tag = '1.10.11' }
ton_api = { git = 'https://github.com/tonlabs/ton-labs-tl', package = 'ton_api', tag = '0.2.111' }

[dev-dependencies]

env_logger = '0.7.1'
chrono = '0.4.10'
env_logger = "0.7.1"
chrono = "0.4.10"
4 changes: 3 additions & 1 deletion catchain/src/catchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,8 @@ impl CatchainProcessor {
Ok(processor) => processor,
Err(err) => {
error!("CatchainProcessor::main_loop: error during creation of CatchainProcessor: {:?}", err);
overloaded_flag.store(false, Ordering::SeqCst);
is_stopped_flag.store(true, Ordering::SeqCst);
return;
}
};
Expand Down Expand Up @@ -1325,7 +1327,7 @@ impl CatchainProcessor {
fn remove_random_top_block(&mut self) -> BlockPtr {
instrument!();

let random_value = self.rng.gen_range(0, self.top_blocks.len());
let random_value = self.rng.gen_range(0..self.top_blocks.len());
let mut index = 0;
let mut found_hash: Option<BlockHash> = None;

Expand Down
37 changes: 21 additions & 16 deletions catchain/src/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ impl Receiver for ReceiverImpl {
self.synchronize();

let delay = Duration::from_millis(self.rng.gen_range(
CATCHAIN_NEIGHBOURS_SYNC_MIN_PERIOD_MS,
CATCHAIN_NEIGHBOURS_SYNC_MIN_PERIOD_MS..
CATCHAIN_NEIGHBOURS_SYNC_MAX_PERIOD_MS + 1,
));

Expand All @@ -648,7 +648,7 @@ impl Receiver for ReceiverImpl {
self.choose_neighbours();

let delay = Duration::from_millis(self.rng.gen_range(
CATCHAIN_NEIGHBOURS_ROTATE_MIN_PERIOD_MS,
CATCHAIN_NEIGHBOURS_ROTATE_MIN_PERIOD_MS..
CATCHAIN_NEIGHBOURS_ROTATE_MAX_PERIOD_MS + 1,
));

Expand Down Expand Up @@ -1230,11 +1230,11 @@ impl ReceiverImpl {

self.next_neighbours_rotate_time = now
+ Duration::from_millis(self.rng.gen_range(
CATCHAIN_NEIGHBOURS_ROTATE_MIN_PERIOD_MS,
CATCHAIN_NEIGHBOURS_ROTATE_MIN_PERIOD_MS..
CATCHAIN_NEIGHBOURS_ROTATE_MAX_PERIOD_MS,
));
self.next_sync_time =
now + Duration::from_millis(((0.001 * self.rng.gen_range(0.0, 60.0)) * 1000.0) as u64);
now + Duration::from_millis(((0.001 * self.rng.gen_range(0.0..60.0)) * 1000.0) as u64);
self.initial_sync_complete_time = now
+ Duration::from_secs(if self.allow_unsafe_self_blocks_resync {
MAX_UNSAFE_INITIAL_SYNC_COMPLETE_TIME_SECS
Expand Down Expand Up @@ -1426,7 +1426,6 @@ impl ReceiverImpl {
//randomly choose max neighbours from sources

let sources_count = self.get_sources_count();
let mut rng = self.rng;
let mut new_neighbours: Vec<usize> = Vec::new();
let mut items_count = MAX_NEIGHBOURS_COUNT;

Expand All @@ -1445,20 +1444,16 @@ impl ReceiverImpl {
continue;
}

let source = self.get_source(i);

if source.borrow().is_blamed() {
if self.get_source(i).borrow().is_blamed() {
continue;
}

let random_value = rng.gen_range(0, sources_count - i);

let random_value = self.rng.gen_range(0..sources_count - i);
if random_value >= items_count {
continue;
}

new_neighbours.push(i);

new_neighbours.push(i);
items_count -= 1;
}

Expand All @@ -1472,19 +1467,17 @@ impl ReceiverImpl {

trace!("Synchronize with other validators");

let mut rng = self.rng;
let sources_count = self.get_sources_count();

for _i in 0..MAX_SOURCES_SYNC_ATTEMPS {
let source_index = rng.gen_range(0, sources_count);
let source_index = self.rng.gen_range(0..sources_count);
let source = self.get_source(source_index);

if source.borrow().is_blamed() {
continue;
}

self.synchronize_with(source);

break;
}
}
Expand Down Expand Up @@ -2517,7 +2510,18 @@ impl ReceiverImpl {
let local_key = parse_hex_as_private_key(
"0000000000000000000000000000000000000000000000000000000000000000",
);
let ids: Vec<CatchainNode> = Vec::new();
let public_key = adnl::common::KeyOption::from_type_and_public_key(
adnl::common::KeyOption::KEY_ED25519,
local_key.pub_key().unwrap()
);
let public_key = Arc::new(public_key);
let adnl_id = get_public_key_hash(&public_key);
let ids = vec![
CatchainNode {
public_key,
adnl_id
}
];
let incarnation = SessionId::default();
let receiver_listener = ReceiverImpl::create_dummy_listener();
let db_root = "".to_string();
Expand All @@ -2534,6 +2538,7 @@ impl ReceiverImpl {
allow_unsafe_self_blocks_resync,
None,
)

}

pub(crate) fn create(
Expand Down
Loading

0 comments on commit 653d06d

Please sign in to comment.