@@ -1504,6 +1504,7 @@ td::Status ValidatorEngine::load_global_config() {
15041504 }
15051505 validator_options_.write ().set_hardforks (std::move (h));
15061506 validator_options_.write ().set_fast_state_serializer_enabled (fast_state_serializer_enabled_);
1507+ validator_options_.write ().set_catchain_broadcast_speed_multiplier (broadcast_speed_multiplier_catchain_);
15071508
15081509 return td::Status::OK ();
15091510}
@@ -2004,9 +2005,13 @@ void ValidatorEngine::start_full_node() {
20042005 R.ensure ();
20052006 td::actor::send_closure (SelfId, &ValidatorEngine::started_full_node);
20062007 });
2008+ ton::validator::fullnode::FullNodeOptions full_node_options{
2009+ .config_ = config_.full_node_config ,
2010+ .public_broadcast_speed_multiplier_ = broadcast_speed_multiplier_public_,
2011+ .private_broadcast_speed_multiplier_ = broadcast_speed_multiplier_private_};
20072012 full_node_ = ton::validator::fullnode::FullNode::create (
20082013 short_id, ton::adnl::AdnlNodeIdShort{config_.full_node }, validator_options_->zero_block_id ().file_hash ,
2009- config_. full_node_config , keyring_.get (), adnl_.get (), rldp_.get (), rldp2_.get (),
2014+ full_node_options , keyring_.get (), adnl_.get (), rldp_.get (), rldp2_.get (),
20102015 default_dht_node_.is_zero () ? td::actor::ActorId<ton::dht::Dht>{} : dht_nodes_[default_dht_node_].get (),
20112016 overlay_manager_.get (), validator_manager_.get (), full_node_client_.get (), db_root_, std::move (P));
20122017 for (auto &v : config_.validators ) {
@@ -4562,6 +4567,42 @@ int main(int argc, char *argv[]) {
45624567 " disable persistent state serializer (similar to set-state-serializer-enabled 0 in validator console)" , [&]() {
45634568 acts.push_back ([&x]() { td::actor::send_closure (x, &ValidatorEngine::set_state_serializer_disabled_flag); });
45644569 });
4570+ p.add_checked_option (
4571+ ' \0 ' , " broadcast-speed-catchain" ,
4572+ " multiplier for broadcast speed in catchain overlays (experimental, default is 1.0, which is ~300 KB/s)" ,
4573+ [&](td::Slice s) -> td::Status {
4574+ auto v = td::to_double (s);
4575+ if (v <= 0.0 ) {
4576+ return td::Status::Error (" broadcast-speed-catchain should be positive" );
4577+ }
4578+ acts.push_back (
4579+ [&x, v]() { td::actor::send_closure (x, &ValidatorEngine::set_broadcast_speed_multiplier_catchain, v); });
4580+ return td::Status::OK ();
4581+ });
4582+ p.add_checked_option (
4583+ ' \0 ' , " broadcast-speed-public" ,
4584+ " multiplier for broadcast speed in public shard overlays (experimental, default is 1.0, which is ~300 KB/s)" ,
4585+ [&](td::Slice s) -> td::Status {
4586+ auto v = td::to_double (s);
4587+ if (v <= 0.0 ) {
4588+ return td::Status::Error (" broadcast-speed-public should be positive" );
4589+ }
4590+ acts.push_back (
4591+ [&x, v]() { td::actor::send_closure (x, &ValidatorEngine::set_broadcast_speed_multiplier_public, v); });
4592+ return td::Status::OK ();
4593+ });
4594+ p.add_checked_option (
4595+ ' \0 ' , " broadcast-speed-private" ,
4596+ " multiplier for broadcast speed in private block overlays (experimental, default is 1.0, which is ~300 KB/s)" ,
4597+ [&](td::Slice s) -> td::Status {
4598+ auto v = td::to_double (s);
4599+ if (v <= 0.0 ) {
4600+ return td::Status::Error (" broadcast-speed-private should be positive" );
4601+ }
4602+ acts.push_back (
4603+ [&x, v]() { td::actor::send_closure (x, &ValidatorEngine::set_broadcast_speed_multiplier_private, v); });
4604+ return td::Status::OK ();
4605+ });
45654606 auto S = p.run (argc, argv);
45664607 if (S.is_error ()) {
45674608 LOG (ERROR) << " failed to parse options: " << S.move_as_error ();
0 commit comments