From 5589075c22d7220626c51c474ec7065ce9339c07 Mon Sep 17 00:00:00 2001 From: Wesley Shillingford Date: Tue, 26 May 2020 18:37:50 +0100 Subject: [PATCH] Double bandwidth limit (#2787) --- nano/core_test/node.cpp | 4 ++-- nano/node/nodeconfig.cpp | 4 ++-- nano/node/nodeconfig.hpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index 3b17c528..754d5670 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -839,7 +839,7 @@ TEST (node_config, v17_values) tree.put ("use_memory_pools", true); tree.put ("confirmation_history_size", 2048); tree.put ("active_elections_size", 50000); - tree.put ("bandwidth_limit", 5242880); + tree.put ("bandwidth_limit", 10485760); tree.put ("conf_height_processor_batch_min_time", 0); } @@ -857,7 +857,7 @@ TEST (node_config, v17_values) ASSERT_TRUE (config.use_memory_pools); ASSERT_EQ (config.confirmation_history_size, 2048); ASSERT_EQ (config.active_elections_size, 50000); - ASSERT_EQ (config.bandwidth_limit, 5242880); + ASSERT_EQ (config.bandwidth_limit, 10485760); ASSERT_EQ (config.conf_height_processor_batch_min_time.count (), 0); // Check config is correct with other values diff --git a/nano/node/nodeconfig.cpp b/nano/node/nodeconfig.cpp index d035ec93..f0ce4b41 100644 --- a/nano/node/nodeconfig.cpp +++ b/nano/node/nodeconfig.cpp @@ -401,7 +401,7 @@ nano::error nano::node_config::deserialize_toml (nano::tomlconfig & toml) } if (bandwidth_limit > std::numeric_limits::max ()) { - toml.get_error ().set ("bandwidth_limit unbounded = 0, default = 5242880, max = 18446744073709551615"); + toml.get_error ().set ("bandwidth_limit unbounded = 0, default = 10485760, max = 18446744073709551615"); } if (vote_generator_threshold < 1 || vote_generator_threshold > 11) { @@ -817,7 +817,7 @@ nano::error nano::node_config::deserialize_json (bool & upgraded_a, nano::jsonco } if (bandwidth_limit > std::numeric_limits::max ()) { - json.get_error ().set ("bandwidth_limit unbounded = 0, default = 5242880, max = 18446744073709551615"); + json.get_error ().set ("bandwidth_limit unbounded = 0, default = 10485760, max = 18446744073709551615"); } if (vote_generator_threshold < 1 || vote_generator_threshold > 11) { diff --git a/nano/node/nodeconfig.hpp b/nano/node/nodeconfig.hpp index c9f5bb17..4d0aad05 100644 --- a/nano/node/nodeconfig.hpp +++ b/nano/node/nodeconfig.hpp @@ -90,8 +90,8 @@ public: static std::chrono::seconds constexpr keepalive_period = std::chrono::seconds (60); static std::chrono::seconds constexpr keepalive_cutoff = keepalive_period * 5; static std::chrono::minutes constexpr wallet_backup_interval = std::chrono::minutes (5); - /** Default outbound traffic shaping is 5MB/s */ - size_t bandwidth_limit{ 5 * 1024 * 1024 }; + /** Default outbound traffic shaping is 10MB/s */ + size_t bandwidth_limit{ 10 * 1024 * 1024 }; /** By default, allow bursts of 15MB/s (not sustainable) */ double bandwidth_limit_burst_ratio{ 3. }; std::chrono::milliseconds conf_height_processor_batch_min_time{ 50 };