Double bandwidth limit (#2787)

This commit is contained in:
Wesley Shillingford 2020-05-26 18:37:50 +01:00 committed by GitHub
commit 5589075c22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -401,7 +401,7 @@ nano::error nano::node_config::deserialize_toml (nano::tomlconfig & toml)
}
if (bandwidth_limit > std::numeric_limits<size_t>::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<size_t>::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)
{

View file

@ -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 };